1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44 #define YYBISON 1
45
46
47 #define YYBISON_VERSION "2.5"
48
49
50 #define YYSKELETON_NAME "yacc.c"
51
52
53 #define YYPURE 0
54
55
56 #define YYPUSH 0
57
58
59 #define YYPULL 1
60
61
62 #define YYLSP_NEEDED 0
63
64
65 #define yyparse syntax_parser_parse
66 #define yylex syntax_parser_lex
67 #define yyerror syntax_parser_error
68 #define yylval syntax_parser_lval
69 #define yychar syntax_parser_char
70 #define yydebug syntax_parser_debug
71 #define yynerrs syntax_parser_nerrs
72
73
74
75
76
77 #line 3 "syntax_parser.y"
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96 #include <stdio.h>
97 #include "syntax.h"
98 #ifdef DMALLOC
99 #include <dmalloc.h>
100 #endif
101 #include "mymalloc.h"
102
103 static libsynt_group_info *gs[100];
104 static int gsindex = 0;
105
106 liberty_hash_table *libsynt_groups;
107 liberty_hash_table *libsynt_allgroups;
108 liberty_hash_table *libsynt_attrs;
109
110 libsynt_technology libsynt_techs[20];
111 int libsynt_tech_count = 0;
112
113 void push_group(libsynt_head *h);
114 void pop_group(void);
115
116 extern int synt_lineno;
117
118 libsynt_attribute_info *make_complex(libsynt_head *h);
119
120 libsynt_attribute_info *make_simple(char *name, libsynt_attr_type type, void *constraint_ptr);
121
122
123 static char *enumlist[100];
124 static int enumcount;
125
126
127
128
129 #line 130 "syntax_parser.c"
130
131
132 #ifndef YYDEBUG
133 # define YYDEBUG 0
134 #endif
135
136
137 #ifdef YYERROR_VERBOSE
138 # undef YYERROR_VERBOSE
139 # define YYERROR_VERBOSE 1
140 #else
141 # define YYERROR_VERBOSE 0
142 #endif
143
144
145 #ifndef YYTOKEN_TABLE
146 # define YYTOKEN_TABLE 0
147 #endif
148
149
150
151 #ifndef YYTOKENTYPE
152 # define YYTOKENTYPE
153
154
155 enum yytokentype {
156 COMMA = 258,
157 SEMI = 259,
158 LPAR = 260,
159 RPAR = 261,
160 LCURLY = 262,
161 RCURLY = 263,
162 COLON = 264,
163 LBRACK = 265,
164 RBRACK = 266,
165 KW_FLOAT = 267,
166 KW_STRING = 268,
167 KW_ENUM = 269,
168 KW_UNK_ARGS = 270,
169 KW_INTEGER = 271,
170 KW_VIRTATTR = 272,
171 KW_SHORT = 273,
172 KW_OR = 274,
173 KW_AND = 275,
174 KW_BOOLEAN = 276,
175 COLONEQ = 277,
176 KW_LIST = 278,
177 GREATERTHAN = 279,
178 LESSTHAN = 280,
179 DOTS = 281,
180 NUM = 282,
181 STRING = 283,
182 IDENT = 284
183 };
184 #endif
185
186 #define COMMA 258
187 #define SEMI 259
188 #define LPAR 260
189 #define RPAR 261
190 #define LCURLY 262
191 #define RCURLY 263
192 #define COLON 264
193 #define LBRACK 265
194 #define RBRACK 266
195 #define KW_FLOAT 267
196 #define KW_STRING 268
197 #define KW_ENUM 269
198 #define KW_UNK_ARGS 270
199 #define KW_INTEGER 271
200 #define KW_VIRTATTR 272
201 #define KW_SHORT 273
202 #define KW_OR 274
203 #define KW_AND 275
204 #define KW_BOOLEAN 276
205 #define COLONEQ 277
206 #define KW_LIST 278
207 #define GREATERTHAN 279
208 #define LESSTHAN 280
209 #define DOTS 281
210 #define NUM 282
211 #define STRING 283
212 #define IDENT 284
213
214
215
216
217 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
218 typedef union YYSTYPE
219 {
220
221
222 #line 53 "syntax_parser.y"
223
224 char *str;
225 double num;
226 void *voidptr;
227 libsynt_attr_type attrtype;
228 libsynt_float_constraint *float_constr;
229 libsynt_int_constraint *int_constr;
230 libsynt_string_enum *str_enum;
231 libsynt_argument *arg;
232 libsynt_attribute_info *attr;
233 libsynt_name_constraints nameconstr;
234 libsynt_group_info *group;
235 libsynt_head *head;
236 libsynt_technology *tech;
237
238
239
240
241 #line 242 "syntax_parser.c"
242 } YYSTYPE;
243 # define YYSTYPE_IS_TRIVIAL 1
244 # define yystype YYSTYPE
245 # define YYSTYPE_IS_DECLARED 1
246 #endif
247
248
249
250
251
252
253 #line 254 "syntax_parser.c"
254
255 #ifdef short
256 # undef short
257 #endif
258
259 #ifdef YYTYPE_UINT8
260 typedef YYTYPE_UINT8 yytype_uint8;
261 #else
262 typedef unsigned char yytype_uint8;
263 #endif
264
265 #ifdef YYTYPE_INT8
266 typedef YYTYPE_INT8 yytype_int8;
267 #elif (defined __STDC__ || defined __C99__FUNC__ \
268 || defined __cplusplus || defined _MSC_VER)
269 typedef signed char yytype_int8;
270 #else
271 typedef short int yytype_int8;
272 #endif
273
274 #ifdef YYTYPE_UINT16
275 typedef YYTYPE_UINT16 yytype_uint16;
276 #else
277 typedef unsigned short int yytype_uint16;
278 #endif
279
280 #ifdef YYTYPE_INT16
281 typedef YYTYPE_INT16 yytype_int16;
282 #else
283 typedef short int yytype_int16;
284 #endif
285
286 #ifndef YYSIZE_T
287 # ifdef __SIZE_TYPE__
288 # define YYSIZE_T __SIZE_TYPE__
289 # elif defined size_t
290 # define YYSIZE_T size_t
291 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
292 || defined __cplusplus || defined _MSC_VER)
293 # include <stddef.h>
294 # define YYSIZE_T size_t
295 # else
296 # define YYSIZE_T unsigned int
297 # endif
298 #endif
299
300 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
301
302 #ifndef YY_
303 # if defined YYENABLE_NLS && YYENABLE_NLS
304 # if ENABLE_NLS
305 # include <libintl.h>
306 # define YY_(msgid) dgettext ("bison-runtime", msgid)
307 # endif
308 # endif
309 # ifndef YY_
310 # define YY_(msgid) msgid
311 # endif
312 #endif
313
314
315 #if ! defined lint || defined __GNUC__
316 # define YYUSE(e) ((void) (e))
317 #else
318 # define YYUSE(e)
319 #endif
320
321
322 #ifndef lint
323 # define YYID(n) (n)
324 #else
325 #if (defined __STDC__ || defined __C99__FUNC__ \
326 || defined __cplusplus || defined _MSC_VER)
327 static int
328 YYID (int yyi)
329 #else
330 static int
331 YYID (yyi)
332 int yyi;
333 #endif
334 {
335 return yyi;
336 }
337 #endif
338
339 #if ! defined yyoverflow || YYERROR_VERBOSE
340
341
342
343 # ifdef YYSTACK_USE_ALLOCA
344 # if YYSTACK_USE_ALLOCA
345 # ifdef __GNUC__
346 # define YYSTACK_ALLOC __builtin_alloca
347 # elif defined __BUILTIN_VA_ARG_INCR
348 # include <alloca.h>
349 # elif defined _AIX
350 # define YYSTACK_ALLOC __alloca
351 # elif defined _MSC_VER
352 # include <malloc.h>
353 # define alloca _alloca
354 # else
355 # define YYSTACK_ALLOC alloca
356 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
357 || defined __cplusplus || defined _MSC_VER)
358 # include <stdlib.h>
359 # ifndef EXIT_SUCCESS
360 # define EXIT_SUCCESS 0
361 # endif
362 # endif
363 # endif
364 # endif
365 # endif
366
367 # ifdef YYSTACK_ALLOC
368
369 # define YYSTACK_FREE(Ptr) do { ; } while (YYID (0))
370 # ifndef YYSTACK_ALLOC_MAXIMUM
371
372
373
374
375 # define YYSTACK_ALLOC_MAXIMUM 4032
376 # endif
377 # else
378 # define YYSTACK_ALLOC YYMALLOC
379 # define YYSTACK_FREE YYFREE
380 # ifndef YYSTACK_ALLOC_MAXIMUM
381 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
382 # endif
383 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
384 && ! ((defined YYMALLOC || defined malloc) \
385 && (defined YYFREE || defined free)))
386 # include <stdlib.h>
387 # ifndef EXIT_SUCCESS
388 # define EXIT_SUCCESS 0
389 # endif
390 # endif
391 # ifndef YYMALLOC
392 # define YYMALLOC malloc
393 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
394 || defined __cplusplus || defined _MSC_VER)
395 void *malloc (YYSIZE_T);
396 # endif
397 # endif
398 # ifndef YYFREE
399 # define YYFREE free
400 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
401 || defined __cplusplus || defined _MSC_VER)
402 void free (void *);
403 # endif
404 # endif
405 # endif
406 #endif
407
408
409 #if (! defined yyoverflow \
410 && (! defined __cplusplus \
411 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
412
413
414 union yyalloc
415 {
416 yytype_int16 yyss_alloc;
417 YYSTYPE yyvs_alloc;
418 };
419
420
421 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
422
423
424
425 # define YYSTACK_BYTES(N) \
426 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
427 + YYSTACK_GAP_MAXIMUM)
428
429 # define YYCOPY_NEEDED 1
430
431
432
433
434
435
436 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
437 do \
438 { \
439 YYSIZE_T yynewbytes; \
440 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
441 Stack = &yyptr->Stack_alloc; \
442 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
443 yyptr += yynewbytes / sizeof (*yyptr); \
444 } \
445 while (YYID (0))
446
447 #endif
448
449 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
450
451
452 # ifndef YYCOPY
453 # if defined __GNUC__ && 1 < __GNUC__
454 # define YYCOPY(To, From, Count) \
455 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
456 # else
457 # define YYCOPY(To, From, Count) \
458 do \
459 { \
460 YYSIZE_T yyi; \
461 for (yyi = 0; yyi < (Count); yyi++) \
462 (To)[yyi] = (From)[yyi]; \
463 } \
464 while (YYID (0))
465 # endif
466 # endif
467 #endif
468
469
470 #define YYFINAL 8
471
472 #define YYLAST 152
473
474
475 #define YYNTOKENS 30
476
477 #define YYNNTS 18
478
479 #define YYNRULES 70
480
481 #define YYNSTATES 133
482
483
484 #define YYUNDEFTOK 2
485 #define YYMAXUTOK 284
486
487 #define YYTRANSLATE(YYX) \
488 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
489
490
491 static const yytype_uint8 yytranslate[] =
492 {
493 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
494 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
495 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
496 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
497 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
498 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
499 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
500 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
501 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
502 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
503 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
504 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
505 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
506 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
507 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
508 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
509 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
510 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
511 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
512 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
513 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
514 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
515 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
516 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
517 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
518 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
519 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
520 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
521 25, 26, 27, 28, 29
522 };
523
524 #if YYDEBUG
525
526
527 static const yytype_uint16 yyprhs[] =
528 {
529 0, 0, 3, 5, 6, 12, 13, 18, 20, 23,
530 25, 27, 29, 34, 39, 45, 51, 56, 62, 67,
531 73, 78, 84, 89, 93, 95, 99, 104, 109, 114,
532 122, 125, 132, 139, 149, 152, 159, 166, 176, 181,
533 186, 194, 197, 204, 211, 221, 224, 231, 238, 248,
534 251, 256, 261, 263, 265, 266, 268, 272, 280, 284,
535 290, 292, 294, 296, 298, 300, 304, 308, 312, 316,
536 318
537 };
538
539
540 static const yytype_int8 yyrhs[] =
541 {
542 31, 0, -1, 32, -1, -1, 43, 7, 33, 35,
543 8, -1, -1, 43, 7, 34, 8, -1, 36, -1,
544 35, 36, -1, 37, -1, 42, -1, 32, -1, 29,
545 9, 17, 4, -1, 29, 9, 13, 4, -1, 29,
546 9, 13, 38, 4, -1, 29, 9, 12, 40, 4,
547 -1, 29, 9, 12, 4, -1, 29, 9, 14, 38,
548 4, -1, 29, 9, 18, 4, -1, 29, 9, 18,
549 41, 4, -1, 29, 9, 16, 4, -1, 29, 9,
550 16, 41, 4, -1, 29, 9, 21, 4, -1, 5,
551 39, 6, -1, 47, -1, 39, 3, 47, -1, 39,
552 3, 19, 47, -1, 5, 24, 27, 6, -1, 5,
553 25, 27, 6, -1, 5, 24, 27, 20, 25, 27,
554 6, -1, 22, 27, -1, 5, 24, 27, 6, 22,
555 27, -1, 5, 25, 27, 6, 22, 27, -1, 5,
556 24, 27, 20, 25, 27, 6, 22, 27, -1, 22,
557 47, -1, 5, 24, 27, 6, 22, 47, -1, 5,
558 25, 27, 6, 22, 47, -1, 5, 24, 27, 20,
559 25, 27, 6, 22, 47, -1, 5, 24, 27, 6,
560 -1, 5, 25, 27, 6, -1, 5, 24, 27, 20,
561 25, 27, 6, -1, 22, 27, -1, 5, 24, 27,
562 6, 22, 27, -1, 5, 25, 27, 6, 22, 27,
563 -1, 5, 24, 27, 20, 25, 27, 6, 22, 27,
564 -1, 22, 47, -1, 5, 24, 27, 6, 22, 47,
565 -1, 5, 25, 27, 6, 22, 47, -1, 5, 24,
566 27, 20, 25, 27, 6, 22, 47, -1, 43, 4,
567 -1, 29, 5, 44, 6, -1, 18, 5, 44, 6,
568 -1, 45, -1, 46, -1, -1, 29, -1, 10, 29,
569 11, -1, 29, 10, 3, 26, 3, 29, 11, -1,
570 29, 3, 29, -1, 29, 3, 29, 3, 29, -1,
571 13, -1, 16, -1, 12, -1, 15, -1, 23, -1,
572 46, 3, 13, -1, 46, 3, 16, -1, 46, 3,
573 12, -1, 46, 3, 23, -1, 28, -1, 29, -1
574 };
575
576
577 static const yytype_uint8 yyrline[] =
578 {
579 0, 90, 90, 93, 93, 94, 94, 100, 101, 105,
580 106, 107, 110, 111, 112, 113, 114, 115, 116, 117,
581 118, 119, 120, 123, 127, 128, 129, 133, 134, 135,
582 137, 138, 139, 140, 142, 143, 144, 145, 149, 150,
583 151, 153, 154, 155, 156, 158, 159, 160, 161, 167,
584 170, 171, 175, 176, 179, 180, 181, 182, 183, 184,
585 187, 188, 189, 190, 191, 192, 193, 194, 195, 200,
586 201
587 };
588 #endif
589
590 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
591
592
593 static const char *const yytname[] =
594 {
595 "$end", "error", "$undefined", "COMMA", "SEMI", "LPAR", "RPAR",
596 "LCURLY", "RCURLY", "COLON", "LBRACK", "RBRACK", "KW_FLOAT", "KW_STRING",
597 "KW_ENUM", "KW_UNK_ARGS", "KW_INTEGER", "KW_VIRTATTR", "KW_SHORT",
598 "KW_OR", "KW_AND", "KW_BOOLEAN", "COLONEQ", "KW_LIST", "GREATERTHAN",
599 "LESSTHAN", "DOTS", "NUM", "STRING", "IDENT", "$accept", "file", "group",
600 "$@1", "$@2", "statements", "statement", "simple_attr", "string_enum",
601 "s_or_i_list", "float_constraint", "int_constraint", "complex_attr",
602 "head", "arg_or_namelist", "namelist", "arglist", "s_or_i", 0
603 };
604 #endif
605
606 # ifdef YYPRINT
607
608
609 static const yytype_uint16 yytoknum[] =
610 {
611 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
612 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
613 275, 276, 277, 278, 279, 280, 281, 282, 283, 284
614 };
615 # endif
616
617
618 static const yytype_uint8 yyr1[] =
619 {
620 0, 30, 31, 33, 32, 34, 32, 35, 35, 36,
621 36, 36, 37, 37, 37, 37, 37, 37, 37, 37,
622 37, 37, 37, 38, 39, 39, 39, 40, 40, 40,
623 40, 40, 40, 40, 40, 40, 40, 40, 41, 41,
624 41, 41, 41, 41, 41, 41, 41, 41, 41, 42,
625 43, 43, 44, 44, 45, 45, 45, 45, 45, 45,
626 46, 46, 46, 46, 46, 46, 46, 46, 46, 47,
627 47
628 };
629
630
631 static const yytype_uint8 yyr2[] =
632 {
633 0, 2, 1, 0, 5, 0, 4, 1, 2, 1,
634 1, 1, 4, 4, 5, 5, 4, 5, 4, 5,
635 4, 5, 4, 3, 1, 3, 4, 4, 4, 7,
636 2, 6, 6, 9, 2, 6, 6, 9, 4, 4,
637 7, 2, 6, 6, 9, 2, 6, 6, 9, 2,
638 4, 4, 1, 1, 0, 1, 3, 7, 3, 5,
639 1, 1, 1, 1, 1, 3, 3, 3, 3, 1,
640 1
641 };
642
643
644
645
646 static const yytype_uint8 yydefact[] =
647 {
648 0, 0, 0, 0, 2, 0, 54, 54, 1, 3,
649 0, 62, 60, 63, 61, 64, 55, 0, 52, 53,
650 0, 0, 0, 0, 0, 0, 51, 0, 50, 0,
651 11, 0, 7, 9, 10, 0, 6, 56, 58, 0,
652 67, 65, 66, 68, 0, 4, 8, 49, 0, 0,
653 0, 0, 0, 0, 0, 0, 0, 59, 0, 16,
654 0, 0, 0, 13, 0, 0, 0, 20, 0, 0,
655 0, 12, 18, 0, 22, 0, 0, 0, 30, 69,
656 70, 34, 15, 0, 24, 14, 17, 0, 0, 41,
657 45, 21, 19, 57, 0, 0, 0, 23, 0, 0,
658 27, 0, 28, 0, 25, 38, 0, 39, 0, 0,
659 0, 26, 0, 0, 0, 31, 35, 0, 32, 36,
660 42, 46, 0, 43, 47, 29, 40, 0, 0, 33,
661 37, 44, 48
662 };
663
664
665 static const yytype_int8 yydefgoto[] =
666 {
667 -1, 3, 30, 21, 22, 31, 32, 33, 65, 83,
668 62, 70, 34, 35, 17, 18, 19, 81
669 };
670
671
672
673 #define YYPACT_NINF -65
674 static const yytype_int8 yypact[] =
675 {
676 -10, 9, 26, 49, -65, 76, -6, -6, -65, 46,
677 67, -65, -65, -65, -65, -65, 37, 91, -65, 95,
678 93, 16, 92, 90, 73, 100, -65, 13, -65, 32,
679 -65, -7, -65, -65, -65, 54, -65, -65, 101, 79,
680 -65, -65, -65, -65, 39, -65, -65, -65, 77, 104,
681 -2, 86, 103, 8, 105, 11, 106, -65, 82, -65,
682 68, 38, 108, -65, 14, 109, 110, -65, 70, 41,
683 111, -65, -65, 112, -65, 107, 94, 96, -65, -65,
684 -65, -65, -65, 56, -65, -65, -65, 97, 98, -65,
685 -65, -65, -65, -65, 15, 113, -1, -65, 18, 114,
686 115, 102, 116, 14, -65, 117, 118, 119, 44, 99,
687 47, -65, 50, 120, 53, -65, -65, 122, -65, -65,
688 -65, -65, 123, -65, -65, 124, 126, 57, 60, -65,
689 -65, -65, -65
690 };
691
692
693 static const yytype_int16 yypgoto[] =
694 {
695 -65, -65, 130, -65, -65, -65, 121, -65, 65, -65,
696 -65, 78, -65, 131, 125, -65, -65, -64
697 };
698
699
700
701
702 #define YYTABLE_NINF -6
703 static const yytype_int16 yytable[] =
704 {
705 84, 45, 59, 60, 10, 90, 11, 12, 1, 13,
706 14, 1, 67, 68, 6, 72, 68, 15, 103, 2,
707 61, 100, 29, 16, 105, 40, 41, 79, 80, 42,
708 69, 7, 104, 69, 1, 101, 43, 7, 106, 111,
709 24, 44, 79, 80, 116, 29, 119, 25, 121, 8,
710 124, 50, 51, 52, -5, 53, 54, 55, 47, 96,
711 56, 9, 97, 130, 132, 78, 79, 80, 89, 79,
712 80, 115, 79, 80, 118, 79, 80, 120, 79, 80,
713 123, 79, 80, 9, 129, 79, 80, 131, 79, 80,
714 63, 64, 76, 77, 87, 88, 23, 26, 27, 28,
715 36, 37, 38, 39, 48, 49, 57, 58, 64, 71,
716 74, 75, 82, 85, 86, 91, 92, 66, 93, 102,
717 107, 94, 0, 95, 98, 99, 117, 109, 125, 126,
718 4, 5, 20, 73, 0, 0, 0, 108, 110, 112,
719 0, 114, 0, 113, 0, 0, 127, 122, 128, 0,
720 0, 0, 46
721 };
722
723 #define yypact_value_is_default(yystate) \
724 ((yystate) == (-65))
725
726 #define yytable_value_is_error(yytable_value) \
727 YYID (0)
728
729 static const yytype_int16 yycheck[] =
730 {
731 64, 8, 4, 5, 10, 69, 12, 13, 18, 15,
732 16, 18, 4, 5, 5, 4, 5, 23, 19, 29,
733 22, 6, 29, 29, 6, 12, 13, 28, 29, 16,
734 22, 5, 96, 22, 18, 20, 23, 5, 20, 103,
735 3, 9, 28, 29, 108, 29, 110, 10, 112, 0,
736 114, 12, 13, 14, 8, 16, 17, 18, 4, 3,
737 21, 7, 6, 127, 128, 27, 28, 29, 27, 28,
738 29, 27, 28, 29, 27, 28, 29, 27, 28, 29,
739 27, 28, 29, 7, 27, 28, 29, 27, 28, 29,
740 4, 5, 24, 25, 24, 25, 29, 6, 3, 6,
741 8, 11, 29, 3, 3, 26, 29, 3, 5, 4,
742 4, 29, 4, 4, 4, 4, 4, 52, 11, 6,
743 6, 27, -1, 27, 27, 27, 27, 25, 6, 6,
744 0, 0, 7, 55, -1, -1, -1, 22, 22, 22,
745 -1, 22, -1, 25, -1, -1, 22, 27, 22, -1,
746 -1, -1, 31
747 };
748
749
750
751 static const yytype_uint8 yystos[] =
752 {
753 0, 18, 29, 31, 32, 43, 5, 5, 0, 7,
754 10, 12, 13, 15, 16, 23, 29, 44, 45, 46,
755 44, 33, 34, 29, 3, 10, 6, 3, 6, 29,
756 32, 35, 36, 37, 42, 43, 8, 11, 29, 3,
757 12, 13, 16, 23, 9, 8, 36, 4, 3, 26,
758 12, 13, 14, 16, 17, 18, 21, 29, 3, 4,
759 5, 22, 40, 4, 5, 38, 38, 4, 5, 22,
760 41, 4, 4, 41, 4, 29, 24, 25, 27, 28,
761 29, 47, 4, 39, 47, 4, 4, 24, 25, 27,
762 47, 4, 4, 11, 27, 27, 3, 6, 27, 27,
763 6, 20, 6, 19, 47, 6, 20, 6, 22, 25,
764 22, 47, 22, 25, 22, 27, 47, 27, 27, 47,
765 27, 47, 27, 27, 47, 6, 6, 22, 22, 27,
766 47, 27, 47
767 };
768
769 #define yyerrok (yyerrstatus = 0)
770 #define yyclearin (yychar = YYEMPTY)
771 #define YYEMPTY (-2)
772 #define YYEOF 0
773
774 #define YYACCEPT goto yyacceptlab
775 #define YYABORT goto yyabortlab
776 #define YYERROR goto yyerrorlab
777
778
779
780
781
782
783
784
785
786 #define YYFAIL goto yyerrlab
787 #if defined YYFAIL
788
789
790
791
792 #endif
793
794 #define YYRECOVERING() (!!yyerrstatus)
795
796 #define YYBACKUP(Token, Value) \
797 do \
798 if (yychar == YYEMPTY && yylen == 1) \
799 { \
800 yychar = (Token); \
801 yylval = (Value); \
802 YYPOPSTACK (1); \
803 goto yybackup; \
804 } \
805 else \
806 { \
807 yyerror (YY_("syntax error: cannot back up")); \
808 YYERROR; \
809 } \
810 while (YYID (0))
811
812
813 #define YYTERROR 1
814 #define YYERRCODE 256
815
816
817
818
819
820
821 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
822 #ifndef YYLLOC_DEFAULT
823 # define YYLLOC_DEFAULT(Current, Rhs, N) \
824 do \
825 if (YYID (N)) \
826 { \
827 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
828 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
829 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
830 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
831 } \
832 else \
833 { \
834 (Current).first_line = (Current).last_line = \
835 YYRHSLOC (Rhs, 0).last_line; \
836 (Current).first_column = (Current).last_column = \
837 YYRHSLOC (Rhs, 0).last_column; \
838 } \
839 while (YYID (0))
840 #endif
841
842
843
844
845 #ifndef YY_LOCATION_PRINT
846 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
847 #endif
848
849
850
851
852 #ifdef YYLEX_PARAM
853 # define YYLEX yylex (YYLEX_PARAM)
854 #else
855 # define YYLEX yylex ()
856 #endif
857
858
859 #if YYDEBUG
860
861 # ifndef YYFPRINTF
862 # include <stdio.h>
863 # define YYFPRINTF fprintf
864 # endif
865
866 # define YYDPRINTF(Args) \
867 do { \
868 if (yydebug) \
869 YYFPRINTF Args; \
870 } while (YYID (0))
871
872 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
873 do { \
874 if (yydebug) \
875 { \
876 YYFPRINTF (stderr, "%s ", Title); \
877 yy_symbol_print (stderr, \
878 Type, Value); \
879 YYFPRINTF (stderr, "\n"); \
880 } \
881 } while (YYID (0))
882
883
884
885
886
887
888
889 #if (defined __STDC__ || defined __C99__FUNC__ \
890 || defined __cplusplus || defined _MSC_VER)
891 static void
892 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
893 #else
894 static void
895 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
896 FILE *yyoutput;
897 int yytype;
898 YYSTYPE const * const yyvaluep;
899 #endif
900 {
901 if (!yyvaluep)
902 return;
903 # ifdef YYPRINT
904 if (yytype < YYNTOKENS)
905 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
906 # else
907 YYUSE (yyoutput);
908 # endif
909 switch (yytype)
910 {
911 default:
912 break;
913 }
914 }
915
916
917
918
919
920
921 #if (defined __STDC__ || defined __C99__FUNC__ \
922 || defined __cplusplus || defined _MSC_VER)
923 static void
924 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
925 #else
926 static void
927 yy_symbol_print (yyoutput, yytype, yyvaluep)
928 FILE *yyoutput;
929 int yytype;
930 YYSTYPE const * const yyvaluep;
931 #endif
932 {
933 if (yytype < YYNTOKENS)
934 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
935 else
936 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
937
938 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
939 YYFPRINTF (yyoutput, ")");
940 }
941
942
943
944
945
946
947 #if (defined __STDC__ || defined __C99__FUNC__ \
948 || defined __cplusplus || defined _MSC_VER)
949 static void
950 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
951 #else
952 static void
953 yy_stack_print (yybottom, yytop)
954 yytype_int16 *yybottom;
955 yytype_int16 *yytop;
956 #endif
957 {
958 YYFPRINTF (stderr, "Stack now");
959 for (; yybottom <= yytop; yybottom++)
960 {
961 int yybot = *yybottom;
962 YYFPRINTF (stderr, " %d", yybot);
963 }
964 YYFPRINTF (stderr, "\n");
965 }
966
967 # define YY_STACK_PRINT(Bottom, Top) \
968 do { \
969 if (yydebug) \
970 yy_stack_print ((Bottom), (Top)); \
971 } while (YYID (0))
972
973
974
975
976
977
978 #if (defined __STDC__ || defined __C99__FUNC__ \
979 || defined __cplusplus || defined _MSC_VER)
980 static void
981 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
982 #else
983 static void
984 yy_reduce_print (yyvsp, yyrule)
985 YYSTYPE *yyvsp;
986 int yyrule;
987 #endif
988 {
989 int yynrhs = yyr2[yyrule];
990 int yyi;
991 unsigned long int yylno = yyrline[yyrule];
992 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
993 yyrule - 1, yylno);
994
995 for (yyi = 0; yyi < yynrhs; yyi++)
996 {
997 YYFPRINTF (stderr, " $%d = ", yyi + 1);
998 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
999 &(yyvsp[(yyi + 1) - (yynrhs)])
1000 );
1001 YYFPRINTF (stderr, "\n");
1002 }
1003 }
1004
1005 # define YY_REDUCE_PRINT(Rule) \
1006 do { \
1007 if (yydebug) \
1008 yy_reduce_print (yyvsp, Rule); \
1009 } while (YYID (0))
1010
1011
1012
1013 int yydebug;
1014 #else
1015 # define YYDPRINTF(Args)
1016 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1017 # define YY_STACK_PRINT(Bottom, Top)
1018 # define YY_REDUCE_PRINT(Rule)
1019 #endif
1020
1021
1022
1023 #ifndef YYINITDEPTH
1024 # define YYINITDEPTH 200
1025 #endif
1026
1027
1028
1029
1030
1031
1032
1033
1034 #ifndef YYMAXDEPTH
1035 # define YYMAXDEPTH 10000
1036 #endif
1037
1038
1039 #if YYERROR_VERBOSE
1040
1041 # ifndef yystrlen
1042 # if defined __GLIBC__ && defined _STRING_H
1043 # define yystrlen strlen
1044 # else
1045
1046 #if (defined __STDC__ || defined __C99__FUNC__ \
1047 || defined __cplusplus || defined _MSC_VER)
1048 static YYSIZE_T
1049 yystrlen (const char *yystr)
1050 #else
1051 static YYSIZE_T
1052 yystrlen (yystr)
1053 const char *yystr;
1054 #endif
1055 {
1056 YYSIZE_T yylen;
1057 for (yylen = 0; yystr[yylen]; yylen++)
1058 continue;
1059 return yylen;
1060 }
1061 # endif
1062 # endif
1063
1064 # ifndef yystpcpy
1065 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1066 # define yystpcpy stpcpy
1067 # else
1068
1069
1070 #if (defined __STDC__ || defined __C99__FUNC__ \
1071 || defined __cplusplus || defined _MSC_VER)
1072 static char *
1073 yystpcpy (char *yydest, const char *yysrc)
1074 #else
1075 static char *
1076 yystpcpy (yydest, yysrc)
1077 char *yydest;
1078 const char *yysrc;
1079 #endif
1080 {
1081 char *yyd = yydest;
1082 const char *yys = yysrc;
1083
1084 while ((*yyd++ = *yys++) != '\0')
1085 continue;
1086
1087 return yyd - 1;
1088 }
1089 # endif
1090 # endif
1091
1092 # ifndef yytnamerr
1093
1094
1095
1096
1097
1098
1099
1100 static YYSIZE_T
1101 yytnamerr (char *yyres, const char *yystr)
1102 {
1103 if (*yystr == '"')
1104 {
1105 YYSIZE_T yyn = 0;
1106 char const *yyp = yystr;
1107
1108 for (;;)
1109 switch (*++yyp)
1110 {
1111 case '\'':
1112 case ',':
1113 goto do_not_strip_quotes;
1114
1115 case '\\':
1116 if (*++yyp != '\\')
1117 goto do_not_strip_quotes;
1118
1119 default:
1120 if (yyres)
1121 yyres[yyn] = *yyp;
1122 yyn++;
1123 break;
1124
1125 case '"':
1126 if (yyres)
1127 yyres[yyn] = '\0';
1128 return yyn;
1129 }
1130 do_not_strip_quotes: ;
1131 }
1132
1133 if (! yyres)
1134 return yystrlen (yystr);
1135
1136 return yystpcpy (yyres, yystr) - yyres;
1137 }
1138 # endif
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148 static int
1149 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1150 yytype_int16 *yyssp, int yytoken)
1151 {
1152 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
1153 YYSIZE_T yysize = yysize0;
1154 YYSIZE_T yysize1;
1155 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1156
1157 const char *yyformat = 0;
1158
1159 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1160
1161
1162 int yycount = 0;
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191 if (yytoken != YYEMPTY)
1192 {
1193 int yyn = yypact[*yyssp];
1194 yyarg[yycount++] = yytname[yytoken];
1195 if (!yypact_value_is_default (yyn))
1196 {
1197
1198
1199
1200 int yyxbegin = yyn < 0 ? -yyn : 0;
1201
1202 int yychecklim = YYLAST - yyn + 1;
1203 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1204 int yyx;
1205
1206 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1207 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1208 && !yytable_value_is_error (yytable[yyx + yyn]))
1209 {
1210 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1211 {
1212 yycount = 1;
1213 yysize = yysize0;
1214 break;
1215 }
1216 yyarg[yycount++] = yytname[yyx];
1217 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1218 if (! (yysize <= yysize1
1219 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1220 return 2;
1221 yysize = yysize1;
1222 }
1223 }
1224 }
1225
1226 switch (yycount)
1227 {
1228 # define YYCASE_(N, S) \
1229 case N: \
1230 yyformat = S; \
1231 break
1232 YYCASE_(0, YY_("syntax error"));
1233 YYCASE_(1, YY_("syntax error, unexpected %s"));
1234 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1235 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1236 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1237 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1238 # undef YYCASE_
1239 }
1240
1241 yysize1 = yysize + yystrlen (yyformat);
1242 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1243 return 2;
1244 yysize = yysize1;
1245
1246 if (*yymsg_alloc < yysize)
1247 {
1248 *yymsg_alloc = 2 * yysize;
1249 if (! (yysize <= *yymsg_alloc
1250 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1251 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1252 return 1;
1253 }
1254
1255
1256
1257
1258 {
1259 char *yyp = *yymsg;
1260 int yyi = 0;
1261 while ((*yyp = *yyformat) != '\0')
1262 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1263 {
1264 yyp += yytnamerr (yyp, yyarg[yyi++]);
1265 yyformat += 2;
1266 }
1267 else
1268 {
1269 yyp++;
1270 yyformat++;
1271 }
1272 }
1273 return 0;
1274 }
1275 #endif
1276
1277
1278
1279
1280
1281
1282 #if (defined __STDC__ || defined __C99__FUNC__ \
1283 || defined __cplusplus || defined _MSC_VER)
1284 static void
1285 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1286 #else
1287 static void
1288 yydestruct (yymsg, yytype, yyvaluep)
1289 const char *yymsg;
1290 int yytype;
1291 YYSTYPE *yyvaluep;
1292 #endif
1293 {
1294 YYUSE (yyvaluep);
1295
1296 if (!yymsg)
1297 yymsg = "Deleting";
1298 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1299
1300 switch (yytype)
1301 {
1302
1303 default:
1304 break;
1305 }
1306 }
1307
1308
1309
1310 #ifdef YYPARSE_PARAM
1311 #if defined __STDC__ || defined __cplusplus
1312 int yyparse (void *YYPARSE_PARAM);
1313 #else
1314 int yyparse ();
1315 #endif
1316 #else
1317 #if defined __STDC__ || defined __cplusplus
1318 int yyparse (void);
1319 #else
1320 int yyparse ();
1321 #endif
1322 #endif
1323
1324
1325
1326 int yychar;
1327
1328
1329 YYSTYPE yylval;
1330
1331
1332 int yynerrs;
1333
1334
1335
1336
1337
1338
1339 #ifdef YYPARSE_PARAM
1340 #if (defined __STDC__ || defined __C99__FUNC__ \
1341 || defined __cplusplus || defined _MSC_VER)
1342 int
1343 yyparse (void *YYPARSE_PARAM)
1344 #else
1345 int
1346 yyparse (YYPARSE_PARAM)
1347 void *YYPARSE_PARAM;
1348 #endif
1349 #else
1350 #if (defined __STDC__ || defined __C99__FUNC__ \
1351 || defined __cplusplus || defined _MSC_VER)
1352 int
1353 yyparse (void)
1354 #else
1355 int
1356 yyparse ()
1357
1358 #endif
1359 #endif
1360 {
1361 int yystate;
1362
1363 int yyerrstatus;
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373 yytype_int16 yyssa[YYINITDEPTH];
1374 yytype_int16 *yyss;
1375 yytype_int16 *yyssp;
1376
1377
1378 YYSTYPE yyvsa[YYINITDEPTH];
1379 YYSTYPE *yyvs;
1380 YYSTYPE *yyvsp;
1381
1382 YYSIZE_T yystacksize;
1383
1384 int yyn;
1385 int yyresult;
1386
1387 int yytoken;
1388
1389
1390 YYSTYPE yyval;
1391
1392 #if YYERROR_VERBOSE
1393
1394 char yymsgbuf[128];
1395 char *yymsg = yymsgbuf;
1396 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1397 #endif
1398
1399 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1400
1401
1402
1403 int yylen = 0;
1404
1405 yytoken = 0;
1406 yyss = yyssa;
1407 yyvs = yyvsa;
1408 yystacksize = YYINITDEPTH;
1409
1410 YYDPRINTF ((stderr, "Starting parse\n"));
1411
1412 yystate = 0;
1413 yyerrstatus = 0;
1414 yynerrs = 0;
1415 yychar = YYEMPTY;
1416
1417
1418
1419
1420
1421 yyssp = yyss;
1422 yyvsp = yyvs;
1423
1424 goto yysetstate;
1425
1426
1427
1428
1429 yynewstate:
1430
1431
1432 yyssp++;
1433
1434 yysetstate:
1435 *yyssp = yystate;
1436
1437 if (yyss + yystacksize - 1 <= yyssp)
1438 {
1439
1440 YYSIZE_T yysize = yyssp - yyss + 1;
1441
1442 #ifdef yyoverflow
1443 {
1444
1445
1446
1447 YYSTYPE *yyvs1 = yyvs;
1448 yytype_int16 *yyss1 = yyss;
1449
1450
1451
1452
1453
1454 yyoverflow (YY_("memory exhausted"),
1455 &yyss1, yysize * sizeof (*yyssp),
1456 &yyvs1, yysize * sizeof (*yyvsp),
1457 &yystacksize);
1458
1459 yyss = yyss1;
1460 yyvs = yyvs1;
1461 }
1462 #else
1463 # ifndef YYSTACK_RELOCATE
1464 goto yyexhaustedlab;
1465 # else
1466
1467 if (YYMAXDEPTH <= yystacksize)
1468 goto yyexhaustedlab;
1469 yystacksize *= 2;
1470 if (YYMAXDEPTH < yystacksize)
1471 yystacksize = YYMAXDEPTH;
1472
1473 {
1474 yytype_int16 *yyss1 = yyss;
1475 union yyalloc *yyptr =
1476 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1477 if (! yyptr)
1478 goto yyexhaustedlab;
1479 YYSTACK_RELOCATE (yyss_alloc, yyss);
1480 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1481 # undef YYSTACK_RELOCATE
1482 if (yyss1 != yyssa)
1483 YYSTACK_FREE (yyss1);
1484 }
1485 # endif
1486 #endif
1487
1488 yyssp = yyss + yysize - 1;
1489 yyvsp = yyvs + yysize - 1;
1490
1491 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1492 (unsigned long int) yystacksize));
1493
1494 if (yyss + yystacksize - 1 <= yyssp)
1495 YYABORT;
1496 }
1497
1498 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1499
1500 if (yystate == YYFINAL)
1501 YYACCEPT;
1502
1503 goto yybackup;
1504
1505
1506
1507
1508 yybackup:
1509
1510
1511
1512
1513
1514 yyn = yypact[yystate];
1515 if (yypact_value_is_default (yyn))
1516 goto yydefault;
1517
1518
1519
1520
1521 if (yychar == YYEMPTY)
1522 {
1523 YYDPRINTF ((stderr, "Reading a token: "));
1524 yychar = YYLEX;
1525 }
1526
1527 if (yychar <= YYEOF)
1528 {
1529 yychar = yytoken = YYEOF;
1530 YYDPRINTF ((stderr, "Now at end of input.\n"));
1531 }
1532 else
1533 {
1534 yytoken = YYTRANSLATE (yychar);
1535 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1536 }
1537
1538
1539
1540 yyn += yytoken;
1541 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1542 goto yydefault;
1543 yyn = yytable[yyn];
1544 if (yyn <= 0)
1545 {
1546 if (yytable_value_is_error (yyn))
1547 goto yyerrlab;
1548 yyn = -yyn;
1549 goto yyreduce;
1550 }
1551
1552
1553
1554 if (yyerrstatus)
1555 yyerrstatus--;
1556
1557
1558 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1559
1560
1561 yychar = YYEMPTY;
1562
1563 yystate = yyn;
1564 *++yyvsp = yylval;
1565
1566 goto yynewstate;
1567
1568
1569
1570
1571
1572 yydefault:
1573 yyn = yydefact[yystate];
1574 if (yyn == 0)
1575 goto yyerrlab;
1576 goto yyreduce;
1577
1578
1579
1580
1581
1582 yyreduce:
1583
1584 yylen = yyr2[yyn];
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594 yyval = yyvsp[1-yylen];
1595
1596
1597 YY_REDUCE_PRINT (yyn);
1598 switch (yyn)
1599 {
1600 case 2:
1601
1602
1603 #line 90 "syntax_parser.y"
1604 { libsynt_techs[libsynt_tech_count++].lib = (yyvsp[(1) - (1)].group); }
1605 break;
1606
1607 case 3:
1608
1609
1610 #line 93 "syntax_parser.y"
1611 {push_group((yyvsp[(1) - (2)].head));}
1612 break;
1613
1614 case 4:
1615
1616
1617 #line 93 "syntax_parser.y"
1618 {(yyval.group) = gs[gsindex-1];pop_group();}
1619 break;
1620
1621 case 5:
1622
1623
1624 #line 94 "syntax_parser.y"
1625 {push_group((yyvsp[(1) - (2)].head));}
1626 break;
1627
1628 case 6:
1629
1630
1631 #line 94 "syntax_parser.y"
1632 {si2drObjectIdT toid; (yyval.group) = gs[gsindex-1]; liberty_hash_lookup(libsynt_groups, gs[gsindex-1]->type, &toid);
1633 if( toid.v1 != (void*)NULL )(yyval.group)->ref =(libsynt_group_info*)toid.v1;
1634 else {printf("Error: line %d: Couldn't find group %s\n",(yyvsp[(1) - (4)].head)->lineno,(yyvsp[(1) - (4)].head)->ident); } pop_group();}
1635 break;
1636
1637 case 7:
1638
1639
1640 #line 100 "syntax_parser.y"
1641 {}
1642 break;
1643
1644 case 8:
1645
1646
1647 #line 101 "syntax_parser.y"
1648 {}
1649 break;
1650
1651 case 9:
1652
1653
1654 #line 105 "syntax_parser.y"
1655 {si2drObjectIdT toid; toid.v1 = (void*)(yyvsp[(1) - (1)].attr);liberty_hash_enter_oid(gs[gsindex-1]->attr_hash, (yyvsp[(1) - (1)].attr)->name, toid);(yyvsp[(1) - (1)].attr)->next = gs[gsindex-1]->attr_list; gs[gsindex-1]->attr_list = (yyvsp[(1) - (1)].attr); }
1656 break;
1657
1658 case 10:
1659
1660
1661 #line 106 "syntax_parser.y"
1662 {si2drObjectIdT toid;toid.v1 = (void*)(yyvsp[(1) - (1)].attr);liberty_hash_enter_oid(gs[gsindex-1]->attr_hash, (yyvsp[(1) - (1)].attr)->name, toid);(yyvsp[(1) - (1)].attr)->next = gs[gsindex-1]->attr_list; gs[gsindex-1]->attr_list = (yyvsp[(1) - (1)].attr);}
1663 break;
1664
1665 case 11:
1666
1667
1668 #line 107 "syntax_parser.y"
1669 {si2drObjectIdT toid;toid.v1 = (void*)(yyvsp[(1) - (1)].group);liberty_hash_enter_oid(gs[gsindex-1]->group_hash, (yyvsp[(1) - (1)].group)->type,toid);(yyvsp[(1) - (1)].group)->next = gs[gsindex-1]->group_list; gs[gsindex-1]->group_list = (yyvsp[(1) - (1)].group);}
1670 break;
1671
1672 case 12:
1673
1674
1675 #line 110 "syntax_parser.y"
1676 { (yyval.attr) = make_simple((yyvsp[(1) - (4)].str),SYNTAX_ATTRTYPE_VIRTUAL,0);}
1677 break;
1678
1679 case 13:
1680
1681
1682 #line 111 "syntax_parser.y"
1683 { (yyval.attr) = make_simple((yyvsp[(1) - (4)].str),SYNTAX_ATTRTYPE_STRING,0);}
1684 break;
1685
1686 case 14:
1687
1688
1689 #line 112 "syntax_parser.y"
1690 { (yyval.attr) = make_simple((yyvsp[(1) - (5)].str),SYNTAX_ATTRTYPE_ENUM, (yyvsp[(4) - (5)].str_enum));}
1691 break;
1692
1693 case 15:
1694
1695
1696 #line 113 "syntax_parser.y"
1697 { (yyval.attr) = make_simple((yyvsp[(1) - (5)].str),SYNTAX_ATTRTYPE_FLOAT,(yyvsp[(4) - (5)].float_constr));}
1698 break;
1699
1700 case 16:
1701
1702
1703 #line 114 "syntax_parser.y"
1704 { (yyval.attr) = make_simple((yyvsp[(1) - (4)].str),SYNTAX_ATTRTYPE_FLOAT,0);}
1705 break;
1706
1707 case 17:
1708
1709
1710 #line 115 "syntax_parser.y"
1711 { (yyval.attr) = make_simple((yyvsp[(1) - (5)].str),SYNTAX_ATTRTYPE_ENUM, (yyvsp[(4) - (5)].str_enum));}
1712 break;
1713
1714 case 18:
1715
1716
1717 #line 116 "syntax_parser.y"
1718 { (yyval.attr) = make_simple((yyvsp[(1) - (4)].str),SYNTAX_ATTRTYPE_INT,0);}
1719 break;
1720
1721 case 19:
1722
1723
1724 #line 117 "syntax_parser.y"
1725 { (yyval.attr) = make_simple((yyvsp[(1) - (5)].str),SYNTAX_ATTRTYPE_INT,(yyvsp[(4) - (5)].int_constr));}
1726 break;
1727
1728 case 20:
1729
1730
1731 #line 118 "syntax_parser.y"
1732 { (yyval.attr) = make_simple((yyvsp[(1) - (4)].str),SYNTAX_ATTRTYPE_INT,0);}
1733 break;
1734
1735 case 21:
1736
1737
1738 #line 119 "syntax_parser.y"
1739 { (yyval.attr) = make_simple((yyvsp[(1) - (5)].str),SYNTAX_ATTRTYPE_INT,(yyvsp[(4) - (5)].int_constr));}
1740 break;
1741
1742 case 22:
1743
1744
1745 #line 120 "syntax_parser.y"
1746 { (yyval.attr) = make_simple((yyvsp[(1) - (4)].str),SYNTAX_ATTRTYPE_BOOLEAN,0);}
1747 break;
1748
1749 case 23:
1750
1751
1752 #line 123 "syntax_parser.y"
1753 { int i; (yyval.str_enum) = (libsynt_string_enum*)my_calloc(sizeof(libsynt_string_enum),1); (yyval.str_enum)->array = (char**)my_calloc(sizeof(char*),enumcount+1);
1754 for(i=0;i<enumcount; i++){(yyval.str_enum)->array[i] = enumlist[i];} (yyval.str_enum)->size = enumcount;}
1755 break;
1756
1757 case 24:
1758
1759
1760 #line 127 "syntax_parser.y"
1761 { enumcount=0; enumlist[enumcount++] = (yyvsp[(1) - (1)].str);}
1762 break;
1763
1764 case 25:
1765
1766
1767 #line 128 "syntax_parser.y"
1768 { enumlist[enumcount++] = (yyvsp[(3) - (3)].str);}
1769 break;
1770
1771 case 26:
1772
1773
1774 #line 129 "syntax_parser.y"
1775 { enumlist[enumcount++] = (yyvsp[(4) - (4)].str);}
1776 break;
1777
1778 case 27:
1779
1780
1781 #line 133 "syntax_parser.y"
1782 {(yyval.float_constr) = (libsynt_float_constraint*)my_calloc(sizeof(libsynt_float_constraint),1); (yyval.float_constr)->greater_than = (yyvsp[(3) - (4)].num); (yyval.float_constr)->greater_specd =1; }
1783 break;
1784
1785 case 28:
1786
1787
1788 #line 134 "syntax_parser.y"
1789 {(yyval.float_constr) = (libsynt_float_constraint*)my_calloc(sizeof(libsynt_float_constraint),1); (yyval.float_constr)->less_than = (yyvsp[(3) - (4)].num); (yyval.float_constr)->less_specd = 1; }
1790 break;
1791
1792 case 29:
1793
1794
1795 #line 135 "syntax_parser.y"
1796 {(yyval.float_constr) = (libsynt_float_constraint*)my_calloc(sizeof(libsynt_float_constraint),1);
1797 (yyval.float_constr)->less_than = (yyvsp[(6) - (7)].num); (yyval.float_constr)->less_specd = 1;(yyval.float_constr)->greater_than = (yyvsp[(3) - (7)].num); (yyval.float_constr)->greater_specd =1;}
1798 break;
1799
1800 case 30:
1801
1802
1803 #line 137 "syntax_parser.y"
1804 {(yyval.float_constr) = (libsynt_float_constraint*)my_calloc(sizeof(libsynt_float_constraint),1); (yyval.float_constr)->default_value = (yyvsp[(2) - (2)].num); (yyval.float_constr)->default_specd =1;}
1805 break;
1806
1807 case 31:
1808
1809
1810 #line 138 "syntax_parser.y"
1811 {(yyval.float_constr) = (libsynt_float_constraint*)my_calloc(sizeof(libsynt_float_constraint),1); (yyval.float_constr)->default_value = (yyvsp[(6) - (6)].num); (yyval.float_constr)->default_specd =1; (yyval.float_constr)->greater_than = (yyvsp[(3) - (6)].num); (yyval.float_constr)->greater_specd =1; }
1812 break;
1813
1814 case 32:
1815
1816
1817 #line 139 "syntax_parser.y"
1818 {(yyval.float_constr) = (libsynt_float_constraint*)my_calloc(sizeof(libsynt_float_constraint),1); (yyval.float_constr)->default_value = (yyvsp[(6) - (6)].num); (yyval.float_constr)->default_specd =1;(yyval.float_constr)->less_than = (yyvsp[(3) - (6)].num); (yyval.float_constr)->less_specd = 1; }
1819 break;
1820
1821 case 33:
1822
1823
1824 #line 140 "syntax_parser.y"
1825 {(yyval.float_constr) = (libsynt_float_constraint*)my_calloc(sizeof(libsynt_float_constraint),1); (yyval.float_constr)->default_value = (yyvsp[(9) - (9)].num);
1826 (yyval.float_constr)->less_than = (yyvsp[(6) - (9)].num); (yyval.float_constr)->less_specd = 1;(yyval.float_constr)->greater_than = (yyvsp[(3) - (9)].num); (yyval.float_constr)->greater_specd =1; (yyval.float_constr)->default_specd =1;}
1827 break;
1828
1829 case 34:
1830
1831
1832 #line 142 "syntax_parser.y"
1833 {(yyval.float_constr) = (libsynt_float_constraint*)my_calloc(sizeof(libsynt_float_constraint),1); (yyval.float_constr)->refd_default = (yyvsp[(2) - (2)].str); (yyval.float_constr)->ref_default_specd =1;}
1834 break;
1835
1836 case 35:
1837
1838
1839 #line 143 "syntax_parser.y"
1840 {(yyval.float_constr) = (libsynt_float_constraint*)my_calloc(sizeof(libsynt_float_constraint),1); (yyval.float_constr)->refd_default = (yyvsp[(6) - (6)].str); (yyval.float_constr)->ref_default_specd =1;(yyval.float_constr)->greater_than = (yyvsp[(3) - (6)].num); (yyval.float_constr)->greater_specd =1; }
1841 break;
1842
1843 case 36:
1844
1845
1846 #line 144 "syntax_parser.y"
1847 {(yyval.float_constr) = (libsynt_float_constraint*)my_calloc(sizeof(libsynt_float_constraint),1); (yyval.float_constr)->refd_default = (yyvsp[(6) - (6)].str); (yyval.float_constr)->ref_default_specd =1;(yyval.float_constr)->less_than = (yyvsp[(3) - (6)].num); (yyval.float_constr)->less_specd = 1; }
1848 break;
1849
1850 case 37:
1851
1852
1853 #line 145 "syntax_parser.y"
1854 {(yyval.float_constr) = (libsynt_float_constraint*)my_calloc(sizeof(libsynt_float_constraint),1); (yyval.float_constr)->refd_default = (yyvsp[(9) - (9)].str);
1855 (yyval.float_constr)->less_than = (yyvsp[(6) - (9)].num); (yyval.float_constr)->less_specd = 1;(yyval.float_constr)->greater_than = (yyvsp[(3) - (9)].num); (yyval.float_constr)->greater_specd =1; (yyval.float_constr)->ref_default_specd =1;}
1856 break;
1857
1858 case 38:
1859
1860
1861 #line 149 "syntax_parser.y"
1862 {(yyval.int_constr) = (libsynt_int_constraint*)my_calloc(sizeof(libsynt_int_constraint),1); (yyval.int_constr)->greater_than = (yyvsp[(3) - (4)].num); (yyval.int_constr)->greater_specd =1; }
1863 break;
1864
1865 case 39:
1866
1867
1868 #line 150 "syntax_parser.y"
1869 {(yyval.int_constr) = (libsynt_int_constraint*)my_calloc(sizeof(libsynt_int_constraint),1); (yyval.int_constr)->less_than = (yyvsp[(3) - (4)].num); (yyval.int_constr)->less_specd = 1; }
1870 break;
1871
1872 case 40:
1873
1874
1875 #line 151 "syntax_parser.y"
1876 {(yyval.int_constr) = (libsynt_int_constraint*)my_calloc(sizeof(libsynt_int_constraint),1);
1877 (yyval.int_constr)->less_than = (yyvsp[(6) - (7)].num); (yyval.int_constr)->less_specd = 1;(yyval.int_constr)->greater_than = (yyvsp[(3) - (7)].num); (yyval.int_constr)->greater_specd =1;}
1878 break;
1879
1880 case 41:
1881
1882
1883 #line 153 "syntax_parser.y"
1884 {(yyval.int_constr) = (libsynt_int_constraint*)my_calloc(sizeof(libsynt_int_constraint),1); (yyval.int_constr)->default_value = (yyvsp[(2) - (2)].num); (yyval.int_constr)->default_specd =1;}
1885 break;
1886
1887 case 42:
1888
1889
1890 #line 154 "syntax_parser.y"
1891 {(yyval.int_constr) = (libsynt_int_constraint*)my_calloc(sizeof(libsynt_int_constraint),1); (yyval.int_constr)->default_value = (yyvsp[(6) - (6)].num); (yyval.int_constr)->default_specd =1; (yyval.int_constr)->greater_than = (yyvsp[(3) - (6)].num); (yyval.int_constr)->greater_specd =1; }
1892 break;
1893
1894 case 43:
1895
1896
1897 #line 155 "syntax_parser.y"
1898 {(yyval.int_constr) = (libsynt_int_constraint*)my_calloc(sizeof(libsynt_int_constraint),1); (yyval.int_constr)->default_value = (yyvsp[(6) - (6)].num); (yyval.int_constr)->default_specd =1;(yyval.int_constr)->less_than = (yyvsp[(3) - (6)].num); (yyval.int_constr)->less_specd = 1; }
1899 break;
1900
1901 case 44:
1902
1903
1904 #line 156 "syntax_parser.y"
1905 {(yyval.int_constr) = (libsynt_int_constraint*)my_calloc(sizeof(libsynt_int_constraint),1); (yyval.int_constr)->default_value = (yyvsp[(9) - (9)].num);
1906 (yyval.int_constr)->less_than = (yyvsp[(6) - (9)].num); (yyval.int_constr)->less_specd = 1;(yyval.int_constr)->greater_than = (yyvsp[(3) - (9)].num); (yyval.int_constr)->greater_specd =1; (yyval.int_constr)->default_specd =1;}
1907 break;
1908
1909 case 45:
1910
1911
1912 #line 158 "syntax_parser.y"
1913 {(yyval.int_constr) = (libsynt_int_constraint*)my_calloc(sizeof(libsynt_int_constraint),1); (yyval.int_constr)->refd_default = (yyvsp[(2) - (2)].str); (yyval.int_constr)->ref_default_specd =1;}
1914 break;
1915
1916 case 46:
1917
1918
1919 #line 159 "syntax_parser.y"
1920 {(yyval.int_constr) = (libsynt_int_constraint*)my_calloc(sizeof(libsynt_int_constraint),1); (yyval.int_constr)->refd_default = (yyvsp[(6) - (6)].str); (yyval.int_constr)->ref_default_specd =1;(yyval.int_constr)->greater_than = (yyvsp[(3) - (6)].num); (yyval.int_constr)->greater_specd =1; }
1921 break;
1922
1923 case 47:
1924
1925
1926 #line 160 "syntax_parser.y"
1927 {(yyval.int_constr) = (libsynt_int_constraint*)my_calloc(sizeof(libsynt_int_constraint),1); (yyval.int_constr)->refd_default = (yyvsp[(6) - (6)].str); (yyval.int_constr)->ref_default_specd =1;(yyval.int_constr)->less_than = (yyvsp[(3) - (6)].num); (yyval.int_constr)->less_specd = 1; }
1928 break;
1929
1930 case 48:
1931
1932
1933 #line 161 "syntax_parser.y"
1934 {(yyval.int_constr) = (libsynt_int_constraint*)my_calloc(sizeof(libsynt_int_constraint),1); (yyval.int_constr)->refd_default = (yyvsp[(9) - (9)].str);
1935 (yyval.int_constr)->less_than = (yyvsp[(6) - (9)].num); (yyval.int_constr)->less_specd = 1;(yyval.int_constr)->greater_than = (yyvsp[(3) - (9)].num); (yyval.int_constr)->greater_specd =1; (yyval.int_constr)->ref_default_specd =1;}
1936 break;
1937
1938 case 49:
1939
1940
1941 #line 167 "syntax_parser.y"
1942 { (yyval.attr)= make_complex((yyvsp[(1) - (2)].head));}
1943 break;
1944
1945 case 50:
1946
1947
1948 #line 170 "syntax_parser.y"
1949 { (yyval.head) = (yyvsp[(3) - (4)].head); (yyval.head)->ident = (yyvsp[(1) - (4)].str); (yyval.head)->lineno = synt_lineno;}
1950 break;
1951
1952 case 51:
1953
1954
1955 #line 171 "syntax_parser.y"
1956 { (yyval.head) = (yyvsp[(3) - (4)].head); (yyval.head)->ident = "short"; (yyval.head)->lineno = synt_lineno;}
1957 break;
1958
1959 case 52:
1960
1961
1962 #line 175 "syntax_parser.y"
1963 {(yyval.head) = my_calloc(sizeof(libsynt_head),1); (yyval.head)->namecons = (yyvsp[(1) - (1)].nameconstr);}
1964 break;
1965
1966 case 53:
1967
1968
1969 #line 176 "syntax_parser.y"
1970 {(yyval.head) = my_calloc(sizeof(libsynt_head),1); (yyval.head)->arglist = (yyvsp[(1) - (1)].arg);}
1971 break;
1972
1973 case 54:
1974
1975
1976 #line 179 "syntax_parser.y"
1977 {(yyval.nameconstr) = SYNTAX_GNAME_NONE;}
1978 break;
1979
1980 case 55:
1981
1982
1983 #line 180 "syntax_parser.y"
1984 {(yyval.nameconstr) = SYNTAX_GNAME_ONE;}
1985 break;
1986
1987 case 56:
1988
1989
1990 #line 181 "syntax_parser.y"
1991 {(yyval.nameconstr) = SYNTAX_GNAME_NONE_OR_ONE;}
1992 break;
1993
1994 case 57:
1995
1996
1997 #line 182 "syntax_parser.y"
1998 {(yyval.nameconstr) = SYNTAX_GNAME_ONE_OR_MORE;}
1999 break;
2000
2001 case 58:
2002
2003
2004 #line 183 "syntax_parser.y"
2005 {(yyval.nameconstr) = SYNTAX_GNAME_TWO;}
2006 break;
2007
2008 case 59:
2009
2010
2011 #line 184 "syntax_parser.y"
2012 {(yyval.nameconstr) = SYNTAX_GNAME_THREE;}
2013 break;
2014
2015 case 60:
2016
2017
2018 #line 187 "syntax_parser.y"
2019 { (yyval.arg)=my_calloc(sizeof(libsynt_argument),1); (yyval.arg)->type = SYNTAX_ATTRTYPE_STRING;}
2020 break;
2021
2022 case 61:
2023
2024
2025 #line 188 "syntax_parser.y"
2026 {(yyval.arg)=my_calloc(sizeof(libsynt_argument),1); (yyval.arg)->type = SYNTAX_ATTRTYPE_INT;}
2027 break;
2028
2029 case 62:
2030
2031
2032 #line 189 "syntax_parser.y"
2033 {(yyval.arg)=my_calloc(sizeof(libsynt_argument),1); (yyval.arg)->type = SYNTAX_ATTRTYPE_FLOAT;}
2034 break;
2035
2036 case 63:
2037
2038
2039 #line 190 "syntax_parser.y"
2040 {(yyval.arg)=my_calloc(sizeof(libsynt_argument),1); (yyval.arg)->type = SYNTAX_ATTRTYPE_COMPLEX_UNKNOWN;}
2041 break;
2042
2043 case 64:
2044
2045
2046 #line 191 "syntax_parser.y"
2047 {(yyval.arg)=my_calloc(sizeof(libsynt_argument),1); (yyval.arg)->type = SYNTAX_ATTRTYPE_COMPLEX_LIST;}
2048 break;
2049
2050 case 65:
2051
2052
2053 #line 192 "syntax_parser.y"
2054 {libsynt_argument *x= my_calloc(sizeof(libsynt_argument),1),*y; x->type = SYNTAX_ATTRTYPE_STRING; for(y=(yyval.arg);y;y=y->next){if( !y->next){y->next=x;break;}}(yyval.arg)=(yyvsp[(1) - (3)].arg);}
2055 break;
2056
2057 case 66:
2058
2059
2060 #line 193 "syntax_parser.y"
2061 {libsynt_argument *x= my_calloc(sizeof(libsynt_argument),1),*y; x->type = SYNTAX_ATTRTYPE_INT;for(y=(yyval.arg);y;y=y->next){if( !y->next){y->next=x;break;}}(yyval.arg)=(yyvsp[(1) - (3)].arg);}
2062 break;
2063
2064 case 67:
2065
2066
2067 #line 194 "syntax_parser.y"
2068 {libsynt_argument *x= my_calloc(sizeof(libsynt_argument),1),*y; x->type = SYNTAX_ATTRTYPE_FLOAT;for(y=(yyval.arg);y;y=y->next){if( !y->next){y->next=x;break;}}(yyval.arg)=(yyvsp[(1) - (3)].arg);}
2069 break;
2070
2071 case 68:
2072
2073
2074 #line 195 "syntax_parser.y"
2075 {libsynt_argument *x= my_calloc(sizeof(libsynt_argument),1),*y; x->type = SYNTAX_ATTRTYPE_COMPLEX_LIST;for(y=(yyval.arg);y;y=y->next){if( !y->next){y->next=x;break;}}(yyval.arg)=(yyvsp[(1) - (3)].arg);}
2076 break;
2077
2078 case 69:
2079
2080
2081 #line 200 "syntax_parser.y"
2082 {(yyval.str) = (yyvsp[(1) - (1)].str);}
2083 break;
2084
2085 case 70:
2086
2087
2088 #line 201 "syntax_parser.y"
2089 {(yyval.str)=(yyvsp[(1) - (1)].str);}
2090 break;
2091
2092
2093
2094
2095 #line 2096 "syntax_parser.c"
2096 default: break;
2097 }
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2110
2111 YYPOPSTACK (yylen);
2112 yylen = 0;
2113 YY_STACK_PRINT (yyss, yyssp);
2114
2115 *++yyvsp = yyval;
2116
2117
2118
2119
2120
2121 yyn = yyr1[yyn];
2122
2123 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2124 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2125 yystate = yytable[yystate];
2126 else
2127 yystate = yydefgoto[yyn - YYNTOKENS];
2128
2129 goto yynewstate;
2130
2131
2132
2133
2134
2135 yyerrlab:
2136
2137
2138 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2139
2140
2141 if (!yyerrstatus)
2142 {
2143 ++yynerrs;
2144 #if ! YYERROR_VERBOSE
2145 yyerror (YY_("syntax error"));
2146 #else
2147 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2148 yyssp, yytoken)
2149 {
2150 char const *yymsgp = YY_("syntax error");
2151 int yysyntax_error_status;
2152 yysyntax_error_status = YYSYNTAX_ERROR;
2153 if (yysyntax_error_status == 0)
2154 yymsgp = yymsg;
2155 else if (yysyntax_error_status == 1)
2156 {
2157 if (yymsg != yymsgbuf)
2158 YYSTACK_FREE (yymsg);
2159 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2160 if (!yymsg)
2161 {
2162 yymsg = yymsgbuf;
2163 yymsg_alloc = sizeof yymsgbuf;
2164 yysyntax_error_status = 2;
2165 }
2166 else
2167 {
2168 yysyntax_error_status = YYSYNTAX_ERROR;
2169 yymsgp = yymsg;
2170 }
2171 }
2172 yyerror (yymsgp);
2173 if (yysyntax_error_status == 2)
2174 goto yyexhaustedlab;
2175 }
2176 # undef YYSYNTAX_ERROR
2177 #endif
2178 }
2179
2180
2181
2182 if (yyerrstatus == 3)
2183 {
2184
2185
2186
2187 if (yychar <= YYEOF)
2188 {
2189
2190 if (yychar == YYEOF)
2191 YYABORT;
2192 }
2193 else
2194 {
2195 yydestruct ("Error: discarding",
2196 yytoken, &yylval);
2197 yychar = YYEMPTY;
2198 }
2199 }
2200
2201
2202
2203 goto yyerrlab1;
2204
2205
2206
2207
2208
2209 yyerrorlab:
2210
2211
2212
2213
2214 if ( 0)
2215 goto yyerrorlab;
2216
2217
2218
2219 YYPOPSTACK (yylen);
2220 yylen = 0;
2221 YY_STACK_PRINT (yyss, yyssp);
2222 yystate = *yyssp;
2223 goto yyerrlab1;
2224
2225
2226
2227
2228
2229 yyerrlab1:
2230 yyerrstatus = 3;
2231
2232 for (;;)
2233 {
2234 yyn = yypact[yystate];
2235 if (!yypact_value_is_default (yyn))
2236 {
2237 yyn += YYTERROR;
2238 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2239 {
2240 yyn = yytable[yyn];
2241 if (0 < yyn)
2242 break;
2243 }
2244 }
2245
2246
2247 if (yyssp == yyss)
2248 YYABORT;
2249
2250
2251 yydestruct ("Error: popping",
2252 yystos[yystate], yyvsp);
2253 YYPOPSTACK (1);
2254 yystate = *yyssp;
2255 YY_STACK_PRINT (yyss, yyssp);
2256 }
2257
2258 *++yyvsp = yylval;
2259
2260
2261
2262 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2263
2264 yystate = yyn;
2265 goto yynewstate;
2266
2267
2268
2269
2270
2271 yyacceptlab:
2272 yyresult = 0;
2273 goto yyreturn;
2274
2275
2276
2277
2278 yyabortlab:
2279 yyresult = 1;
2280 goto yyreturn;
2281
2282 #if !defined(yyoverflow) || YYERROR_VERBOSE
2283
2284
2285
2286 yyexhaustedlab:
2287 yyerror (YY_("memory exhausted"));
2288 yyresult = 2;
2289
2290 #endif
2291
2292 yyreturn:
2293 if (yychar != YYEMPTY)
2294 {
2295
2296
2297 yytoken = YYTRANSLATE (yychar);
2298 yydestruct ("Cleanup: discarding lookahead",
2299 yytoken, &yylval);
2300 }
2301
2302
2303 YYPOPSTACK (yylen);
2304 YY_STACK_PRINT (yyss, yyssp);
2305 while (yyssp != yyss)
2306 {
2307 yydestruct ("Cleanup: popping",
2308 yystos[*yyssp], yyvsp);
2309 YYPOPSTACK (1);
2310 }
2311 #ifndef yyoverflow
2312 if (yyss != yyssa)
2313 YYSTACK_FREE (yyss);
2314 #endif
2315 #if YYERROR_VERBOSE
2316 if (yymsg != yymsgbuf)
2317 YYSTACK_FREE (yymsg);
2318 #endif
2319
2320 return YYID (yyresult);
2321 }
2322
2323
2324
2325
2326 #line 204 "syntax_parser.y"
2327
2328
2329 void push_group(libsynt_head *h )
2330 {
2331 si2drObjectIdT toid,noid;
2332
2333 gs[gsindex] = (libsynt_group_info*)my_calloc(sizeof(libsynt_group_info),1);
2334
2335 toid.v1 = (void*)gs[gsindex];
2336
2337 gs[gsindex]->lineno = h->lineno;
2338
2339 gs[gsindex]->type = h->ident;
2340
2341 gs[gsindex]->name_constraints = h->namecons;
2342
2343 gs[gsindex]->attr_hash = liberty_hash_create_hash_table(41, 1, 0);
2344
2345 gs[gsindex]->group_hash = liberty_hash_create_hash_table(41, 1, 0);
2346
2347 liberty_hash_lookup(libsynt_groups, h->ident, &noid);
2348 if( noid.v1 == (void*)NULL )
2349 liberty_hash_enter_oid(libsynt_groups, h->ident, toid);
2350
2351 liberty_hash_lookup(libsynt_allgroups, h->ident, &noid);
2352 if( noid.v1 == (void*)NULL )
2353 liberty_hash_enter_oid(libsynt_allgroups, h->ident, toid);
2354
2355 gsindex++;
2356 }
2357
2358 void pop_group(void)
2359 {
2360 gsindex--;
2361 }
2362
2363 libsynt_attribute_info *make_complex(libsynt_head *h)
2364 {
2365 si2drObjectIdT toid,noid;
2366 libsynt_attribute_info *x = my_calloc(sizeof(libsynt_attribute_info),1);
2367 x->name = h->ident;
2368 toid.v1 = (void*)x;
2369
2370 if( h->arglist->type == SYNTAX_ATTRTYPE_COMPLEX_UNKNOWN )
2371 x->type = SYNTAX_ATTRTYPE_COMPLEX_UNKNOWN;
2372 else if( h->arglist->type == SYNTAX_ATTRTYPE_COMPLEX_LIST )
2373 x->type = SYNTAX_ATTRTYPE_COMPLEX_LIST;
2374 else
2375 x->type = SYNTAX_ATTRTYPE_COMPLEX;
2376 x->u.args = h->arglist;
2377 liberty_hash_lookup(libsynt_attrs, h->ident, &noid);
2378 if( noid.v1 == (void*)NULL )
2379 liberty_hash_enter_oid(libsynt_attrs, h->ident, toid);
2380 return x;
2381 }
2382
2383 libsynt_attribute_info *make_simple(char *name, libsynt_attr_type type, void *constraint_ptr)
2384 {
2385 si2drObjectIdT toid,noid;
2386 libsynt_attribute_info *x = my_calloc(sizeof(libsynt_attribute_info),1);
2387 x->name = name;
2388 x->type = type;
2389 toid.v1 = (void*)x;
2390 switch( type )
2391 {
2392 case SYNTAX_ATTRTYPE_STRING:
2393 break;
2394 case SYNTAX_ATTRTYPE_VIRTUAL:
2395 break;
2396 case SYNTAX_ATTRTYPE_ENUM:
2397 x->u.stringenum = (libsynt_string_enum*)constraint_ptr;
2398 break;
2399 case SYNTAX_ATTRTYPE_FLOAT:
2400 x->u.floatcon = (libsynt_float_constraint*)constraint_ptr;
2401 break;
2402 case SYNTAX_ATTRTYPE_INT:
2403 x->u.intcon = (libsynt_int_constraint*)constraint_ptr;
2404 break;
2405 case SYNTAX_ATTRTYPE_BOOLEAN:
2406 break;
2407 default:
2408 break;
2409 }
2410 liberty_hash_lookup(libsynt_attrs, x->name, &noid);
2411 if( noid.v1 == (void*)NULL )
2412 liberty_hash_enter_oid(libsynt_attrs, x->name, toid);
2413 return x;
2414 }
2415
2416 int syntax_parser_error(char *);
2417
2418 int yyerror(char *s)
2419 {
2420 fprintf(stderr,"%s line number %d\n", s, synt_lineno);
2421 return 0;
2422 }
2423