]> git.saurik.com Git - bison.git/blob - src/parse-gram.c
Set all front-end %define defaults in one place.
[bison.git] / src / parse-gram.c
1 /* A Bison parser, made by GNU Bison 2.4.307-8f0d-dirty. */
2
3 /* Implementation for Bison's Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
6 2007, 2008, 2009 Free Software Foundation, Inc.
7
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20
21 /* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
30
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
33
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
36
37 /* All symbols defined below should begin with yy or YY, to avoid
38 infringing on user name space. This should be done even for local
39 variables, as they might otherwise be expanded by user macros.
40 There are some unavoidable exceptions within include files to
41 define necessary library symbols; they are noted "INFRINGES ON
42 USER NAME SPACE" below. */
43
44 /* Identify Bison output. */
45 #define YYBISON 1
46
47 /* Bison version. */
48 #define YYBISON_VERSION "2.4.307-8f0d-dirty"
49
50 /* Skeleton name. */
51 #define YYSKELETON_NAME "yacc.c"
52
53 /* Pure parsers. */
54 #define YYPURE 1
55
56 /* Push parsers. */
57 #define YYPUSH 0
58
59 /* Pull parsers. */
60 #define YYPULL 1
61
62 /* Using locations. */
63 #define YYLSP_NEEDED 1
64
65 /* Substitute the variable and function names. */
66 #define yyparse gram_parse
67 #define yylex gram_lex
68 #define yyerror gram_error
69 #define yylval gram_lval
70 #define yychar gram_char
71 #define yydebug gram_debug
72 #define yynerrs gram_nerrs
73 #define yylloc gram_lloc
74
75 /* Copy the first part of user declarations. */
76 /* Line 191 of yacc.c */
77 #line 1 "parse-gram.y"
78 /* Bison Grammar Parser -*- C -*-
79
80 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
81 Foundation, Inc.
82
83 This file is part of Bison, the GNU Compiler Compiler.
84
85 This program is free software: you can redistribute it and/or modify
86 it under the terms of the GNU General Public License as published by
87 the Free Software Foundation, either version 3 of the License, or
88 (at your option) any later version.
89
90 This program is distributed in the hope that it will be useful,
91 but WITHOUT ANY WARRANTY; without even the implied warranty of
92 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
93 GNU General Public License for more details.
94
95 You should have received a copy of the GNU General Public License
96 along with this program. If not, see <http://www.gnu.org/licenses/>. */
97
98 #include <config.h>
99 #include "system.h"
100
101 #include "complain.h"
102 #include "conflicts.h"
103 #include "files.h"
104 #include "getargs.h"
105 #include "gram.h"
106 #include "muscle-tab.h"
107 #include "quotearg.h"
108 #include "reader.h"
109 #include "symlist.h"
110 #include "scan-gram.h"
111 #include "scan-code.h"
112
113 #define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
114 static YYLTYPE lloc_default (YYLTYPE const *, int);
115
116 #define YY_LOCATION_PRINT(File, Loc) \
117 location_print (File, Loc)
118
119 static void version_check (location const *loc, char const *version);
120
121 /* Request detailed syntax error messages, and pass them to GRAM_ERROR.
122 FIXME: depends on the undocumented availability of YYLLOC. */
123 #undef yyerror
124 #define yyerror(Msg) \
125 gram_error (&yylloc, Msg)
126 static void gram_error (location const *, char const *);
127
128 static char const *char_name (char);
129
130 /** Add a lex-param or a parse-param.
131 *
132 * \param type \a lex_param or \a parse_param
133 * \param decl the formal argument
134 * \param loc the location in the source.
135 */
136 static void add_param (char const *type, char *decl, location loc);
137
138
139 static symbol_class current_class = unknown_sym;
140 static uniqstr current_type = NULL;
141 static symbol *current_lhs;
142 static location current_lhs_location;
143 static int current_prec = 0;
144
145 #define YYTYPE_INT16 int_fast16_t
146 #define YYTYPE_INT8 int_fast8_t
147 #define YYTYPE_UINT16 uint_fast16_t
148 #define YYTYPE_UINT8 uint_fast8_t
149
150 /* Line 191 of yacc.c */
151 #line 152 "src/parse-gram.c"
152
153 /* Enabling traces. */
154 #ifndef YYDEBUG
155 # define YYDEBUG 1
156 #endif
157
158 /* Enabling verbose error messages. */
159 #ifdef YYERROR_VERBOSE
160 # undef YYERROR_VERBOSE
161 # define YYERROR_VERBOSE 1
162 #else
163 # define YYERROR_VERBOSE 1
164 #endif
165
166 /* Enabling the token table. */
167 #ifndef YYTOKEN_TABLE
168 # define YYTOKEN_TABLE 0
169 #endif
170
171
172 /* Tokens. */
173 #ifndef YYTOKENTYPE
174 # define YYTOKENTYPE
175 /* Put the tokens into the symbol table, so that GDB and other debuggers
176 know about them. */
177 enum yytokentype {
178 GRAM_EOF = 0,
179 STRING = 258,
180 INT = 259,
181 PERCENT_TOKEN = 260,
182 PERCENT_NTERM = 261,
183 PERCENT_TYPE = 262,
184 PERCENT_DESTRUCTOR = 263,
185 PERCENT_PRINTER = 264,
186 PERCENT_LEFT = 265,
187 PERCENT_RIGHT = 266,
188 PERCENT_NONASSOC = 267,
189 PERCENT_PRECEDENCE = 268,
190 PERCENT_PREC = 269,
191 PERCENT_DPREC = 270,
192 PERCENT_MERGE = 271,
193 PERCENT_CODE = 272,
194 PERCENT_DEFAULT_PREC = 273,
195 PERCENT_DEFINE = 274,
196 PERCENT_DEFINES = 275,
197 PERCENT_EXPECT = 276,
198 PERCENT_EXPECT_RR = 277,
199 PERCENT_FLAG = 278,
200 PERCENT_FILE_PREFIX = 279,
201 PERCENT_GLR_PARSER = 280,
202 PERCENT_INITIAL_ACTION = 281,
203 PERCENT_LANGUAGE = 282,
204 PERCENT_LEX_PARAM = 283,
205 PERCENT_NAME_PREFIX = 284,
206 PERCENT_NO_DEFAULT_PREC = 285,
207 PERCENT_NO_LINES = 286,
208 PERCENT_NONDETERMINISTIC_PARSER = 287,
209 PERCENT_OUTPUT = 288,
210 PERCENT_PARSE_PARAM = 289,
211 PERCENT_REQUIRE = 290,
212 PERCENT_SKELETON = 291,
213 PERCENT_START = 292,
214 PERCENT_TOKEN_TABLE = 293,
215 PERCENT_VERBOSE = 294,
216 PERCENT_YACC = 295,
217 BRACED_CODE = 296,
218 CHAR = 297,
219 EPILOGUE = 298,
220 EQUAL = 299,
221 ID = 300,
222 ID_COLON = 301,
223 PERCENT_PERCENT = 302,
224 PIPE = 303,
225 PROLOGUE = 304,
226 SEMICOLON = 305,
227 TAG = 306,
228 TAG_ANY = 307,
229 TAG_NONE = 308,
230 PERCENT_UNION = 309
231 };
232 #endif
233 /* Tokens. */
234 #define GRAM_EOF 0
235 #define STRING 258
236 #define INT 259
237 #define PERCENT_TOKEN 260
238 #define PERCENT_NTERM 261
239 #define PERCENT_TYPE 262
240 #define PERCENT_DESTRUCTOR 263
241 #define PERCENT_PRINTER 264
242 #define PERCENT_LEFT 265
243 #define PERCENT_RIGHT 266
244 #define PERCENT_NONASSOC 267
245 #define PERCENT_PRECEDENCE 268
246 #define PERCENT_PREC 269
247 #define PERCENT_DPREC 270
248 #define PERCENT_MERGE 271
249 #define PERCENT_CODE 272
250 #define PERCENT_DEFAULT_PREC 273
251 #define PERCENT_DEFINE 274
252 #define PERCENT_DEFINES 275
253 #define PERCENT_EXPECT 276
254 #define PERCENT_EXPECT_RR 277
255 #define PERCENT_FLAG 278
256 #define PERCENT_FILE_PREFIX 279
257 #define PERCENT_GLR_PARSER 280
258 #define PERCENT_INITIAL_ACTION 281
259 #define PERCENT_LANGUAGE 282
260 #define PERCENT_LEX_PARAM 283
261 #define PERCENT_NAME_PREFIX 284
262 #define PERCENT_NO_DEFAULT_PREC 285
263 #define PERCENT_NO_LINES 286
264 #define PERCENT_NONDETERMINISTIC_PARSER 287
265 #define PERCENT_OUTPUT 288
266 #define PERCENT_PARSE_PARAM 289
267 #define PERCENT_REQUIRE 290
268 #define PERCENT_SKELETON 291
269 #define PERCENT_START 292
270 #define PERCENT_TOKEN_TABLE 293
271 #define PERCENT_VERBOSE 294
272 #define PERCENT_YACC 295
273 #define BRACED_CODE 296
274 #define CHAR 297
275 #define EPILOGUE 298
276 #define EQUAL 299
277 #define ID 300
278 #define ID_COLON 301
279 #define PERCENT_PERCENT 302
280 #define PIPE 303
281 #define PROLOGUE 304
282 #define SEMICOLON 305
283 #define TAG 306
284 #define TAG_ANY 307
285 #define TAG_NONE 308
286 #define PERCENT_UNION 309
287
288
289
290
291 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
292 typedef union YYSTYPE
293 {
294 /* Line 224 of yacc.c */
295 #line 92 "parse-gram.y"
296
297 symbol *symbol;
298 symbol_list *list;
299 int integer;
300 char const *chars;
301 char *code;
302 assoc assoc;
303 uniqstr uniqstr;
304 unsigned char character;
305
306
307 /* Line 224 of yacc.c */
308 #line 309 "src/parse-gram.c"
309 } YYSTYPE;
310 # define YYSTYPE_IS_TRIVIAL 1
311 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
312 # define YYSTYPE_IS_DECLARED 1
313 #endif
314
315 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
316 typedef struct YYLTYPE
317 {
318 int first_line;
319 int first_column;
320 int last_line;
321 int last_column;
322 } YYLTYPE;
323 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
324 # define YYLTYPE_IS_DECLARED 1
325 # define YYLTYPE_IS_TRIVIAL 1
326 #endif
327
328
329 /* Copy the second part of user declarations. */
330
331 /* Line 266 of yacc.c */
332 #line 333 "src/parse-gram.c"
333
334 #ifdef short
335 # undef short
336 #endif
337
338 #ifdef YYTYPE_UINT8
339 typedef YYTYPE_UINT8 yytype_uint8;
340 #else
341 typedef unsigned char yytype_uint8;
342 #endif
343
344 #ifdef YYTYPE_INT8
345 typedef YYTYPE_INT8 yytype_int8;
346 #elif (defined __STDC__ || defined __C99__FUNC__ \
347 || defined __cplusplus || defined _MSC_VER)
348 typedef signed char yytype_int8;
349 #else
350 typedef short int yytype_int8;
351 #endif
352
353 #ifdef YYTYPE_UINT16
354 typedef YYTYPE_UINT16 yytype_uint16;
355 #else
356 typedef unsigned short int yytype_uint16;
357 #endif
358
359 #ifdef YYTYPE_INT16
360 typedef YYTYPE_INT16 yytype_int16;
361 #else
362 typedef short int yytype_int16;
363 #endif
364
365 #ifndef YYSIZE_T
366 # ifdef __SIZE_TYPE__
367 # define YYSIZE_T __SIZE_TYPE__
368 # elif defined size_t
369 # define YYSIZE_T size_t
370 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
371 || defined __cplusplus || defined _MSC_VER)
372 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
373 # define YYSIZE_T size_t
374 # else
375 # define YYSIZE_T unsigned int
376 # endif
377 #endif
378
379 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
380
381 #ifndef YY_
382 # if YYENABLE_NLS
383 # if ENABLE_NLS
384 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
385 # define YY_(msgid) dgettext ("bison-runtime", msgid)
386 # endif
387 # endif
388 # ifndef YY_
389 # define YY_(msgid) msgid
390 # endif
391 #endif
392
393 /* Suppress unused-variable warnings by "using" E. */
394 #if ! defined lint || defined __GNUC__
395 # define YYUSE(e) ((void) (e))
396 #else
397 # define YYUSE(e) /* empty */
398 #endif
399
400 /* Identity function, used to suppress warnings about constant conditions. */
401 #ifndef lint
402 # define YYID(n) (n)
403 #else
404 #if (defined __STDC__ || defined __C99__FUNC__ \
405 || defined __cplusplus || defined _MSC_VER)
406 static int
407 YYID (int yyi)
408 #else
409 static int
410 YYID (yyi)
411 int yyi;
412 #endif
413 {
414 return yyi;
415 }
416 #endif
417
418 #if ! defined yyoverflow || YYERROR_VERBOSE
419
420 /* The parser invokes alloca or malloc; define the necessary symbols. */
421
422 # ifdef YYSTACK_USE_ALLOCA
423 # if YYSTACK_USE_ALLOCA
424 # ifdef __GNUC__
425 # define YYSTACK_ALLOC __builtin_alloca
426 # elif defined __BUILTIN_VA_ARG_INCR
427 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
428 # elif defined _AIX
429 # define YYSTACK_ALLOC __alloca
430 # elif defined _MSC_VER
431 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
432 # define alloca _alloca
433 # else
434 # define YYSTACK_ALLOC alloca
435 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
436 || defined __cplusplus || defined _MSC_VER)
437 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
438 # ifndef _STDLIB_H
439 # define _STDLIB_H 1
440 # endif
441 # endif
442 # endif
443 # endif
444 # endif
445
446 # ifdef YYSTACK_ALLOC
447 /* Pacify GCC's `empty if-body' warning. */
448 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
449 # ifndef YYSTACK_ALLOC_MAXIMUM
450 /* The OS might guarantee only one guard page at the bottom of the stack,
451 and a page size can be as small as 4096 bytes. So we cannot safely
452 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
453 to allow for a few compiler-allocated temporary stack slots. */
454 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
455 # endif
456 # else
457 # define YYSTACK_ALLOC YYMALLOC
458 # define YYSTACK_FREE YYFREE
459 # ifndef YYSTACK_ALLOC_MAXIMUM
460 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
461 # endif
462 # if (defined __cplusplus && ! defined _STDLIB_H \
463 && ! ((defined YYMALLOC || defined malloc) \
464 && (defined YYFREE || defined free)))
465 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
466 # ifndef _STDLIB_H
467 # define _STDLIB_H 1
468 # endif
469 # endif
470 # ifndef YYMALLOC
471 # define YYMALLOC malloc
472 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
473 || defined __cplusplus || defined _MSC_VER)
474 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
475 # endif
476 # endif
477 # ifndef YYFREE
478 # define YYFREE free
479 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
480 || defined __cplusplus || defined _MSC_VER)
481 void free (void *); /* INFRINGES ON USER NAME SPACE */
482 # endif
483 # endif
484 # endif
485 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
486
487
488 #if (! defined yyoverflow \
489 && (! defined __cplusplus \
490 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
491 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
492
493 /* A type that is properly aligned for any stack member. */
494 union yyalloc
495 {
496 yytype_int16 yyss_alloc;
497 YYSTYPE yyvs_alloc;
498 YYLTYPE yyls_alloc;
499 };
500
501 /* The size of the maximum gap between one aligned stack and the next. */
502 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
503
504 /* The size of an array large to enough to hold all stacks, each with
505 N elements. */
506 # define YYSTACK_BYTES(N) \
507 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
508 + 2 * YYSTACK_GAP_MAXIMUM)
509
510 /* Copy COUNT objects from FROM to TO. The source and destination do
511 not overlap. */
512 # ifndef YYCOPY
513 # if defined __GNUC__ && 1 < __GNUC__
514 # define YYCOPY(To, From, Count) \
515 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
516 # else
517 # define YYCOPY(To, From, Count) \
518 do \
519 { \
520 YYSIZE_T yyi; \
521 for (yyi = 0; yyi < (Count); yyi++) \
522 (To)[yyi] = (From)[yyi]; \
523 } \
524 while (YYID (0))
525 # endif
526 # endif
527
528 /* Relocate STACK from its old location to the new one. The
529 local variables YYSIZE and YYSTACKSIZE give the old and new number of
530 elements in the stack, and YYPTR gives the new location of the
531 stack. Advance YYPTR to a properly aligned location for the next
532 stack. */
533 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
534 do \
535 { \
536 YYSIZE_T yynewbytes; \
537 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
538 Stack = &yyptr->Stack_alloc; \
539 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
540 yyptr += yynewbytes / sizeof (*yyptr); \
541 } \
542 while (YYID (0))
543
544 #endif
545
546 /* YYFINAL -- State number of the termination state. */
547 #define YYFINAL 3
548 /* YYLAST -- Last index in YYTABLE. */
549 #define YYLAST 186
550
551 /* YYNTOKENS -- Number of terminals. */
552 #define YYNTOKENS 55
553 /* YYNNTS -- Number of nonterminals. */
554 #define YYNNTS 33
555 /* YYNRULES -- Number of rules. */
556 #define YYNRULES 103
557 /* YYNSTATES -- Number of states. */
558 #define YYNSTATES 141
559
560 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
561 by yylex, with out-of-bounds checking. */
562 #define YYUNDEFTOK 2
563 #define YYMAXUTOK 309
564
565 #define YYTRANSLATE(YYX) \
566 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
567
568 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
569 as returned by yylex, without out-of-bounds checking. */
570 static const yytype_uint8 yytranslate[] =
571 {
572 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
573 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
574 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
575 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
576 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
577 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
578 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
579 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
580 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
598 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
599 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
600 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
601 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
602 45, 46, 47, 48, 49, 50, 51, 52, 53, 54
603 };
604
605 #if YYDEBUG
606 /* YYRLINEYYN -- Source line where rule number YYN was defined. */
607 static const yytype_uint16 yyrline[] =
608 {
609 0, 201, 201, 209, 211, 215, 216, 226, 230, 234,
610 235, 240, 241, 242, 243, 244, 249, 258, 259, 260,
611 261, 262, 263, 264, 265, 266, 267, 268, 292, 293,
612 294, 295, 299, 300, 301, 305, 312, 319, 323, 327,
613 334, 349, 350, 354, 366, 366, 371, 371, 376, 387,
614 402, 403, 404, 405, 409, 410, 415, 417, 422, 423,
615 428, 430, 435, 436, 440, 441, 442, 443, 448, 453,
616 458, 464, 470, 481, 482, 491, 492, 498, 499, 500,
617 507, 507, 511, 512, 513, 518, 519, 521, 523, 525,
618 527, 539, 540, 545, 546, 555, 575, 577, 586, 591,
619 592, 597, 604, 606
620 };
621 #endif
622
623 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
624 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
625 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
626 static const char *const yytname[] =
627 {
628 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
629 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",
630 "\"%printer\"", "\"%left\"", "\"%right\"", "\"%nonassoc\"",
631 "\"%precedence\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%code\"",
632 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%expect\"",
633 "\"%expect-rr\"", "\"%<flag>\"", "\"%file-prefix\"", "\"%glr-parser\"",
634 "\"%initial-action\"", "\"%language\"", "\"%lex-param\"",
635 "\"%name-prefix\"", "\"%no-default-prec\"", "\"%no-lines\"",
636 "\"%nondeterministic-parser\"", "\"%output\"", "\"%parse-param\"",
637 "\"%require\"", "\"%skeleton\"", "\"%start\"", "\"%token-table\"",
638 "\"%verbose\"", "\"%yacc\"", "\"{...}\"", "\"char\"", "\"epilogue\"",
639 "\"=\"", "\"identifier\"", "\"identifier:\"", "\"%%\"", "\"|\"",
640 "\"%{...%}\"", "\";\"", "\"<tag>\"", "\"<*>\"", "\"<>\"", "\"%union\"",
641 "$accept", "input", "prologue_declarations", "prologue_declaration",
642 "grammar_declaration", "union_name", "symbol_declaration", "$@1", "$@2",
643 "precedence_declaration", "precedence_declarator", "tag.opt",
644 "symbols.prec", "symbol.prec", "symbols.1", "generic_symlist",
645 "generic_symlist_item", "symbol_def", "symbol_defs.1", "grammar",
646 "rules_or_grammar_declaration", "rules", "$@3", "rhses.1", "rhs",
647 "variable", "content.opt", "braceless", "id", "id_colon", "symbol",
648 "string_as_id", "epilogue.opt", 0
649 };
650 #endif
651
652 # ifdef YYPRINT
653 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
654 (internal) symbol number NUM (which must be that of a token). */
655 static const yytype_uint16 yytoknum[] =
656 {
657 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
658 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
659 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
660 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
661 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
662 305, 306, 307, 308, 309
663 };
664 # endif
665
666 #define YYPACT_NINF -93
667
668 #define YYTABLE_NINF -103
669
670 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
671 STATE-NUM. */
672 static const yytype_int16 yypact[] =
673 {
674 -93, 9, 100, -93, -93, -93, -50, 21, 32, -93,
675 -93, -93, -93, -39, -93, 1, 56, 73, 74, -93,
676 10, -93, 38, 79, 43, 27, -93, -93, -93, 37,
677 44, 83, 84, 22, -93, -93, -93, 26, -93, -93,
678 45, -93, -93, -93, -93, 40, -37, -37, 22, 0,
679 0, -93, 47, -93, -93, -93, 86, -93, -93, -93,
680 -93, 89, -93, -93, -93, -93, 92, -93, 94, -93,
681 -93, -93, -93, -93, -93, -93, -93, -93, 48, -93,
682 50, 11, -93, -93, -93, -93, 47, -93, 22, -93,
683 -93, -37, 66, -37, 22, -93, -93, -93, -93, 0,
684 -93, -93, 0, -93, -93, -93, -93, -93, -93, -93,
685 -93, 58, -93, -93, -93, -93, 22, -93, 98, -93,
686 111, -93, -93, -93, -93, 18, 141, -93, -93, -93,
687 -93, -93, 22, 99, 64, -93, -93, 141, -93, -93,
688 -93
689 };
690
691 /* YYDEFACT[S] -- default reduction number in state S. Performed when
692 YYTABLE does not specify something else to do. Zero means the default
693 is an error. */
694 static const yytype_uint8 yydefact[] =
695 {
696 3, 0, 0, 1, 46, 44, 0, 0, 0, 50,
697 51, 52, 53, 0, 37, 0, 9, 0, 0, 7,
698 0, 15, 0, 0, 0, 0, 38, 21, 22, 0,
699 0, 0, 0, 0, 28, 29, 30, 0, 6, 31,
700 41, 4, 5, 33, 32, 54, 0, 0, 0, 0,
701 0, 95, 0, 39, 92, 91, 93, 10, 11, 12,
702 13, 0, 16, 17, 18, 19, 0, 23, 0, 25,
703 26, 27, 101, 97, 96, 99, 34, 100, 0, 98,
704 0, 0, 75, 77, 80, 42, 0, 55, 0, 68,
705 73, 47, 69, 45, 48, 60, 65, 66, 67, 35,
706 62, 64, 36, 40, 94, 8, 14, 20, 24, 79,
707 78, 0, 76, 2, 85, 43, 49, 56, 58, 74,
708 70, 71, 61, 63, 103, 81, 82, 57, 59, 72,
709 85, 84, 0, 0, 0, 87, 86, 83, 88, 89,
710 90
711 };
712
713 /* YYPGOTO[NTERM-NUM]. */
714 static const yytype_int8 yypgoto[] =
715 {
716 -93, -93, -93, -93, 114, -93, -93, -93, -93, -93,
717 -93, -93, -93, 25, -93, 93, -92, -17, 95, -93,
718 65, -93, -93, -93, 15, -93, -93, -26, 3, -93,
719 -33, -45, -93
720 };
721
722 /* YYDEFGOTO[NTERM-NUM]. */
723 static const yytype_int8 yydefgoto[] =
724 {
725 -1, 1, 2, 41, 80, 86, 43, 47, 46, 44,
726 45, 88, 116, 117, 94, 99, 100, 90, 91, 81,
727 82, 83, 114, 125, 126, 56, 105, 53, 75, 84,
728 101, 77, 113
729 };
730
731 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
732 positive, shift that token. If negative, reduce the rule which
733 number is the opposite. If zero, do what YYDEFACT says.
734 If YYTABLE_NINF, syntax error. */
735 static const yytype_int16 yytable[] =
736 {
737 76, 48, 51, 72, 54, 73, 52, 123, 74, 3,
738 123, -102, 78, 60, 89, 95, 4, 5, 6, 7,
739 8, 9, 10, 11, 12, 72, 103, 78, 13, 14,
740 65, 4, 5, 6, 7, 8, 9, 10, 11, 12,
741 67, 26, 73, 13, 14, 74, 55, 121, 33, 92,
742 92, 96, 97, 98, 61, 118, 26, 79, 111, 57,
743 115, 122, 49, 33, 73, 40, 130, 74, 131, 72,
744 120, 66, 79, 50, 119, 129, 119, 58, 59, 62,
745 40, 68, 63, 118, 64, 69, 70, 71, 51, 104,
746 85, 87, 106, 136, 92, 107, 92, 108, 109, 138,
747 110, 124, 128, 139, 136, 4, 5, 6, 7, 8,
748 9, 10, 11, 12, 72, 140, 42, 13, 14, 15,
749 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
750 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
751 36, 127, 93, 102, 72, 137, 112, 37, 0, 38,
752 39, 0, 0, 0, 40, 132, 133, 134, 0, 0,
753 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
754 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
755 0, 0, 135, 73, 0, 0, 74
756 };
757
758 static const yytype_int16 yycheck[] =
759 {
760 33, 51, 41, 3, 3, 42, 45, 99, 45, 0,
761 102, 0, 1, 3, 51, 48, 5, 6, 7, 8,
762 9, 10, 11, 12, 13, 3, 52, 1, 17, 18,
763 3, 5, 6, 7, 8, 9, 10, 11, 12, 13,
764 3, 30, 42, 17, 18, 45, 45, 92, 37, 46,
765 47, 51, 52, 53, 44, 88, 30, 46, 47, 3,
766 86, 94, 41, 37, 42, 54, 48, 45, 50, 3,
767 4, 44, 46, 41, 91, 120, 93, 4, 4, 41,
768 54, 44, 3, 116, 41, 41, 3, 3, 41, 3,
769 45, 51, 3, 126, 91, 3, 93, 3, 50, 132,
770 50, 43, 4, 4, 137, 5, 6, 7, 8, 9,
771 10, 11, 12, 13, 3, 51, 2, 17, 18, 19,
772 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
773 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
774 40, 116, 47, 50, 3, 130, 81, 47, -1, 49,
775 50, -1, -1, -1, 54, 14, 15, 16, -1, -1,
776 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
777 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
778 -1, -1, 41, 42, -1, -1, 45
779 };
780
781 /* STOS_[STATE-NUM] -- The (internal number of the) accessing
782 symbol of state STATE-NUM. */
783 static const yytype_uint8 yystos[] =
784 {
785 0, 56, 57, 0, 5, 6, 7, 8, 9, 10,
786 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
787 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
788 34, 35, 36, 37, 38, 39, 40, 47, 49, 50,
789 54, 58, 59, 61, 64, 65, 63, 62, 51, 41,
790 41, 41, 45, 82, 3, 45, 80, 3, 4, 4,
791 3, 44, 41, 3, 41, 3, 44, 3, 44, 41,
792 3, 3, 3, 42, 45, 83, 85, 86, 1, 46,
793 59, 74, 75, 76, 84, 45, 60, 51, 66, 51,
794 72, 73, 83, 73, 69, 85, 51, 52, 53, 70,
795 71, 85, 70, 82, 3, 81, 3, 3, 3, 50,
796 50, 47, 75, 87, 77, 82, 67, 68, 85, 72,
797 4, 86, 85, 71, 43, 78, 79, 68, 4, 86,
798 48, 50, 14, 15, 16, 41, 85, 79, 85, 4,
799 51
800 };
801
802 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
803 static const yytype_uint8 yyr1[] =
804 {
805 0, 55, 56, 57, 57, 58, 58, 58, 58, 58,
806 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
807 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
808 58, 58, 59, 59, 59, 59, 59, 59, 59, 59,
809 59, 60, 60, 59, 62, 61, 63, 61, 61, 64,
810 65, 65, 65, 65, 66, 66, 67, 67, 68, 68,
811 69, 69, 70, 70, 71, 71, 71, 71, 72, 72,
812 72, 72, 72, 73, 73, 74, 74, 75, 75, 75,
813 77, 76, 78, 78, 78, 79, 79, 79, 79, 79,
814 79, 80, 80, 81, 81, 82, 83, 83, 84, 85,
815 85, 86, 87, 87
816 };
817
818 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
819 static const yytype_uint8 yyr2[] =
820 {
821 0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
822 2, 2, 2, 2, 3, 1, 2, 2, 2, 2,
823 3, 1, 1, 2, 3, 2, 2, 2, 1, 1,
824 1, 1, 1, 1, 2, 3, 3, 1, 1, 2,
825 3, 0, 1, 3, 0, 3, 0, 3, 3, 3,
826 1, 1, 1, 1, 0, 1, 1, 2, 1, 2,
827 1, 2, 1, 2, 1, 1, 1, 1, 1, 1,
828 2, 2, 3, 1, 2, 1, 2, 1, 2, 2,
829 0, 3, 1, 3, 2, 0, 2, 2, 3, 3,
830 3, 1, 1, 0, 1, 1, 1, 1, 1, 1,
831 1, 1, 0, 2
832 };
833
834
835 #define yyerrok (yyerrstatus = 0)
836 #define yyclearin (yychar = YYEMPTY)
837 #define YYEMPTY (-2)
838 #define YYEOF 0
839
840 #define YYACCEPT goto yyacceptlab
841 #define YYABORT goto yyabortlab
842 #define YYERROR goto yyerrorlab
843
844
845 /* Like YYERROR except do call yyerror. This remains here temporarily
846 to ease the transition to the new meaning of YYERROR, for GCC.
847 Once GCC version 2 has supplanted version 1, this can go. */
848
849 #define YYFAIL goto yyerrlab
850
851 #define YYRECOVERING() (!!yyerrstatus)
852
853 #define YYBACKUP(Token, Value) \
854 do \
855 if (yychar == YYEMPTY && yylen == 1) \
856 { \
857 yychar = (Token); \
858 yylval = (Value); \
859 yytoken = YYTRANSLATE (yychar); \
860 YYPOPSTACK (1); \
861 goto yybackup; \
862 } \
863 else \
864 { \
865 yyerror (YY_("syntax error: cannot back up")); \
866 YYERROR; \
867 } \
868 while (YYID (0))
869
870
871 #define YYTERROR 1
872 #define YYERRCODE 256
873
874
875 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
876 If N is 0, then set CURRENT to the empty location which ends
877 the previous symbol: RHS[0] (always defined). */
878
879 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
880 #ifndef YYLLOC_DEFAULT
881 # define YYLLOC_DEFAULT(Current, Rhs, N) \
882 do \
883 if (YYID (N)) \
884 { \
885 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
886 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
887 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
888 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
889 } \
890 else \
891 { \
892 (Current).first_line = (Current).last_line = \
893 YYRHSLOC (Rhs, 0).last_line; \
894 (Current).first_column = (Current).last_column = \
895 YYRHSLOC (Rhs, 0).last_column; \
896 } \
897 while (YYID (0))
898 #endif
899
900
901 /* YY_LOCATION_PRINT -- Print the location on the stream.
902 This macro was not mandated originally: define only if we know
903 we won't break user code: when these are the locations we know. */
904
905 #ifndef YY_LOCATION_PRINT
906 # if YYLTYPE_IS_TRIVIAL
907 # define YY_LOCATION_PRINT(File, Loc) \
908 fprintf (File, "%d.%d-%d.%d", \
909 (Loc).first_line, (Loc).first_column, \
910 (Loc).last_line, (Loc).last_column)
911 # else
912 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
913 # endif
914 #endif
915
916
917 /* YYLEX -- calling `yylex' with the right arguments. */
918
919 #ifdef YYLEX_PARAM
920 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
921 #else
922 # define YYLEX yylex (&yylval, &yylloc)
923 #endif
924
925 /* Enable debugging if requested. */
926 #if YYDEBUG
927
928 # ifndef YYFPRINTF
929 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
930 # define YYFPRINTF fprintf
931 # endif
932
933 # define YYDPRINTF(Args) \
934 do { \
935 if (yydebug) \
936 YYFPRINTF Args; \
937 } while (YYID (0))
938
939 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
940 do { \
941 if (yydebug) \
942 { \
943 YYFPRINTF (stderr, "%s ", Title); \
944 yy_symbol_print (stderr, \
945 Type, Value, Location); \
946 YYFPRINTF (stderr, "\n"); \
947 } \
948 } while (YYID (0))
949
950
951 /*--------------------------------.
952 | Print this symbol on YYOUTPUT. |
953 `--------------------------------*/
954
955 /*ARGSUSED*/
956 #if (defined __STDC__ || defined __C99__FUNC__ \
957 || defined __cplusplus || defined _MSC_VER)
958 static void
959 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
960 #else
961 static void
962 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp)
963 FILE *yyoutput;
964 int yytype;
965 YYSTYPE const * const yyvaluep;
966 YYLTYPE const * const yylocationp;
967 #endif
968 {
969 if (!yyvaluep)
970 return;
971 YYUSE (yylocationp);
972 # ifdef YYPRINT
973 if (yytype < YYNTOKENS)
974 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
975 # else
976 YYUSE (yyoutput);
977 # endif
978 switch (yytype)
979 {
980 case 3: // "string"
981
982 /* Line 647 of yacc.c */
983 #line 178 "parse-gram.y"
984 { fputs (quotearg_style (c_quoting_style, ((*yyvaluep).chars)), stderr); }
985 /* Line 647 of yacc.c */
986 #line 987 "src/parse-gram.c"
987 break;
988
989 case 4: // "integer"
990
991 /* Line 647 of yacc.c */
992 #line 190 "parse-gram.y"
993 { fprintf (stderr, "%d", ((*yyvaluep).integer)); }
994 /* Line 647 of yacc.c */
995 #line 996 "src/parse-gram.c"
996 break;
997
998 case 23: // "%<flag>"
999
1000 /* Line 647 of yacc.c */
1001 #line 186 "parse-gram.y"
1002 { fprintf (stderr, "%%%s", ((*yyvaluep).uniqstr)); }
1003 /* Line 647 of yacc.c */
1004 #line 1005 "src/parse-gram.c"
1005 break;
1006
1007 case 41: // "{...}"
1008
1009 /* Line 647 of yacc.c */
1010 #line 180 "parse-gram.y"
1011 { fprintf (stderr, "{\n%s\n}", ((*yyvaluep).code)); }
1012 /* Line 647 of yacc.c */
1013 #line 1014 "src/parse-gram.c"
1014 break;
1015
1016 case 42: // "char"
1017
1018 /* Line 647 of yacc.c */
1019 #line 172 "parse-gram.y"
1020 { fputs (char_name (((*yyvaluep).character)), stderr); }
1021 /* Line 647 of yacc.c */
1022 #line 1023 "src/parse-gram.c"
1023 break;
1024
1025 case 43: // "epilogue"
1026
1027 /* Line 647 of yacc.c */
1028 #line 180 "parse-gram.y"
1029 { fprintf (stderr, "{\n%s\n}", ((*yyvaluep).chars)); }
1030 /* Line 647 of yacc.c */
1031 #line 1032 "src/parse-gram.c"
1032 break;
1033
1034 case 45: // "identifier"
1035
1036 /* Line 647 of yacc.c */
1037 #line 184 "parse-gram.y"
1038 { fputs (((*yyvaluep).uniqstr), stderr); }
1039 /* Line 647 of yacc.c */
1040 #line 1041 "src/parse-gram.c"
1041 break;
1042
1043 case 46: // "identifier:"
1044
1045 /* Line 647 of yacc.c */
1046 #line 185 "parse-gram.y"
1047 { fprintf (stderr, "%s:", ((*yyvaluep).uniqstr)); }
1048 /* Line 647 of yacc.c */
1049 #line 1050 "src/parse-gram.c"
1050 break;
1051
1052 case 49: // "%{...%}"
1053
1054 /* Line 647 of yacc.c */
1055 #line 180 "parse-gram.y"
1056 { fprintf (stderr, "{\n%s\n}", ((*yyvaluep).chars)); }
1057 /* Line 647 of yacc.c */
1058 #line 1059 "src/parse-gram.c"
1059 break;
1060
1061 case 51: // "<tag>"
1062
1063 /* Line 647 of yacc.c */
1064 #line 187 "parse-gram.y"
1065 { fprintf (stderr, "<%s>", ((*yyvaluep).uniqstr)); }
1066 /* Line 647 of yacc.c */
1067 #line 1068 "src/parse-gram.c"
1068 break;
1069
1070 case 80: // variable
1071
1072 /* Line 647 of yacc.c */
1073 #line 184 "parse-gram.y"
1074 { fputs (((*yyvaluep).uniqstr), stderr); }
1075 /* Line 647 of yacc.c */
1076 #line 1077 "src/parse-gram.c"
1077 break;
1078
1079 case 81: // content.opt
1080
1081 /* Line 647 of yacc.c */
1082 #line 180 "parse-gram.y"
1083 { fprintf (stderr, "{\n%s\n}", ((*yyvaluep).chars)); }
1084 /* Line 647 of yacc.c */
1085 #line 1086 "src/parse-gram.c"
1086 break;
1087
1088 case 82: // braceless
1089
1090 /* Line 647 of yacc.c */
1091 #line 180 "parse-gram.y"
1092 { fprintf (stderr, "{\n%s\n}", ((*yyvaluep).chars)); }
1093 /* Line 647 of yacc.c */
1094 #line 1095 "src/parse-gram.c"
1095 break;
1096
1097 case 83: // id
1098
1099 /* Line 647 of yacc.c */
1100 #line 193 "parse-gram.y"
1101 { fprintf (stderr, "%s", ((*yyvaluep).symbol)->tag); }
1102 /* Line 647 of yacc.c */
1103 #line 1104 "src/parse-gram.c"
1104 break;
1105
1106 case 84: // id_colon
1107
1108 /* Line 647 of yacc.c */
1109 #line 194 "parse-gram.y"
1110 { fprintf (stderr, "%s:", ((*yyvaluep).symbol)->tag); }
1111 /* Line 647 of yacc.c */
1112 #line 1113 "src/parse-gram.c"
1113 break;
1114
1115 case 85: // symbol
1116
1117 /* Line 647 of yacc.c */
1118 #line 193 "parse-gram.y"
1119 { fprintf (stderr, "%s", ((*yyvaluep).symbol)->tag); }
1120 /* Line 647 of yacc.c */
1121 #line 1122 "src/parse-gram.c"
1122 break;
1123
1124 case 86: // string_as_id
1125
1126 /* Line 647 of yacc.c */
1127 #line 193 "parse-gram.y"
1128 { fprintf (stderr, "%s", ((*yyvaluep).symbol)->tag); }
1129 /* Line 647 of yacc.c */
1130 #line 1131 "src/parse-gram.c"
1131 break;
1132
1133 default:
1134 break;
1135 }
1136 }
1137
1138
1139 /*--------------------------------.
1140 | Print this symbol on YYOUTPUT. |
1141 `--------------------------------*/
1142
1143 #if (defined __STDC__ || defined __C99__FUNC__ \
1144 || defined __cplusplus || defined _MSC_VER)
1145 static void
1146 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
1147 #else
1148 static void
1149 yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp)
1150 FILE *yyoutput;
1151 int yytype;
1152 YYSTYPE const * const yyvaluep;
1153 YYLTYPE const * const yylocationp;
1154 #endif
1155 {
1156 if (yytype < YYNTOKENS)
1157 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1158 else
1159 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1160
1161 YY_LOCATION_PRINT (yyoutput, *yylocationp);
1162 YYFPRINTF (yyoutput, ": ");
1163 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
1164 YYFPRINTF (yyoutput, ")");
1165 }
1166
1167 /*------------------------------------------------------------------.
1168 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1169 | TOP (included). |
1170 `------------------------------------------------------------------*/
1171
1172 #if (defined __STDC__ || defined __C99__FUNC__ \
1173 || defined __cplusplus || defined _MSC_VER)
1174 static void
1175 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1176 #else
1177 static void
1178 yy_stack_print (yybottom, yytop)
1179 yytype_int16 *yybottom;
1180 yytype_int16 *yytop;
1181 #endif
1182 {
1183 YYFPRINTF (stderr, "Stack now");
1184 for (; yybottom <= yytop; yybottom++)
1185 {
1186 int yybot = *yybottom;
1187 YYFPRINTF (stderr, " %d", yybot);
1188 }
1189 YYFPRINTF (stderr, "\n");
1190 }
1191
1192 # define YY_STACK_PRINT(Bottom, Top) \
1193 do { \
1194 if (yydebug) \
1195 yy_stack_print ((Bottom), (Top)); \
1196 } while (YYID (0))
1197
1198
1199 /*------------------------------------------------.
1200 | Report that the YYRULE is going to be reduced. |
1201 `------------------------------------------------*/
1202
1203 #if (defined __STDC__ || defined __C99__FUNC__ \
1204 || defined __cplusplus || defined _MSC_VER)
1205 static void
1206 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule)
1207 #else
1208 static void
1209 yy_reduce_print (yyssp, yyvsp, yylsp, yyrule)
1210 yytype_int16 *yyssp;
1211 YYSTYPE *yyvsp;
1212 YYLTYPE *yylsp;
1213 int yyrule;
1214 #endif
1215 {
1216 unsigned long int yylno = yyrline[yyrule];
1217 int yynrhs = yyr2[yyrule];
1218 int yyi;
1219 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1220 yyrule - 1, yylno);
1221 /* The symbols being reduced. */
1222 for (yyi = 0; yyi < yynrhs; yyi++)
1223 {
1224 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1225 yy_symbol_print (stderr,
1226 yystos[yyssp[yyi + 1 - yynrhs]],
1227 &(yyvsp[(yyi + 1) - (yynrhs)])
1228 , &(yylsp[(yyi + 1) - (yynrhs)]) );
1229 YYFPRINTF (stderr, "\n");
1230 }
1231 }
1232
1233 # define YY_REDUCE_PRINT(Rule) \
1234 do { \
1235 if (yydebug) \
1236 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
1237 } while (YYID (0))
1238
1239 /* Nonzero means print parse trace. It is left uninitialized so that
1240 multiple parsers can coexist. */
1241 int yydebug;
1242 #else /* !YYDEBUG */
1243 # define YYDPRINTF(Args)
1244 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1245 # define YY_STACK_PRINT(Bottom, Top)
1246 # define YY_REDUCE_PRINT(Rule)
1247 #endif /* !YYDEBUG */
1248
1249
1250 /* YYINITDEPTH -- initial size of the parser's stacks. */
1251 #ifndef YYINITDEPTH
1252 # define YYINITDEPTH 200
1253 #endif
1254
1255 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1256 if the built-in stack extension method is used).
1257
1258 Do not make this value too large; the results are undefined if
1259 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1260 evaluated with infinite-precision integer arithmetic. */
1261
1262 #ifndef YYMAXDEPTH
1263 # define YYMAXDEPTH 10000
1264 #endif
1265
1266 \f
1267
1268 #if YYERROR_VERBOSE
1269
1270 # ifndef yystrlen
1271 # if defined __GLIBC__ && defined _STRING_H
1272 # define yystrlen strlen
1273 # else
1274 /* Return the length of YYSTR. */
1275 #if (defined __STDC__ || defined __C99__FUNC__ \
1276 || defined __cplusplus || defined _MSC_VER)
1277 static YYSIZE_T
1278 yystrlen (const char *yystr)
1279 #else
1280 static YYSIZE_T
1281 yystrlen (yystr)
1282 const char *yystr;
1283 #endif
1284 {
1285 YYSIZE_T yylen;
1286 for (yylen = 0; yystr[yylen]; yylen++)
1287 continue;
1288 return yylen;
1289 }
1290 # endif
1291 # endif
1292
1293 # ifndef yystpcpy
1294 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1295 # define yystpcpy stpcpy
1296 # else
1297 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1298 YYDEST. */
1299 #if (defined __STDC__ || defined __C99__FUNC__ \
1300 || defined __cplusplus || defined _MSC_VER)
1301 static char *
1302 yystpcpy (char *yydest, const char *yysrc)
1303 #else
1304 static char *
1305 yystpcpy (yydest, yysrc)
1306 char *yydest;
1307 const char *yysrc;
1308 #endif
1309 {
1310 char *yyd = yydest;
1311 const char *yys = yysrc;
1312
1313 while ((*yyd++ = *yys++) != '\0')
1314 continue;
1315
1316 return yyd - 1;
1317 }
1318 # endif
1319 # endif
1320
1321 # ifndef yytnamerr
1322 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1323 quotes and backslashes, so that it's suitable for yyerror. The
1324 heuristic is that double-quoting is unnecessary unless the string
1325 contains an apostrophe, a comma, or backslash (other than
1326 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1327 null, do not copy; instead, return the length of what the result
1328 would have been. */
1329 static YYSIZE_T
1330 yytnamerr (char *yyres, const char *yystr)
1331 {
1332 if (*yystr == '"')
1333 {
1334 YYSIZE_T yyn = 0;
1335 char const *yyp = yystr;
1336
1337 for (;;)
1338 switch (*++yyp)
1339 {
1340 case '\'':
1341 case ',':
1342 goto do_not_strip_quotes;
1343
1344 case '\\':
1345 if (*++yyp != '\\')
1346 goto do_not_strip_quotes;
1347 /* Fall through. */
1348 default:
1349 if (yyres)
1350 yyres[yyn] = *yyp;
1351 yyn++;
1352 break;
1353
1354 case '"':
1355 if (yyres)
1356 yyres[yyn] = '\0';
1357 return yyn;
1358 }
1359 do_not_strip_quotes: ;
1360 }
1361
1362 if (! yyres)
1363 return yystrlen (yystr);
1364
1365 return yystpcpy (yyres, yystr) - yyres;
1366 }
1367 # endif
1368
1369 /* Copy into YYRESULT an error message about the unexpected token
1370 YYTOKEN while in state YYSTATE. Return the number of bytes copied,
1371 including the terminating null byte. If YYRESULT is null, do not
1372 copy anything; just return the number of bytes that would be
1373 copied. As a special case, return 0 if an ordinary "syntax error"
1374 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1375 size calculation. */
1376 static YYSIZE_T
1377 yysyntax_error (char *yyresult, int yystate, int yytoken)
1378 {
1379 int yyn = yypact[yystate];
1380
1381 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1382 return 0;
1383 else
1384 {
1385 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
1386 YYSIZE_T yysize = yysize0;
1387 YYSIZE_T yysize1;
1388 int yysize_overflow = 0;
1389 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1390 /* Internationalized format string. */
1391 const char *yyformat = 0;
1392 /* Arguments of yyformat. */
1393 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1394
1395 /* Start YYX at -YYN if negative to avoid negative indexes in
1396 YYCHECK. */
1397 int yyxbegin = yyn < 0 ? -yyn : 0;
1398
1399 /* Stay within bounds of both yycheck and yytname. */
1400 int yychecklim = YYLAST - yyn + 1;
1401 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1402 /* Number of reported tokens (one for the "unexpected", one per
1403 "expected"). */
1404 int yycount = 0;
1405 int yyx;
1406
1407 yyarg[yycount++] = yytname[yytoken];
1408
1409 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1410 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1411 {
1412 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1413 {
1414 yycount = 1;
1415 yysize = yysize0;
1416 break;
1417 }
1418 yyarg[yycount++] = yytname[yyx];
1419 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1420 yysize_overflow |= (yysize1 < yysize);
1421 yysize = yysize1;
1422 }
1423
1424 switch (yycount)
1425 {
1426 #define YYCASE_(N, S) \
1427 case N: \
1428 yyformat = S; \
1429 break
1430 YYCASE_(1, YY_("syntax error, unexpected %s"));
1431 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1432 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1433 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1434 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1435 #undef YYCASE_
1436 }
1437
1438 yysize1 = yysize + yystrlen (yyformat);
1439 yysize_overflow |= (yysize1 < yysize);
1440 yysize = yysize1;
1441
1442 if (yysize_overflow)
1443 return YYSIZE_MAXIMUM;
1444
1445 if (yyresult)
1446 {
1447 /* Avoid sprintf, as that infringes on the user's name space.
1448 Don't have undefined behavior even if the translation
1449 produced a string with the wrong number of "%s"s. */
1450 char *yyp = yyresult;
1451 int yyi = 0;
1452 while ((*yyp = *yyformat) != '\0')
1453 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1454 {
1455 yyp += yytnamerr (yyp, yyarg[yyi++]);
1456 yyformat += 2;
1457 }
1458 else
1459 {
1460 yyp++;
1461 yyformat++;
1462 }
1463 }
1464 return yysize;
1465 }
1466 }
1467 #endif /* YYERROR_VERBOSE */
1468 \f
1469
1470 /*-----------------------------------------------.
1471 | Release the memory associated to this symbol. |
1472 `-----------------------------------------------*/
1473
1474 /*ARGSUSED*/
1475 #if (defined __STDC__ || defined __C99__FUNC__ \
1476 || defined __cplusplus || defined _MSC_VER)
1477 static void
1478 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
1479 #else
1480 static void
1481 yydestruct (yymsg, yytype, yyvaluep, yylocationp)
1482 const char *yymsg;
1483 int yytype;
1484 YYSTYPE *yyvaluep;
1485 YYLTYPE *yylocationp;
1486 #endif
1487 {
1488 YYUSE (yyvaluep);
1489 YYUSE (yylocationp);
1490
1491 if (!yymsg)
1492 yymsg = "Deleting";
1493 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1494
1495 switch (yytype)
1496 {
1497 default:
1498 break;
1499 }
1500 }
1501
1502 /* Prevent warnings from -Wmissing-prototypes. */
1503 #ifdef YYPARSE_PARAM
1504 #if (defined __STDC__ || defined __C99__FUNC__ \
1505 || defined __cplusplus || defined _MSC_VER)
1506 int yyparse (void *YYPARSE_PARAM);
1507 #else
1508 int yyparse ();
1509 #endif
1510 #else /* ! YYPARSE_PARAM */
1511 #if (defined __STDC__ || defined __C99__FUNC__ \
1512 || defined __cplusplus || defined _MSC_VER)
1513 int yyparse (void);
1514 #else
1515 int yyparse ();
1516 #endif
1517 #endif /* ! YYPARSE_PARAM */
1518
1519
1520
1521
1522
1523 /*-------------------------.
1524 | yyparse or yypush_parse. |
1525 `-------------------------*/
1526
1527 #ifdef YYPARSE_PARAM
1528 #if (defined __STDC__ || defined __C99__FUNC__ \
1529 || defined __cplusplus || defined _MSC_VER)
1530 int
1531 yyparse (void *YYPARSE_PARAM)
1532 #else
1533 int
1534 yyparse (YYPARSE_PARAM)
1535 void *YYPARSE_PARAM;
1536 #endif
1537 #else /* ! YYPARSE_PARAM */
1538 #if (defined __STDC__ || defined __C99__FUNC__ \
1539 || defined __cplusplus || defined _MSC_VER)
1540 int
1541 yyparse (void)
1542 #else
1543 int
1544 yyparse ()
1545
1546 #endif
1547 #endif
1548 {
1549 /* The lookahead symbol. */
1550 int yychar;
1551
1552 /* The semantic value of the lookahead symbol. */
1553 YYSTYPE yylval;
1554
1555 /* Location data for the lookahead symbol. */
1556 YYLTYPE yylloc;
1557
1558 /* Number of syntax errors so far. */
1559 int yynerrs;
1560
1561 int yystate;
1562 /* Number of tokens to shift before error messages enabled. */
1563 int yyerrstatus;
1564
1565 /* The stacks and their tools:
1566 `yyss': related to states.
1567 `yyvs': related to semantic values.
1568 `yyls': related to locations.
1569
1570 Refer to the stacks thru separate pointers, to allow yyoverflow
1571 to reallocate them elsewhere. */
1572
1573 /* The state stack. */
1574 yytype_int16 yyssa[YYINITDEPTH];
1575 yytype_int16 *yyss;
1576 yytype_int16 *yyssp;
1577
1578 /* The semantic value stack. */
1579 YYSTYPE yyvsa[YYINITDEPTH];
1580 YYSTYPE *yyvs;
1581 YYSTYPE *yyvsp;
1582
1583 /* The location stack. */
1584 YYLTYPE yylsa[YYINITDEPTH];
1585 YYLTYPE *yyls;
1586 YYLTYPE *yylsp;
1587
1588 /* The locations where the error started and ended. */
1589 YYLTYPE yyerror_range[2];
1590
1591 YYSIZE_T yystacksize;
1592
1593 int yyn;
1594 int yyresult;
1595 /* Lookahead token as an internal (translated) token number. */
1596 int yytoken;
1597 /* The variables used to return semantic value and location from the
1598 action routines. */
1599 YYSTYPE yyval;
1600 YYLTYPE yyloc;
1601
1602 #if YYERROR_VERBOSE
1603 /* Buffer for error messages, and its allocated size. */
1604 char yymsgbuf[128];
1605 char *yymsg = yymsgbuf;
1606 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1607 #endif
1608
1609 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1610
1611 /* The number of symbols on the RHS of the reduced rule.
1612 Keep to zero when no symbol should be popped. */
1613 int yylen = 0;
1614
1615 yytoken = 0;
1616 yyss = yyssa;
1617 yyvs = yyvsa;
1618 yyls = yylsa;
1619 yystacksize = YYINITDEPTH;
1620
1621 YYDPRINTF ((stderr, "Starting parse\n"));
1622
1623 yystate = 0;
1624 yyerrstatus = 0;
1625 yynerrs = 0;
1626 yychar = YYEMPTY; /* Cause a token to be read. */
1627
1628 /* Initialize stack pointers.
1629 Waste one element of value and location stack
1630 so that they stay on the same level as the state stack.
1631 The wasted elements are never initialized. */
1632 yyssp = yyss;
1633 yyvsp = yyvs;
1634 yylsp = yyls;
1635
1636 #if YYLTYPE_IS_TRIVIAL
1637 /* Initialize the default location before parsing starts. */
1638 yylloc.first_line = yylloc.last_line = 1;
1639 yylloc.first_column = yylloc.last_column = 1;
1640 #endif
1641
1642 /* User initialization code. */
1643 /* Line 1173 of yacc.c */
1644 #line 84 "parse-gram.y"
1645 {
1646 /* Bison's grammar can initial empty locations, hence a default
1647 location is needed. */
1648 boundary_set (&yylloc.start, current_file, 1, 1);
1649 boundary_set (&yylloc.end, current_file, 1, 1);
1650 }
1651 /* Line 1173 of yacc.c */
1652 #line 1653 "src/parse-gram.c"
1653 yylsp[0] = yylloc;
1654
1655 goto yysetstate;
1656
1657 /*------------------------------------------------------------.
1658 | yynewstate -- Push a new state, which is found in yystate. |
1659 `------------------------------------------------------------*/
1660 yynewstate:
1661 /* In all cases, when you get here, the value and location stacks
1662 have just been pushed. So pushing a state here evens the stacks. */
1663 yyssp++;
1664
1665 yysetstate:
1666 *yyssp = yystate;
1667
1668 if (yyss + yystacksize - 1 <= yyssp)
1669 {
1670 /* Get the current used size of the three stacks, in elements. */
1671 YYSIZE_T yysize = yyssp - yyss + 1;
1672
1673 #ifdef yyoverflow
1674 {
1675 /* Give user a chance to reallocate the stack. Use copies of
1676 these so that the &'s don't force the real ones into
1677 memory. */
1678 YYSTYPE *yyvs1 = yyvs;
1679 yytype_int16 *yyss1 = yyss;
1680 YYLTYPE *yyls1 = yyls;
1681
1682 /* Each stack pointer address is followed by the size of the
1683 data in use in that stack, in bytes. This used to be a
1684 conditional around just the two extra args, but that might
1685 be undefined if yyoverflow is a macro. */
1686 yyoverflow (YY_("memory exhausted"),
1687 &yyss1, yysize * sizeof (*yyssp),
1688 &yyvs1, yysize * sizeof (*yyvsp),
1689 &yyls1, yysize * sizeof (*yylsp),
1690 &yystacksize);
1691
1692 yyls = yyls1;
1693 yyss = yyss1;
1694 yyvs = yyvs1;
1695 }
1696 #else /* no yyoverflow */
1697 # ifndef YYSTACK_RELOCATE
1698 goto yyexhaustedlab;
1699 # else
1700 /* Extend the stack our own way. */
1701 if (YYMAXDEPTH <= yystacksize)
1702 goto yyexhaustedlab;
1703 yystacksize *= 2;
1704 if (YYMAXDEPTH < yystacksize)
1705 yystacksize = YYMAXDEPTH;
1706
1707 {
1708 yytype_int16 *yyss1 = yyss;
1709 union yyalloc *yyptr =
1710 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1711 if (! yyptr)
1712 goto yyexhaustedlab;
1713 YYSTACK_RELOCATE (yyss_alloc, yyss);
1714 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1715 YYSTACK_RELOCATE (yyls_alloc, yyls);
1716 # undef YYSTACK_RELOCATE
1717 if (yyss1 != yyssa)
1718 YYSTACK_FREE (yyss1);
1719 }
1720 # endif
1721 #endif /* no yyoverflow */
1722
1723 yyssp = yyss + yysize - 1;
1724 yyvsp = yyvs + yysize - 1;
1725 yylsp = yyls + yysize - 1;
1726
1727 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1728 (unsigned long int) yystacksize));
1729
1730 if (yyss + yystacksize - 1 <= yyssp)
1731 YYABORT;
1732 }
1733
1734 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1735
1736 if (yystate == YYFINAL)
1737 YYACCEPT;
1738
1739 goto yybackup;
1740
1741 /*-----------.
1742 | yybackup. |
1743 `-----------*/
1744 yybackup:
1745
1746 /* Do appropriate processing given the current state. Read a
1747 lookahead token if we need one and don't already have one. */
1748
1749 /* First try to decide what to do without reference to lookahead token. */
1750 yyn = yypact[yystate];
1751 if (yyn == YYPACT_NINF)
1752 goto yydefault;
1753
1754 /* Not known => get a lookahead token if don't already have one. */
1755
1756 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1757 if (yychar == YYEMPTY)
1758 {
1759 YYDPRINTF ((stderr, "Reading a token: "));
1760 yychar = YYLEX;
1761 }
1762
1763 if (yychar <= YYEOF)
1764 {
1765 yychar = yytoken = YYEOF;
1766 YYDPRINTF ((stderr, "Now at end of input.\n"));
1767 }
1768 else
1769 {
1770 yytoken = YYTRANSLATE (yychar);
1771 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1772 }
1773
1774 /* If the proper action on seeing token YYTOKEN is to reduce or to
1775 detect an error, take that action. */
1776 yyn += yytoken;
1777 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1778 goto yydefault;
1779 yyn = yytable[yyn];
1780 if (yyn <= 0)
1781 {
1782 if (yyn == 0 || yyn == YYTABLE_NINF)
1783 goto yyerrlab;
1784 yyn = -yyn;
1785 goto yyreduce;
1786 }
1787
1788 /* Count tokens shifted since error; after three, turn off error
1789 status. */
1790 if (yyerrstatus)
1791 yyerrstatus--;
1792
1793 /* Shift the lookahead token. */
1794 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1795
1796 /* Discard the shifted token. */
1797 yychar = YYEMPTY;
1798
1799 yystate = yyn;
1800 *++yyvsp = yylval;
1801 *++yylsp = yylloc;
1802 goto yynewstate;
1803
1804
1805 /*-----------------------------------------------------------.
1806 | yydefault -- do the default action for the current state. |
1807 `-----------------------------------------------------------*/
1808 yydefault:
1809 yyn = yydefact[yystate];
1810 if (yyn == 0)
1811 goto yyerrlab;
1812 goto yyreduce;
1813
1814
1815 /*-----------------------------.
1816 | yyreduce -- Do a reduction. |
1817 `-----------------------------*/
1818 yyreduce:
1819 /* yyn is the number of a rule to reduce with. */
1820 yylen = yyr2[yyn];
1821
1822 /* If YYLEN is nonzero, implement the default value of the action:
1823 `$$ = $1'.
1824
1825 Otherwise, the following line sets YYVAL to garbage.
1826 This behavior is undocumented and Bison
1827 users should not rely upon it. Assigning to YYVAL
1828 unconditionally makes the parser a bit smaller, and it avoids a
1829 GCC warning that YYVAL may be used uninitialized. */
1830 yyval = yyvsp[1-yylen];
1831
1832 /* Default location. */
1833 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1834 YY_REDUCE_PRINT (yyn);
1835 switch (yyn)
1836 {
1837 case 6:
1838 /* Line 1380 of yacc.c */
1839 #line 217 "parse-gram.y"
1840 {
1841 code_props plain_code;
1842 code_props_plain_init (&plain_code, (yyvsp[0].chars), (yylsp[0]));
1843 code_props_translate_code (&plain_code);
1844 gram_scanner_last_string_free ();
1845 muscle_code_grow (union_seen ? "post_prologue" : "pre_prologue",
1846 plain_code.code, (yylsp[0]));
1847 code_scanner_last_string_free ();
1848 }
1849 /* Line 1380 of yacc.c */
1850 #line 1851 "src/parse-gram.c"
1851 break;
1852
1853 case 7:
1854 /* Line 1380 of yacc.c */
1855 #line 227 "parse-gram.y"
1856 {
1857 muscle_percent_define_ensure ((yyvsp[0].uniqstr), (yylsp[0]), true);
1858 }
1859 /* Line 1380 of yacc.c */
1860 #line 1861 "src/parse-gram.c"
1861 break;
1862
1863 case 8:
1864 /* Line 1380 of yacc.c */
1865 #line 231 "parse-gram.y"
1866 {
1867 muscle_percent_define_insert ((yyvsp[-1].uniqstr), (yylsp[-1]), (yyvsp[0].chars));
1868 }
1869 /* Line 1380 of yacc.c */
1870 #line 1871 "src/parse-gram.c"
1871 break;
1872
1873 case 9:
1874 /* Line 1380 of yacc.c */
1875 #line 234 "parse-gram.y"
1876 { defines_flag = true; }
1877 /* Line 1380 of yacc.c */
1878 #line 1879 "src/parse-gram.c"
1879 break;
1880
1881 case 10:
1882 /* Line 1380 of yacc.c */
1883 #line 236 "parse-gram.y"
1884 {
1885 defines_flag = true;
1886 spec_defines_file = xstrdup ((yyvsp[0].chars));
1887 }
1888 /* Line 1380 of yacc.c */
1889 #line 1890 "src/parse-gram.c"
1890 break;
1891
1892 case 11:
1893 /* Line 1380 of yacc.c */
1894 #line 240 "parse-gram.y"
1895 { expected_sr_conflicts = (yyvsp[0].integer); }
1896 /* Line 1380 of yacc.c */
1897 #line 1898 "src/parse-gram.c"
1898 break;
1899
1900 case 12:
1901 /* Line 1380 of yacc.c */
1902 #line 241 "parse-gram.y"
1903 { expected_rr_conflicts = (yyvsp[0].integer); }
1904 /* Line 1380 of yacc.c */
1905 #line 1906 "src/parse-gram.c"
1906 break;
1907
1908 case 13:
1909 /* Line 1380 of yacc.c */
1910 #line 242 "parse-gram.y"
1911 { spec_file_prefix = (yyvsp[0].chars); }
1912 /* Line 1380 of yacc.c */
1913 #line 1914 "src/parse-gram.c"
1914 break;
1915
1916 case 14:
1917 /* Line 1380 of yacc.c */
1918 #line 243 "parse-gram.y"
1919 { spec_file_prefix = (yyvsp[0].chars); }
1920 /* Line 1380 of yacc.c */
1921 #line 1922 "src/parse-gram.c"
1922 break;
1923
1924 case 15:
1925 /* Line 1380 of yacc.c */
1926 #line 245 "parse-gram.y"
1927 {
1928 nondeterministic_parser = true;
1929 glr_parser = true;
1930 }
1931 /* Line 1380 of yacc.c */
1932 #line 1933 "src/parse-gram.c"
1933 break;
1934
1935 case 16:
1936 /* Line 1380 of yacc.c */
1937 #line 250 "parse-gram.y"
1938 {
1939 code_props action;
1940 code_props_symbol_action_init (&action, (yyvsp[0].code), (yylsp[0]));
1941 code_props_translate_code (&action);
1942 gram_scanner_last_string_free ();
1943 muscle_code_grow ("initial_action", action.code, (yylsp[0]));
1944 code_scanner_last_string_free ();
1945 }
1946 /* Line 1380 of yacc.c */
1947 #line 1948 "src/parse-gram.c"
1948 break;
1949
1950 case 17:
1951 /* Line 1380 of yacc.c */
1952 #line 258 "parse-gram.y"
1953 { language_argmatch ((yyvsp[0].chars), grammar_prio, (yylsp[-1])); }
1954 /* Line 1380 of yacc.c */
1955 #line 1956 "src/parse-gram.c"
1956 break;
1957
1958 case 18:
1959 /* Line 1380 of yacc.c */
1960 #line 259 "parse-gram.y"
1961 { add_param ("lex_param", (yyvsp[0].code), (yylsp[0])); }
1962 /* Line 1380 of yacc.c */
1963 #line 1964 "src/parse-gram.c"
1964 break;
1965
1966 case 19:
1967 /* Line 1380 of yacc.c */
1968 #line 260 "parse-gram.y"
1969 { spec_name_prefix = (yyvsp[0].chars); }
1970 /* Line 1380 of yacc.c */
1971 #line 1972 "src/parse-gram.c"
1972 break;
1973
1974 case 20:
1975 /* Line 1380 of yacc.c */
1976 #line 261 "parse-gram.y"
1977 { spec_name_prefix = (yyvsp[0].chars); }
1978 /* Line 1380 of yacc.c */
1979 #line 1980 "src/parse-gram.c"
1980 break;
1981
1982 case 21:
1983 /* Line 1380 of yacc.c */
1984 #line 262 "parse-gram.y"
1985 { no_lines_flag = true; }
1986 /* Line 1380 of yacc.c */
1987 #line 1988 "src/parse-gram.c"
1988 break;
1989
1990 case 22:
1991 /* Line 1380 of yacc.c */
1992 #line 263 "parse-gram.y"
1993 { nondeterministic_parser = true; }
1994 /* Line 1380 of yacc.c */
1995 #line 1996 "src/parse-gram.c"
1996 break;
1997
1998 case 23:
1999 /* Line 1380 of yacc.c */
2000 #line 264 "parse-gram.y"
2001 { spec_outfile = (yyvsp[0].chars); }
2002 /* Line 1380 of yacc.c */
2003 #line 2004 "src/parse-gram.c"
2004 break;
2005
2006 case 24:
2007 /* Line 1380 of yacc.c */
2008 #line 265 "parse-gram.y"
2009 { spec_outfile = (yyvsp[0].chars); }
2010 /* Line 1380 of yacc.c */
2011 #line 2012 "src/parse-gram.c"
2012 break;
2013
2014 case 25:
2015 /* Line 1380 of yacc.c */
2016 #line 266 "parse-gram.y"
2017 { add_param ("parse_param", (yyvsp[0].code), (yylsp[0])); }
2018 /* Line 1380 of yacc.c */
2019 #line 2020 "src/parse-gram.c"
2020 break;
2021
2022 case 26:
2023 /* Line 1380 of yacc.c */
2024 #line 267 "parse-gram.y"
2025 { version_check (&(yylsp[0]), (yyvsp[0].chars)); }
2026 /* Line 1380 of yacc.c */
2027 #line 2028 "src/parse-gram.c"
2028 break;
2029
2030 case 27:
2031 /* Line 1380 of yacc.c */
2032 #line 269 "parse-gram.y"
2033 {
2034 char const *skeleton_user = (yyvsp[0].chars);
2035 if (strchr (skeleton_user, '/'))
2036 {
2037 size_t dir_length = strlen (current_file);
2038 char *skeleton_build;
2039 while (dir_length && current_file[dir_length - 1] != '/')
2040 --dir_length;
2041 while (dir_length && current_file[dir_length - 1] == '/')
2042 --dir_length;
2043 skeleton_build =
2044 xmalloc (dir_length + 1 + strlen (skeleton_user) + 1);
2045 if (dir_length > 0)
2046 {
2047 strncpy (skeleton_build, current_file, dir_length);
2048 skeleton_build[dir_length++] = '/';
2049 }
2050 strcpy (skeleton_build + dir_length, skeleton_user);
2051 skeleton_user = uniqstr_new (skeleton_build);
2052 free (skeleton_build);
2053 }
2054 skeleton_arg (skeleton_user, grammar_prio, (yylsp[-1]));
2055 }
2056 /* Line 1380 of yacc.c */
2057 #line 2058 "src/parse-gram.c"
2058 break;
2059
2060 case 28:
2061 /* Line 1380 of yacc.c */
2062 #line 292 "parse-gram.y"
2063 { token_table_flag = true; }
2064 /* Line 1380 of yacc.c */
2065 #line 2066 "src/parse-gram.c"
2066 break;
2067
2068 case 29:
2069 /* Line 1380 of yacc.c */
2070 #line 293 "parse-gram.y"
2071 { report_flag |= report_states; }
2072 /* Line 1380 of yacc.c */
2073 #line 2074 "src/parse-gram.c"
2074 break;
2075
2076 case 30:
2077 /* Line 1380 of yacc.c */
2078 #line 294 "parse-gram.y"
2079 { yacc_flag = true; }
2080 /* Line 1380 of yacc.c */
2081 #line 2082 "src/parse-gram.c"
2082 break;
2083
2084 case 34:
2085 /* Line 1380 of yacc.c */
2086 #line 302 "parse-gram.y"
2087 {
2088 grammar_start_symbol_set ((yyvsp[0].symbol), (yylsp[0]));
2089 }
2090 /* Line 1380 of yacc.c */
2091 #line 2092 "src/parse-gram.c"
2092 break;
2093
2094 case 35:
2095 /* Line 1380 of yacc.c */
2096 #line 306 "parse-gram.y"
2097 {
2098 symbol_list *list;
2099 for (list = (yyvsp[0].list); list; list = list->next)
2100 symbol_list_destructor_set (list, (yyvsp[-1].code), (yylsp[-1]));
2101 symbol_list_free ((yyvsp[0].list));
2102 }
2103 /* Line 1380 of yacc.c */
2104 #line 2105 "src/parse-gram.c"
2105 break;
2106
2107 case 36:
2108 /* Line 1380 of yacc.c */
2109 #line 313 "parse-gram.y"
2110 {
2111 symbol_list *list;
2112 for (list = (yyvsp[0].list); list; list = list->next)
2113 symbol_list_printer_set (list, (yyvsp[-1].code), (yylsp[-1]));
2114 symbol_list_free ((yyvsp[0].list));
2115 }
2116 /* Line 1380 of yacc.c */
2117 #line 2118 "src/parse-gram.c"
2118 break;
2119
2120 case 37:
2121 /* Line 1380 of yacc.c */
2122 #line 320 "parse-gram.y"
2123 {
2124 default_prec = true;
2125 }
2126 /* Line 1380 of yacc.c */
2127 #line 2128 "src/parse-gram.c"
2128 break;
2129
2130 case 38:
2131 /* Line 1380 of yacc.c */
2132 #line 324 "parse-gram.y"
2133 {
2134 default_prec = false;
2135 }
2136 /* Line 1380 of yacc.c */
2137 #line 2138 "src/parse-gram.c"
2138 break;
2139
2140 case 39:
2141 /* Line 1380 of yacc.c */
2142 #line 328 "parse-gram.y"
2143 {
2144 /* Do not invoke muscle_percent_code_grow here since it invokes
2145 muscle_user_name_list_grow. */
2146 muscle_code_grow ("percent_code()", (yyvsp[0].chars), (yylsp[0]));
2147 code_scanner_last_string_free ();
2148 }
2149 /* Line 1380 of yacc.c */
2150 #line 2151 "src/parse-gram.c"
2151 break;
2152
2153 case 40:
2154 /* Line 1380 of yacc.c */
2155 #line 335 "parse-gram.y"
2156 {
2157 muscle_percent_code_grow ((yyvsp[-1].uniqstr), (yylsp[-1]), (yyvsp[0].chars), (yylsp[0]));
2158 code_scanner_last_string_free ();
2159 }
2160 /* Line 1380 of yacc.c */
2161 #line 2162 "src/parse-gram.c"
2162 break;
2163
2164 case 41:
2165 /* Line 1380 of yacc.c */
2166 #line 349 "parse-gram.y"
2167 {}
2168 /* Line 1380 of yacc.c */
2169 #line 2170 "src/parse-gram.c"
2170 break;
2171
2172 case 42:
2173 /* Line 1380 of yacc.c */
2174 #line 350 "parse-gram.y"
2175 { muscle_code_grow ("union_name", (yyvsp[0].uniqstr), (yylsp[0])); }
2176 /* Line 1380 of yacc.c */
2177 #line 2178 "src/parse-gram.c"
2178 break;
2179
2180 case 43:
2181 /* Line 1380 of yacc.c */
2182 #line 355 "parse-gram.y"
2183 {
2184 union_seen = true;
2185 muscle_code_grow ("stype", (yyvsp[0].chars), (yylsp[0]));
2186 code_scanner_last_string_free ();
2187 }
2188 /* Line 1380 of yacc.c */
2189 #line 2190 "src/parse-gram.c"
2190 break;
2191
2192 case 44:
2193 /* Line 1380 of yacc.c */
2194 #line 366 "parse-gram.y"
2195 { current_class = nterm_sym; }
2196 /* Line 1380 of yacc.c */
2197 #line 2198 "src/parse-gram.c"
2198 break;
2199
2200 case 45:
2201 /* Line 1380 of yacc.c */
2202 #line 367 "parse-gram.y"
2203 {
2204 current_class = unknown_sym;
2205 current_type = NULL;
2206 }
2207 /* Line 1380 of yacc.c */
2208 #line 2209 "src/parse-gram.c"
2209 break;
2210
2211 case 46:
2212 /* Line 1380 of yacc.c */
2213 #line 371 "parse-gram.y"
2214 { current_class = token_sym; }
2215 /* Line 1380 of yacc.c */
2216 #line 2217 "src/parse-gram.c"
2217 break;
2218
2219 case 47:
2220 /* Line 1380 of yacc.c */
2221 #line 372 "parse-gram.y"
2222 {
2223 current_class = unknown_sym;
2224 current_type = NULL;
2225 }
2226 /* Line 1380 of yacc.c */
2227 #line 2228 "src/parse-gram.c"
2228 break;
2229
2230 case 48:
2231 /* Line 1380 of yacc.c */
2232 #line 377 "parse-gram.y"
2233 {
2234 symbol_list *list;
2235 tag_seen = true;
2236 for (list = (yyvsp[0].list); list; list = list->next)
2237 symbol_type_set (list->content.sym, (yyvsp[-1].uniqstr), (yylsp[-1]));
2238 symbol_list_free ((yyvsp[0].list));
2239 }
2240 /* Line 1380 of yacc.c */
2241 #line 2242 "src/parse-gram.c"
2242 break;
2243
2244 case 49:
2245 /* Line 1380 of yacc.c */
2246 #line 388 "parse-gram.y"
2247 {
2248 symbol_list *list;
2249 ++current_prec;
2250 for (list = (yyvsp[0].list); list; list = list->next)
2251 {
2252 symbol_type_set (list->content.sym, current_type, (yylsp[-1]));
2253 symbol_precedence_set (list->content.sym, current_prec, (yyvsp[-2].assoc), (yylsp[-2]));
2254 }
2255 symbol_list_free ((yyvsp[0].list));
2256 current_type = NULL;
2257 }
2258 /* Line 1380 of yacc.c */
2259 #line 2260 "src/parse-gram.c"
2260 break;
2261
2262 case 50:
2263 /* Line 1380 of yacc.c */
2264 #line 402 "parse-gram.y"
2265 { (yyval.assoc) = left_assoc; }
2266 /* Line 1380 of yacc.c */
2267 #line 2268 "src/parse-gram.c"
2268 break;
2269
2270 case 51:
2271 /* Line 1380 of yacc.c */
2272 #line 403 "parse-gram.y"
2273 { (yyval.assoc) = right_assoc; }
2274 /* Line 1380 of yacc.c */
2275 #line 2276 "src/parse-gram.c"
2276 break;
2277
2278 case 52:
2279 /* Line 1380 of yacc.c */
2280 #line 404 "parse-gram.y"
2281 { (yyval.assoc) = non_assoc; }
2282 /* Line 1380 of yacc.c */
2283 #line 2284 "src/parse-gram.c"
2284 break;
2285
2286 case 53:
2287 /* Line 1380 of yacc.c */
2288 #line 405 "parse-gram.y"
2289 { (yyval.assoc) = precedence_assoc; }
2290 /* Line 1380 of yacc.c */
2291 #line 2292 "src/parse-gram.c"
2292 break;
2293
2294 case 54:
2295 /* Line 1380 of yacc.c */
2296 #line 409 "parse-gram.y"
2297 { current_type = NULL; }
2298 /* Line 1380 of yacc.c */
2299 #line 2300 "src/parse-gram.c"
2300 break;
2301
2302 case 55:
2303 /* Line 1380 of yacc.c */
2304 #line 410 "parse-gram.y"
2305 { current_type = (yyvsp[0].uniqstr); tag_seen = true; }
2306 /* Line 1380 of yacc.c */
2307 #line 2308 "src/parse-gram.c"
2308 break;
2309
2310 case 56:
2311 /* Line 1380 of yacc.c */
2312 #line 416 "parse-gram.y"
2313 { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); }
2314 /* Line 1380 of yacc.c */
2315 #line 2316 "src/parse-gram.c"
2316 break;
2317
2318 case 57:
2319 /* Line 1380 of yacc.c */
2320 #line 418 "parse-gram.y"
2321 { (yyval.list) = symbol_list_prepend ((yyvsp[-1].list), symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0]))); }
2322 /* Line 1380 of yacc.c */
2323 #line 2324 "src/parse-gram.c"
2324 break;
2325
2326 case 58:
2327 /* Line 1380 of yacc.c */
2328 #line 422 "parse-gram.y"
2329 { (yyval.symbol) = (yyvsp[0].symbol); }
2330 /* Line 1380 of yacc.c */
2331 #line 2332 "src/parse-gram.c"
2332 break;
2333
2334 case 59:
2335 /* Line 1380 of yacc.c */
2336 #line 423 "parse-gram.y"
2337 { (yyval.symbol) = (yyvsp[-1].symbol); symbol_user_token_number_set ((yyvsp[-1].symbol), (yyvsp[0].integer), (yylsp[0])); }
2338 /* Line 1380 of yacc.c */
2339 #line 2340 "src/parse-gram.c"
2340 break;
2341
2342 case 60:
2343 /* Line 1380 of yacc.c */
2344 #line 429 "parse-gram.y"
2345 { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); }
2346 /* Line 1380 of yacc.c */
2347 #line 2348 "src/parse-gram.c"
2348 break;
2349
2350 case 61:
2351 /* Line 1380 of yacc.c */
2352 #line 431 "parse-gram.y"
2353 { (yyval.list) = symbol_list_prepend ((yyvsp[-1].list), symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0]))); }
2354 /* Line 1380 of yacc.c */
2355 #line 2356 "src/parse-gram.c"
2356 break;
2357
2358 case 62:
2359 /* Line 1380 of yacc.c */
2360 #line 435 "parse-gram.y"
2361 { (yyval.list) = (yyvsp[0].list); }
2362 /* Line 1380 of yacc.c */
2363 #line 2364 "src/parse-gram.c"
2364 break;
2365
2366 case 63:
2367 /* Line 1380 of yacc.c */
2368 #line 436 "parse-gram.y"
2369 { (yyval.list) = symbol_list_prepend ((yyvsp[-1].list), (yyvsp[0].list)); }
2370 /* Line 1380 of yacc.c */
2371 #line 2372 "src/parse-gram.c"
2372 break;
2373
2374 case 64:
2375 /* Line 1380 of yacc.c */
2376 #line 440 "parse-gram.y"
2377 { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); }
2378 /* Line 1380 of yacc.c */
2379 #line 2380 "src/parse-gram.c"
2380 break;
2381
2382 case 65:
2383 /* Line 1380 of yacc.c */
2384 #line 441 "parse-gram.y"
2385 { (yyval.list) = symbol_list_type_new ((yyvsp[0].uniqstr), (yylsp[0])); }
2386 /* Line 1380 of yacc.c */
2387 #line 2388 "src/parse-gram.c"
2388 break;
2389
2390 case 66:
2391 /* Line 1380 of yacc.c */
2392 #line 442 "parse-gram.y"
2393 { (yyval.list) = symbol_list_default_tagged_new ((yylsp[0])); }
2394 /* Line 1380 of yacc.c */
2395 #line 2396 "src/parse-gram.c"
2396 break;
2397
2398 case 67:
2399 /* Line 1380 of yacc.c */
2400 #line 443 "parse-gram.y"
2401 { (yyval.list) = symbol_list_default_tagless_new ((yylsp[0])); }
2402 /* Line 1380 of yacc.c */
2403 #line 2404 "src/parse-gram.c"
2404 break;
2405
2406 case 68:
2407 /* Line 1380 of yacc.c */
2408 #line 449 "parse-gram.y"
2409 {
2410 current_type = (yyvsp[0].uniqstr);
2411 tag_seen = true;
2412 }
2413 /* Line 1380 of yacc.c */
2414 #line 2415 "src/parse-gram.c"
2415 break;
2416
2417 case 69:
2418 /* Line 1380 of yacc.c */
2419 #line 454 "parse-gram.y"
2420 {
2421 symbol_class_set ((yyvsp[0].symbol), current_class, (yylsp[0]), true);
2422 symbol_type_set ((yyvsp[0].symbol), current_type, (yylsp[0]));
2423 }
2424 /* Line 1380 of yacc.c */
2425 #line 2426 "src/parse-gram.c"
2426 break;
2427
2428 case 70:
2429 /* Line 1380 of yacc.c */
2430 #line 459 "parse-gram.y"
2431 {
2432 symbol_class_set ((yyvsp[-1].symbol), current_class, (yylsp[-1]), true);
2433 symbol_type_set ((yyvsp[-1].symbol), current_type, (yylsp[-1]));
2434 symbol_user_token_number_set ((yyvsp[-1].symbol), (yyvsp[0].integer), (yylsp[0]));
2435 }
2436 /* Line 1380 of yacc.c */
2437 #line 2438 "src/parse-gram.c"
2438 break;
2439
2440 case 71:
2441 /* Line 1380 of yacc.c */
2442 #line 465 "parse-gram.y"
2443 {
2444 symbol_class_set ((yyvsp[-1].symbol), current_class, (yylsp[-1]), true);
2445 symbol_type_set ((yyvsp[-1].symbol), current_type, (yylsp[-1]));
2446 symbol_make_alias ((yyvsp[-1].symbol), (yyvsp[0].symbol), (yyloc));
2447 }
2448 /* Line 1380 of yacc.c */
2449 #line 2450 "src/parse-gram.c"
2450 break;
2451
2452 case 72:
2453 /* Line 1380 of yacc.c */
2454 #line 471 "parse-gram.y"
2455 {
2456 symbol_class_set ((yyvsp[-2].symbol), current_class, (yylsp[-2]), true);
2457 symbol_type_set ((yyvsp[-2].symbol), current_type, (yylsp[-2]));
2458 symbol_user_token_number_set ((yyvsp[-2].symbol), (yyvsp[-1].integer), (yylsp[-1]));
2459 symbol_make_alias ((yyvsp[-2].symbol), (yyvsp[0].symbol), (yyloc));
2460 }
2461 /* Line 1380 of yacc.c */
2462 #line 2463 "src/parse-gram.c"
2463 break;
2464
2465 case 79:
2466 /* Line 1380 of yacc.c */
2467 #line 501 "parse-gram.y"
2468 {
2469 yyerrok;
2470 }
2471 /* Line 1380 of yacc.c */
2472 #line 2473 "src/parse-gram.c"
2473 break;
2474
2475 case 80:
2476 /* Line 1380 of yacc.c */
2477 #line 507 "parse-gram.y"
2478 { current_lhs = (yyvsp[0].symbol); current_lhs_location = (yylsp[0]); }
2479 /* Line 1380 of yacc.c */
2480 #line 2481 "src/parse-gram.c"
2481 break;
2482
2483 case 82:
2484 /* Line 1380 of yacc.c */
2485 #line 511 "parse-gram.y"
2486 { grammar_current_rule_end ((yylsp[0])); }
2487 /* Line 1380 of yacc.c */
2488 #line 2489 "src/parse-gram.c"
2489 break;
2490
2491 case 83:
2492 /* Line 1380 of yacc.c */
2493 #line 512 "parse-gram.y"
2494 { grammar_current_rule_end ((yylsp[0])); }
2495 /* Line 1380 of yacc.c */
2496 #line 2497 "src/parse-gram.c"
2497 break;
2498
2499 case 85:
2500 /* Line 1380 of yacc.c */
2501 #line 518 "parse-gram.y"
2502 { grammar_current_rule_begin (current_lhs, current_lhs_location); }
2503 /* Line 1380 of yacc.c */
2504 #line 2505 "src/parse-gram.c"
2505 break;
2506
2507 case 86:
2508 /* Line 1380 of yacc.c */
2509 #line 520 "parse-gram.y"
2510 { grammar_current_rule_symbol_append ((yyvsp[0].symbol), (yylsp[0])); }
2511 /* Line 1380 of yacc.c */
2512 #line 2513 "src/parse-gram.c"
2513 break;
2514
2515 case 87:
2516 /* Line 1380 of yacc.c */
2517 #line 522 "parse-gram.y"
2518 { grammar_current_rule_action_append ((yyvsp[0].code), (yylsp[0])); }
2519 /* Line 1380 of yacc.c */
2520 #line 2521 "src/parse-gram.c"
2521 break;
2522
2523 case 88:
2524 /* Line 1380 of yacc.c */
2525 #line 524 "parse-gram.y"
2526 { grammar_current_rule_prec_set ((yyvsp[0].symbol), (yylsp[0])); }
2527 /* Line 1380 of yacc.c */
2528 #line 2529 "src/parse-gram.c"
2529 break;
2530
2531 case 89:
2532 /* Line 1380 of yacc.c */
2533 #line 526 "parse-gram.y"
2534 { grammar_current_rule_dprec_set ((yyvsp[0].integer), (yylsp[0])); }
2535 /* Line 1380 of yacc.c */
2536 #line 2537 "src/parse-gram.c"
2537 break;
2538
2539 case 90:
2540 /* Line 1380 of yacc.c */
2541 #line 528 "parse-gram.y"
2542 { grammar_current_rule_merge_set ((yyvsp[0].uniqstr), (yylsp[0])); }
2543 /* Line 1380 of yacc.c */
2544 #line 2545 "src/parse-gram.c"
2545 break;
2546
2547 case 92:
2548 /* Line 1380 of yacc.c */
2549 #line 540 "parse-gram.y"
2550 { (yyval.uniqstr) = uniqstr_new ((yyvsp[0].chars)); }
2551 /* Line 1380 of yacc.c */
2552 #line 2553 "src/parse-gram.c"
2553 break;
2554
2555 case 93:
2556 /* Line 1380 of yacc.c */
2557 #line 545 "parse-gram.y"
2558 { (yyval.chars) = ""; }
2559 /* Line 1380 of yacc.c */
2560 #line 2561 "src/parse-gram.c"
2561 break;
2562
2563 case 95:
2564 /* Line 1380 of yacc.c */
2565 #line 556 "parse-gram.y"
2566 {
2567 code_props plain_code;
2568 (yyvsp[0].code)[strlen ((yyvsp[0].code)) - 1] = '\n';
2569 code_props_plain_init (&plain_code, (yyvsp[0].code)+1, (yylsp[0]));
2570 code_props_translate_code (&plain_code);
2571 gram_scanner_last_string_free ();
2572 (yyval.chars) = plain_code.code;
2573 }
2574 /* Line 1380 of yacc.c */
2575 #line 2576 "src/parse-gram.c"
2576 break;
2577
2578 case 96:
2579 /* Line 1380 of yacc.c */
2580 #line 576 "parse-gram.y"
2581 { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); }
2582 /* Line 1380 of yacc.c */
2583 #line 2584 "src/parse-gram.c"
2584 break;
2585
2586 case 97:
2587 /* Line 1380 of yacc.c */
2588 #line 578 "parse-gram.y"
2589 {
2590 (yyval.symbol) = symbol_get (char_name ((yyvsp[0].character)), (yylsp[0]));
2591 symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false);
2592 symbol_user_token_number_set ((yyval.symbol), (yyvsp[0].character), (yylsp[0]));
2593 }
2594 /* Line 1380 of yacc.c */
2595 #line 2596 "src/parse-gram.c"
2596 break;
2597
2598 case 98:
2599 /* Line 1380 of yacc.c */
2600 #line 586 "parse-gram.y"
2601 { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); }
2602 /* Line 1380 of yacc.c */
2603 #line 2604 "src/parse-gram.c"
2604 break;
2605
2606 case 101:
2607 /* Line 1380 of yacc.c */
2608 #line 598 "parse-gram.y"
2609 {
2610 (yyval.symbol) = symbol_get (quotearg_style (c_quoting_style, (yyvsp[0].chars)), (yylsp[0]));
2611 symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false);
2612 }
2613 /* Line 1380 of yacc.c */
2614 #line 2615 "src/parse-gram.c"
2615 break;
2616
2617 case 103:
2618 /* Line 1380 of yacc.c */
2619 #line 607 "parse-gram.y"
2620 {
2621 code_props plain_code;
2622 code_props_plain_init (&plain_code, (yyvsp[0].chars), (yylsp[0]));
2623 code_props_translate_code (&plain_code);
2624 gram_scanner_last_string_free ();
2625 muscle_code_grow ("epilogue", plain_code.code, (yylsp[0]));
2626 code_scanner_last_string_free ();
2627 }
2628 /* Line 1380 of yacc.c */
2629 #line 2630 "src/parse-gram.c"
2630 break;
2631
2632
2633 /* Line 1380 of yacc.c */
2634 #line 2635 "src/parse-gram.c"
2635 default: break;
2636 }
2637 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2638
2639 YYPOPSTACK (yylen);
2640 yylen = 0;
2641 YY_STACK_PRINT (yyss, yyssp);
2642
2643 *++yyvsp = yyval;
2644 *++yylsp = yyloc;
2645
2646 /* Now `shift' the result of the reduction. Determine what state
2647 that goes to, based on the state we popped back to and the rule
2648 number reduced by. */
2649
2650 yyn = yyr1[yyn];
2651
2652 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2653 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2654 yystate = yytable[yystate];
2655 else
2656 yystate = yydefgoto[yyn - YYNTOKENS];
2657
2658 goto yynewstate;
2659
2660
2661 /*------------------------------------.
2662 | yyerrlab -- here on detecting error |
2663 `------------------------------------*/
2664 yyerrlab:
2665 /* If not already recovering from an error, report this error. */
2666 if (!yyerrstatus)
2667 {
2668 ++yynerrs;
2669 #if ! YYERROR_VERBOSE
2670 yyerror (YY_("syntax error"));
2671 #else
2672 {
2673 YYSIZE_T yysize = yysyntax_error (0, yystate, yytoken);
2674 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2675 {
2676 YYSIZE_T yyalloc = 2 * yysize;
2677 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2678 yyalloc = YYSTACK_ALLOC_MAXIMUM;
2679 if (yymsg != yymsgbuf)
2680 YYSTACK_FREE (yymsg);
2681 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2682 if (yymsg)
2683 yymsg_alloc = yyalloc;
2684 else
2685 {
2686 yymsg = yymsgbuf;
2687 yymsg_alloc = sizeof yymsgbuf;
2688 }
2689 }
2690
2691 if (0 < yysize && yysize <= yymsg_alloc)
2692 {
2693 (void) yysyntax_error (yymsg, yystate, yytoken);
2694 yyerror (yymsg);
2695 }
2696 else
2697 {
2698 yyerror (YY_("syntax error"));
2699 if (yysize != 0)
2700 goto yyexhaustedlab;
2701 }
2702 }
2703 #endif
2704 }
2705
2706 yyerror_range[0] = yylloc;
2707
2708 if (yyerrstatus == 3)
2709 {
2710 /* If just tried and failed to reuse lookahead token after an
2711 error, discard it. */
2712
2713 if (yychar <= YYEOF)
2714 {
2715 /* Return failure if at end of input. */
2716 if (yychar == YYEOF)
2717 YYABORT;
2718 }
2719 else
2720 {
2721 yydestruct ("Error: discarding",
2722 yytoken, &yylval, &yylloc);
2723 yychar = YYEMPTY;
2724 }
2725 }
2726
2727 /* Else will try to reuse lookahead token after shifting the error
2728 token. */
2729 goto yyerrlab1;
2730
2731
2732 /*---------------------------------------------------.
2733 | yyerrorlab -- error raised explicitly by YYERROR. |
2734 `---------------------------------------------------*/
2735 yyerrorlab:
2736
2737 /* Pacify compilers like GCC when the user code never invokes
2738 YYERROR and the label yyerrorlab therefore never appears in user
2739 code. */
2740 if (/*CONSTCOND*/ 0)
2741 goto yyerrorlab;
2742
2743 yyerror_range[0] = yylsp[1-yylen];
2744 /* Do not reclaim the symbols of the rule which action triggered
2745 this YYERROR. */
2746 YYPOPSTACK (yylen);
2747 yylen = 0;
2748 YY_STACK_PRINT (yyss, yyssp);
2749 yystate = *yyssp;
2750 goto yyerrlab1;
2751
2752
2753 /*-------------------------------------------------------------.
2754 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2755 `-------------------------------------------------------------*/
2756 yyerrlab1:
2757 yyerrstatus = 3; /* Each real token shifted decrements this. */
2758
2759 for (;;)
2760 {
2761 yyn = yypact[yystate];
2762 if (yyn != YYPACT_NINF)
2763 {
2764 yyn += YYTERROR;
2765 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2766 {
2767 yyn = yytable[yyn];
2768 if (0 < yyn)
2769 break;
2770 }
2771 }
2772
2773 /* Pop the current state because it cannot handle the error token. */
2774 if (yyssp == yyss)
2775 YYABORT;
2776
2777 yyerror_range[0] = *yylsp;
2778 yydestruct ("Error: popping",
2779 yystos[yystate], yyvsp, yylsp);
2780 YYPOPSTACK (1);
2781 yystate = *yyssp;
2782 YY_STACK_PRINT (yyss, yyssp);
2783 }
2784
2785 *++yyvsp = yylval;
2786
2787 yyerror_range[1] = yylloc;
2788 /* Using YYLLOC is tempting, but would change the location of
2789 the lookahead. YYLOC is available though. */
2790 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
2791 *++yylsp = yyloc;
2792
2793 /* Shift the error token. */
2794 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2795
2796 yystate = yyn;
2797 goto yynewstate;
2798
2799
2800 /*-------------------------------------.
2801 | yyacceptlab -- YYACCEPT comes here. |
2802 `-------------------------------------*/
2803 yyacceptlab:
2804 yyresult = 0;
2805 goto yyreturn;
2806
2807 /*-----------------------------------.
2808 | yyabortlab -- YYABORT comes here. |
2809 `-----------------------------------*/
2810 yyabortlab:
2811 yyresult = 1;
2812 goto yyreturn;
2813
2814 #if !defined(yyoverflow) || YYERROR_VERBOSE
2815 /*-------------------------------------------------.
2816 | yyexhaustedlab -- memory exhaustion comes here. |
2817 `-------------------------------------------------*/
2818 yyexhaustedlab:
2819 yyerror (YY_("memory exhausted"));
2820 yyresult = 2;
2821 /* Fall through. */
2822 #endif
2823
2824 yyreturn:
2825 if (yychar != YYEMPTY)
2826 yydestruct ("Cleanup: discarding lookahead",
2827 yytoken, &yylval, &yylloc);
2828 /* Do not reclaim the symbols of the rule which action triggered
2829 this YYABORT or YYACCEPT. */
2830 YYPOPSTACK (yylen);
2831 YY_STACK_PRINT (yyss, yyssp);
2832 while (yyssp != yyss)
2833 {
2834 yydestruct ("Cleanup: popping",
2835 yystos[*yyssp], yyvsp, yylsp);
2836 YYPOPSTACK (1);
2837 }
2838 #ifndef yyoverflow
2839 if (yyss != yyssa)
2840 YYSTACK_FREE (yyss);
2841 #endif
2842 #if YYERROR_VERBOSE
2843 if (yymsg != yymsgbuf)
2844 YYSTACK_FREE (yymsg);
2845 #endif
2846 /* Make sure YYID is used. */
2847 return YYID (yyresult);
2848 }
2849
2850 /* Line 1599 of yacc.c */
2851 #line 617 "parse-gram.y"
2852
2853
2854
2855 /* Return the location of the left-hand side of a rule whose
2856 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2857 the right-hand side, and return an empty location equal to the end
2858 boundary of RHS[0] if the right-hand side is empty. */
2859
2860 static YYLTYPE
2861 lloc_default (YYLTYPE const *rhs, int n)
2862 {
2863 int i;
2864 YYLTYPE loc;
2865
2866 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2867 The bug is fixed in 7.4.2m, but play it safe for now. */
2868 loc.start = rhs[n].end;
2869 loc.end = rhs[n].end;
2870
2871 /* Ignore empty nonterminals the start of the the right-hand side.
2872 Do not bother to ignore them at the end of the right-hand side,
2873 since empty nonterminals have the same end as their predecessors. */
2874 for (i = 1; i <= n; i++)
2875 if (! equal_boundaries (rhs[i].start, rhs[i].end))
2876 {
2877 loc.start = rhs[i].start;
2878 break;
2879 }
2880
2881 return loc;
2882 }
2883
2884
2885 /* Add a lex-param or a parse-param (depending on TYPE) with
2886 declaration DECL and location LOC. */
2887
2888 static void
2889 add_param (char const *type, char *decl, location loc)
2890 {
2891 static char const alphanum[26 + 26 + 1 + 10] =
2892 "abcdefghijklmnopqrstuvwxyz"
2893 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2894 "_"
2895 "0123456789";
2896 char const *name_start = NULL;
2897 char *p;
2898
2899 /* Stop on last actual character. */
2900 for (p = decl; p[1]; p++)
2901 if ((p == decl
2902 || ! memchr (alphanum, p[-1], sizeof alphanum))
2903 && memchr (alphanum, p[0], sizeof alphanum - 10))
2904 name_start = p;
2905
2906 /* Strip the surrounding '{' and '}', and any blanks just inside
2907 the braces. */
2908 while (*--p == ' ' || *p == '\t')
2909 continue;
2910 p[1] = '\0';
2911 while (*++decl == ' ' || *decl == '\t')
2912 continue;
2913
2914 if (! name_start)
2915 complain_at (loc, _("missing identifier in parameter declaration"));
2916 else
2917 {
2918 char *name;
2919 size_t name_len;
2920
2921 for (name_len = 1;
2922 memchr (alphanum, name_start[name_len], sizeof alphanum);
2923 name_len++)
2924 continue;
2925
2926 name = xmalloc (name_len + 1);
2927 memcpy (name, name_start, name_len);
2928 name[name_len] = '\0';
2929 muscle_pair_list_grow (type, decl, name);
2930 free (name);
2931 }
2932
2933 gram_scanner_last_string_free ();
2934 }
2935
2936
2937 static void
2938 version_check (location const *loc, char const *version)
2939 {
2940 if (strverscmp (version, PACKAGE_VERSION) > 0)
2941 {
2942 complain_at (*loc, "require bison %s, but have %s",
2943 version, PACKAGE_VERSION);
2944 exit (63);
2945 }
2946 }
2947
2948 static void
2949 gram_error (location const *loc, char const *msg)
2950 {
2951 complain_at (*loc, "%s", msg);
2952 }
2953
2954 char const *
2955 token_name (int type)
2956 {
2957 return yytname[YYTRANSLATE (type)];
2958 }
2959
2960 static char const *
2961 char_name (char c)
2962 {
2963 if (c == '\'')
2964 return "'\\''";
2965 else
2966 {
2967 char buf[4];
2968 buf[0] = '\''; buf[1] = c; buf[2] = '\''; buf[3] = '\0';
2969 return quotearg_style (escape_quoting_style, buf);
2970 }
2971 }