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