1 |
/* A Bison parser, made by GNU Bison 1.75c. */ |
/* A Bison parser, made by GNU Bison 1.75d. */ |
2 |
|
|
3 |
/* Skeleton parser for Yacc-like parsing with Bison, |
/* Skeleton parser for Yacc-like parsing with Bison, |
4 |
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. |
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. |
99 |
TYPE = 291, |
TYPE = 291, |
100 |
EQUAL = 292, |
EQUAL = 292, |
101 |
SEMICOLON = 293, |
SEMICOLON = 293, |
102 |
COLON = 294, |
PIPE = 294, |
103 |
COMMA = 295, |
ID = 295, |
104 |
PIPE = 296, |
ID_COLON = 296, |
105 |
ID = 297, |
PERCENT_PERCENT = 297, |
106 |
PERCENT_PERCENT = 298, |
PROLOGUE = 298, |
107 |
PROLOGUE = 299, |
EPILOGUE = 299, |
108 |
EPILOGUE = 300, |
BRACED_CODE = 300 |
|
BRACED_CODE = 301 |
|
109 |
}; |
}; |
110 |
#endif |
#endif |
111 |
#define GRAM_EOF 0 |
#define GRAM_EOF 0 |
145 |
#define TYPE 291 |
#define TYPE 291 |
146 |
#define EQUAL 292 |
#define EQUAL 292 |
147 |
#define SEMICOLON 293 |
#define SEMICOLON 293 |
148 |
#define COLON 294 |
#define PIPE 294 |
149 |
#define COMMA 295 |
#define ID 295 |
150 |
#define PIPE 296 |
#define ID_COLON 296 |
151 |
#define ID 297 |
#define PERCENT_PERCENT 297 |
152 |
#define PERCENT_PERCENT 298 |
#define PROLOGUE 298 |
153 |
#define PROLOGUE 299 |
#define EPILOGUE 299 |
154 |
#define EPILOGUE 300 |
#define BRACED_CODE 300 |
|
#define BRACED_CODE 301 |
|
155 |
|
|
156 |
|
|
157 |
|
|
160 |
#line 31 "parse-gram.y" |
#line 31 "parse-gram.y" |
161 |
|
|
162 |
#include "system.h" |
#include "system.h" |
163 |
|
|
164 |
#include "complain.h" |
#include "complain.h" |
165 |
#include "muscle_tab.h" |
#include "conflicts.h" |
166 |
#include "files.h" |
#include "files.h" |
167 |
#include "getargs.h" |
#include "getargs.h" |
|
#include "output.h" |
|
|
#include "symlist.h" |
|
168 |
#include "gram.h" |
#include "gram.h" |
169 |
|
#include "muscle_tab.h" |
170 |
|
#include "output.h" |
171 |
#include "reader.h" |
#include "reader.h" |
172 |
#include "conflicts.h" |
#include "symlist.h" |
173 |
|
|
174 |
/* Produce verbose syntax errors. */ |
/* Produce verbose syntax errors. */ |
175 |
#define YYERROR_VERBOSE 1 |
#define YYERROR_VERBOSE 1 |
|
#define YYLLOC_DEFAULT(Current, Rhs, N) \ |
|
|
do { \ |
|
|
if (N) \ |
|
|
{ \ |
|
|
Current.first_column = Rhs[1].first_column; \ |
|
|
Current.first_line = Rhs[1].first_line; \ |
|
|
Current.last_column = Rhs[N].last_column; \ |
|
|
Current.last_line = Rhs[N].last_line; \ |
|
|
} \ |
|
|
else \ |
|
|
{ \ |
|
|
Current = Rhs[0]; \ |
|
|
} \ |
|
|
} while (0) |
|
176 |
|
|
177 |
/* Pass the control structure to YYPARSE and YYLEX. */ |
#define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N) |
178 |
#define YYPARSE_PARAM gram_control |
static YYLTYPE lloc_default (YYLTYPE const *, int); |
|
#define YYLEX_PARAM gram_control |
|
|
/* YYPARSE receives GRAM_CONTROL as a void *. Provide a |
|
|
correctly typed access to it. */ |
|
|
#define yycontrol ((gram_control_t *) gram_control) |
|
179 |
|
|
180 |
/* Request detailed syntax error messages, and pass them to GRAM_ERROR. |
/* Request detailed syntax error messages, and pass them to GRAM_ERROR. |
181 |
FIXME: depends on the undocumented availability of YYLLOC.t */ |
FIXME: depends on the undocumented availability of YYLLOC. */ |
182 |
#undef yyerror |
#undef yyerror |
183 |
#define yyerror(Msg) \ |
#define yyerror(Msg) \ |
184 |
gram_error (&yylloc, Msg) |
gram_error (&yylloc, Msg) |
185 |
|
static void gram_error (location const *, char const *); |
186 |
|
|
187 |
#define YYPRINT(File, Type, Value) \ |
#define YYPRINT(File, Type, Value) \ |
188 |
yyprint (File, Type, &Value) |
print_token_value (File, Type, &Value) |
189 |
static void yyprint (FILE *file, int type, const yystype *value); |
static void print_token_value (FILE *, int, YYSTYPE const *); |
190 |
|
|
191 |
|
static void add_param (char const *, char const *, location); |
192 |
|
|
193 |
symbol_class current_class = unknown_sym; |
symbol_class current_class = unknown_sym; |
194 |
struniq_t current_type = 0; |
uniqstr current_type = 0; |
195 |
symbol_t *current_lhs; |
symbol *current_lhs; |
196 |
location_t current_lhs_location; |
location current_lhs_location; |
197 |
assoc_t current_assoc; |
assoc current_assoc; |
198 |
int current_prec = 0; |
int current_prec = 0; |
199 |
braced_code_t current_braced_code = action_braced_code; |
braced_code current_braced_code = action_braced_code; |
200 |
|
|
201 |
|
|
202 |
/* Enabling traces. */ |
/* Enabling traces. */ |
213 |
#endif |
#endif |
214 |
|
|
215 |
#ifndef YYSTYPE |
#ifndef YYSTYPE |
216 |
#line 89 "parse-gram.y" |
#line 75 "parse-gram.y" |
217 |
typedef union { |
typedef union { |
218 |
symbol_t *symbol; |
symbol *symbol; |
219 |
symbol_list_t *list; |
symbol_list *list; |
220 |
int integer; |
int integer; |
221 |
char *string; |
char *chars; |
222 |
assoc_t assoc; |
assoc assoc; |
223 |
struniq_t struniq; |
uniqstr uniqstr; |
224 |
} yystype; |
} yystype; |
225 |
/* Line 195 of /usr/local/share/bison/yacc.c. */ |
/* Line 195 of yacc.c. */ |
226 |
#line 242 "parse-gram.c" |
#line 226 "parse-gram.c" |
227 |
# define YYSTYPE yystype |
# define YYSTYPE yystype |
228 |
# define YYSTYPE_IS_TRIVIAL 1 |
# define YYSTYPE_IS_TRIVIAL 1 |
229 |
#endif |
#endif |
243 |
/* Copy the second part of user declarations. */ |
/* Copy the second part of user declarations. */ |
244 |
|
|
245 |
|
|
246 |
/* Line __line__ of __file__. */ |
/* Line 215 of yacc.c. */ |
247 |
#line 263 "parse-gram.c" |
#line 247 "parse-gram.c" |
248 |
|
|
249 |
#if ! defined (yyoverflow) || YYERROR_VERBOSE |
#if ! defined (yyoverflow) || YYERROR_VERBOSE |
250 |
|
|
291 |
}; |
}; |
292 |
|
|
293 |
/* The size of the maximum gap between one aligned stack and the next. */ |
/* The size of the maximum gap between one aligned stack and the next. */ |
294 |
# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) |
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
295 |
|
|
296 |
/* The size of an array large to enough to hold all stacks, each with |
/* The size of an array large to enough to hold all stacks, each with |
297 |
N elements. */ |
N elements. */ |
298 |
# define YYSTACK_BYTES(N) \ |
# define YYSTACK_BYTES(N) \ |
299 |
((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ |
((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ |
300 |
+ 2 * YYSTACK_GAP_MAX) |
+ 2 * YYSTACK_GAP_MAXIMUM) |
301 |
|
|
302 |
/* Copy COUNT objects from FROM to TO. The source and destination do |
/* Copy COUNT objects from FROM to TO. The source and destination do |
303 |
not overlap. */ |
not overlap. */ |
328 |
YYSIZE_T yynewbytes; \ |
YYSIZE_T yynewbytes; \ |
329 |
YYCOPY (&yyptr->Stack, Stack, yysize); \ |
YYCOPY (&yyptr->Stack, Stack, yysize); \ |
330 |
Stack = &yyptr->Stack; \ |
Stack = &yyptr->Stack; \ |
331 |
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ |
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ |
332 |
yyptr += yynewbytes / sizeof (*yyptr); \ |
yyptr += yynewbytes / sizeof (*yyptr); \ |
333 |
} \ |
} \ |
334 |
while (0) |
while (0) |
344 |
/* YYFINAL -- State number of the termination state. */ |
/* YYFINAL -- State number of the termination state. */ |
345 |
#define YYFINAL 3 |
#define YYFINAL 3 |
346 |
/* YYLAST -- Last index in YYTABLE. */ |
/* YYLAST -- Last index in YYTABLE. */ |
347 |
#define YYLAST 152 |
#define YYLAST 153 |
348 |
|
|
349 |
/* YYNTOKENS -- Number of terminals. */ |
/* YYNTOKENS -- Number of terminals. */ |
350 |
#define YYNTOKENS 47 |
#define YYNTOKENS 46 |
351 |
/* YYNNTS -- Number of nonterminals. */ |
/* YYNNTS -- Number of nonterminals. */ |
352 |
#define YYNNTS 29 |
#define YYNNTS 28 |
353 |
/* YYNRULES -- Number of rules. */ |
/* YYNRULES -- Number of rules. */ |
354 |
#define YYNRULES 77 |
#define YYNRULES 77 |
355 |
/* YYNRULES -- Number of states. */ |
/* YYNRULES -- Number of states. */ |
356 |
#define YYNSTATES 116 |
#define YYNSTATES 109 |
357 |
|
|
358 |
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ |
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ |
359 |
#define YYUNDEFTOK 2 |
#define YYUNDEFTOK 2 |
360 |
#define YYMAXUTOK 301 |
#define YYMAXUTOK 300 |
361 |
|
|
362 |
#define YYTRANSLATE(YYX) \ |
#define YYTRANSLATE(YYX) \ |
363 |
((YYX <= 0) ? YYEOF : \ |
((YYX <= 0) ? YYEOF : \ |
396 |
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, |
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, |
397 |
25, 26, 27, 28, 29, 30, 31, 32, 33, 34, |
25, 26, 27, 28, 29, 30, 31, 32, 33, 34, |
398 |
35, 36, 37, 38, 39, 40, 41, 42, 43, 44, |
35, 36, 37, 38, 39, 40, 41, 42, 43, 44, |
399 |
45, 46 |
45 |
400 |
}; |
}; |
401 |
|
|
402 |
#if YYDEBUG |
#if YYDEBUG |
404 |
YYRHS. */ |
YYRHS. */ |
405 |
static const unsigned char yyprhs[] = |
static const unsigned char yyprhs[] = |
406 |
{ |
{ |
407 |
0, 0, 3, 8, 9, 13, 15, 17, 19, 23, |
0, 0, 3, 8, 9, 12, 14, 16, 18, 22, |
408 |
25, 27, 30, 34, 36, 41, 43, 47, 49, 53, |
24, 26, 29, 33, 35, 38, 40, 44, 46, 50, |
409 |
58, 60, 63, 65, 67, 69, 71, 73, 76, 79, |
53, 55, 58, 60, 62, 64, 66, 68, 70, 73, |
410 |
80, 85, 86, 91, 92, 96, 97, 101, 105, 109, |
76, 77, 82, 83, 88, 89, 93, 94, 98, 102, |
411 |
111, 113, 115, 116, 118, 120, 123, 125, 127, 130, |
106, 108, 110, 112, 113, 115, 117, 120, 122, 124, |
412 |
133, 137, 139, 142, 144, 147, 149, 152, 155, 156, |
127, 130, 134, 136, 139, 141, 144, 146, 148, 151, |
413 |
162, 164, 168, 169, 172, 175, 179, 183, 187, 189, |
153, 154, 158, 160, 164, 165, 168, 171, 175, 179, |
414 |
191, 193, 195, 197, 199, 200, 203, 204 |
183, 185, 187, 189, 191, 193, 195, 196 |
415 |
}; |
}; |
416 |
|
|
417 |
/* YYRHS -- A `-1'-separated list of the rules' RHS. */ |
/* YYRHS -- A `-1'-separated list of the rules' RHS. */ |
418 |
static const yysigned_char yyrhs[] = |
static const yysigned_char yyrhs[] = |
419 |
{ |
{ |
420 |
48, 0, -1, 49, 43, 63, 74, -1, -1, 49, |
47, 0, -1, 48, 42, 62, 73, -1, -1, 48, |
421 |
50, 75, -1, 51, -1, 44, -1, 17, -1, 18, |
49, -1, 50, -1, 43, -1, 17, -1, 18, 71, |
422 |
72, 72, -1, 19, -1, 20, -1, 21, 4, -1, |
71, -1, 19, -1, 20, -1, 21, 4, -1, 22, |
423 |
22, 37, 72, -1, 23, -1, 24, 73, 40, 73, |
37, 71, -1, 23, -1, 24, 72, -1, 25, -1, |
424 |
-1, 25, -1, 26, 37, 72, -1, 27, -1, 28, |
26, 37, 71, -1, 27, -1, 28, 37, 71, -1, |
425 |
37, 72, -1, 29, 73, 40, 73, -1, 30, -1, |
29, 72, -1, 30, -1, 31, 71, -1, 33, -1, |
426 |
31, 72, -1, 33, -1, 34, -1, 35, -1, 57, |
34, -1, 35, -1, 38, -1, 56, -1, 53, -1, |
427 |
-1, 54, -1, 32, 69, -1, 10, 46, -1, -1, |
32, 68, -1, 10, 45, -1, -1, 8, 51, 45, |
428 |
8, 52, 46, 60, -1, -1, 9, 53, 46, 60, |
59, -1, -1, 9, 52, 45, 59, -1, -1, 6, |
429 |
-1, -1, 6, 55, 62, -1, -1, 5, 56, 62, |
54, 61, -1, -1, 5, 55, 61, -1, 7, 36, |
430 |
-1, 7, 36, 60, -1, 58, 59, 60, -1, 11, |
59, -1, 57, 58, 59, -1, 11, -1, 12, -1, |
431 |
-1, 12, -1, 13, -1, -1, 36, -1, 69, -1, |
13, -1, -1, 36, -1, 68, -1, 59, 68, -1, |
432 |
60, 69, -1, 36, -1, 42, -1, 42, 4, -1, |
36, -1, 40, -1, 40, 4, -1, 40, 70, -1, |
433 |
42, 71, -1, 42, 4, 71, -1, 61, -1, 62, |
40, 4, 70, -1, 60, -1, 61, 60, -1, 63, |
434 |
61, -1, 64, -1, 63, 64, -1, 65, -1, 51, |
-1, 62, 63, -1, 64, -1, 50, -1, 1, 38, |
435 |
38, -1, 1, 38, -1, -1, 42, 39, 66, 67, |
-1, 38, -1, -1, 41, 65, 66, -1, 67, -1, |
436 |
38, -1, 68, -1, 67, 41, 68, -1, -1, 68, |
66, 39, 67, -1, -1, 67, 68, -1, 67, 69, |
437 |
69, -1, 68, 70, -1, 68, 14, 69, -1, 68, |
-1, 67, 14, 68, -1, 67, 15, 4, -1, 67, |
438 |
15, 4, -1, 68, 16, 36, -1, 42, -1, 71, |
16, 36, -1, 40, -1, 70, -1, 45, -1, 3, |
439 |
-1, 46, -1, 3, -1, 3, -1, 46, -1, -1, |
-1, 3, -1, 45, -1, -1, 42, 44, -1 |
|
43, 45, -1, -1, 38, -1 |
|
440 |
}; |
}; |
441 |
|
|
442 |
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ |
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ |
443 |
static const unsigned short yyrline[] = |
static const unsigned short yyrline[] = |
444 |
{ |
{ |
445 |
0, 170, 170, 182, 184, 187, 189, 190, 191, 192, |
0, 156, 156, 164, 166, 170, 171, 172, 173, 174, |
446 |
193, 194, 195, 196, 197, 202, 203, 204, 205, 206, |
175, 176, 177, 178, 179, 180, 181, 182, 183, 184, |
447 |
211, 212, 213, 214, 215, 218, 220, 221, 225, 232, |
185, 186, 187, 188, 189, 190, 194, 195, 196, 200, |
448 |
231, 242, 241, 254, 253, 259, 259, 264, 273, 288, |
207, 206, 217, 216, 229, 229, 234, 234, 239, 249, |
449 |
290, 291, 294, 296, 301, 303, 307, 312, 317, 323, |
264, 265, 266, 270, 271, 277, 278, 283, 287, 292, |
450 |
329, 339, 342, 351, 353, 359, 361, 366, 373, 372, |
298, 304, 315, 316, 325, 326, 332, 333, 338, 342, |
451 |
377, 379, 382, 385, 387, 389, 391, 393, 397, 399, |
346, 346, 350, 351, 356, 357, 359, 361, 363, 365, |
452 |
402, 408, 417, 426, 434, 436, 443, 445 |
370, 371, 375, 381, 390, 399, 406, 408 |
453 |
}; |
}; |
454 |
#endif |
#endif |
455 |
|
|
467 |
"\"%locations\"", "\"%name-prefix\"", "\"%no-lines\"", "\"%output\"", |
"\"%locations\"", "\"%name-prefix\"", "\"%no-lines\"", "\"%output\"", |
468 |
"\"%parse-param\"", "\"%pure-parser\"", "\"%skeleton\"", "\"%start\"", |
"\"%parse-param\"", "\"%pure-parser\"", "\"%skeleton\"", "\"%start\"", |
469 |
"\"%token-table\"", "\"%verbose\"", "\"%yacc\"", "\"type\"", "\"=\"", |
"\"%token-table\"", "\"%verbose\"", "\"%yacc\"", "\"type\"", "\"=\"", |
470 |
"\";\"", "\":\"", "\",\"", "\"|\"", "\"identifier\"", "\"%%\"", |
"\";\"", "\"|\"", "\"identifier\"", "\"identifier:\"", "\"%%\"", |
471 |
"\"%{...%}\"", "\"epilogue\"", "\"{...}\"", "$accept", "input", |
"\"%{...%}\"", "\"epilogue\"", "\"{...}\"", "$accept", "input", |
472 |
"declarations", "declaration", "grammar_declaration", "@1", "@2", |
"declarations", "declaration", "grammar_declaration", "@1", "@2", |
473 |
"symbol_declaration", "@3", "@4", "precedence_declaration", |
"symbol_declaration", "@3", "@4", "precedence_declaration", |
474 |
"precedence_declarator", "type.opt", "symbols.1", "symbol_def", |
"precedence_declarator", "type.opt", "symbols.1", "symbol_def", |
475 |
"symbol_defs.1", "grammar", "rules_or_grammar_declaration", "rules", |
"symbol_defs.1", "grammar", "rules_or_grammar_declaration", "rules", |
476 |
"@5", "rhses.1", "rhs", "symbol", "action", "string_as_id", |
"@5", "rhses.1", "rhs", "symbol", "action", "string_as_id", |
477 |
"string_content", "code_content", "epilogue.opt", "semi_colon.opt", 0 |
"string_content", "code_content", "epilogue.opt", 0 |
478 |
}; |
}; |
479 |
#endif |
#endif |
480 |
|
|
487 |
265, 266, 267, 268, 269, 270, 271, 272, 273, 274, |
265, 266, 267, 268, 269, 270, 271, 272, 273, 274, |
488 |
275, 276, 277, 278, 279, 280, 281, 282, 283, 284, |
275, 276, 277, 278, 279, 280, 281, 282, 283, 284, |
489 |
285, 286, 287, 288, 289, 290, 291, 292, 293, 294, |
285, 286, 287, 288, 289, 290, 291, 292, 293, 294, |
490 |
295, 296, 297, 298, 299, 300, 301 |
295, 296, 297, 298, 299, 300 |
491 |
}; |
}; |
492 |
# endif |
# endif |
493 |
|
|
494 |
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
495 |
static const unsigned char yyr1[] = |
static const unsigned char yyr1[] = |
496 |
{ |
{ |
497 |
0, 47, 48, 49, 49, 50, 50, 50, 50, 50, |
0, 46, 47, 48, 48, 49, 49, 49, 49, 49, |
498 |
50, 50, 50, 50, 50, 50, 50, 50, 50, 50, |
49, 49, 49, 49, 49, 49, 49, 49, 49, 49, |
499 |
50, 50, 50, 50, 50, 51, 51, 51, 51, 52, |
49, 49, 49, 49, 49, 49, 50, 50, 50, 50, |
500 |
51, 53, 51, 55, 54, 56, 54, 54, 57, 58, |
51, 50, 52, 50, 54, 53, 55, 53, 53, 56, |
501 |
58, 58, 59, 59, 60, 60, 61, 61, 61, 61, |
57, 57, 57, 58, 58, 59, 59, 60, 60, 60, |
502 |
61, 62, 62, 63, 63, 64, 64, 64, 66, 65, |
60, 60, 61, 61, 62, 62, 63, 63, 63, 63, |
503 |
67, 67, 68, 68, 68, 68, 68, 68, 69, 69, |
65, 64, 66, 66, 67, 67, 67, 67, 67, 67, |
504 |
70, 71, 72, 73, 74, 74, 75, 75 |
68, 68, 69, 70, 71, 72, 73, 73 |
505 |
}; |
}; |
506 |
|
|
507 |
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ |
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ |
508 |
static const unsigned char yyr2[] = |
static const unsigned char yyr2[] = |
509 |
{ |
{ |
510 |
0, 2, 4, 0, 3, 1, 1, 1, 3, 1, |
0, 2, 4, 0, 2, 1, 1, 1, 3, 1, |
511 |
1, 2, 3, 1, 4, 1, 3, 1, 3, 4, |
1, 2, 3, 1, 2, 1, 3, 1, 3, 2, |
512 |
1, 2, 1, 1, 1, 1, 1, 2, 2, 0, |
1, 2, 1, 1, 1, 1, 1, 1, 2, 2, |
513 |
4, 0, 4, 0, 3, 0, 3, 3, 3, 1, |
0, 4, 0, 4, 0, 3, 0, 3, 3, 3, |
514 |
1, 1, 0, 1, 1, 2, 1, 1, 2, 2, |
1, 1, 1, 0, 1, 1, 2, 1, 1, 2, |
515 |
3, 1, 2, 1, 2, 1, 2, 2, 0, 5, |
2, 3, 1, 2, 1, 2, 1, 1, 2, 1, |
516 |
1, 3, 0, 2, 2, 3, 3, 3, 1, 1, |
0, 3, 1, 3, 0, 2, 2, 3, 3, 3, |
517 |
1, 1, 1, 1, 0, 2, 0, 1 |
1, 1, 1, 1, 1, 1, 0, 2 |
518 |
}; |
}; |
519 |
|
|
520 |
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state |
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state |
522 |
means the default is an error. */ |
means the default is an error. */ |
523 |
static const unsigned char yydefact[] = |
static const unsigned char yydefact[] = |
524 |
{ |
{ |
525 |
3, 0, 0, 1, 35, 33, 0, 29, 31, 0, |
3, 0, 0, 1, 36, 34, 0, 30, 32, 0, |
526 |
39, 40, 41, 7, 0, 9, 10, 0, 0, 13, |
40, 41, 42, 7, 0, 9, 10, 0, 0, 13, |
527 |
0, 15, 0, 17, 0, 0, 20, 0, 0, 22, |
0, 15, 0, 17, 0, 0, 20, 0, 0, 22, |
528 |
23, 24, 0, 6, 76, 5, 26, 25, 42, 0, |
23, 24, 25, 0, 6, 4, 5, 27, 26, 43, |
529 |
0, 0, 0, 0, 28, 72, 0, 11, 0, 73, |
0, 0, 0, 0, 0, 29, 74, 0, 11, 0, |
530 |
0, 0, 0, 0, 21, 71, 68, 27, 69, 0, |
75, 14, 0, 0, 19, 21, 73, 70, 28, 71, |
531 |
0, 0, 0, 53, 55, 77, 4, 43, 0, 46, |
0, 59, 60, 57, 0, 54, 56, 44, 0, 47, |
532 |
47, 51, 36, 34, 37, 44, 0, 0, 8, 12, |
48, 52, 37, 35, 38, 45, 0, 0, 8, 12, |
533 |
0, 16, 18, 0, 57, 58, 56, 0, 54, 2, |
16, 18, 58, 64, 0, 55, 2, 39, 49, 50, |
534 |
38, 48, 49, 52, 45, 30, 32, 14, 19, 62, |
53, 46, 31, 33, 61, 62, 77, 51, 64, 0, |
535 |
75, 50, 0, 60, 59, 62, 0, 0, 0, 70, |
0, 0, 72, 65, 66, 63, 67, 68, 69 |
|
63, 64, 61, 65, 66, 67 |
|
536 |
}; |
}; |
537 |
|
|
538 |
/* YYDEFGOTO[NTERM-NUM]. */ |
/* YYDEFGOTO[NTERM-NUM]. */ |
539 |
static const yysigned_char yydefgoto[] = |
static const yysigned_char yydefgoto[] = |
540 |
{ |
{ |
541 |
-1, 1, 2, 34, 61, 42, 43, 36, 40, 39, |
-1, 1, 2, 35, 63, 43, 44, 37, 41, 40, |
542 |
37, 38, 68, 74, 71, 72, 62, 63, 64, 99, |
38, 39, 68, 74, 71, 72, 64, 65, 66, 83, |
543 |
102, 103, 75, 111, 58, 46, 50, 89, 66 |
94, 95, 75, 104, 59, 47, 51, 86 |
544 |
}; |
}; |
545 |
|
|
546 |
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
547 |
STATE-NUM. */ |
STATE-NUM. */ |
548 |
#define YYPACT_NINF -66 |
#define YYPACT_NINF -67 |
549 |
static const yysigned_char yypact[] = |
static const yysigned_char yypact[] = |
550 |
{ |
{ |
551 |
-66, 6, 108, -66, -66, -66, -16, -66, -66, -21, |
-67, 5, 110, -67, -67, -67, -17, -67, -67, -14, |
552 |
-66, -66, -66, -66, 19, -66, -66, 32, 5, -66, |
-67, -67, -67, -67, 29, -67, -67, 30, -1, -67, |
553 |
3, -66, 10, -66, 11, 3, -66, 19, 1, -66, |
-10, -67, 4, -67, 7, -10, -67, 29, 0, -67, |
554 |
-66, -66, 80, -66, 12, -66, -66, -66, 16, -19, |
-67, -67, -67, 73, -67, -67, -67, -67, -67, 2, |
555 |
-19, 1, 7, 8, -66, -66, 19, -66, 19, -66, |
-20, -20, 0, -8, 3, -67, -67, 29, -67, 29, |
556 |
18, 19, 19, 20, -66, -66, -66, -66, -66, 13, |
-67, -67, 29, 29, -67, -67, -67, -67, -67, -67, |
557 |
24, 17, 2, -66, -66, -66, -66, -66, 1, -66, |
11, -67, -67, -67, 1, -67, -67, -67, 0, -67, |
558 |
29, -66, -19, -19, 1, -66, 1, 1, -66, -66, |
14, -67, -20, -20, 0, -67, 0, 0, -67, -67, |
559 |
3, -66, -66, 3, -66, -66, -66, 21, -66, -66, |
-67, -67, -67, -67, 9, -67, -67, 0, 51, -67, |
560 |
1, 61, -66, -66, -66, 1, 1, -66, -66, -66, |
-67, -67, 0, 0, 16, 12, -67, -67, -67, 0, |
561 |
-66, -66, -17, 15, -66, -66, 1, 65, 34, -66, |
52, 22, -67, -67, -67, 12, -67, -67, -67 |
|
-66, -66, 15, -66, -66, -66 |
|
562 |
}; |
}; |
563 |
|
|
564 |
/* YYPGOTO[NTERM-NUM]. */ |
/* YYPGOTO[NTERM-NUM]. */ |
565 |
static const yysigned_char yypgoto[] = |
static const yysigned_char yypgoto[] = |
566 |
{ |
{ |
567 |
-66, -66, -66, -66, 63, -66, -66, -66, -66, -66, |
-67, -67, -67, -67, 58, -67, -67, -67, -67, -67, |
568 |
-66, -66, -66, -49, -34, 31, -66, 14, -66, -66, |
-67, -67, -67, -47, -49, 20, -67, 6, -67, -67, |
569 |
-66, -33, -28, -66, -65, -11, -24, -66, -66 |
-67, -36, -28, -67, -66, -2, 38, -67 |
570 |
}; |
}; |
571 |
|
|
572 |
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If |
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If |
573 |
positive, shift that token. If negative, reduce the rule which |
positive, shift that token. If negative, reduce the rule which |
574 |
number is the opposite. If zero, do what YYDEFACT says. |
number is the opposite. If zero, do what YYDEFACT says. |
575 |
If YYTABLE_NINF, syntax error. */ |
If YYTABLE_NINF, syntax error. */ |
576 |
#define YYTABLE_NINF -75 |
#define YYTABLE_NINF -77 |
577 |
static const yysigned_char yytable[] = |
static const yysigned_char yytable[] = |
578 |
{ |
{ |
579 |
57, 53, -74, 59, 55, 92, 3, 4, 5, 6, |
58, -76, 60, 56, 89, 3, 4, 5, 6, 7, |
580 |
7, 8, 9, 10, 11, 12, 54, 69, 55, 90, |
8, 9, 10, 11, 12, 56, 69, 56, 88, 42, |
581 |
41, 104, 45, 70, 105, 44, 101, 95, 96, 106, |
70, 87, 97, 90, 90, 55, 99, 100, 101, 92, |
582 |
107, 108, 55, 91, 28, 78, 47, 79, 93, 93, |
93, 45, 46, 28, 48, 50, 49, 76, 67, 61, |
583 |
81, 82, 48, 56, 60, 87, 94, 51, 52, 49, |
57, 52, 62, 84, 53, 78, 91, 79, 77, 82, |
584 |
65, 84, 67, 76, 77, 86, 97, 56, 80, 98, |
80, 81, 57, 96, 56, 98, 107, 102, 108, 91, |
585 |
83, 109, 94, 85, 55, 35, 100, 94, 94, 114, |
36, 73, 105, 54, 91, 91, 0, 103, 0, 0, |
586 |
115, 73, 112, 0, 0, 110, 88, 0, 113, 0, |
85, 106, 0, 0, 60, 0, 0, 103, 4, 5, |
587 |
0, 59, 0, 0, 110, 4, 5, 6, 7, 8, |
6, 7, 8, 9, 10, 11, 12, 0, 0, 0, |
|
9, 10, 11, 12, 0, 0, 0, 0, 0, 0, |
|
588 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
589 |
0, 0, 28, 4, 5, 6, 7, 8, 9, 10, |
0, 0, 0, 0, 0, 28, 0, 0, 0, 0, |
590 |
11, 12, 60, 0, 0, 13, 14, 15, 16, 17, |
0, 61, 0, 0, 62, 4, 5, 6, 7, 8, |
591 |
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, |
9, 10, 11, 12, 0, 0, 0, 13, 14, 15, |
592 |
28, 29, 30, 31, 0, 0, 0, 0, 0, 0, |
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, |
593 |
0, 32, 33 |
26, 27, 28, 29, 30, 31, 0, 0, 32, 0, |
594 |
|
0, 0, 33, 34 |
595 |
}; |
}; |
596 |
|
|
597 |
static const yysigned_char yycheck[] = |
static const yysigned_char yycheck[] = |
598 |
{ |
{ |
599 |
28, 25, 0, 1, 3, 70, 0, 5, 6, 7, |
28, 0, 1, 3, 70, 0, 5, 6, 7, 8, |
600 |
8, 9, 10, 11, 12, 13, 27, 36, 3, 68, |
9, 10, 11, 12, 13, 3, 36, 3, 4, 36, |
601 |
36, 38, 3, 42, 41, 46, 91, 76, 77, 14, |
40, 68, 88, 72, 73, 27, 14, 15, 16, 76, |
602 |
15, 16, 3, 4, 32, 46, 4, 48, 72, 73, |
77, 45, 3, 32, 4, 45, 37, 45, 36, 38, |
603 |
51, 52, 37, 42, 42, 43, 74, 37, 37, 46, |
40, 37, 41, 42, 37, 47, 74, 49, 45, 38, |
604 |
38, 38, 36, 46, 46, 38, 80, 42, 40, 83, |
52, 53, 40, 44, 3, 39, 4, 45, 36, 87, |
605 |
40, 46, 90, 39, 3, 2, 45, 95, 96, 4, |
2, 41, 98, 25, 92, 93, -1, 95, -1, -1, |
606 |
36, 40, 105, -1, -1, 103, 62, -1, 106, -1, |
64, 99, -1, -1, 1, -1, -1, 105, 5, 6, |
607 |
-1, 1, -1, -1, 112, 5, 6, 7, 8, 9, |
7, 8, 9, 10, 11, 12, 13, -1, -1, -1, |
|
10, 11, 12, 13, -1, -1, -1, -1, -1, -1, |
|
608 |
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
609 |
-1, -1, 32, 5, 6, 7, 8, 9, 10, 11, |
-1, -1, -1, -1, -1, 32, -1, -1, -1, -1, |
610 |
12, 13, 42, -1, -1, 17, 18, 19, 20, 21, |
-1, 38, -1, -1, 41, 5, 6, 7, 8, 9, |
611 |
22, 23, 24, 25, 26, 27, 28, 29, 30, 31, |
10, 11, 12, 13, -1, -1, -1, 17, 18, 19, |
612 |
32, 33, 34, 35, -1, -1, -1, -1, -1, -1, |
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, |
613 |
-1, 43, 44 |
30, 31, 32, 33, 34, 35, -1, -1, 38, -1, |
614 |
|
-1, -1, 42, 43 |
615 |
}; |
}; |
616 |
|
|
617 |
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing |
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing |
618 |
symbol of state STATE-NUM. */ |
symbol of state STATE-NUM. */ |
619 |
static const unsigned char yystos[] = |
static const unsigned char yystos[] = |
620 |
{ |
{ |
621 |
0, 48, 49, 0, 5, 6, 7, 8, 9, 10, |
0, 47, 48, 0, 5, 6, 7, 8, 9, 10, |
622 |
11, 12, 13, 17, 18, 19, 20, 21, 22, 23, |
11, 12, 13, 17, 18, 19, 20, 21, 22, 23, |
623 |
24, 25, 26, 27, 28, 29, 30, 31, 32, 33, |
24, 25, 26, 27, 28, 29, 30, 31, 32, 33, |
624 |
34, 35, 43, 44, 50, 51, 54, 57, 58, 56, |
34, 35, 38, 42, 43, 49, 50, 53, 56, 57, |
625 |
55, 36, 52, 53, 46, 3, 72, 4, 37, 46, |
55, 54, 36, 51, 52, 45, 3, 71, 4, 37, |
626 |
73, 37, 37, 73, 72, 3, 42, 69, 71, 1, |
45, 72, 37, 37, 72, 71, 3, 40, 68, 70, |
627 |
42, 51, 63, 64, 65, 38, 75, 36, 59, 36, |
1, 38, 41, 50, 62, 63, 64, 36, 58, 36, |
628 |
42, 61, 62, 62, 60, 69, 46, 46, 72, 72, |
40, 60, 61, 61, 59, 68, 45, 45, 71, 71, |
629 |
40, 72, 72, 40, 38, 39, 38, 43, 64, 74, |
71, 71, 38, 65, 42, 63, 73, 59, 4, 70, |
630 |
60, 4, 71, 61, 69, 60, 60, 73, 73, 66, |
60, 68, 59, 59, 66, 67, 44, 70, 39, 14, |
631 |
45, 71, 67, 68, 38, 41, 14, 15, 16, 46, |
15, 16, 45, 68, 69, 67, 68, 4, 36 |
|
69, 70, 68, 69, 4, 36 |
|
632 |
}; |
}; |
633 |
|
|
634 |
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) |
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) |
716 |
if (yydebug) \ |
if (yydebug) \ |
717 |
YYFPRINTF Args; \ |
YYFPRINTF Args; \ |
718 |
} while (0) |
} while (0) |
719 |
|
|
720 |
# define YYDSYMPRINT(Args) \ |
# define YYDSYMPRINT(Args) \ |
721 |
do { \ |
do { \ |
722 |
if (yydebug) \ |
if (yydebug) \ |
723 |
yysymprint Args; \ |
yysymprint Args; \ |
724 |
} while (0) |
} while (0) |
725 |
|
|
726 |
# define YYDSYMPRINTF(Title, Token, Value, Location) \ |
# define YYDSYMPRINTF(Title, Token, Value, Location) \ |
727 |
do { \ |
do { \ |
728 |
if (yydebug) \ |
if (yydebug) \ |
734 |
} \ |
} \ |
735 |
} while (0) |
} while (0) |
736 |
|
|
737 |
|
/*------------------------------------------------------------------. |
738 |
|
| yy_stack_print -- Print the state stack from its BOTTOM up to its | |
739 |
|
| TOP (cinluded). | |
740 |
|
`------------------------------------------------------------------*/ |
741 |
|
|
742 |
|
#if defined (__STDC__) || defined (__cplusplus) |
743 |
|
static void |
744 |
|
yy_stack_print (short *bottom, short *top) |
745 |
|
#else |
746 |
|
static void |
747 |
|
yy_stack_print (bottom, top) |
748 |
|
short *bottom; |
749 |
|
short *top; |
750 |
|
#endif |
751 |
|
{ |
752 |
|
YYFPRINTF (stderr, "Stack now"); |
753 |
|
for (/* Nothing. */; bottom <= top; ++bottom) |
754 |
|
YYFPRINTF (stderr, " %d", *bottom); |
755 |
|
YYFPRINTF (stderr, "\n"); |
756 |
|
} |
757 |
|
|
758 |
|
# define YY_STACK_PRINT(Bottom, Top) \ |
759 |
|
do { \ |
760 |
|
if (yydebug) \ |
761 |
|
yy_stack_print ((Bottom), (Top)); \ |
762 |
|
} while (0) |
763 |
|
|
764 |
|
|
765 |
|
/*------------------------------------------------. |
766 |
|
| Report that the YYRULE is going to be reduced. | |
767 |
|
`------------------------------------------------*/ |
768 |
|
|
769 |
|
#if defined (__STDC__) || defined (__cplusplus) |
770 |
|
static void |
771 |
|
yy_reduce_print (int yyrule) |
772 |
|
#else |
773 |
|
static void |
774 |
|
yy_reduce_print (yyrule) |
775 |
|
int yyrule; |
776 |
|
#endif |
777 |
|
{ |
778 |
|
int yyi; |
779 |
|
unsigned int yylineno = yyrline[yyrule]; |
780 |
|
YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", |
781 |
|
yyrule - 1, yylineno); |
782 |
|
/* Print the symbols being reduced, and their result. */ |
783 |
|
for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) |
784 |
|
YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); |
785 |
|
YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); |
786 |
|
} |
787 |
|
|
788 |
|
# define YY_REDUCE_PRINT(Rule) \ |
789 |
|
do { \ |
790 |
|
if (yydebug) \ |
791 |
|
yy_reduce_print (Rule); \ |
792 |
|
} while (0) |
793 |
|
|
794 |
/* Nonzero means print parse trace. It is left uninitialized so that |
/* Nonzero means print parse trace. It is left uninitialized so that |
795 |
multiple parsers can coexist. */ |
multiple parsers can coexist. */ |
796 |
int yydebug; |
int yydebug; |
798 |
# define YYDPRINTF(Args) |
# define YYDPRINTF(Args) |
799 |
# define YYDSYMPRINT(Args) |
# define YYDSYMPRINT(Args) |
800 |
# define YYDSYMPRINTF(Title, Token, Value, Location) |
# define YYDSYMPRINTF(Title, Token, Value, Location) |
801 |
|
# define YY_STACK_PRINT(Bottom, Top) |
802 |
|
# define YY_REDUCE_PRINT(Rule) |
803 |
#endif /* !YYDEBUG */ |
#endif /* !YYDEBUG */ |
804 |
|
|
805 |
|
|
806 |
/* YYINITDEPTH -- initial size of the parser's stacks. */ |
/* YYINITDEPTH -- initial size of the parser's stacks. */ |
807 |
#ifndef YYINITDEPTH |
#ifndef YYINITDEPTH |
808 |
# define YYINITDEPTH 200 |
# define YYINITDEPTH 200 |
881 |
|
|
882 |
|
|
883 |
#if YYDEBUG |
#if YYDEBUG |
884 |
/*-----------------------------. |
/*--------------------------------. |
885 |
| Print this symbol on YYOUT. | |
| Print this symbol on YYOUTPUT. | |
886 |
`-----------------------------*/ |
`--------------------------------*/ |
887 |
|
|
888 |
#if defined (__STDC__) || defined (__cplusplus) |
#if defined (__STDC__) || defined (__cplusplus) |
889 |
static void |
static void |
890 |
yysymprint (FILE *yyout, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp) |
yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp) |
891 |
#else |
#else |
892 |
static void |
static void |
893 |
yysymprint (yyout, yytype, yyvaluep, yylocationp) |
yysymprint (yyoutput, yytype, yyvaluep, yylocationp) |
894 |
FILE *yyout; |
FILE *yyoutput; |
895 |
int yytype; |
int yytype; |
896 |
YYSTYPE *yyvaluep; |
YYSTYPE *yyvaluep; |
897 |
YYLTYPE *yylocationp; |
YYLTYPE *yylocationp; |
903 |
|
|
904 |
if (yytype < YYNTOKENS) |
if (yytype < YYNTOKENS) |
905 |
{ |
{ |
906 |
YYFPRINTF (yyout, "token %s (", yytname[yytype]); |
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); |
907 |
# ifdef YYPRINT |
# ifdef YYPRINT |
908 |
YYPRINT (yyout, yytoknum[yytype], *yyvaluep); |
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); |
909 |
# endif |
# endif |
910 |
} |
} |
911 |
else |
else |
912 |
YYFPRINTF (yyout, "nterm %s (", yytname[yytype]); |
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); |
913 |
|
|
914 |
switch (yytype) |
switch (yytype) |
915 |
{ |
{ |
916 |
default: |
default: |
917 |
break; |
break; |
918 |
} |
} |
919 |
YYFPRINTF (yyout, ")"); |
YYFPRINTF (yyoutput, ")"); |
920 |
} |
} |
921 |
|
|
922 |
#endif /* YYDEBUG. */ |
#endif /* ! YYDEBUG */ |
923 |
/*-----------------------------------------------. |
/*-----------------------------------------------. |
924 |
| Release the memory associated to this symbol. | |
| Release the memory associated to this symbol. | |
925 |
`-----------------------------------------------*/ |
`-----------------------------------------------*/ |
962 |
#else |
#else |
963 |
int yyparse (); |
int yyparse (); |
964 |
#endif |
#endif |
965 |
#endif |
#endif /* ! YYPARSE_PARAM */ |
966 |
|
|
967 |
|
|
968 |
|
|
1175 |
} |
} |
1176 |
else |
else |
1177 |
{ |
{ |
|
/* We have to keep this `#if YYDEBUG', since we use variables |
|
|
which are defined only if `YYDEBUG' is set. */ |
|
1178 |
YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); |
YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); |
1179 |
} |
} |
1180 |
|
|
1243 |
|
|
1244 |
/* Default location. */ |
/* Default location. */ |
1245 |
YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); |
YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); |
1246 |
|
YY_REDUCE_PRINT (yyn); |
|
#if YYDEBUG |
|
|
/* We have to keep this `#if YYDEBUG', since we use variables which |
|
|
are defined only if `YYDEBUG' is set. */ |
|
|
if (yydebug) |
|
|
{ |
|
|
int yyi; |
|
|
|
|
|
YYFPRINTF (stderr, "Reducing by rule %d (line %d), ", |
|
|
yyn - 1, yyrline[yyn]); |
|
|
|
|
|
/* Print the symbols being reduced, and their result. */ |
|
|
for (yyi = yyprhs[yyn]; 0 <= yyrhs[yyi]; yyi++) |
|
|
YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); |
|
|
YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyn]]); |
|
|
} |
|
|
#endif |
|
1247 |
switch (yyn) |
switch (yyn) |
1248 |
{ |
{ |
1249 |
case 2: |
case 6: |
1250 |
#line 172 "parse-gram.y" |
#line 171 "parse-gram.y" |
1251 |
{ |
{ prologue_augment (yyvsp[0].chars, yylsp[0]); } |
|
yycontrol->errcode = 0; |
|
|
} |
|
|
break; |
|
|
|
|
|
case 6: |
|
|
#line 189 "parse-gram.y" |
|
|
{ prologue_augment (yyvsp[0].string, yylsp[0]); } |
|
1252 |
break; |
break; |
1253 |
|
|
1254 |
case 7: |
case 7: |
1255 |
#line 190 "parse-gram.y" |
#line 172 "parse-gram.y" |
1256 |
{ debug_flag = 1; } |
{ debug_flag = 1; } |
1257 |
break; |
break; |
1258 |
|
|
1259 |
case 8: |
case 8: |
1260 |
#line 191 "parse-gram.y" |
#line 173 "parse-gram.y" |
1261 |
{ muscle_insert (yyvsp[-1].string, yyvsp[0].string); } |
{ muscle_insert (yyvsp[-1].chars, yyvsp[0].chars); } |
1262 |
break; |
break; |
1263 |
|
|
1264 |
case 9: |
case 9: |
1265 |
#line 192 "parse-gram.y" |
#line 174 "parse-gram.y" |
1266 |
{ defines_flag = 1; } |
{ defines_flag = 1; } |
1267 |
break; |
break; |
1268 |
|
|
1269 |
case 10: |
case 10: |
1270 |
#line 193 "parse-gram.y" |
#line 175 "parse-gram.y" |
1271 |
{ error_verbose = 1; } |
{ error_verbose = 1; } |
1272 |
break; |
break; |
1273 |
|
|
1274 |
case 11: |
case 11: |
1275 |
#line 194 "parse-gram.y" |
#line 176 "parse-gram.y" |
1276 |
{ expected_conflicts = yyvsp[0].integer; } |
{ expected_conflicts = yyvsp[0].integer; } |
1277 |
break; |
break; |
1278 |
|
|
1279 |
case 12: |
case 12: |
1280 |
#line 195 "parse-gram.y" |
#line 177 "parse-gram.y" |
1281 |
{ spec_file_prefix = yyvsp[0].string; } |
{ spec_file_prefix = yyvsp[0].chars; } |
1282 |
break; |
break; |
1283 |
|
|
1284 |
case 13: |
case 13: |
1285 |
#line 196 "parse-gram.y" |
#line 178 "parse-gram.y" |
1286 |
{ glr_parser = 1; } |
{ glr_parser = 1; } |
1287 |
break; |
break; |
1288 |
|
|
1289 |
case 14: |
case 14: |
1290 |
#line 198 "parse-gram.y" |
#line 179 "parse-gram.y" |
1291 |
{ |
{ add_param ("lex_param", yyvsp[0].chars, yylsp[0]); } |
|
muscle_pair_list_grow ("lex_param", yyvsp[-2].string, yyvsp[0].string); |
|
|
scanner_last_string_free (); |
|
|
} |
|
1292 |
break; |
break; |
1293 |
|
|
1294 |
case 15: |
case 15: |
1295 |
#line 202 "parse-gram.y" |
#line 180 "parse-gram.y" |
1296 |
{ locations_flag = 1; } |
{ locations_flag = 1; } |
1297 |
break; |
break; |
1298 |
|
|
1299 |
case 16: |
case 16: |
1300 |
#line 203 "parse-gram.y" |
#line 181 "parse-gram.y" |
1301 |
{ spec_name_prefix = yyvsp[0].string; } |
{ spec_name_prefix = yyvsp[0].chars; } |
1302 |
break; |
break; |
1303 |
|
|
1304 |
case 17: |
case 17: |
1305 |
#line 204 "parse-gram.y" |
#line 182 "parse-gram.y" |
1306 |
{ no_lines_flag = 1; } |
{ no_lines_flag = 1; } |
1307 |
break; |
break; |
1308 |
|
|
1309 |
case 18: |
case 18: |
1310 |
#line 205 "parse-gram.y" |
#line 183 "parse-gram.y" |
1311 |
{ spec_outfile = yyvsp[0].string; } |
{ spec_outfile = yyvsp[0].chars; } |
1312 |
break; |
break; |
1313 |
|
|
1314 |
case 19: |
case 19: |
1315 |
#line 207 "parse-gram.y" |
#line 184 "parse-gram.y" |
1316 |
{ |
{ add_param ("parse_param", yyvsp[0].chars, yylsp[0]); } |
|
muscle_pair_list_grow ("parse_param", yyvsp[-2].string, yyvsp[0].string); |
|
|
scanner_last_string_free (); |
|
|
} |
|
1317 |
break; |
break; |
1318 |
|
|
1319 |
case 20: |
case 20: |
1320 |
#line 211 "parse-gram.y" |
#line 185 "parse-gram.y" |
1321 |
{ pure_parser = 1; } |
{ pure_parser = 1; } |
1322 |
break; |
break; |
1323 |
|
|
1324 |
case 21: |
case 21: |
1325 |
#line 212 "parse-gram.y" |
#line 186 "parse-gram.y" |
1326 |
{ skeleton = yyvsp[0].string; } |
{ skeleton = yyvsp[0].chars; } |
1327 |
break; |
break; |
1328 |
|
|
1329 |
case 22: |
case 22: |
1330 |
#line 213 "parse-gram.y" |
#line 187 "parse-gram.y" |
1331 |
{ token_table_flag = 1; } |
{ token_table_flag = 1; } |
1332 |
break; |
break; |
1333 |
|
|
1334 |
case 23: |
case 23: |
1335 |
#line 214 "parse-gram.y" |
#line 188 "parse-gram.y" |
1336 |
{ report_flag = 1; } |
{ report_flag = 1; } |
1337 |
break; |
break; |
1338 |
|
|
1339 |
case 24: |
case 24: |
1340 |
#line 215 "parse-gram.y" |
#line 189 "parse-gram.y" |
1341 |
{ yacc_flag = 1; } |
{ yacc_flag = 1; } |
1342 |
break; |
break; |
1343 |
|
|
1344 |
case 27: |
case 28: |
1345 |
#line 222 "parse-gram.y" |
#line 197 "parse-gram.y" |
1346 |
{ |
{ |
1347 |
grammar_start_symbol_set (yyvsp[0].symbol, yylsp[0]); |
grammar_start_symbol_set (yyvsp[0].symbol, yylsp[0]); |
1348 |
} |
} |
1349 |
break; |
break; |
1350 |
|
|
1351 |
case 28: |
case 29: |
1352 |
#line 226 "parse-gram.y" |
#line 201 "parse-gram.y" |
1353 |
{ |
{ |
1354 |
typed = 1; |
typed = 1; |
1355 |
MUSCLE_INSERT_INT ("stype_line", yylsp[0].first_line); |
MUSCLE_INSERT_INT ("stype_line", yylsp[0].start.line); |
1356 |
muscle_insert ("stype", yyvsp[0].string); |
muscle_insert ("stype", yyvsp[0].chars); |
1357 |
} |
} |
1358 |
break; |
break; |
1359 |
|
|
1360 |
case 29: |
case 30: |
1361 |
#line 232 "parse-gram.y" |
#line 207 "parse-gram.y" |
1362 |
{ current_braced_code = destructor_braced_code; } |
{ current_braced_code = destructor_braced_code; } |
1363 |
break; |
break; |
1364 |
|
|
1365 |
case 30: |
case 31: |
1366 |
#line 234 "parse-gram.y" |
#line 209 "parse-gram.y" |
1367 |
{ |
{ |
1368 |
symbol_list_t *list; |
symbol_list *list; |
1369 |
for (list = yyvsp[0].list; list; list = list->next) |
for (list = yyvsp[0].list; list; list = list->next) |
1370 |
symbol_destructor_set (list->sym, yyvsp[-1].string, yylsp[-1]); |
symbol_destructor_set (list->sym, yyvsp[-1].chars, yylsp[-1]); |
1371 |
symbol_list_free (yyvsp[0].list); |
symbol_list_free (yyvsp[0].list); |
1372 |
current_braced_code = action_braced_code; |
current_braced_code = action_braced_code; |
1373 |
} |
} |
1374 |
break; |
break; |
1375 |
|
|
1376 |
case 31: |
case 32: |
1377 |
#line 242 "parse-gram.y" |
#line 217 "parse-gram.y" |
1378 |
{ current_braced_code = printer_braced_code; } |
{ current_braced_code = printer_braced_code; } |
1379 |
break; |
break; |
1380 |
|
|
1381 |
case 32: |
case 33: |
1382 |
#line 244 "parse-gram.y" |
#line 219 "parse-gram.y" |
1383 |
{ |
{ |
1384 |
symbol_list_t *list; |
symbol_list *list; |
1385 |
for (list = yyvsp[0].list; list; list = list->next) |
for (list = yyvsp[0].list; list; list = list->next) |
1386 |
symbol_printer_set (list->sym, yyvsp[-1].string, list->location); |
symbol_printer_set (list->sym, yyvsp[-1].chars, list->location); |
1387 |
symbol_list_free (yyvsp[0].list); |
symbol_list_free (yyvsp[0].list); |
1388 |
current_braced_code = action_braced_code; |
current_braced_code = action_braced_code; |
1389 |
} |
} |
1390 |
break; |
break; |
1391 |
|
|
1392 |
case 33: |
case 34: |
1393 |
#line 254 "parse-gram.y" |
#line 229 "parse-gram.y" |
1394 |
{ current_class = nterm_sym; } |
{ current_class = nterm_sym; } |
1395 |
break; |
break; |
1396 |
|
|
1397 |
case 34: |
case 35: |
1398 |
#line 255 "parse-gram.y" |
#line 230 "parse-gram.y" |
1399 |
{ |
{ |
1400 |
current_class = unknown_sym; |
current_class = unknown_sym; |
1401 |
current_type = NULL; |
current_type = NULL; |
1402 |
} |
} |
1403 |
break; |
break; |
1404 |
|
|
1405 |
case 35: |
case 36: |
1406 |
#line 259 "parse-gram.y" |
#line 234 "parse-gram.y" |
1407 |
{ current_class = token_sym; } |
{ current_class = token_sym; } |
1408 |
break; |
break; |
1409 |
|
|
1410 |
case 36: |
case 37: |
1411 |
#line 260 "parse-gram.y" |
#line 235 "parse-gram.y" |
1412 |
{ |
{ |
1413 |
current_class = unknown_sym; |
current_class = unknown_sym; |
1414 |
current_type = NULL; |
current_type = NULL; |
1415 |
} |
} |
1416 |
break; |
break; |
1417 |
|
|
1418 |
case 37: |
case 38: |
1419 |
#line 265 "parse-gram.y" |
#line 240 "parse-gram.y" |
1420 |
{ |
{ |
1421 |
symbol_list_t *list; |
symbol_list *list; |
1422 |
for (list = yyvsp[0].list; list; list = list->next) |
for (list = yyvsp[0].list; list; list = list->next) |
1423 |
symbol_type_set (list->sym, yyvsp[-1].struniq, yylsp[-1]); |
symbol_type_set (list->sym, yyvsp[-1].uniqstr, yylsp[-1]); |
1424 |
symbol_list_free (yyvsp[0].list); |
symbol_list_free (yyvsp[0].list); |
1425 |
} |
} |
1426 |
break; |
break; |
1427 |
|
|
1428 |
case 38: |
case 39: |
1429 |
#line 275 "parse-gram.y" |
#line 250 "parse-gram.y" |
1430 |
{ |
{ |
1431 |
symbol_list_t *list; |
symbol_list *list; |
1432 |
++current_prec; |
++current_prec; |
1433 |
for (list = yyvsp[0].list; list; list = list->next) |
for (list = yyvsp[0].list; list; list = list->next) |
1434 |
{ |
{ |
1440 |
} |
} |
1441 |
break; |
break; |
1442 |
|
|
1443 |
case 39: |
case 40: |
1444 |
#line 289 "parse-gram.y" |
#line 264 "parse-gram.y" |
1445 |
{ yyval.assoc = left_assoc; } |
{ yyval.assoc = left_assoc; } |
1446 |
break; |
break; |
1447 |
|
|
1448 |
case 40: |
case 41: |
1449 |
#line 290 "parse-gram.y" |
#line 265 "parse-gram.y" |
1450 |
{ yyval.assoc = right_assoc; } |
{ yyval.assoc = right_assoc; } |
1451 |
break; |
break; |
1452 |
|
|
1453 |
case 41: |
case 42: |
1454 |
#line 291 "parse-gram.y" |
#line 266 "parse-gram.y" |
1455 |
{ yyval.assoc = non_assoc; } |
{ yyval.assoc = non_assoc; } |
1456 |
break; |
break; |
1457 |
|
|
1458 |
case 42: |
case 43: |
1459 |
#line 295 "parse-gram.y" |
#line 270 "parse-gram.y" |
1460 |
{ current_type = NULL; } |
{ current_type = NULL; } |
1461 |
break; |
break; |
1462 |
|
|
1463 |
case 43: |
case 44: |
1464 |
#line 296 "parse-gram.y" |
#line 271 "parse-gram.y" |
1465 |
{ current_type = yyvsp[0].struniq; } |
{ current_type = yyvsp[0].uniqstr; } |
1466 |
break; |
break; |
1467 |
|
|
1468 |
case 44: |
case 45: |
1469 |
#line 302 "parse-gram.y" |
#line 277 "parse-gram.y" |
1470 |
{ yyval.list = symbol_list_new (yyvsp[0].symbol, yylsp[0]); } |
{ yyval.list = symbol_list_new (yyvsp[0].symbol, yylsp[0]); } |
1471 |
break; |
break; |
1472 |
|
|
1473 |
case 45: |
case 46: |
1474 |
#line 303 "parse-gram.y" |
#line 278 "parse-gram.y" |
1475 |
{ yyval.list = symbol_list_prepend (yyvsp[-1].list, yyvsp[0].symbol, yylsp[0]); } |
{ yyval.list = symbol_list_prepend (yyvsp[-1].list, yyvsp[0].symbol, yylsp[0]); } |
1476 |
break; |
break; |
1477 |
|
|
1478 |
case 46: |
case 47: |
1479 |
#line 309 "parse-gram.y" |
#line 284 "parse-gram.y" |
1480 |
{ |
{ |
1481 |
current_type = yyvsp[0].struniq; |
current_type = yyvsp[0].uniqstr; |
1482 |
} |
} |
1483 |
break; |
break; |
1484 |
|
|
1485 |
case 47: |
case 48: |
1486 |
#line 313 "parse-gram.y" |
#line 288 "parse-gram.y" |
1487 |
{ |
{ |
1488 |
symbol_class_set (yyvsp[0].symbol, current_class, yylsp[0]); |
symbol_class_set (yyvsp[0].symbol, current_class, yylsp[0]); |
1489 |
symbol_type_set (yyvsp[0].symbol, current_type, yylsp[0]); |
symbol_type_set (yyvsp[0].symbol, current_type, yylsp[0]); |
1490 |
} |
} |
1491 |
break; |
break; |
1492 |
|
|
1493 |
case 48: |
case 49: |
1494 |
#line 318 "parse-gram.y" |
#line 293 "parse-gram.y" |
1495 |
{ |
{ |
1496 |
symbol_class_set (yyvsp[-1].symbol, current_class, yylsp[-1]); |
symbol_class_set (yyvsp[-1].symbol, current_class, yylsp[-1]); |
1497 |
symbol_type_set (yyvsp[-1].symbol, current_type, yylsp[-1]); |
symbol_type_set (yyvsp[-1].symbol, current_type, yylsp[-1]); |
1499 |
} |
} |
1500 |
break; |
break; |
1501 |
|
|
1502 |
case 49: |
case 50: |
1503 |
#line 324 "parse-gram.y" |
#line 299 "parse-gram.y" |
1504 |
{ |
{ |
1505 |
symbol_class_set (yyvsp[-1].symbol, current_class, yylsp[-1]); |
symbol_class_set (yyvsp[-1].symbol, current_class, yylsp[-1]); |
1506 |
symbol_type_set (yyvsp[-1].symbol, current_type, yylsp[-1]); |
symbol_type_set (yyvsp[-1].symbol, current_type, yylsp[-1]); |
1508 |
} |
} |
1509 |
break; |
break; |
1510 |
|
|
1511 |
case 50: |
case 51: |
1512 |
#line 330 "parse-gram.y" |
#line 305 "parse-gram.y" |
1513 |
{ |
{ |
1514 |
symbol_class_set (yyvsp[-2].symbol, current_class, yylsp[-2]); |
symbol_class_set (yyvsp[-2].symbol, current_class, yylsp[-2]); |
1515 |
symbol_type_set (yyvsp[-2].symbol, current_type, yylsp[-2]); |
symbol_type_set (yyvsp[-2].symbol, current_type, yylsp[-2]); |
1518 |
} |
} |
1519 |
break; |
break; |
1520 |
|
|
1521 |
case 51: |
case 57: |
1522 |
#line 341 "parse-gram.y" |
#line 334 "parse-gram.y" |
|
{;} |
|
|
break; |
|
|
|
|
|
case 52: |
|
|
#line 343 "parse-gram.y" |
|
|
{;} |
|
|
break; |
|
|
|
|
|
case 56: |
|
|
#line 362 "parse-gram.y" |
|
1523 |
{ |
{ |
1524 |
if (yacc_flag) |
if (yacc_flag) |
1525 |
complain_at (yyloc, _("POSIX forbids declarations in the grammar")); |
complain_at (yyloc, _("POSIX forbids declarations in the grammar")); |
1526 |
} |
} |
1527 |
break; |
break; |
1528 |
|
|
1529 |
case 57: |
case 58: |
1530 |
#line 367 "parse-gram.y" |
#line 339 "parse-gram.y" |
1531 |
{ |
{ |
1532 |
yyerrok; |
yyerrok; |
1533 |
} |
} |
1534 |
break; |
break; |
1535 |
|
|
1536 |
case 58: |
case 60: |
1537 |
#line 373 "parse-gram.y" |
#line 346 "parse-gram.y" |
1538 |
{ current_lhs = yyvsp[-1].symbol; current_lhs_location = yylsp[-1]; } |
{ current_lhs = yyvsp[0].symbol; current_lhs_location = yylsp[0]; } |
|
break; |
|
|
|
|
|
case 59: |
|
|
#line 374 "parse-gram.y" |
|
|
{;} |
|
1539 |
break; |
break; |
1540 |
|
|
1541 |
case 60: |
case 62: |
1542 |
#line 378 "parse-gram.y" |
#line 350 "parse-gram.y" |
1543 |
{ grammar_rule_end (yylsp[0]); } |
{ grammar_rule_end (yylsp[0]); } |
1544 |
break; |
break; |
1545 |
|
|
1546 |
case 61: |
case 63: |
1547 |
#line 379 "parse-gram.y" |
#line 351 "parse-gram.y" |
1548 |
{ grammar_rule_end (yylsp[0]); } |
{ grammar_rule_end (yylsp[0]); } |
1549 |
break; |
break; |
1550 |
|
|
1551 |
case 62: |
case 64: |
1552 |
#line 384 "parse-gram.y" |
#line 356 "parse-gram.y" |
1553 |
{ grammar_rule_begin (current_lhs, current_lhs_location); } |
{ grammar_rule_begin (current_lhs, current_lhs_location); } |
1554 |
break; |
break; |
1555 |
|
|
1556 |
case 63: |
case 65: |
1557 |
#line 386 "parse-gram.y" |
#line 358 "parse-gram.y" |
1558 |
{ grammar_current_rule_symbol_append (yyvsp[0].symbol, yylsp[0]); } |
{ grammar_current_rule_symbol_append (yyvsp[0].symbol, yylsp[0]); } |
1559 |
break; |
break; |
1560 |
|
|
1561 |
case 64: |
case 66: |
1562 |
#line 388 "parse-gram.y" |
#line 360 "parse-gram.y" |
1563 |
{ grammar_current_rule_action_append (yyvsp[0].string, yylsp[0]); } |
{ grammar_current_rule_action_append (yyvsp[0].chars, yylsp[0]); } |
1564 |
break; |
break; |
1565 |
|
|
1566 |
case 65: |
case 67: |
1567 |
#line 390 "parse-gram.y" |
#line 362 "parse-gram.y" |
1568 |
{ grammar_current_rule_prec_set (yyvsp[0].symbol, yylsp[0]); } |
{ grammar_current_rule_prec_set (yyvsp[0].symbol, yylsp[0]); } |
1569 |
break; |
break; |
1570 |
|
|
1571 |
case 66: |
case 68: |
1572 |
#line 392 "parse-gram.y" |
#line 364 "parse-gram.y" |
1573 |
{ grammar_current_rule_dprec_set (yyvsp[0].integer, yylsp[0]); } |
{ grammar_current_rule_dprec_set (yyvsp[0].integer, yylsp[0]); } |
1574 |
break; |
break; |
1575 |
|
|
1576 |
case 67: |
case 69: |
1577 |
#line 394 "parse-gram.y" |
#line 366 "parse-gram.y" |
1578 |
{ grammar_current_rule_merge_set (yyvsp[0].struniq, yylsp[0]); } |
{ grammar_current_rule_merge_set (yyvsp[0].uniqstr, yylsp[0]); } |
1579 |
break; |
break; |
1580 |
|
|
1581 |
case 68: |
case 70: |
1582 |
#line 398 "parse-gram.y" |
#line 370 "parse-gram.y" |
1583 |
{ yyval.symbol = yyvsp[0].symbol; } |
{ yyval.symbol = yyvsp[0].symbol; } |
1584 |
break; |
break; |
1585 |
|
|
1586 |
case 69: |
case 71: |
1587 |
#line 399 "parse-gram.y" |
#line 371 "parse-gram.y" |
1588 |
{ yyval.symbol = yyvsp[0].symbol; } |
{ yyval.symbol = yyvsp[0].symbol; } |
1589 |
break; |
break; |
1590 |
|
|
1591 |
case 70: |
case 72: |
1592 |
#line 404 "parse-gram.y" |
#line 376 "parse-gram.y" |
1593 |
{ yyval.string = yyvsp[0].string; } |
{ yyval.chars = yyvsp[0].chars; } |
1594 |
break; |
break; |
1595 |
|
|
1596 |
case 71: |
case 73: |
1597 |
#line 410 "parse-gram.y" |
#line 382 "parse-gram.y" |
1598 |
{ |
{ |
1599 |
yyval.symbol = symbol_get (yyvsp[0].string, yylsp[0]); |
yyval.symbol = symbol_get (yyvsp[0].chars, yylsp[0]); |
1600 |
symbol_class_set (yyval.symbol, token_sym, yylsp[0]); |
symbol_class_set (yyval.symbol, token_sym, yylsp[0]); |
1601 |
} |
} |
1602 |
break; |
break; |
1603 |
|
|
1604 |
case 72: |
case 74: |
1605 |
#line 419 "parse-gram.y" |
#line 391 "parse-gram.y" |
1606 |
{ |
{ |
1607 |
yyval.string = yyvsp[0].string + 1; |
yyval.chars = yyvsp[0].chars + 1; |
1608 |
yyval.string[strlen (yyval.string) - 1] = '\0'; |
yyval.chars[strlen (yyval.chars) - 1] = '\0'; |
1609 |
} |
} |
1610 |
break; |
break; |
1611 |
|
|
1612 |
case 73: |
case 75: |
1613 |
#line 428 "parse-gram.y" |
#line 400 "parse-gram.y" |
1614 |
{ |
{ |
1615 |
yyval.string = yyvsp[0].string + 1; |
yyval.chars = yyvsp[0].chars + 1; |
1616 |
yyval.string[strlen (yyval.string) - 1] = '\0'; |
yyval.chars[strlen (yyval.chars) - 1] = '\0'; |
1617 |
} |
} |
1618 |
break; |
break; |
1619 |
|
|
1620 |
case 75: |
case 77: |
1621 |
#line 437 "parse-gram.y" |
#line 409 "parse-gram.y" |
1622 |
{ |
{ |
1623 |
epilogue_augment (yyvsp[0].string, yylsp[0]); |
epilogue_augment (yyvsp[0].chars, yylsp[0]); |
1624 |
scanner_last_string_free (); |
scanner_last_string_free (); |
1625 |
} |
} |
1626 |
break; |
break; |
1628 |
|
|
1629 |
} |
} |
1630 |
|
|
1631 |
/* Line 959 of /usr/local/share/bison/yacc.c. */ |
/* Line 991 of yacc.c. */ |
1632 |
#line 1636 "parse-gram.c" |
#line 1632 "parse-gram.c" |
1633 |
|
|
1634 |
yyvsp -= yylen; |
yyvsp -= yylen; |
1635 |
yyssp -= yylen; |
yyssp -= yylen; |
1636 |
yylsp -= yylen; |
yylsp -= yylen; |
1637 |
|
|
1638 |
#if YYDEBUG |
YY_STACK_PRINT (yyss, yyssp); |
|
if (yydebug) |
|
|
{ |
|
|
short *yyssp1 = yyss - 1; |
|
|
YYFPRINTF (stderr, "state stack now"); |
|
|
while (yyssp1 != yyssp) |
|
|
YYFPRINTF (stderr, " %d", *++yyssp1); |
|
|
YYFPRINTF (stderr, "\n"); |
|
|
} |
|
|
#endif |
|
1639 |
|
|
1640 |
*++yyvsp = yyval; |
*++yyvsp = yyval; |
1641 |
*++yylsp = yyloc; |
*++yylsp = yyloc; |
1712 |
#endif /* YYERROR_VERBOSE */ |
#endif /* YYERROR_VERBOSE */ |
1713 |
yyerror ("syntax error"); |
yyerror ("syntax error"); |
1714 |
} |
} |
|
goto yyerrlab1; |
|
|
|
|
1715 |
|
|
|
/*----------------------------------------------------. |
|
|
| yyerrlab1 -- error raised explicitly by an action. | |
|
|
`----------------------------------------------------*/ |
|
|
yyerrlab1: |
|
1716 |
if (yyerrstatus == 3) |
if (yyerrstatus == 3) |
1717 |
{ |
{ |
1718 |
/* If just tried and failed to reuse lookahead token after an |
/* If just tried and failed to reuse lookahead token after an |
1740 |
|
|
1741 |
/* Else will try to reuse lookahead token after shifting the error |
/* Else will try to reuse lookahead token after shifting the error |
1742 |
token. */ |
token. */ |
1743 |
|
goto yyerrlab1; |
1744 |
|
|
1745 |
|
|
1746 |
|
/*----------------------------------------------------. |
1747 |
|
| yyerrlab1 -- error raised explicitly by an action. | |
1748 |
|
`----------------------------------------------------*/ |
1749 |
|
yyerrlab1: |
1750 |
yyerrstatus = 3; /* Each real token shifted decrements this. */ |
yyerrstatus = 3; /* Each real token shifted decrements this. */ |
1751 |
|
|
1752 |
for (;;) |
for (;;) |
1772 |
yyvsp--; |
yyvsp--; |
1773 |
yystate = *--yyssp; |
yystate = *--yyssp; |
1774 |
yylsp--; |
yylsp--; |
1775 |
|
YY_STACK_PRINT (yyss, yyssp); |
|
#if YYDEBUG |
|
|
if (yydebug) |
|
|
{ |
|
|
short *yyssp1 = yyss - 1; |
|
|
YYFPRINTF (stderr, "Error: state stack now"); |
|
|
while (yyssp1 != yyssp) |
|
|
YYFPRINTF (stderr, " %d", *++yyssp1); |
|
|
YYFPRINTF (stderr, "\n"); |
|
|
} |
|
|
#endif |
|
1776 |
} |
} |
1777 |
|
|
1778 |
if (yyn == YYFINAL) |
if (yyn == YYFINAL) |
1820 |
} |
} |
1821 |
|
|
1822 |
|
|
1823 |
#line 447 "parse-gram.y" |
#line 415 "parse-gram.y" |
1824 |
|
|
1825 |
|
|
1826 |
|
|
1827 |
|
/* Return the location of the left-hand side of a rule whose |
1828 |
|
right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in |
1829 |
|
the right-hand side, and return an empty location equal to the end |
1830 |
|
boundary of RHS[0] if the right-hand side is empty. */ |
1831 |
|
|
1832 |
|
static YYLTYPE |
1833 |
|
lloc_default (YYLTYPE const *rhs, int n) |
1834 |
|
{ |
1835 |
|
int i; |
1836 |
|
int j; |
1837 |
|
YYLTYPE r; |
1838 |
|
r.start = r.end = rhs[n].end; |
1839 |
|
|
1840 |
|
for (i = 1; i <= n; i++) |
1841 |
|
if (! equal_boundaries (rhs[i].start, rhs[i].end)) |
1842 |
|
{ |
1843 |
|
r.start = rhs[i].start; |
1844 |
|
|
1845 |
|
for (j = n; i < j; j--) |
1846 |
|
if (! equal_boundaries (rhs[j].start, rhs[j].end)) |
1847 |
|
break; |
1848 |
|
r.end = rhs[j].end; |
1849 |
|
|
1850 |
|
break; |
1851 |
|
} |
1852 |
|
|
1853 |
|
return r; |
1854 |
|
} |
1855 |
|
|
1856 |
|
|
1857 |
|
/* Add a lex-param or a parse-param (depending on TYPE) with |
1858 |
|
declaration DECL and location LOC. */ |
1859 |
|
|
1860 |
|
static void |
1861 |
|
add_param (char const *type, char const *decl, location loc) |
1862 |
|
{ |
1863 |
|
static char const alphanum[] = |
1864 |
|
"0123456789" |
1865 |
|
"abcdefghijklmnopqrstuvwxyz" |
1866 |
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
1867 |
|
"_"; |
1868 |
|
char const *alpha = alphanum + 10; |
1869 |
|
char const *name_start = NULL; |
1870 |
|
char const *p; |
1871 |
|
|
1872 |
|
for (p = decl; *p; p++) |
1873 |
|
if ((p == decl || ! strchr (alphanum, p[-1])) && strchr (alpha, p[0])) |
1874 |
|
name_start = p; |
1875 |
|
|
1876 |
|
if (! name_start) |
1877 |
|
complain_at (loc, _("missing identifier in parameter declaration")); |
1878 |
|
else |
1879 |
|
{ |
1880 |
|
char *name; |
1881 |
|
size_t name_len; |
1882 |
|
|
1883 |
|
for (name_len = 1; |
1884 |
|
name_start[name_len] && strchr (alphanum, name_start[name_len]); |
1885 |
|
name_len++) |
1886 |
|
continue; |
1887 |
|
|
1888 |
|
name = xmalloc (name_len + 1); |
1889 |
|
memcpy (name, name_start, name_len); |
1890 |
|
name[name_len] = '\0'; |
1891 |
|
muscle_pair_list_grow (type, decl, name); |
1892 |
|
free (name); |
1893 |
|
} |
1894 |
|
|
1895 |
|
scanner_last_string_free (); |
1896 |
|
} |
1897 |
|
|
1898 |
/*------------------------------------------------------------------. |
/*------------------------------------------------------------------. |
1899 |
| When debugging the parser, display tokens' locations and values. | |
| When debugging the parser, display tokens' locations and values. | |
1900 |
`------------------------------------------------------------------*/ |
`------------------------------------------------------------------*/ |
1901 |
|
|
1902 |
static void |
static void |
1903 |
yyprint (FILE *file, |
print_token_value (FILE *file, int type, YYSTYPE const *value) |
|
int type, const yystype *value) |
|
1904 |
{ |
{ |
1905 |
fputc (' ', file); |
fputc (' ', file); |
1906 |
switch (type) |
switch (type) |
1914 |
break; |
break; |
1915 |
|
|
1916 |
case STRING: |
case STRING: |
1917 |
fprintf (file, " = \"%s\"", value->string); |
fprintf (file, " = \"%s\"", value->chars); |
1918 |
break; |
break; |
1919 |
|
|
1920 |
case TYPE: |
case TYPE: |
1921 |
fprintf (file, " = <%s>", value->struniq); |
fprintf (file, " = <%s>", value->uniqstr); |
1922 |
break; |
break; |
1923 |
|
|
1924 |
case BRACED_CODE: |
case BRACED_CODE: |
1925 |
case PROLOGUE: |
case PROLOGUE: |
1926 |
case EPILOGUE: |
case EPILOGUE: |
1927 |
fprintf (file, " = {{ %s }}", value->string); |
fprintf (file, " = {{ %s }}", value->chars); |
1928 |
break; |
break; |
1929 |
|
|
1930 |
default: |
default: |
1933 |
} |
} |
1934 |
} |
} |
1935 |
|
|
1936 |
void |
static void |
1937 |
gram_error (location_t *yylloc, const char *msg) |
gram_error (location const *loc, char const *msg) |
1938 |
{ |
{ |
1939 |
complain_at (*yylloc, "%s", msg); |
complain_at (*loc, "%s", msg); |
1940 |
} |
} |
1941 |
|
|