Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | mjames | 1 | /* A Bison parser, made by GNU Bison 3.0.4. */ |
2 | |||
3 | /* Bison implementation for Yacc-like parsers in C |
||
4 | |||
5 | Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. |
||
6 | |||
7 | This program is free software: you can redistribute it and/or modify |
||
8 | it under the terms of the GNU General Public License as published by |
||
9 | the Free Software Foundation, either version 3 of the License, or |
||
10 | (at your option) any later version. |
||
11 | |||
12 | This program is distributed in the hope that it will be useful, |
||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
15 | GNU General Public License for more details. |
||
16 | |||
17 | You should have received a copy of the GNU General Public License |
||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
||
19 | |||
20 | /* As a special exception, you may create a larger work that contains |
||
21 | part or all of the Bison parser skeleton and distribute that work |
||
22 | under terms of your choice, so long as that work isn't itself a |
||
23 | parser generator using the skeleton or a modified version thereof |
||
24 | as a parser skeleton. Alternatively, if you modify or redistribute |
||
25 | the parser skeleton itself, you may (at your option) remove this |
||
26 | special exception, which will cause the skeleton and the resulting |
||
27 | Bison output files to be licensed under the GNU General Public |
||
28 | License without this special exception. |
||
29 | |||
30 | This special exception was added by the Free Software Foundation in |
||
31 | version 2.2 of Bison. */ |
||
32 | |||
33 | /* C LALR(1) parser skeleton written by Richard Stallman, by |
||
34 | simplifying the original so-called "semantic" parser. */ |
||
35 | |||
36 | /* All symbols defined below should begin with yy or YY, to avoid |
||
37 | infringing on user name space. This should be done even for local |
||
38 | variables, as they might otherwise be expanded by user macros. |
||
39 | There are some unavoidable exceptions within include files to |
||
40 | define necessary library symbols; they are noted "INFRINGES ON |
||
41 | USER NAME SPACE" below. */ |
||
42 | |||
43 | /* Identify Bison output. */ |
||
44 | #define YYBISON 1 |
||
45 | |||
46 | /* Bison version. */ |
||
47 | #define YYBISON_VERSION "3.0.4" |
||
48 | |||
49 | /* Skeleton name. */ |
||
50 | #define YYSKELETON_NAME "yacc.c" |
||
51 | |||
52 | /* Pure parsers. */ |
||
53 | #define YYPURE 0 |
||
54 | |||
55 | /* Push parsers. */ |
||
56 | #define YYPUSH 0 |
||
57 | |||
58 | /* Pull parsers. */ |
||
59 | #define YYPULL 1 |
||
60 | |||
61 | /* Copy the first part of user declarations. */ |
||
62 | #line 1 "gen_yacc.y" /* yacc.c:339 */ |
||
63 | |||
64 | /* |
||
65 | * $Header: C:/cvsroot/Vert03/gen_src/gen_yacc.y,v 1.1.1.1 2003/11/04 23:34:57 mjames Exp $ |
||
66 | * |
||
67 | * $Log: gen_yacc.y,v $ |
||
68 | * Revision 1.1.1.1 2003/11/04 23:34:57 mjames |
||
69 | * Imported into local repositrory |
||
70 | * |
||
71 | * Revision 1.10 2002/10/02 19:37:29 MJAMES |
||
72 | * Moved dummy functions to a separate support file. |
||
73 | * |
||
74 | * Used correct number of arguments to define_pin |
||
75 | * |
||
76 | * Revision 1.9 2002/09/09 10:36:20 mjames |
||
77 | * Checkpoint checkin |
||
78 | * |
||
79 | * Revision 1.8 2001/10/31 22:20:07 mjames |
||
80 | * Tidying up problematical comments caused by CVS |
||
81 | * 'intelligent' comment guessing |
||
82 | * |
||
83 | * Revision 1.7 2001/10/02 20:53:46 mjames |
||
84 | * Moved documentation about code to main program module. |
||
85 | * |
||
86 | * Revision 1.6 2001/09/16 19:59:20 mjames |
||
87 | * tidying |
||
88 | * |
||
89 | * Revision 1.5 2001/06/07 10:28:06 MJAMES |
||
90 | * Removed ] symbol dropped in by mistake |
||
91 | * |
||
92 | * Revision 1.4 2001/06/06 14:46:02 mjames |
||
93 | * Added further Verilog support. |
||
94 | * Corrected write ext command to not require additional argument. |
||
95 | * Added write quartus for creation of a pinfit file relevant to Quartus |
||
96 | * |
||
97 | * Revision 1.3 2001/06/06 12:10:21 mjames |
||
98 | * Move from HPUX |
||
99 | * |
||
100 | * Revision 1.2 2000/12/04 13:14:03 mjames |
||
101 | * Imported all of the PCB syntax readers. |
||
102 | * |
||
103 | * Converted "a/b" to mean "a" divided by "b" insted of a single string |
||
104 | * "a/b" in Verilog |
||
105 | * |
||
106 | * Revision 1.1.1.1 2000/10/19 21:58:38 mjames |
||
107 | * Mike put it here |
||
108 | * |
||
109 | * |
||
110 | * Revision 1.18 2000/10/04 10:37:06 10:37:06 mjames (Mike James) |
||
111 | * Modified for Vertical2 : support COMPONENTS and SIGNALS |
||
112 | * |
||
113 | * Revision 1.15 2000/09/27 10:45:41 10:45:41 mjames (Mike James) |
||
114 | * Corrected to use correct return code from yyparse() |
||
115 | * |
||
116 | * Revision 1.14 2000/09/21 10:15:45 10:15:45 mjames (Mike James) |
||
117 | * Part of Release Sep21Alpha |
||
118 | * |
||
119 | * Revision 1.13 2000/08/25 09:57:18 09:57:18 mjames (Mike James) |
||
120 | * Part of Release Aug25_alpha |
||
121 | * |
||
122 | * Revision 1.12 2000/08/16 08:57:35 08:57:35 mjames (Mike James) |
||
123 | * Part of Release CD01_Aug2000 |
||
124 | * |
||
125 | * Revision 1.11 2000/08/14 14:45:15 14:45:15 mjames (Mike James) |
||
126 | * Part of Release Aug_14_2000 |
||
127 | * |
||
128 | * Revision 1.10 2000/08/11 08:30:36 08:30:36 mjames (Mike James) |
||
129 | * Part of Release Aug_11_2000 |
||
130 | * |
||
131 | * Revision 1.9 2000/08/09 10:31:52 10:31:52 mjames (Mike James) |
||
132 | * Part of Release Aug__9_2000 |
||
133 | * |
||
134 | * Revision 1.8 2000/05/31 11:43:03 11:43:03 mjames (Mike James) |
||
135 | * Part of Release May_31_2000 |
||
136 | * |
||
137 | * Revision 1.7 2000/05/08 17:01:42 17:01:42 mjames (Mike James) |
||
138 | * Part of Release May__8_2000 |
||
139 | * |
||
140 | * Revision 1.6 2000/05/08 16:59:35 16:59:35 mjames (Mike James) |
||
141 | * Part of Release May__8_2000 |
||
142 | * |
||
143 | * Revision 1.5 2000/05/08 16:57:11 16:57:11 mjames (Mike James) |
||
144 | * Part of Release May__8_2000 |
||
145 | * |
||
146 | * Revision 1.4 2000/03/08 16:19:07 16:19:07 mjames (Mike James) |
||
147 | * New version including PC |
||
148 | * |
||
149 | * Revision 1.1 2000/02/23 13:17:00 13:17:00 mjames (Mike James) |
||
150 | * Initial revision |
||
151 | * |
||
152 | * Revision 1.10 2000/01/20 15:58:46 15:58:46 mjames (Mike James) |
||
153 | * Part of Release R22 |
||
154 | * |
||
155 | * Revision 1.9 99/12/22 11:15:27 11:15:27 mjames (Mike James) |
||
156 | * Part of Release Dec_22_1999 |
||
157 | * |
||
158 | * Revision 1.8 99/06/25 14:35:45 14:35:45 mjames (Mike James) |
||
159 | * Added in reference to expression.h, but no changes made |
||
160 | * to the function of acfread yet. |
||
161 | * |
||
162 | * Revision 1.7 99/05/04 09:52:32 09:52:32 mjames (Mike James) |
||
163 | * General checkin |
||
164 | * |
||
165 | * Revision 1.5 98/07/14 13:24:51 13:24:51 mjames (Mike James) |
||
166 | * Altered calling of some database functions |
||
167 | * |
||
168 | * Revision 1.4 98/02/11 11:26:46 11:26:46 mjames (Mike James) |
||
169 | * Checked in for version 6.2a |
||
170 | * |
||
171 | * Revision 1.3 97/04/23 08:45:10 08:45:10 mjames (Mike James) |
||
172 | * CHecked in for release rel23041997 |
||
173 | * |
||
174 | * Revision 1.2 96/12/23 15:16:50 15:16:50 mjames (Mike James) |
||
175 | * Altered because find_socket takes a reference |
||
176 | * to the head-of-list-pointer noth the pointer itself. |
||
177 | * |
||
178 | * Revision 1.1 96/12/13 08:43:46 08:43:46 mjames (Mike James) |
||
179 | * Initial revision |
||
180 | * |
||
181 | * |
||
182 | * */ |
||
183 | |||
184 | /* |
||
185 | @title |
||
186 | PROGRAM genread: Converter for .GEN files |
||
187 | @text |
||
188 | PCB netlist to ACFP converter. Looks for netlists in ASCII containing tags like: |
||
189 | @listing |
||
190 | $PACKAGES |
||
191 | $NETS |
||
192 | $END |
||
193 | |||
194 | @text |
||
195 | Commonly seen with a '.GEN' file suffix. Lots of exclamation marks '!' in the |
||
196 | netlist file. Mentor Graphics ? |
||
197 | @end |
||
198 | */ |
||
199 | |||
200 | #include "database.h" |
||
201 | #include "expression.h" |
||
202 | #include "generic.h" |
||
203 | |||
204 | #include <stdio.h> |
||
205 | #include <stdlib.h> |
||
206 | #include <string.h> |
||
207 | |||
208 | static char IDstr[] = "@(#)$Header: C:/cvsroot/Vert03/gen_src/gen_yacc.y,v 1.1.1.1 2003/11/04 " |
||
209 | "23:34:57 mjames Exp $"; |
||
210 | |||
211 | static socket_t *current_chip; |
||
212 | static char curr_net_nam[MAXIDLEN]; |
||
213 | int inside_block; |
||
214 | |||
215 | #line 222 "gen_yacc.c" /* yacc.c:339 */ |
||
216 | |||
217 | #ifndef YY_NULLPTR |
||
218 | #if defined __cplusplus && 201103L <= __cplusplus |
||
219 | #define YY_NULLPTR nullptr |
||
220 | #else |
||
221 | #define YY_NULLPTR 0 |
||
222 | #endif |
||
223 | #endif |
||
224 | |||
225 | /* Enabling verbose error messages. */ |
||
226 | #ifdef YYERROR_VERBOSE |
||
227 | #undef YYERROR_VERBOSE |
||
228 | #define YYERROR_VERBOSE 1 |
||
229 | #else |
||
230 | #define YYERROR_VERBOSE 0 |
||
231 | #endif |
||
232 | |||
233 | /* Debug traces. */ |
||
234 | #ifndef YYDEBUG |
||
235 | #define YYDEBUG 0 |
||
236 | #endif |
||
237 | #if YYDEBUG |
||
238 | extern int yydebug; |
||
239 | #endif |
||
240 | |||
241 | /* Token type. */ |
||
242 | #ifndef YYTOKENTYPE |
||
243 | #define YYTOKENTYPE |
||
244 | enum yytokentype |
||
245 | { |
||
246 | PACKAGES = 258, |
||
247 | NETS = 259, |
||
248 | END = 260, |
||
249 | NL = 261, |
||
250 | PLING = 262, |
||
251 | SEMI = 263, |
||
252 | DOT = 264, |
||
253 | COMMA = 265, |
||
254 | ASTRING = 266 |
||
255 | }; |
||
256 | #endif |
||
257 | /* Tokens. */ |
||
258 | #define PACKAGES 258 |
||
259 | #define NETS 259 |
||
260 | #define END 260 |
||
261 | #define NL 261 |
||
262 | #define PLING 262 |
||
263 | #define SEMI 263 |
||
264 | #define DOT 264 |
||
265 | #define COMMA 265 |
||
266 | #define ASTRING 266 |
||
267 | |||
268 | /* Value type. */ |
||
269 | #if !defined YYSTYPE && !defined YYSTYPE_IS_DECLARED |
||
270 | |||
271 | union YYSTYPE |
||
272 | { |
||
273 | #line 156 "gen_yacc.y" /* yacc.c:355 */ |
||
274 | char *string; |
||
275 | |||
276 | #line 284 "gen_yacc.c" /* yacc.c:355 */ |
||
277 | }; |
||
278 | |||
279 | typedef union YYSTYPE YYSTYPE; |
||
280 | #define YYSTYPE_IS_TRIVIAL 1 |
||
281 | #define YYSTYPE_IS_DECLARED 1 |
||
282 | #endif |
||
283 | |||
284 | extern YYSTYPE yylval; |
||
285 | |||
286 | int yyparse (void); |
||
287 | |||
288 | /* Copy the second part of user declarations. */ |
||
289 | |||
290 | #line 301 "gen_yacc.c" /* yacc.c:358 */ |
||
291 | |||
292 | #ifdef short |
||
293 | #undef short |
||
294 | #endif |
||
295 | |||
296 | #ifdef YYTYPE_UINT8 |
||
297 | typedef YYTYPE_UINT8 yytype_uint8; |
||
298 | #else |
||
299 | typedef unsigned char yytype_uint8; |
||
300 | #endif |
||
301 | |||
302 | #ifdef YYTYPE_INT8 |
||
303 | typedef YYTYPE_INT8 yytype_int8; |
||
304 | #else |
||
305 | typedef signed char yytype_int8; |
||
306 | #endif |
||
307 | |||
308 | #ifdef YYTYPE_UINT16 |
||
309 | typedef YYTYPE_UINT16 yytype_uint16; |
||
310 | #else |
||
311 | typedef unsigned short int yytype_uint16; |
||
312 | #endif |
||
313 | |||
314 | #ifdef YYTYPE_INT16 |
||
315 | typedef YYTYPE_INT16 yytype_int16; |
||
316 | #else |
||
317 | typedef short int yytype_int16; |
||
318 | #endif |
||
319 | |||
320 | #ifndef YYSIZE_T |
||
321 | #ifdef __SIZE_TYPE__ |
||
322 | #define YYSIZE_T __SIZE_TYPE__ |
||
323 | #elif defined size_t |
||
324 | #define YYSIZE_T size_t |
||
325 | #elif !defined YYSIZE_T |
||
326 | #include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
||
327 | #define YYSIZE_T size_t |
||
328 | #else |
||
329 | #define YYSIZE_T unsigned int |
||
330 | #endif |
||
331 | #endif |
||
332 | |||
333 | #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
||
334 | |||
335 | #ifndef YY_ |
||
336 | #if defined YYENABLE_NLS && YYENABLE_NLS |
||
337 | #if ENABLE_NLS |
||
338 | #include <libintl.h> /* INFRINGES ON USER NAME SPACE */ |
||
339 | #define YY_(Msgid) dgettext ("bison-runtime", Msgid) |
||
340 | #endif |
||
341 | #endif |
||
342 | #ifndef YY_ |
||
343 | #define YY_(Msgid) Msgid |
||
344 | #endif |
||
345 | #endif |
||
346 | |||
347 | #ifndef YY_ATTRIBUTE |
||
348 | #if (defined __GNUC__ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) || \ |
||
349 | defined __SUNPRO_C && 0x5110 <= __SUNPRO_C |
||
350 | #define YY_ATTRIBUTE(Spec) __attribute__ (Spec) |
||
351 | #else |
||
352 | #define YY_ATTRIBUTE(Spec) /* empty */ |
||
353 | #endif |
||
354 | #endif |
||
355 | |||
356 | #ifndef YY_ATTRIBUTE_PURE |
||
357 | #define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) |
||
358 | #endif |
||
359 | |||
360 | #ifndef YY_ATTRIBUTE_UNUSED |
||
361 | #define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) |
||
362 | #endif |
||
363 | |||
364 | #if !defined _Noreturn && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) |
||
365 | #if defined _MSC_VER && 1200 <= _MSC_VER |
||
366 | #define _Noreturn __declspec(noreturn) |
||
367 | #else |
||
368 | #define _Noreturn YY_ATTRIBUTE((__noreturn__)) |
||
369 | #endif |
||
370 | #endif |
||
371 | |||
372 | /* Suppress unused-variable warnings by "using" E. */ |
||
373 | #if !defined lint || defined __GNUC__ |
||
374 | #define YYUSE(E) ((void) (E)) |
||
375 | #else |
||
376 | #define YYUSE(E) /* empty */ |
||
377 | #endif |
||
378 | |||
379 | #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ |
||
380 | /* Suppress an incorrect diagnostic about yylval being uninitialized. */ |
||
381 | #define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ |
||
382 | _Pragma ("GCC diagnostic push") _Pragma ("GCC diagnostic ignored " \ |
||
383 | "\"-Wuninitialized\"") \ |
||
384 | _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") |
||
385 | #define YY_IGNORE_MAYBE_UNINITIALIZED_END _Pragma ("GCC diagnostic pop") |
||
386 | #else |
||
387 | #define YY_INITIAL_VALUE(Value) Value |
||
388 | #endif |
||
389 | #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
||
390 | #define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
||
391 | #define YY_IGNORE_MAYBE_UNINITIALIZED_END |
||
392 | #endif |
||
393 | #ifndef YY_INITIAL_VALUE |
||
394 | #define YY_INITIAL_VALUE(Value) /* Nothing. */ |
||
395 | #endif |
||
396 | |||
397 | #if !defined yyoverflow || YYERROR_VERBOSE |
||
398 | |||
399 | /* The parser invokes alloca or malloc; define the necessary symbols. */ |
||
400 | |||
401 | #ifdef YYSTACK_USE_ALLOCA |
||
402 | #if YYSTACK_USE_ALLOCA |
||
403 | #ifdef __GNUC__ |
||
404 | #define YYSTACK_ALLOC __builtin_alloca |
||
405 | #elif defined __BUILTIN_VA_ARG_INCR |
||
406 | #include <alloca.h> /* INFRINGES ON USER NAME SPACE */ |
||
407 | #elif defined _AIX |
||
408 | #define YYSTACK_ALLOC __alloca |
||
409 | #elif defined _MSC_VER |
||
410 | #include <malloc.h> /* INFRINGES ON USER NAME SPACE */ |
||
411 | #define alloca _alloca |
||
412 | #else |
||
413 | #define YYSTACK_ALLOC alloca |
||
414 | #if !defined _ALLOCA_H && !defined EXIT_SUCCESS |
||
415 | #include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
||
416 | /* Use EXIT_SUCCESS as a witness for stdlib.h. */ |
||
417 | #ifndef EXIT_SUCCESS |
||
418 | #define EXIT_SUCCESS 0 |
||
419 | #endif |
||
420 | #endif |
||
421 | #endif |
||
422 | #endif |
||
423 | #endif |
||
424 | |||
425 | #ifdef YYSTACK_ALLOC |
||
426 | /* Pacify GCC's 'empty if-body' warning. */ |
||
427 | #define YYSTACK_FREE(Ptr) \ |
||
428 | do \ |
||
429 | { /* empty */ \ |
||
430 | ; \ |
||
431 | } while (0) |
||
432 | #ifndef YYSTACK_ALLOC_MAXIMUM |
||
433 | /* The OS might guarantee only one guard page at the bottom of the stack, |
||
434 | and a page size can be as small as 4096 bytes. So we cannot safely |
||
435 | invoke alloca (N) if N exceeds 4096. Use a slightly smaller number |
||
436 | to allow for a few compiler-allocated temporary stack slots. */ |
||
437 | #define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ |
||
438 | #endif |
||
439 | #else |
||
440 | #define YYSTACK_ALLOC YYMALLOC |
||
441 | #define YYSTACK_FREE YYFREE |
||
442 | #ifndef YYSTACK_ALLOC_MAXIMUM |
||
443 | #define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
||
444 | #endif |
||
445 | #if ( \ |
||
446 | defined __cplusplus && !defined EXIT_SUCCESS && \ |
||
447 | !((defined YYMALLOC || defined malloc) && (defined YYFREE || defined free))) |
||
448 | #include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
||
449 | #ifndef EXIT_SUCCESS |
||
450 | #define EXIT_SUCCESS 0 |
||
451 | #endif |
||
452 | #endif |
||
453 | #ifndef YYMALLOC |
||
454 | #define YYMALLOC malloc |
||
455 | #if !defined malloc && !defined EXIT_SUCCESS |
||
456 | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ |
||
457 | #endif |
||
458 | #endif |
||
459 | #ifndef YYFREE |
||
460 | #define YYFREE free |
||
461 | #if !defined free && !defined EXIT_SUCCESS |
||
462 | void free (void *); /* INFRINGES ON USER NAME SPACE */ |
||
463 | #endif |
||
464 | #endif |
||
465 | #endif |
||
466 | #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ |
||
467 | |||
468 | #if ( \ |
||
469 | !defined yyoverflow && \ |
||
470 | (!defined __cplusplus || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) |
||
471 | |||
472 | /* A type that is properly aligned for any stack member. */ |
||
473 | union yyalloc |
||
474 | { |
||
475 | yytype_int16 yyss_alloc; |
||
476 | YYSTYPE yyvs_alloc; |
||
477 | }; |
||
478 | |||
479 | /* The size of the maximum gap between one aligned stack and the next. */ |
||
480 | #define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
||
481 | |||
482 | /* The size of an array large to enough to hold all stacks, each with |
||
483 | N elements. */ |
||
484 | #define YYSTACK_BYTES(N) \ |
||
485 | ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) + YYSTACK_GAP_MAXIMUM) |
||
486 | |||
487 | #define YYCOPY_NEEDED 1 |
||
488 | |||
489 | /* Relocate STACK from its old location to the new one. The |
||
490 | local variables YYSIZE and YYSTACKSIZE give the old and new number of |
||
491 | elements in the stack, and YYPTR gives the new location of the |
||
492 | stack. Advance YYPTR to a properly aligned location for the next |
||
493 | stack. */ |
||
494 | #define YYSTACK_RELOCATE(Stack_alloc, Stack) \ |
||
495 | do \ |
||
496 | { \ |
||
497 | YYSIZE_T yynewbytes; \ |
||
498 | YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ |
||
499 | Stack = &yyptr->Stack_alloc; \ |
||
500 | yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ |
||
501 | yyptr += yynewbytes / sizeof (*yyptr); \ |
||
502 | } while (0) |
||
503 | |||
504 | #endif |
||
505 | |||
506 | #if defined YYCOPY_NEEDED && YYCOPY_NEEDED |
||
507 | /* Copy COUNT objects from SRC to DST. The source and destination do |
||
508 | not overlap. */ |
||
509 | #ifndef YYCOPY |
||
510 | #if defined __GNUC__ && 1 < __GNUC__ |
||
511 | #define YYCOPY(Dst, Src, Count) __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) |
||
512 | #else |
||
513 | #define YYCOPY(Dst, Src, Count) \ |
||
514 | do \ |
||
515 | { \ |
||
516 | YYSIZE_T yyi; \ |
||
517 | for (yyi = 0; yyi < (Count); yyi++) \ |
||
518 | (Dst)[yyi] = (Src)[yyi]; \ |
||
519 | } while (0) |
||
520 | #endif |
||
521 | #endif |
||
522 | #endif /* !YYCOPY_NEEDED */ |
||
523 | |||
524 | /* YYFINAL -- State number of the termination state. */ |
||
525 | #define YYFINAL 14 |
||
526 | /* YYLAST -- Last index in YYTABLE. */ |
||
527 | #define YYLAST 49 |
||
528 | |||
529 | /* YYNTOKENS -- Number of terminals. */ |
||
530 | #define YYNTOKENS 12 |
||
531 | /* YYNNTS -- Number of nonterminals. */ |
||
532 | #define YYNNTS 13 |
||
533 | /* YYNRULES -- Number of rules. */ |
||
534 | #define YYNRULES 23 |
||
535 | /* YYNSTATES -- Number of states. */ |
||
536 | #define YYNSTATES 43 |
||
537 | |||
538 | /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned |
||
539 | by yylex, with out-of-bounds checking. */ |
||
540 | #define YYUNDEFTOK 2 |
||
541 | #define YYMAXUTOK 266 |
||
542 | |||
543 | #define YYTRANSLATE(YYX) ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
||
544 | |||
545 | /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM |
||
546 | as returned by yylex, without out-of-bounds checking. */ |
||
547 | static const yytype_uint8 yytranslate[] = { |
||
548 | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
||
549 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
||
550 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
||
551 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
||
552 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
||
553 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
||
554 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
||
555 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
||
556 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; |
||
557 | |||
558 | #if YYDEBUG |
||
559 | /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ |
||
560 | static const yytype_uint8 yyrline[] = {0, 165, 165, 166, 170, 171, 172, 173, |
||
561 | 177, 178, 180, 181, 185, 192, 193, 197, |
||
562 | 200, 201, 202, 205, 208, 216, 217, 218}; |
||
563 | #endif |
||
564 | |||
565 | #if YYDEBUG || YYERROR_VERBOSE || 0 |
||
566 | /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
||
567 | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
||
568 | static const char *const yytname[] = {"$end", |
||
569 | "error", |
||
570 | "$undefined", |
||
571 | "PACKAGES", |
||
572 | "NETS", |
||
573 | "END", |
||
574 | "NL", |
||
575 | "PLING", |
||
576 | "SEMI", |
||
577 | "DOT", |
||
578 | "COMMA", |
||
579 | "ASTRING", |
||
580 | "$accept", |
||
581 | "objects", |
||
582 | "object", |
||
583 | "package_list", |
||
584 | "nets_list", |
||
585 | "component_lines", |
||
586 | "component_line", |
||
587 | "nets", |
||
588 | "net", |
||
589 | "pins", |
||
590 | "net_name", |
||
591 | "pin", |
||
592 | "gap", |
||
593 | YY_NULLPTR}; |
||
594 | #endif |
||
595 | |||
596 | #ifdef YYPRINT |
||
597 | /* YYTOKNUM[NUM] -- (External) token number corresponding to the |
||
598 | (internal) symbol number NUM (which must be that of a token). */ |
||
599 | static const yytype_uint16 yytoknum[] = { |
||
600 | 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266}; |
||
601 | #endif |
||
602 | |||
603 | #define YYPACT_NINF -30 |
||
604 | |||
605 | #define yypact_value_is_default(Yystate) (!!((Yystate) == (-30))) |
||
606 | |||
607 | #define YYTABLE_NINF -1 |
||
608 | |||
609 | #define yytable_value_is_error(Yytable_value) 0 |
||
610 | |||
611 | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
||
612 | STATE-NUM. */ |
||
613 | static const yytype_int8 yypact[] = {14, -3, 5, 17, 18, 2, -30, -30, -30, -30, 16, |
||
614 | 19, -30, -30, -30, -30, 21, -2, -30, 23, 18, 19, |
||
615 | 22, 24, -30, -30, -30, -30, -30, 20, 4, -30, 26, |
||
616 | 25, 31, -30, -30, 27, -30, 22, 33, 11, -30}; |
||
617 | |||
618 | /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. |
||
619 | Performed when YYTABLE does not specify something else to do. Zero |
||
620 | means the default is an error. */ |
||
621 | static const yytype_uint8 yydefact[] = {23, 0, 0, 0, 22, 0, 3, 4, 5, 7, 0, 0, 6, 21, 1, |
||
622 | 2, 0, 23, 11, 0, 23, 14, 0, 0, 10, 8, 19, 9, 13, 0, |
||
623 | 23, 17, 0, 0, 0, 16, 15, 0, 20, 0, 0, 18, 12}; |
||
624 | |||
625 | /* YYPGOTO[NTERM-NUM]. */ |
||
626 | static const yytype_int8 yypgoto[] = { |
||
627 | -30, -30, 35, -30, -30, -30, 8, 28, -30, -7, -30, -29, -4}; |
||
628 | |||
629 | /* YYDEFGOTO[NTERM-NUM]. */ |
||
630 | static const yytype_int8 yydefgoto[] = {-1, 5, 6, 7, 8, 17, 18, 20, 21, 30, 22, 31, 9}; |
||
631 | |||
632 | /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If |
||
633 | positive, shift that token. If negative, reduce the rule whose |
||
634 | number is the opposite. If YYTABLE_NINF, syntax error. */ |
||
635 | static const yytype_uint8 yytable[] = {13, 35, 14, 10, 4, 1, 2, 3, 4, 16, 4, 11, 35, |
||
636 | 25, 34, 29, 27, 1, 2, 3, 4, 34, 29, 12, 4, 24, |
||
637 | 36, 16, 23, 33, 19, 26, 41, 29, 37, 32, 38, 39, 40, |
||
638 | 42, 15, 0, 0, 0, 0, 0, 0, 0, 0, 28}; |
||
639 | |||
640 | static const yytype_int8 yycheck[] = {4, 30, 0, 6, 6, 3, 4, 5, 6, 11, 6, 6, 41, |
||
641 | 17, 10, 11, 20, 3, 4, 5, 6, 10, 11, 6, 6, 17, |
||
642 | 30, 11, 7, 9, 11, 8, 39, 11, 8, 11, 11, 6, 11, |
||
643 | 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, 21}; |
||
644 | |||
645 | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing |
||
646 | symbol of state STATE-NUM. */ |
||
647 | static const yytype_uint8 yystos[] = { |
||
648 | 0, 3, 4, 5, 6, 13, 14, 15, 16, 24, 6, 6, 6, 24, 0, 14, 11, 17, 18, 11, 19, 20, |
||
649 | 22, 7, 18, 24, 8, 24, 19, 11, 21, 23, 11, 9, 10, 23, 24, 8, 11, 6, 11, 21, 6}; |
||
650 | |||
651 | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
||
652 | static const yytype_uint8 yyr1[] = {0, 12, 13, 13, 14, 14, 14, 14, 15, 16, 17, 17, |
||
653 | 18, 19, 19, 20, 21, 21, 21, 22, 23, 24, 24, 24}; |
||
654 | |||
655 | /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ |
||
656 | static const yytype_uint8 yyr2[] = {0, 2, 2, 1, 1, 1, 2, 1, 4, 4, 2, 1, |
||
657 | 6, 2, 1, 3, 2, 1, 4, 2, 3, 2, 1, 0}; |
||
658 | |||
659 | #define yyerrok (yyerrstatus = 0) |
||
660 | #define yyclearin (yychar = YYEMPTY) |
||
661 | #define YYEMPTY (-2) |
||
662 | #define YYEOF 0 |
||
663 | |||
664 | #define YYACCEPT goto yyacceptlab |
||
665 | #define YYABORT goto yyabortlab |
||
666 | #define YYERROR goto yyerrorlab |
||
667 | |||
668 | #define YYRECOVERING() (!!yyerrstatus) |
||
669 | |||
670 | #define YYBACKUP(Token, Value) \ |
||
671 | do \ |
||
672 | if (yychar == YYEMPTY) \ |
||
673 | { \ |
||
674 | yychar = (Token); \ |
||
675 | yylval = (Value); \ |
||
676 | YYPOPSTACK (yylen); \ |
||
677 | yystate = *yyssp; \ |
||
678 | goto yybackup; \ |
||
679 | } \ |
||
680 | else \ |
||
681 | { \ |
||
682 | yyerror (YY_ ("syntax error: cannot back up")); \ |
||
683 | YYERROR; \ |
||
684 | } \ |
||
685 | while (0) |
||
686 | |||
687 | /* Error token number */ |
||
688 | #define YYTERROR 1 |
||
689 | #define YYERRCODE 256 |
||
690 | |||
691 | /* Enable debugging if requested. */ |
||
692 | #if YYDEBUG |
||
693 | |||
694 | #ifndef YYFPRINTF |
||
695 | #include <stdio.h> /* INFRINGES ON USER NAME SPACE */ |
||
696 | #define YYFPRINTF fprintf |
||
697 | #endif |
||
698 | |||
699 | #define YYDPRINTF(Args) \ |
||
700 | do \ |
||
701 | { \ |
||
702 | if (yydebug) \ |
||
703 | YYFPRINTF Args; \ |
||
704 | } while (0) |
||
705 | |||
706 | /* This macro is provided for backward compatibility. */ |
||
707 | #ifndef YY_LOCATION_PRINT |
||
708 | #define YY_LOCATION_PRINT(File, Loc) ((void) 0) |
||
709 | #endif |
||
710 | |||
711 | #define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ |
||
712 | do \ |
||
713 | { \ |
||
714 | if (yydebug) \ |
||
715 | { \ |
||
716 | YYFPRINTF (stderr, "%s ", Title); \ |
||
717 | yy_symbol_print (stderr, Type, Value); \ |
||
718 | YYFPRINTF (stderr, "\n"); \ |
||
719 | } \ |
||
720 | } while (0) |
||
721 | |||
722 | /*----------------------------------------. |
||
723 | | Print this symbol's value on YYOUTPUT. | |
||
724 | `----------------------------------------*/ |
||
725 | |||
726 | static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep) |
||
727 | { |
||
728 | FILE *yyo = yyoutput; |
||
729 | YYUSE (yyo); |
||
730 | if (!yyvaluep) |
||
731 | return; |
||
732 | #ifdef YYPRINT |
||
733 | if (yytype < YYNTOKENS) |
||
734 | YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); |
||
735 | #endif |
||
736 | YYUSE (yytype); |
||
737 | } |
||
738 | |||
739 | /*--------------------------------. |
||
740 | | Print this symbol on YYOUTPUT. | |
||
741 | `--------------------------------*/ |
||
742 | |||
743 | static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep) |
||
744 | { |
||
745 | YYFPRINTF ( |
||
746 | yyoutput, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); |
||
747 | |||
748 | yy_symbol_value_print (yyoutput, yytype, yyvaluep); |
||
749 | YYFPRINTF (yyoutput, ")"); |
||
750 | } |
||
751 | |||
752 | /*------------------------------------------------------------------. |
||
753 | | yy_stack_print -- Print the state stack from its BOTTOM up to its | |
||
754 | | TOP (included). | |
||
755 | `------------------------------------------------------------------*/ |
||
756 | |||
757 | static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) |
||
758 | { |
||
759 | YYFPRINTF (stderr, "Stack now"); |
||
760 | for (; yybottom <= yytop; yybottom++) |
||
761 | { |
||
762 | int yybot = *yybottom; |
||
763 | YYFPRINTF (stderr, " %d", yybot); |
||
764 | } |
||
765 | YYFPRINTF (stderr, "\n"); |
||
766 | } |
||
767 | |||
768 | #define YY_STACK_PRINT(Bottom, Top) \ |
||
769 | do \ |
||
770 | { \ |
||
771 | if (yydebug) \ |
||
772 | yy_stack_print ((Bottom), (Top)); \ |
||
773 | } while (0) |
||
774 | |||
775 | /*------------------------------------------------. |
||
776 | | Report that the YYRULE is going to be reduced. | |
||
777 | `------------------------------------------------*/ |
||
778 | |||
779 | static void yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) |
||
780 | { |
||
781 | unsigned long int yylno = yyrline[yyrule]; |
||
782 | int yynrhs = yyr2[yyrule]; |
||
783 | int yyi; |
||
784 | YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); |
||
785 | /* The symbols being reduced. */ |
||
786 | for (yyi = 0; yyi < yynrhs; yyi++) |
||
787 | { |
||
788 | YYFPRINTF (stderr, " $%d = ", yyi + 1); |
||
789 | yy_symbol_print ( |
||
790 | stderr, yystos[yyssp[yyi + 1 - yynrhs]], &(yyvsp[(yyi + 1) - (yynrhs)])); |
||
791 | YYFPRINTF (stderr, "\n"); |
||
792 | } |
||
793 | } |
||
794 | |||
795 | #define YY_REDUCE_PRINT(Rule) \ |
||
796 | do \ |
||
797 | { \ |
||
798 | if (yydebug) \ |
||
799 | yy_reduce_print (yyssp, yyvsp, Rule); \ |
||
800 | } while (0) |
||
801 | |||
802 | /* Nonzero means print parse trace. It is left uninitialized so that |
||
803 | multiple parsers can coexist. */ |
||
804 | int yydebug; |
||
805 | #else /* !YYDEBUG */ |
||
806 | #define YYDPRINTF(Args) |
||
807 | #define YY_SYMBOL_PRINT(Title, Type, Value, Location) |
||
808 | #define YY_STACK_PRINT(Bottom, Top) |
||
809 | #define YY_REDUCE_PRINT(Rule) |
||
810 | #endif /* !YYDEBUG */ |
||
811 | |||
812 | /* YYINITDEPTH -- initial size of the parser's stacks. */ |
||
813 | #ifndef YYINITDEPTH |
||
814 | #define YYINITDEPTH 200 |
||
815 | #endif |
||
816 | |||
817 | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only |
||
818 | if the built-in stack extension method is used). |
||
819 | |||
820 | Do not make this value too large; the results are undefined if |
||
821 | YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) |
||
822 | evaluated with infinite-precision integer arithmetic. */ |
||
823 | |||
824 | #ifndef YYMAXDEPTH |
||
825 | #define YYMAXDEPTH 10000 |
||
826 | #endif |
||
827 | |||
828 | #if YYERROR_VERBOSE |
||
829 | |||
830 | #ifndef yystrlen |
||
831 | #if defined __GLIBC__ && defined _STRING_H |
||
832 | #define yystrlen strlen |
||
833 | #else |
||
834 | /* Return the length of YYSTR. */ |
||
835 | static YYSIZE_T yystrlen (const char *yystr) |
||
836 | { |
||
837 | YYSIZE_T yylen; |
||
838 | for (yylen = 0; yystr[yylen]; yylen++) |
||
839 | continue; |
||
840 | return yylen; |
||
841 | } |
||
842 | #endif |
||
843 | #endif |
||
844 | |||
845 | #ifndef yystpcpy |
||
846 | #if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE |
||
847 | #define yystpcpy stpcpy |
||
848 | #else |
||
849 | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in |
||
850 | YYDEST. */ |
||
851 | static char *yystpcpy (char *yydest, const char *yysrc) |
||
852 | { |
||
853 | char *yyd = yydest; |
||
854 | const char *yys = yysrc; |
||
855 | |||
856 | while ((*yyd++ = *yys++) != '\0') |
||
857 | continue; |
||
858 | |||
859 | return yyd - 1; |
||
860 | } |
||
861 | #endif |
||
862 | #endif |
||
863 | |||
864 | #ifndef yytnamerr |
||
865 | /* Copy to YYRES the contents of YYSTR after stripping away unnecessary |
||
866 | quotes and backslashes, so that it's suitable for yyerror. The |
||
867 | heuristic is that double-quoting is unnecessary unless the string |
||
868 | contains an apostrophe, a comma, or backslash (other than |
||
869 | backslash-backslash). YYSTR is taken from yytname. If YYRES is |
||
870 | null, do not copy; instead, return the length of what the result |
||
871 | would have been. */ |
||
872 | static YYSIZE_T yytnamerr (char *yyres, const char *yystr) |
||
873 | { |
||
874 | if (*yystr == '"') |
||
875 | { |
||
876 | YYSIZE_T yyn = 0; |
||
877 | char const *yyp = yystr; |
||
878 | |||
879 | for (;;) |
||
880 | switch (*++yyp) |
||
881 | { |
||
882 | case '\'': |
||
883 | case ',': |
||
884 | goto do_not_strip_quotes; |
||
885 | |||
886 | case '\\': |
||
887 | if (*++yyp != '\\') |
||
888 | goto do_not_strip_quotes; |
||
889 | /* Fall through. */ |
||
890 | default: |
||
891 | if (yyres) |
||
892 | yyres[yyn] = *yyp; |
||
893 | yyn++; |
||
894 | break; |
||
895 | |||
896 | case '"': |
||
897 | if (yyres) |
||
898 | yyres[yyn] = '\0'; |
||
899 | return yyn; |
||
900 | } |
||
901 | do_not_strip_quotes:; |
||
902 | } |
||
903 | |||
904 | if (!yyres) |
||
905 | return yystrlen (yystr); |
||
906 | |||
907 | return yystpcpy (yyres, yystr) - yyres; |
||
908 | } |
||
909 | #endif |
||
910 | |||
911 | /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message |
||
912 | about the unexpected token YYTOKEN for the state stack whose top is |
||
913 | YYSSP. |
||
914 | |||
915 | Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is |
||
916 | not large enough to hold the message. In that case, also set |
||
917 | *YYMSG_ALLOC to the required number of bytes. Return 2 if the |
||
918 | required number of bytes is too large to store. */ |
||
919 | static int |
||
920 | yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) |
||
921 | { |
||
922 | YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); |
||
923 | YYSIZE_T yysize = yysize0; |
||
924 | enum |
||
925 | { |
||
926 | YYERROR_VERBOSE_ARGS_MAXIMUM = 5 |
||
927 | }; |
||
928 | /* Internationalized format string. */ |
||
929 | const char *yyformat = YY_NULLPTR; |
||
930 | /* Arguments of yyformat. */ |
||
931 | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; |
||
932 | /* Number of reported tokens (one for the "unexpected", one per |
||
933 | "expected"). */ |
||
934 | int yycount = 0; |
||
935 | |||
936 | /* There are many possibilities here to consider: |
||
937 | - If this state is a consistent state with a default action, then |
||
938 | the only way this function was invoked is if the default action |
||
939 | is an error action. In that case, don't check for expected |
||
940 | tokens because there are none. |
||
941 | - The only way there can be no lookahead present (in yychar) is if |
||
942 | this state is a consistent state with a default action. Thus, |
||
943 | detecting the absence of a lookahead is sufficient to determine |
||
944 | that there is no unexpected or expected token to report. In that |
||
945 | case, just report a simple "syntax error". |
||
946 | - Don't assume there isn't a lookahead just because this state is a |
||
947 | consistent state with a default action. There might have been a |
||
948 | previous inconsistent state, consistent state with a non-default |
||
949 | action, or user semantic action that manipulated yychar. |
||
950 | - Of course, the expected token list depends on states to have |
||
951 | correct lookahead information, and it depends on the parser not |
||
952 | to perform extra reductions after fetching a lookahead from the |
||
953 | scanner and before detecting a syntax error. Thus, state merging |
||
954 | (from LALR or IELR) and default reductions corrupt the expected |
||
955 | token list. However, the list is correct for canonical LR with |
||
956 | one exception: it will still contain any token that will not be |
||
957 | accepted due to an error action in a later state. |
||
958 | */ |
||
959 | if (yytoken != YYEMPTY) |
||
960 | { |
||
961 | int yyn = yypact[*yyssp]; |
||
962 | yyarg[yycount++] = yytname[yytoken]; |
||
963 | if (!yypact_value_is_default (yyn)) |
||
964 | { |
||
965 | /* Start YYX at -YYN if negative to avoid negative indexes in |
||
966 | YYCHECK. In other words, skip the first -YYN actions for |
||
967 | this state because they are default actions. */ |
||
968 | int yyxbegin = yyn < 0 ? -yyn : 0; |
||
969 | /* Stay within bounds of both yycheck and yytname. */ |
||
970 | int yychecklim = YYLAST - yyn + 1; |
||
971 | int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; |
||
972 | int yyx; |
||
973 | |||
974 | for (yyx = yyxbegin; yyx < yyxend; ++yyx) |
||
975 | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR && |
||
976 | !yytable_value_is_error (yytable[yyx + yyn])) |
||
977 | { |
||
978 | if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) |
||
979 | { |
||
980 | yycount = 1; |
||
981 | yysize = yysize0; |
||
982 | break; |
||
983 | } |
||
984 | yyarg[yycount++] = yytname[yyx]; |
||
985 | { |
||
986 | YYSIZE_T yysize1 = |
||
987 | yysize + |
||
988 | yytnamerr (YY_NULLPTR, yytname[yyx]); |
||
989 | if (!(yysize <= yysize1 && |
||
990 | yysize1 <= YYSTACK_ALLOC_MAXIMUM)) |
||
991 | return 2; |
||
992 | yysize = yysize1; |
||
993 | } |
||
994 | } |
||
995 | } |
||
996 | } |
||
997 | |||
998 | switch (yycount) |
||
999 | { |
||
1000 | #define YYCASE_(N, S) \ |
||
1001 | case N: \ |
||
1002 | yyformat = S; \ |
||
1003 | break |
||
1004 | YYCASE_ (0, YY_ ("syntax error")); |
||
1005 | YYCASE_ (1, YY_ ("syntax error, unexpected %s")); |
||
1006 | YYCASE_ (2, YY_ ("syntax error, unexpected %s, expecting %s")); |
||
1007 | YYCASE_ (3, YY_ ("syntax error, unexpected %s, expecting %s or %s")); |
||
1008 | YYCASE_ (4, YY_ ("syntax error, unexpected %s, expecting %s or %s or %s")); |
||
1009 | YYCASE_ ( |
||
1010 | 5, YY_ ("syntax error, unexpected %s, expecting %s or %s or %s or %s")); |
||
1011 | #undef YYCASE_ |
||
1012 | } |
||
1013 | |||
1014 | { |
||
1015 | YYSIZE_T yysize1 = yysize + yystrlen (yyformat); |
||
1016 | if (!(yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) |
||
1017 | return 2; |
||
1018 | yysize = yysize1; |
||
1019 | } |
||
1020 | |||
1021 | if (*yymsg_alloc < yysize) |
||
1022 | { |
||
1023 | *yymsg_alloc = 2 * yysize; |
||
1024 | if (!(yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) |
||
1025 | *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; |
||
1026 | return 1; |
||
1027 | } |
||
1028 | |||
1029 | /* Avoid sprintf, as that infringes on the user's name space. |
||
1030 | Don't have undefined behavior even if the translation |
||
1031 | produced a string with the wrong number of "%s"s. */ |
||
1032 | { |
||
1033 | char *yyp = *yymsg; |
||
1034 | int yyi = 0; |
||
1035 | while ((*yyp = *yyformat) != '\0') |
||
1036 | if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) |
||
1037 | { |
||
1038 | yyp += yytnamerr (yyp, yyarg[yyi++]); |
||
1039 | yyformat += 2; |
||
1040 | } |
||
1041 | else |
||
1042 | { |
||
1043 | yyp++; |
||
1044 | yyformat++; |
||
1045 | } |
||
1046 | } |
||
1047 | return 0; |
||
1048 | } |
||
1049 | #endif /* YYERROR_VERBOSE */ |
||
1050 | |||
1051 | /*-----------------------------------------------. |
||
1052 | | Release the memory associated to this symbol. | |
||
1053 | `-----------------------------------------------*/ |
||
1054 | |||
1055 | static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) |
||
1056 | { |
||
1057 | YYUSE (yyvaluep); |
||
1058 | if (!yymsg) |
||
1059 | yymsg = "Deleting"; |
||
1060 | YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); |
||
1061 | |||
1062 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
||
1063 | YYUSE (yytype); |
||
1064 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
||
1065 | } |
||
1066 | |||
1067 | /* The lookahead symbol. */ |
||
1068 | int yychar; |
||
1069 | |||
1070 | /* The semantic value of the lookahead symbol. */ |
||
1071 | YYSTYPE yylval; |
||
1072 | /* Number of syntax errors so far. */ |
||
1073 | int yynerrs; |
||
1074 | |||
1075 | /*----------. |
||
1076 | | yyparse. | |
||
1077 | `----------*/ |
||
1078 | |||
1079 | int yyparse (void) |
||
1080 | { |
||
1081 | int yystate; |
||
1082 | /* Number of tokens to shift before error messages enabled. */ |
||
1083 | int yyerrstatus; |
||
1084 | |||
1085 | /* The stacks and their tools: |
||
1086 | 'yyss': related to states. |
||
1087 | 'yyvs': related to semantic values. |
||
1088 | |||
1089 | Refer to the stacks through separate pointers, to allow yyoverflow |
||
1090 | to reallocate them elsewhere. */ |
||
1091 | |||
1092 | /* The state stack. */ |
||
1093 | yytype_int16 yyssa[YYINITDEPTH]; |
||
1094 | yytype_int16 *yyss; |
||
1095 | yytype_int16 *yyssp; |
||
1096 | |||
1097 | /* The semantic value stack. */ |
||
1098 | YYSTYPE yyvsa[YYINITDEPTH]; |
||
1099 | YYSTYPE *yyvs; |
||
1100 | YYSTYPE *yyvsp; |
||
1101 | |||
1102 | YYSIZE_T yystacksize; |
||
1103 | |||
1104 | int yyn; |
||
1105 | int yyresult; |
||
1106 | /* Lookahead token as an internal (translated) token number. */ |
||
1107 | int yytoken = 0; |
||
1108 | /* The variables used to return semantic value and location from the |
||
1109 | action routines. */ |
||
1110 | YYSTYPE yyval; |
||
1111 | |||
1112 | #if YYERROR_VERBOSE |
||
1113 | /* Buffer for error messages, and its allocated size. */ |
||
1114 | char yymsgbuf[128]; |
||
1115 | char *yymsg = yymsgbuf; |
||
1116 | YYSIZE_T yymsg_alloc = sizeof yymsgbuf; |
||
1117 | #endif |
||
1118 | |||
1119 | #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) |
||
1120 | |||
1121 | /* The number of symbols on the RHS of the reduced rule. |
||
1122 | Keep to zero when no symbol should be popped. */ |
||
1123 | int yylen = 0; |
||
1124 | |||
1125 | yyssp = yyss = yyssa; |
||
1126 | yyvsp = yyvs = yyvsa; |
||
1127 | yystacksize = YYINITDEPTH; |
||
1128 | |||
1129 | YYDPRINTF ((stderr, "Starting parse\n")); |
||
1130 | |||
1131 | yystate = 0; |
||
1132 | yyerrstatus = 0; |
||
1133 | yynerrs = 0; |
||
1134 | yychar = YYEMPTY; /* Cause a token to be read. */ |
||
1135 | goto yysetstate; |
||
1136 | |||
1137 | /*------------------------------------------------------------. |
||
1138 | | yynewstate -- Push a new state, which is found in yystate. | |
||
1139 | `------------------------------------------------------------*/ |
||
1140 | yynewstate: |
||
1141 | /* In all cases, when you get here, the value and location stacks |
||
1142 | have just been pushed. So pushing a state here evens the stacks. */ |
||
1143 | yyssp++; |
||
1144 | |||
1145 | yysetstate: |
||
1146 | *yyssp = yystate; |
||
1147 | |||
1148 | if (yyss + yystacksize - 1 <= yyssp) |
||
1149 | { |
||
1150 | /* Get the current used size of the three stacks, in elements. */ |
||
1151 | YYSIZE_T yysize = yyssp - yyss + 1; |
||
1152 | |||
1153 | #ifdef yyoverflow |
||
1154 | { |
||
1155 | /* Give user a chance to reallocate the stack. Use copies of |
||
1156 | these so that the &'s don't force the real ones into |
||
1157 | memory. */ |
||
1158 | YYSTYPE *yyvs1 = yyvs; |
||
1159 | yytype_int16 *yyss1 = yyss; |
||
1160 | |||
1161 | /* Each stack pointer address is followed by the size of the |
||
1162 | data in use in that stack, in bytes. This used to be a |
||
1163 | conditional around just the two extra args, but that might |
||
1164 | be undefined if yyoverflow is a macro. */ |
||
1165 | yyoverflow ( |
||
1166 | YY_ ("memory exhausted"), |
||
1167 | &yyss1, |
||
1168 | yysize * sizeof (*yyssp), |
||
1169 | &yyvs1, |
||
1170 | yysize * sizeof (*yyvsp), |
||
1171 | &yystacksize); |
||
1172 | |||
1173 | yyss = yyss1; |
||
1174 | yyvs = yyvs1; |
||
1175 | } |
||
1176 | #else /* no yyoverflow */ |
||
1177 | #ifndef YYSTACK_RELOCATE |
||
1178 | goto yyexhaustedlab; |
||
1179 | #else |
||
1180 | /* Extend the stack our own way. */ |
||
1181 | if (YYMAXDEPTH <= yystacksize) |
||
1182 | goto yyexhaustedlab; |
||
1183 | yystacksize *= 2; |
||
1184 | if (YYMAXDEPTH < yystacksize) |
||
1185 | yystacksize = YYMAXDEPTH; |
||
1186 | |||
1187 | { |
||
1188 | yytype_int16 *yyss1 = yyss; |
||
1189 | union yyalloc *yyptr = |
||
1190 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); |
||
1191 | if (!yyptr) |
||
1192 | goto yyexhaustedlab; |
||
1193 | YYSTACK_RELOCATE (yyss_alloc, yyss); |
||
1194 | YYSTACK_RELOCATE (yyvs_alloc, yyvs); |
||
1195 | #undef YYSTACK_RELOCATE |
||
1196 | if (yyss1 != yyssa) |
||
1197 | YYSTACK_FREE (yyss1); |
||
1198 | } |
||
1199 | #endif |
||
1200 | #endif /* no yyoverflow */ |
||
1201 | |||
1202 | yyssp = yyss + yysize - 1; |
||
1203 | yyvsp = yyvs + yysize - 1; |
||
1204 | |||
1205 | YYDPRINTF (( |
||
1206 | stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); |
||
1207 | |||
1208 | if (yyss + yystacksize - 1 <= yyssp) |
||
1209 | YYABORT; |
||
1210 | } |
||
1211 | |||
1212 | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
||
1213 | |||
1214 | if (yystate == YYFINAL) |
||
1215 | YYACCEPT; |
||
1216 | |||
1217 | goto yybackup; |
||
1218 | |||
1219 | /*-----------. |
||
1220 | | yybackup. | |
||
1221 | `-----------*/ |
||
1222 | yybackup: |
||
1223 | |||
1224 | /* Do appropriate processing given the current state. Read a |
||
1225 | lookahead token if we need one and don't already have one. */ |
||
1226 | |||
1227 | /* First try to decide what to do without reference to lookahead token. */ |
||
1228 | yyn = yypact[yystate]; |
||
1229 | if (yypact_value_is_default (yyn)) |
||
1230 | goto yydefault; |
||
1231 | |||
1232 | /* Not known => get a lookahead token if don't already have one. */ |
||
1233 | |||
1234 | /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ |
||
1235 | if (yychar == YYEMPTY) |
||
1236 | { |
||
1237 | YYDPRINTF ((stderr, "Reading a token: ")); |
||
1238 | yychar = yylex (); |
||
1239 | } |
||
1240 | |||
1241 | if (yychar <= YYEOF) |
||
1242 | { |
||
1243 | yychar = yytoken = YYEOF; |
||
1244 | YYDPRINTF ((stderr, "Now at end of input.\n")); |
||
1245 | } |
||
1246 | else |
||
1247 | { |
||
1248 | yytoken = YYTRANSLATE (yychar); |
||
1249 | YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); |
||
1250 | } |
||
1251 | |||
1252 | /* If the proper action on seeing token YYTOKEN is to reduce or to |
||
1253 | detect an error, take that action. */ |
||
1254 | yyn += yytoken; |
||
1255 | if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) |
||
1256 | goto yydefault; |
||
1257 | yyn = yytable[yyn]; |
||
1258 | if (yyn <= 0) |
||
1259 | { |
||
1260 | if (yytable_value_is_error (yyn)) |
||
1261 | goto yyerrlab; |
||
1262 | yyn = -yyn; |
||
1263 | goto yyreduce; |
||
1264 | } |
||
1265 | |||
1266 | /* Count tokens shifted since error; after three, turn off error |
||
1267 | status. */ |
||
1268 | if (yyerrstatus) |
||
1269 | yyerrstatus--; |
||
1270 | |||
1271 | /* Shift the lookahead token. */ |
||
1272 | YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); |
||
1273 | |||
1274 | /* Discard the shifted token. */ |
||
1275 | yychar = YYEMPTY; |
||
1276 | |||
1277 | yystate = yyn; |
||
1278 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
||
1279 | *++yyvsp = yylval; |
||
1280 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
||
1281 | |||
1282 | goto yynewstate; |
||
1283 | |||
1284 | /*-----------------------------------------------------------. |
||
1285 | | yydefault -- do the default action for the current state. | |
||
1286 | `-----------------------------------------------------------*/ |
||
1287 | yydefault: |
||
1288 | yyn = yydefact[yystate]; |
||
1289 | if (yyn == 0) |
||
1290 | goto yyerrlab; |
||
1291 | goto yyreduce; |
||
1292 | |||
1293 | /*-----------------------------. |
||
1294 | | yyreduce -- Do a reduction. | |
||
1295 | `-----------------------------*/ |
||
1296 | yyreduce: |
||
1297 | /* yyn is the number of a rule to reduce with. */ |
||
1298 | yylen = yyr2[yyn]; |
||
1299 | |||
1300 | /* If YYLEN is nonzero, implement the default value of the action: |
||
1301 | '$$ = $1'. |
||
1302 | |||
1303 | Otherwise, the following line sets YYVAL to garbage. |
||
1304 | This behavior is undocumented and Bison |
||
1305 | users should not rely upon it. Assigning to YYVAL |
||
1306 | unconditionally makes the parser a bit smaller, and it avoids a |
||
1307 | GCC warning that YYVAL may be used uninitialized. */ |
||
1308 | yyval = yyvsp[1 - yylen]; |
||
1309 | |||
1310 | YY_REDUCE_PRINT (yyn); |
||
1311 | switch (yyn) |
||
1312 | { |
||
1313 | case 12: |
||
1314 | #line 185 "gen_yacc.y" /* yacc.c:1646 */ |
||
1315 | { |
||
1316 | current_chip = find_socket (Ident, (yyvsp[-1].string), Create, &socket_head); |
||
1317 | set_socket (current_chip, Type, (yyvsp[-5].string)); |
||
1318 | set_socket (current_chip, Value, (yyvsp[-3].string)); |
||
1319 | } |
||
1320 | #line 1402 "gen_yacc.c" /* yacc.c:1646 */ |
||
1321 | break; |
||
1322 | |||
1323 | case 19: |
||
1324 | #line 205 "gen_yacc.y" /* yacc.c:1646 */ |
||
1325 | { |
||
1326 | strcpy (curr_net_nam, (yyvsp[-1].string)); |
||
1327 | } |
||
1328 | #line 1408 "gen_yacc.c" /* yacc.c:1646 */ |
||
1329 | break; |
||
1330 | |||
1331 | case 20: |
||
1332 | #line 208 "gen_yacc.y" /* yacc.c:1646 */ |
||
1333 | { |
||
1334 | define_pin ( |
||
1335 | &routed_list, |
||
1336 | find_socket (Ident, (yyvsp[-2].string), Create, &socket_head), |
||
1337 | curr_net_nam, |
||
1338 | BIDIR, |
||
1339 | 0, |
||
1340 | (yyvsp[0].string), |
||
1341 | default_vhdl_datatype, |
||
1342 | NULL); |
||
1343 | } |
||
1344 | #line 1417 "gen_yacc.c" /* yacc.c:1646 */ |
||
1345 | break; |
||
1346 | |||
1347 | #line 1421 "gen_yacc.c" /* yacc.c:1646 */ |
||
1348 | default: |
||
1349 | break; |
||
1350 | } |
||
1351 | /* User semantic actions sometimes alter yychar, and that requires |
||
1352 | that yytoken be updated with the new translation. We take the |
||
1353 | approach of translating immediately before every use of yytoken. |
||
1354 | One alternative is translating here after every semantic action, |
||
1355 | but that translation would be missed if the semantic action invokes |
||
1356 | YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or |
||
1357 | if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an |
||
1358 | incorrect destructor might then be invoked immediately. In the |
||
1359 | case of YYERROR or YYBACKUP, subsequent parser actions might lead |
||
1360 | to an incorrect destructor call or verbose syntax error message |
||
1361 | before the lookahead is translated. */ |
||
1362 | YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); |
||
1363 | |||
1364 | YYPOPSTACK (yylen); |
||
1365 | yylen = 0; |
||
1366 | YY_STACK_PRINT (yyss, yyssp); |
||
1367 | |||
1368 | *++yyvsp = yyval; |
||
1369 | |||
1370 | /* Now 'shift' the result of the reduction. Determine what state |
||
1371 | that goes to, based on the state we popped back to and the rule |
||
1372 | number reduced by. */ |
||
1373 | |||
1374 | yyn = yyr1[yyn]; |
||
1375 | |||
1376 | yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; |
||
1377 | if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) |
||
1378 | yystate = yytable[yystate]; |
||
1379 | else |
||
1380 | yystate = yydefgoto[yyn - YYNTOKENS]; |
||
1381 | |||
1382 | goto yynewstate; |
||
1383 | |||
1384 | /*--------------------------------------. |
||
1385 | | yyerrlab -- here on detecting error. | |
||
1386 | `--------------------------------------*/ |
||
1387 | yyerrlab: |
||
1388 | /* Make sure we have latest lookahead translation. See comments at |
||
1389 | user semantic actions for why this is necessary. */ |
||
1390 | yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); |
||
1391 | |||
1392 | /* If not already recovering from an error, report this error. */ |
||
1393 | if (!yyerrstatus) |
||
1394 | { |
||
1395 | ++yynerrs; |
||
1396 | #if !YYERROR_VERBOSE |
||
1397 | yyerror (YY_ ("syntax error")); |
||
1398 | #else |
||
1399 | #define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, yyssp, yytoken) |
||
1400 | { |
||
1401 | char const *yymsgp = YY_ ("syntax error"); |
||
1402 | int yysyntax_error_status; |
||
1403 | yysyntax_error_status = YYSYNTAX_ERROR; |
||
1404 | if (yysyntax_error_status == 0) |
||
1405 | yymsgp = yymsg; |
||
1406 | else if (yysyntax_error_status == 1) |
||
1407 | { |
||
1408 | if (yymsg != yymsgbuf) |
||
1409 | YYSTACK_FREE (yymsg); |
||
1410 | yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); |
||
1411 | if (!yymsg) |
||
1412 | { |
||
1413 | yymsg = yymsgbuf; |
||
1414 | yymsg_alloc = sizeof yymsgbuf; |
||
1415 | yysyntax_error_status = 2; |
||
1416 | } |
||
1417 | else |
||
1418 | { |
||
1419 | yysyntax_error_status = YYSYNTAX_ERROR; |
||
1420 | yymsgp = yymsg; |
||
1421 | } |
||
1422 | } |
||
1423 | yyerror (yymsgp); |
||
1424 | if (yysyntax_error_status == 2) |
||
1425 | goto yyexhaustedlab; |
||
1426 | } |
||
1427 | #undef YYSYNTAX_ERROR |
||
1428 | #endif |
||
1429 | } |
||
1430 | |||
1431 | if (yyerrstatus == 3) |
||
1432 | { |
||
1433 | /* If just tried and failed to reuse lookahead token after an |
||
1434 | error, discard it. */ |
||
1435 | |||
1436 | if (yychar <= YYEOF) |
||
1437 | { |
||
1438 | /* Return failure if at end of input. */ |
||
1439 | if (yychar == YYEOF) |
||
1440 | YYABORT; |
||
1441 | } |
||
1442 | else |
||
1443 | { |
||
1444 | yydestruct ("Error: discarding", yytoken, &yylval); |
||
1445 | yychar = YYEMPTY; |
||
1446 | } |
||
1447 | } |
||
1448 | |||
1449 | /* Else will try to reuse lookahead token after shifting the error |
||
1450 | token. */ |
||
1451 | goto yyerrlab1; |
||
1452 | |||
1453 | /*---------------------------------------------------. |
||
1454 | | yyerrorlab -- error raised explicitly by YYERROR. | |
||
1455 | `---------------------------------------------------*/ |
||
1456 | yyerrorlab: |
||
1457 | |||
1458 | /* Pacify compilers like GCC when the user code never invokes |
||
1459 | YYERROR and the label yyerrorlab therefore never appears in user |
||
1460 | code. */ |
||
1461 | if (/*CONSTCOND*/ 0) |
||
1462 | goto yyerrorlab; |
||
1463 | |||
1464 | /* Do not reclaim the symbols of the rule whose action triggered |
||
1465 | this YYERROR. */ |
||
1466 | YYPOPSTACK (yylen); |
||
1467 | yylen = 0; |
||
1468 | YY_STACK_PRINT (yyss, yyssp); |
||
1469 | yystate = *yyssp; |
||
1470 | goto yyerrlab1; |
||
1471 | |||
1472 | /*-------------------------------------------------------------. |
||
1473 | | yyerrlab1 -- common code for both syntax error and YYERROR. | |
||
1474 | `-------------------------------------------------------------*/ |
||
1475 | yyerrlab1: |
||
1476 | yyerrstatus = 3; /* Each real token shifted decrements this. */ |
||
1477 | |||
1478 | for (;;) |
||
1479 | { |
||
1480 | yyn = yypact[yystate]; |
||
1481 | if (!yypact_value_is_default (yyn)) |
||
1482 | { |
||
1483 | yyn += YYTERROR; |
||
1484 | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) |
||
1485 | { |
||
1486 | yyn = yytable[yyn]; |
||
1487 | if (0 < yyn) |
||
1488 | break; |
||
1489 | } |
||
1490 | } |
||
1491 | |||
1492 | /* Pop the current state because it cannot handle the error token. */ |
||
1493 | if (yyssp == yyss) |
||
1494 | YYABORT; |
||
1495 | |||
1496 | yydestruct ("Error: popping", yystos[yystate], yyvsp); |
||
1497 | YYPOPSTACK (1); |
||
1498 | yystate = *yyssp; |
||
1499 | YY_STACK_PRINT (yyss, yyssp); |
||
1500 | } |
||
1501 | |||
1502 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
||
1503 | *++yyvsp = yylval; |
||
1504 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
||
1505 | |||
1506 | /* Shift the error token. */ |
||
1507 | YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); |
||
1508 | |||
1509 | yystate = yyn; |
||
1510 | goto yynewstate; |
||
1511 | |||
1512 | /*-------------------------------------. |
||
1513 | | yyacceptlab -- YYACCEPT comes here. | |
||
1514 | `-------------------------------------*/ |
||
1515 | yyacceptlab: |
||
1516 | yyresult = 0; |
||
1517 | goto yyreturn; |
||
1518 | |||
1519 | /*-----------------------------------. |
||
1520 | | yyabortlab -- YYABORT comes here. | |
||
1521 | `-----------------------------------*/ |
||
1522 | yyabortlab: |
||
1523 | yyresult = 1; |
||
1524 | goto yyreturn; |
||
1525 | |||
1526 | #if !defined yyoverflow || YYERROR_VERBOSE |
||
1527 | /*-------------------------------------------------. |
||
1528 | | yyexhaustedlab -- memory exhaustion comes here. | |
||
1529 | `-------------------------------------------------*/ |
||
1530 | yyexhaustedlab: |
||
1531 | yyerror (YY_ ("memory exhausted")); |
||
1532 | yyresult = 2; |
||
1533 | /* Fall through. */ |
||
1534 | #endif |
||
1535 | |||
1536 | yyreturn: |
||
1537 | if (yychar != YYEMPTY) |
||
1538 | { |
||
1539 | /* Make sure we have latest lookahead translation. See comments at |
||
1540 | user semantic actions for why this is necessary. */ |
||
1541 | yytoken = YYTRANSLATE (yychar); |
||
1542 | yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); |
||
1543 | } |
||
1544 | /* Do not reclaim the symbols of the rule whose action triggered |
||
1545 | this YYABORT or YYACCEPT. */ |
||
1546 | YYPOPSTACK (yylen); |
||
1547 | YY_STACK_PRINT (yyss, yyssp); |
||
1548 | while (yyssp != yyss) |
||
1549 | { |
||
1550 | yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); |
||
1551 | YYPOPSTACK (1); |
||
1552 | } |
||
1553 | #ifndef yyoverflow |
||
1554 | if (yyss != yyssa) |
||
1555 | YYSTACK_FREE (yyss); |
||
1556 | #endif |
||
1557 | #if YYERROR_VERBOSE |
||
1558 | if (yymsg != yymsgbuf) |
||
1559 | YYSTACK_FREE (yymsg); |
||
1560 | #endif |
||
1561 | return yyresult; |
||
1562 | } |
||
1563 | #line 222 "gen_yacc.y" /* yacc.c:1906 */ |
||
1564 | |||
1565 | /* defining lineno here */ |
||
1566 | |||
1567 | int lineno; |
||
1568 | extern char *yytext; |
||
1569 | |||
1570 | int yyerror (char *x) |
||
1571 | { |
||
1572 | int token; |
||
1573 | printf ("Error --> %s near string (%s) at line %d\n", x, yytext, lineno); |
||
1574 | /* for(token = yylex();token >= 0 && token!=NL;token = yylex()); */ |
||
1575 | return 1; |
||
1576 | } |
||
1577 | |||
1578 | int yywrap (void) |
||
1579 | { |
||
1580 | return 1; |
||
1581 | } |