]> git.saurik.com Git - bison.git/blob - src/parse-gram.c
-F/--force-define and relative %define/-D/--define priorities.
[bison.git] / src / parse-gram.c
1 /* A Bison parser, made by GNU Bison 2.4.323-f8e7-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.323-f8e7-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, 235,
610 236, 241, 242, 243, 244, 245, 250, 259, 260, 261,
611 262, 263, 264, 265, 266, 267, 268, 269, 293, 294,
612 295, 296, 300, 301, 302, 306, 313, 320, 324, 328,
613 335, 350, 351, 355, 367, 367, 372, 372, 377, 388,
614 403, 404, 405, 406, 410, 411, 416, 418, 423, 424,
615 429, 431, 436, 437, 441, 442, 443, 444, 449, 454,
616 459, 465, 471, 482, 483, 492, 493, 499, 500, 501,
617 508, 508, 512, 513, 514, 519, 520, 522, 524, 526,
618 528, 540, 541, 546, 547, 556, 576, 578, 587, 592,
619 593, 598, 605, 607
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 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
1869 }
1870 /* Line 1380 of yacc.c */
1871 #line 1872 "src/parse-gram.c"
1872 break;
1873
1874 case 9:
1875 /* Line 1380 of yacc.c */
1876 #line 235 "parse-gram.y"
1877 { defines_flag = true; }
1878 /* Line 1380 of yacc.c */
1879 #line 1880 "src/parse-gram.c"
1880 break;
1881
1882 case 10:
1883 /* Line 1380 of yacc.c */
1884 #line 237 "parse-gram.y"
1885 {
1886 defines_flag = true;
1887 spec_defines_file = xstrdup ((yyvsp[0].chars));
1888 }
1889 /* Line 1380 of yacc.c */
1890 #line 1891 "src/parse-gram.c"
1891 break;
1892
1893 case 11:
1894 /* Line 1380 of yacc.c */
1895 #line 241 "parse-gram.y"
1896 { expected_sr_conflicts = (yyvsp[0].integer); }
1897 /* Line 1380 of yacc.c */
1898 #line 1899 "src/parse-gram.c"
1899 break;
1900
1901 case 12:
1902 /* Line 1380 of yacc.c */
1903 #line 242 "parse-gram.y"
1904 { expected_rr_conflicts = (yyvsp[0].integer); }
1905 /* Line 1380 of yacc.c */
1906 #line 1907 "src/parse-gram.c"
1907 break;
1908
1909 case 13:
1910 /* Line 1380 of yacc.c */
1911 #line 243 "parse-gram.y"
1912 { spec_file_prefix = (yyvsp[0].chars); }
1913 /* Line 1380 of yacc.c */
1914 #line 1915 "src/parse-gram.c"
1915 break;
1916
1917 case 14:
1918 /* Line 1380 of yacc.c */
1919 #line 244 "parse-gram.y"
1920 { spec_file_prefix = (yyvsp[0].chars); }
1921 /* Line 1380 of yacc.c */
1922 #line 1923 "src/parse-gram.c"
1923 break;
1924
1925 case 15:
1926 /* Line 1380 of yacc.c */
1927 #line 246 "parse-gram.y"
1928 {
1929 nondeterministic_parser = true;
1930 glr_parser = true;
1931 }
1932 /* Line 1380 of yacc.c */
1933 #line 1934 "src/parse-gram.c"
1934 break;
1935
1936 case 16:
1937 /* Line 1380 of yacc.c */
1938 #line 251 "parse-gram.y"
1939 {
1940 code_props action;
1941 code_props_symbol_action_init (&action, (yyvsp[0].code), (yylsp[0]));
1942 code_props_translate_code (&action);
1943 gram_scanner_last_string_free ();
1944 muscle_code_grow ("initial_action", action.code, (yylsp[0]));
1945 code_scanner_last_string_free ();
1946 }
1947 /* Line 1380 of yacc.c */
1948 #line 1949 "src/parse-gram.c"
1949 break;
1950
1951 case 17:
1952 /* Line 1380 of yacc.c */
1953 #line 259 "parse-gram.y"
1954 { language_argmatch ((yyvsp[0].chars), grammar_prio, (yylsp[-1])); }
1955 /* Line 1380 of yacc.c */
1956 #line 1957 "src/parse-gram.c"
1957 break;
1958
1959 case 18:
1960 /* Line 1380 of yacc.c */
1961 #line 260 "parse-gram.y"
1962 { add_param ("lex_param", (yyvsp[0].code), (yylsp[0])); }
1963 /* Line 1380 of yacc.c */
1964 #line 1965 "src/parse-gram.c"
1965 break;
1966
1967 case 19:
1968 /* Line 1380 of yacc.c */
1969 #line 261 "parse-gram.y"
1970 { spec_name_prefix = (yyvsp[0].chars); }
1971 /* Line 1380 of yacc.c */
1972 #line 1973 "src/parse-gram.c"
1973 break;
1974
1975 case 20:
1976 /* Line 1380 of yacc.c */
1977 #line 262 "parse-gram.y"
1978 { spec_name_prefix = (yyvsp[0].chars); }
1979 /* Line 1380 of yacc.c */
1980 #line 1981 "src/parse-gram.c"
1981 break;
1982
1983 case 21:
1984 /* Line 1380 of yacc.c */
1985 #line 263 "parse-gram.y"
1986 { no_lines_flag = true; }
1987 /* Line 1380 of yacc.c */
1988 #line 1989 "src/parse-gram.c"
1989 break;
1990
1991 case 22:
1992 /* Line 1380 of yacc.c */
1993 #line 264 "parse-gram.y"
1994 { nondeterministic_parser = true; }
1995 /* Line 1380 of yacc.c */
1996 #line 1997 "src/parse-gram.c"
1997 break;
1998
1999 case 23:
2000 /* Line 1380 of yacc.c */
2001 #line 265 "parse-gram.y"
2002 { spec_outfile = (yyvsp[0].chars); }
2003 /* Line 1380 of yacc.c */
2004 #line 2005 "src/parse-gram.c"
2005 break;
2006
2007 case 24:
2008 /* Line 1380 of yacc.c */
2009 #line 266 "parse-gram.y"
2010 { spec_outfile = (yyvsp[0].chars); }
2011 /* Line 1380 of yacc.c */
2012 #line 2013 "src/parse-gram.c"
2013 break;
2014
2015 case 25:
2016 /* Line 1380 of yacc.c */
2017 #line 267 "parse-gram.y"
2018 { add_param ("parse_param", (yyvsp[0].code), (yylsp[0])); }
2019 /* Line 1380 of yacc.c */
2020 #line 2021 "src/parse-gram.c"
2021 break;
2022
2023 case 26:
2024 /* Line 1380 of yacc.c */
2025 #line 268 "parse-gram.y"
2026 { version_check (&(yylsp[0]), (yyvsp[0].chars)); }
2027 /* Line 1380 of yacc.c */
2028 #line 2029 "src/parse-gram.c"
2029 break;
2030
2031 case 27:
2032 /* Line 1380 of yacc.c */
2033 #line 270 "parse-gram.y"
2034 {
2035 char const *skeleton_user = (yyvsp[0].chars);
2036 if (strchr (skeleton_user, '/'))
2037 {
2038 size_t dir_length = strlen (current_file);
2039 char *skeleton_build;
2040 while (dir_length && current_file[dir_length - 1] != '/')
2041 --dir_length;
2042 while (dir_length && current_file[dir_length - 1] == '/')
2043 --dir_length;
2044 skeleton_build =
2045 xmalloc (dir_length + 1 + strlen (skeleton_user) + 1);
2046 if (dir_length > 0)
2047 {
2048 strncpy (skeleton_build, current_file, dir_length);
2049 skeleton_build[dir_length++] = '/';
2050 }
2051 strcpy (skeleton_build + dir_length, skeleton_user);
2052 skeleton_user = uniqstr_new (skeleton_build);
2053 free (skeleton_build);
2054 }
2055 skeleton_arg (skeleton_user, grammar_prio, (yylsp[-1]));
2056 }
2057 /* Line 1380 of yacc.c */
2058 #line 2059 "src/parse-gram.c"
2059 break;
2060
2061 case 28:
2062 /* Line 1380 of yacc.c */
2063 #line 293 "parse-gram.y"
2064 { token_table_flag = true; }
2065 /* Line 1380 of yacc.c */
2066 #line 2067 "src/parse-gram.c"
2067 break;
2068
2069 case 29:
2070 /* Line 1380 of yacc.c */
2071 #line 294 "parse-gram.y"
2072 { report_flag |= report_states; }
2073 /* Line 1380 of yacc.c */
2074 #line 2075 "src/parse-gram.c"
2075 break;
2076
2077 case 30:
2078 /* Line 1380 of yacc.c */
2079 #line 295 "parse-gram.y"
2080 { yacc_flag = true; }
2081 /* Line 1380 of yacc.c */
2082 #line 2083 "src/parse-gram.c"
2083 break;
2084
2085 case 34:
2086 /* Line 1380 of yacc.c */
2087 #line 303 "parse-gram.y"
2088 {
2089 grammar_start_symbol_set ((yyvsp[0].symbol), (yylsp[0]));
2090 }
2091 /* Line 1380 of yacc.c */
2092 #line 2093 "src/parse-gram.c"
2093 break;
2094
2095 case 35:
2096 /* Line 1380 of yacc.c */
2097 #line 307 "parse-gram.y"
2098 {
2099 symbol_list *list;
2100 for (list = (yyvsp[0].list); list; list = list->next)
2101 symbol_list_destructor_set (list, (yyvsp[-1].code), (yylsp[-1]));
2102 symbol_list_free ((yyvsp[0].list));
2103 }
2104 /* Line 1380 of yacc.c */
2105 #line 2106 "src/parse-gram.c"
2106 break;
2107
2108 case 36:
2109 /* Line 1380 of yacc.c */
2110 #line 314 "parse-gram.y"
2111 {
2112 symbol_list *list;
2113 for (list = (yyvsp[0].list); list; list = list->next)
2114 symbol_list_printer_set (list, (yyvsp[-1].code), (yylsp[-1]));
2115 symbol_list_free ((yyvsp[0].list));
2116 }
2117 /* Line 1380 of yacc.c */
2118 #line 2119 "src/parse-gram.c"
2119 break;
2120
2121 case 37:
2122 /* Line 1380 of yacc.c */
2123 #line 321 "parse-gram.y"
2124 {
2125 default_prec = true;
2126 }
2127 /* Line 1380 of yacc.c */
2128 #line 2129 "src/parse-gram.c"
2129 break;
2130
2131 case 38:
2132 /* Line 1380 of yacc.c */
2133 #line 325 "parse-gram.y"
2134 {
2135 default_prec = false;
2136 }
2137 /* Line 1380 of yacc.c */
2138 #line 2139 "src/parse-gram.c"
2139 break;
2140
2141 case 39:
2142 /* Line 1380 of yacc.c */
2143 #line 329 "parse-gram.y"
2144 {
2145 /* Do not invoke muscle_percent_code_grow here since it invokes
2146 muscle_user_name_list_grow. */
2147 muscle_code_grow ("percent_code()", (yyvsp[0].chars), (yylsp[0]));
2148 code_scanner_last_string_free ();
2149 }
2150 /* Line 1380 of yacc.c */
2151 #line 2152 "src/parse-gram.c"
2152 break;
2153
2154 case 40:
2155 /* Line 1380 of yacc.c */
2156 #line 336 "parse-gram.y"
2157 {
2158 muscle_percent_code_grow ((yyvsp[-1].uniqstr), (yylsp[-1]), (yyvsp[0].chars), (yylsp[0]));
2159 code_scanner_last_string_free ();
2160 }
2161 /* Line 1380 of yacc.c */
2162 #line 2163 "src/parse-gram.c"
2163 break;
2164
2165 case 41:
2166 /* Line 1380 of yacc.c */
2167 #line 350 "parse-gram.y"
2168 {}
2169 /* Line 1380 of yacc.c */
2170 #line 2171 "src/parse-gram.c"
2171 break;
2172
2173 case 42:
2174 /* Line 1380 of yacc.c */
2175 #line 351 "parse-gram.y"
2176 { muscle_code_grow ("union_name", (yyvsp[0].uniqstr), (yylsp[0])); }
2177 /* Line 1380 of yacc.c */
2178 #line 2179 "src/parse-gram.c"
2179 break;
2180
2181 case 43:
2182 /* Line 1380 of yacc.c */
2183 #line 356 "parse-gram.y"
2184 {
2185 union_seen = true;
2186 muscle_code_grow ("stype", (yyvsp[0].chars), (yylsp[0]));
2187 code_scanner_last_string_free ();
2188 }
2189 /* Line 1380 of yacc.c */
2190 #line 2191 "src/parse-gram.c"
2191 break;
2192
2193 case 44:
2194 /* Line 1380 of yacc.c */
2195 #line 367 "parse-gram.y"
2196 { current_class = nterm_sym; }
2197 /* Line 1380 of yacc.c */
2198 #line 2199 "src/parse-gram.c"
2199 break;
2200
2201 case 45:
2202 /* Line 1380 of yacc.c */
2203 #line 368 "parse-gram.y"
2204 {
2205 current_class = unknown_sym;
2206 current_type = NULL;
2207 }
2208 /* Line 1380 of yacc.c */
2209 #line 2210 "src/parse-gram.c"
2210 break;
2211
2212 case 46:
2213 /* Line 1380 of yacc.c */
2214 #line 372 "parse-gram.y"
2215 { current_class = token_sym; }
2216 /* Line 1380 of yacc.c */
2217 #line 2218 "src/parse-gram.c"
2218 break;
2219
2220 case 47:
2221 /* Line 1380 of yacc.c */
2222 #line 373 "parse-gram.y"
2223 {
2224 current_class = unknown_sym;
2225 current_type = NULL;
2226 }
2227 /* Line 1380 of yacc.c */
2228 #line 2229 "src/parse-gram.c"
2229 break;
2230
2231 case 48:
2232 /* Line 1380 of yacc.c */
2233 #line 378 "parse-gram.y"
2234 {
2235 symbol_list *list;
2236 tag_seen = true;
2237 for (list = (yyvsp[0].list); list; list = list->next)
2238 symbol_type_set (list->content.sym, (yyvsp[-1].uniqstr), (yylsp[-1]));
2239 symbol_list_free ((yyvsp[0].list));
2240 }
2241 /* Line 1380 of yacc.c */
2242 #line 2243 "src/parse-gram.c"
2243 break;
2244
2245 case 49:
2246 /* Line 1380 of yacc.c */
2247 #line 389 "parse-gram.y"
2248 {
2249 symbol_list *list;
2250 ++current_prec;
2251 for (list = (yyvsp[0].list); list; list = list->next)
2252 {
2253 symbol_type_set (list->content.sym, current_type, (yylsp[-1]));
2254 symbol_precedence_set (list->content.sym, current_prec, (yyvsp[-2].assoc), (yylsp[-2]));
2255 }
2256 symbol_list_free ((yyvsp[0].list));
2257 current_type = NULL;
2258 }
2259 /* Line 1380 of yacc.c */
2260 #line 2261 "src/parse-gram.c"
2261 break;
2262
2263 case 50:
2264 /* Line 1380 of yacc.c */
2265 #line 403 "parse-gram.y"
2266 { (yyval.assoc) = left_assoc; }
2267 /* Line 1380 of yacc.c */
2268 #line 2269 "src/parse-gram.c"
2269 break;
2270
2271 case 51:
2272 /* Line 1380 of yacc.c */
2273 #line 404 "parse-gram.y"
2274 { (yyval.assoc) = right_assoc; }
2275 /* Line 1380 of yacc.c */
2276 #line 2277 "src/parse-gram.c"
2277 break;
2278
2279 case 52:
2280 /* Line 1380 of yacc.c */
2281 #line 405 "parse-gram.y"
2282 { (yyval.assoc) = non_assoc; }
2283 /* Line 1380 of yacc.c */
2284 #line 2285 "src/parse-gram.c"
2285 break;
2286
2287 case 53:
2288 /* Line 1380 of yacc.c */
2289 #line 406 "parse-gram.y"
2290 { (yyval.assoc) = precedence_assoc; }
2291 /* Line 1380 of yacc.c */
2292 #line 2293 "src/parse-gram.c"
2293 break;
2294
2295 case 54:
2296 /* Line 1380 of yacc.c */
2297 #line 410 "parse-gram.y"
2298 { current_type = NULL; }
2299 /* Line 1380 of yacc.c */
2300 #line 2301 "src/parse-gram.c"
2301 break;
2302
2303 case 55:
2304 /* Line 1380 of yacc.c */
2305 #line 411 "parse-gram.y"
2306 { current_type = (yyvsp[0].uniqstr); tag_seen = true; }
2307 /* Line 1380 of yacc.c */
2308 #line 2309 "src/parse-gram.c"
2309 break;
2310
2311 case 56:
2312 /* Line 1380 of yacc.c */
2313 #line 417 "parse-gram.y"
2314 { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); }
2315 /* Line 1380 of yacc.c */
2316 #line 2317 "src/parse-gram.c"
2317 break;
2318
2319 case 57:
2320 /* Line 1380 of yacc.c */
2321 #line 419 "parse-gram.y"
2322 { (yyval.list) = symbol_list_prepend ((yyvsp[-1].list), symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0]))); }
2323 /* Line 1380 of yacc.c */
2324 #line 2325 "src/parse-gram.c"
2325 break;
2326
2327 case 58:
2328 /* Line 1380 of yacc.c */
2329 #line 423 "parse-gram.y"
2330 { (yyval.symbol) = (yyvsp[0].symbol); }
2331 /* Line 1380 of yacc.c */
2332 #line 2333 "src/parse-gram.c"
2333 break;
2334
2335 case 59:
2336 /* Line 1380 of yacc.c */
2337 #line 424 "parse-gram.y"
2338 { (yyval.symbol) = (yyvsp[-1].symbol); symbol_user_token_number_set ((yyvsp[-1].symbol), (yyvsp[0].integer), (yylsp[0])); }
2339 /* Line 1380 of yacc.c */
2340 #line 2341 "src/parse-gram.c"
2341 break;
2342
2343 case 60:
2344 /* Line 1380 of yacc.c */
2345 #line 430 "parse-gram.y"
2346 { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); }
2347 /* Line 1380 of yacc.c */
2348 #line 2349 "src/parse-gram.c"
2349 break;
2350
2351 case 61:
2352 /* Line 1380 of yacc.c */
2353 #line 432 "parse-gram.y"
2354 { (yyval.list) = symbol_list_prepend ((yyvsp[-1].list), symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0]))); }
2355 /* Line 1380 of yacc.c */
2356 #line 2357 "src/parse-gram.c"
2357 break;
2358
2359 case 62:
2360 /* Line 1380 of yacc.c */
2361 #line 436 "parse-gram.y"
2362 { (yyval.list) = (yyvsp[0].list); }
2363 /* Line 1380 of yacc.c */
2364 #line 2365 "src/parse-gram.c"
2365 break;
2366
2367 case 63:
2368 /* Line 1380 of yacc.c */
2369 #line 437 "parse-gram.y"
2370 { (yyval.list) = symbol_list_prepend ((yyvsp[-1].list), (yyvsp[0].list)); }
2371 /* Line 1380 of yacc.c */
2372 #line 2373 "src/parse-gram.c"
2373 break;
2374
2375 case 64:
2376 /* Line 1380 of yacc.c */
2377 #line 441 "parse-gram.y"
2378 { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); }
2379 /* Line 1380 of yacc.c */
2380 #line 2381 "src/parse-gram.c"
2381 break;
2382
2383 case 65:
2384 /* Line 1380 of yacc.c */
2385 #line 442 "parse-gram.y"
2386 { (yyval.list) = symbol_list_type_new ((yyvsp[0].uniqstr), (yylsp[0])); }
2387 /* Line 1380 of yacc.c */
2388 #line 2389 "src/parse-gram.c"
2389 break;
2390
2391 case 66:
2392 /* Line 1380 of yacc.c */
2393 #line 443 "parse-gram.y"
2394 { (yyval.list) = symbol_list_default_tagged_new ((yylsp[0])); }
2395 /* Line 1380 of yacc.c */
2396 #line 2397 "src/parse-gram.c"
2397 break;
2398
2399 case 67:
2400 /* Line 1380 of yacc.c */
2401 #line 444 "parse-gram.y"
2402 { (yyval.list) = symbol_list_default_tagless_new ((yylsp[0])); }
2403 /* Line 1380 of yacc.c */
2404 #line 2405 "src/parse-gram.c"
2405 break;
2406
2407 case 68:
2408 /* Line 1380 of yacc.c */
2409 #line 450 "parse-gram.y"
2410 {
2411 current_type = (yyvsp[0].uniqstr);
2412 tag_seen = true;
2413 }
2414 /* Line 1380 of yacc.c */
2415 #line 2416 "src/parse-gram.c"
2416 break;
2417
2418 case 69:
2419 /* Line 1380 of yacc.c */
2420 #line 455 "parse-gram.y"
2421 {
2422 symbol_class_set ((yyvsp[0].symbol), current_class, (yylsp[0]), true);
2423 symbol_type_set ((yyvsp[0].symbol), current_type, (yylsp[0]));
2424 }
2425 /* Line 1380 of yacc.c */
2426 #line 2427 "src/parse-gram.c"
2427 break;
2428
2429 case 70:
2430 /* Line 1380 of yacc.c */
2431 #line 460 "parse-gram.y"
2432 {
2433 symbol_class_set ((yyvsp[-1].symbol), current_class, (yylsp[-1]), true);
2434 symbol_type_set ((yyvsp[-1].symbol), current_type, (yylsp[-1]));
2435 symbol_user_token_number_set ((yyvsp[-1].symbol), (yyvsp[0].integer), (yylsp[0]));
2436 }
2437 /* Line 1380 of yacc.c */
2438 #line 2439 "src/parse-gram.c"
2439 break;
2440
2441 case 71:
2442 /* Line 1380 of yacc.c */
2443 #line 466 "parse-gram.y"
2444 {
2445 symbol_class_set ((yyvsp[-1].symbol), current_class, (yylsp[-1]), true);
2446 symbol_type_set ((yyvsp[-1].symbol), current_type, (yylsp[-1]));
2447 symbol_make_alias ((yyvsp[-1].symbol), (yyvsp[0].symbol), (yyloc));
2448 }
2449 /* Line 1380 of yacc.c */
2450 #line 2451 "src/parse-gram.c"
2451 break;
2452
2453 case 72:
2454 /* Line 1380 of yacc.c */
2455 #line 472 "parse-gram.y"
2456 {
2457 symbol_class_set ((yyvsp[-2].symbol), current_class, (yylsp[-2]), true);
2458 symbol_type_set ((yyvsp[-2].symbol), current_type, (yylsp[-2]));
2459 symbol_user_token_number_set ((yyvsp[-2].symbol), (yyvsp[-1].integer), (yylsp[-1]));
2460 symbol_make_alias ((yyvsp[-2].symbol), (yyvsp[0].symbol), (yyloc));
2461 }
2462 /* Line 1380 of yacc.c */
2463 #line 2464 "src/parse-gram.c"
2464 break;
2465
2466 case 79:
2467 /* Line 1380 of yacc.c */
2468 #line 502 "parse-gram.y"
2469 {
2470 yyerrok;
2471 }
2472 /* Line 1380 of yacc.c */
2473 #line 2474 "src/parse-gram.c"
2474 break;
2475
2476 case 80:
2477 /* Line 1380 of yacc.c */
2478 #line 508 "parse-gram.y"
2479 { current_lhs = (yyvsp[0].symbol); current_lhs_location = (yylsp[0]); }
2480 /* Line 1380 of yacc.c */
2481 #line 2482 "src/parse-gram.c"
2482 break;
2483
2484 case 82:
2485 /* Line 1380 of yacc.c */
2486 #line 512 "parse-gram.y"
2487 { grammar_current_rule_end ((yylsp[0])); }
2488 /* Line 1380 of yacc.c */
2489 #line 2490 "src/parse-gram.c"
2490 break;
2491
2492 case 83:
2493 /* Line 1380 of yacc.c */
2494 #line 513 "parse-gram.y"
2495 { grammar_current_rule_end ((yylsp[0])); }
2496 /* Line 1380 of yacc.c */
2497 #line 2498 "src/parse-gram.c"
2498 break;
2499
2500 case 85:
2501 /* Line 1380 of yacc.c */
2502 #line 519 "parse-gram.y"
2503 { grammar_current_rule_begin (current_lhs, current_lhs_location); }
2504 /* Line 1380 of yacc.c */
2505 #line 2506 "src/parse-gram.c"
2506 break;
2507
2508 case 86:
2509 /* Line 1380 of yacc.c */
2510 #line 521 "parse-gram.y"
2511 { grammar_current_rule_symbol_append ((yyvsp[0].symbol), (yylsp[0])); }
2512 /* Line 1380 of yacc.c */
2513 #line 2514 "src/parse-gram.c"
2514 break;
2515
2516 case 87:
2517 /* Line 1380 of yacc.c */
2518 #line 523 "parse-gram.y"
2519 { grammar_current_rule_action_append ((yyvsp[0].code), (yylsp[0])); }
2520 /* Line 1380 of yacc.c */
2521 #line 2522 "src/parse-gram.c"
2522 break;
2523
2524 case 88:
2525 /* Line 1380 of yacc.c */
2526 #line 525 "parse-gram.y"
2527 { grammar_current_rule_prec_set ((yyvsp[0].symbol), (yylsp[0])); }
2528 /* Line 1380 of yacc.c */
2529 #line 2530 "src/parse-gram.c"
2530 break;
2531
2532 case 89:
2533 /* Line 1380 of yacc.c */
2534 #line 527 "parse-gram.y"
2535 { grammar_current_rule_dprec_set ((yyvsp[0].integer), (yylsp[0])); }
2536 /* Line 1380 of yacc.c */
2537 #line 2538 "src/parse-gram.c"
2538 break;
2539
2540 case 90:
2541 /* Line 1380 of yacc.c */
2542 #line 529 "parse-gram.y"
2543 { grammar_current_rule_merge_set ((yyvsp[0].uniqstr), (yylsp[0])); }
2544 /* Line 1380 of yacc.c */
2545 #line 2546 "src/parse-gram.c"
2546 break;
2547
2548 case 92:
2549 /* Line 1380 of yacc.c */
2550 #line 541 "parse-gram.y"
2551 { (yyval.uniqstr) = uniqstr_new ((yyvsp[0].chars)); }
2552 /* Line 1380 of yacc.c */
2553 #line 2554 "src/parse-gram.c"
2554 break;
2555
2556 case 93:
2557 /* Line 1380 of yacc.c */
2558 #line 546 "parse-gram.y"
2559 { (yyval.chars) = ""; }
2560 /* Line 1380 of yacc.c */
2561 #line 2562 "src/parse-gram.c"
2562 break;
2563
2564 case 95:
2565 /* Line 1380 of yacc.c */
2566 #line 557 "parse-gram.y"
2567 {
2568 code_props plain_code;
2569 (yyvsp[0].code)[strlen ((yyvsp[0].code)) - 1] = '\n';
2570 code_props_plain_init (&plain_code, (yyvsp[0].code)+1, (yylsp[0]));
2571 code_props_translate_code (&plain_code);
2572 gram_scanner_last_string_free ();
2573 (yyval.chars) = plain_code.code;
2574 }
2575 /* Line 1380 of yacc.c */
2576 #line 2577 "src/parse-gram.c"
2577 break;
2578
2579 case 96:
2580 /* Line 1380 of yacc.c */
2581 #line 577 "parse-gram.y"
2582 { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); }
2583 /* Line 1380 of yacc.c */
2584 #line 2585 "src/parse-gram.c"
2585 break;
2586
2587 case 97:
2588 /* Line 1380 of yacc.c */
2589 #line 579 "parse-gram.y"
2590 {
2591 (yyval.symbol) = symbol_get (char_name ((yyvsp[0].character)), (yylsp[0]));
2592 symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false);
2593 symbol_user_token_number_set ((yyval.symbol), (yyvsp[0].character), (yylsp[0]));
2594 }
2595 /* Line 1380 of yacc.c */
2596 #line 2597 "src/parse-gram.c"
2597 break;
2598
2599 case 98:
2600 /* Line 1380 of yacc.c */
2601 #line 587 "parse-gram.y"
2602 { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); }
2603 /* Line 1380 of yacc.c */
2604 #line 2605 "src/parse-gram.c"
2605 break;
2606
2607 case 101:
2608 /* Line 1380 of yacc.c */
2609 #line 599 "parse-gram.y"
2610 {
2611 (yyval.symbol) = symbol_get (quotearg_style (c_quoting_style, (yyvsp[0].chars)), (yylsp[0]));
2612 symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false);
2613 }
2614 /* Line 1380 of yacc.c */
2615 #line 2616 "src/parse-gram.c"
2616 break;
2617
2618 case 103:
2619 /* Line 1380 of yacc.c */
2620 #line 608 "parse-gram.y"
2621 {
2622 code_props plain_code;
2623 code_props_plain_init (&plain_code, (yyvsp[0].chars), (yylsp[0]));
2624 code_props_translate_code (&plain_code);
2625 gram_scanner_last_string_free ();
2626 muscle_code_grow ("epilogue", plain_code.code, (yylsp[0]));
2627 code_scanner_last_string_free ();
2628 }
2629 /* Line 1380 of yacc.c */
2630 #line 2631 "src/parse-gram.c"
2631 break;
2632
2633
2634 /* Line 1380 of yacc.c */
2635 #line 2636 "src/parse-gram.c"
2636 default: break;
2637 }
2638 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2639
2640 YYPOPSTACK (yylen);
2641 yylen = 0;
2642 YY_STACK_PRINT (yyss, yyssp);
2643
2644 *++yyvsp = yyval;
2645 *++yylsp = yyloc;
2646
2647 /* Now `shift' the result of the reduction. Determine what state
2648 that goes to, based on the state we popped back to and the rule
2649 number reduced by. */
2650
2651 yyn = yyr1[yyn];
2652
2653 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2654 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2655 yystate = yytable[yystate];
2656 else
2657 yystate = yydefgoto[yyn - YYNTOKENS];
2658
2659 goto yynewstate;
2660
2661
2662 /*------------------------------------.
2663 | yyerrlab -- here on detecting error |
2664 `------------------------------------*/
2665 yyerrlab:
2666 /* If not already recovering from an error, report this error. */
2667 if (!yyerrstatus)
2668 {
2669 ++yynerrs;
2670 #if ! YYERROR_VERBOSE
2671 yyerror (YY_("syntax error"));
2672 #else
2673 {
2674 YYSIZE_T yysize = yysyntax_error (0, yystate, yytoken);
2675 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2676 {
2677 YYSIZE_T yyalloc = 2 * yysize;
2678 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2679 yyalloc = YYSTACK_ALLOC_MAXIMUM;
2680 if (yymsg != yymsgbuf)
2681 YYSTACK_FREE (yymsg);
2682 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2683 if (yymsg)
2684 yymsg_alloc = yyalloc;
2685 else
2686 {
2687 yymsg = yymsgbuf;
2688 yymsg_alloc = sizeof yymsgbuf;
2689 }
2690 }
2691
2692 if (0 < yysize && yysize <= yymsg_alloc)
2693 {
2694 (void) yysyntax_error (yymsg, yystate, yytoken);
2695 yyerror (yymsg);
2696 }
2697 else
2698 {
2699 yyerror (YY_("syntax error"));
2700 if (yysize != 0)
2701 goto yyexhaustedlab;
2702 }
2703 }
2704 #endif
2705 }
2706
2707 yyerror_range[0] = yylloc;
2708
2709 if (yyerrstatus == 3)
2710 {
2711 /* If just tried and failed to reuse lookahead token after an
2712 error, discard it. */
2713
2714 if (yychar <= YYEOF)
2715 {
2716 /* Return failure if at end of input. */
2717 if (yychar == YYEOF)
2718 YYABORT;
2719 }
2720 else
2721 {
2722 yydestruct ("Error: discarding",
2723 yytoken, &yylval, &yylloc);
2724 yychar = YYEMPTY;
2725 }
2726 }
2727
2728 /* Else will try to reuse lookahead token after shifting the error
2729 token. */
2730 goto yyerrlab1;
2731
2732
2733 /*---------------------------------------------------.
2734 | yyerrorlab -- error raised explicitly by YYERROR. |
2735 `---------------------------------------------------*/
2736 yyerrorlab:
2737
2738 /* Pacify compilers like GCC when the user code never invokes
2739 YYERROR and the label yyerrorlab therefore never appears in user
2740 code. */
2741 if (/*CONSTCOND*/ 0)
2742 goto yyerrorlab;
2743
2744 yyerror_range[0] = yylsp[1-yylen];
2745 /* Do not reclaim the symbols of the rule which action triggered
2746 this YYERROR. */
2747 YYPOPSTACK (yylen);
2748 yylen = 0;
2749 YY_STACK_PRINT (yyss, yyssp);
2750 yystate = *yyssp;
2751 goto yyerrlab1;
2752
2753
2754 /*-------------------------------------------------------------.
2755 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2756 `-------------------------------------------------------------*/
2757 yyerrlab1:
2758 yyerrstatus = 3; /* Each real token shifted decrements this. */
2759
2760 for (;;)
2761 {
2762 yyn = yypact[yystate];
2763 if (yyn != YYPACT_NINF)
2764 {
2765 yyn += YYTERROR;
2766 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2767 {
2768 yyn = yytable[yyn];
2769 if (0 < yyn)
2770 break;
2771 }
2772 }
2773
2774 /* Pop the current state because it cannot handle the error token. */
2775 if (yyssp == yyss)
2776 YYABORT;
2777
2778 yyerror_range[0] = *yylsp;
2779 yydestruct ("Error: popping",
2780 yystos[yystate], yyvsp, yylsp);
2781 YYPOPSTACK (1);
2782 yystate = *yyssp;
2783 YY_STACK_PRINT (yyss, yyssp);
2784 }
2785
2786 *++yyvsp = yylval;
2787
2788 yyerror_range[1] = yylloc;
2789 /* Using YYLLOC is tempting, but would change the location of
2790 the lookahead. YYLOC is available though. */
2791 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
2792 *++yylsp = yyloc;
2793
2794 /* Shift the error token. */
2795 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2796
2797 yystate = yyn;
2798 goto yynewstate;
2799
2800
2801 /*-------------------------------------.
2802 | yyacceptlab -- YYACCEPT comes here. |
2803 `-------------------------------------*/
2804 yyacceptlab:
2805 yyresult = 0;
2806 goto yyreturn;
2807
2808 /*-----------------------------------.
2809 | yyabortlab -- YYABORT comes here. |
2810 `-----------------------------------*/
2811 yyabortlab:
2812 yyresult = 1;
2813 goto yyreturn;
2814
2815 #if !defined(yyoverflow) || YYERROR_VERBOSE
2816 /*-------------------------------------------------.
2817 | yyexhaustedlab -- memory exhaustion comes here. |
2818 `-------------------------------------------------*/
2819 yyexhaustedlab:
2820 yyerror (YY_("memory exhausted"));
2821 yyresult = 2;
2822 /* Fall through. */
2823 #endif
2824
2825 yyreturn:
2826 if (yychar != YYEMPTY)
2827 yydestruct ("Cleanup: discarding lookahead",
2828 yytoken, &yylval, &yylloc);
2829 /* Do not reclaim the symbols of the rule which action triggered
2830 this YYABORT or YYACCEPT. */
2831 YYPOPSTACK (yylen);
2832 YY_STACK_PRINT (yyss, yyssp);
2833 while (yyssp != yyss)
2834 {
2835 yydestruct ("Cleanup: popping",
2836 yystos[*yyssp], yyvsp, yylsp);
2837 YYPOPSTACK (1);
2838 }
2839 #ifndef yyoverflow
2840 if (yyss != yyssa)
2841 YYSTACK_FREE (yyss);
2842 #endif
2843 #if YYERROR_VERBOSE
2844 if (yymsg != yymsgbuf)
2845 YYSTACK_FREE (yymsg);
2846 #endif
2847 /* Make sure YYID is used. */
2848 return YYID (yyresult);
2849 }
2850
2851 /* Line 1599 of yacc.c */
2852 #line 618 "parse-gram.y"
2853
2854
2855
2856 /* Return the location of the left-hand side of a rule whose
2857 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2858 the right-hand side, and return an empty location equal to the end
2859 boundary of RHS[0] if the right-hand side is empty. */
2860
2861 static YYLTYPE
2862 lloc_default (YYLTYPE const *rhs, int n)
2863 {
2864 int i;
2865 YYLTYPE loc;
2866
2867 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2868 The bug is fixed in 7.4.2m, but play it safe for now. */
2869 loc.start = rhs[n].end;
2870 loc.end = rhs[n].end;
2871
2872 /* Ignore empty nonterminals the start of the the right-hand side.
2873 Do not bother to ignore them at the end of the right-hand side,
2874 since empty nonterminals have the same end as their predecessors. */
2875 for (i = 1; i <= n; i++)
2876 if (! equal_boundaries (rhs[i].start, rhs[i].end))
2877 {
2878 loc.start = rhs[i].start;
2879 break;
2880 }
2881
2882 return loc;
2883 }
2884
2885
2886 /* Add a lex-param or a parse-param (depending on TYPE) with
2887 declaration DECL and location LOC. */
2888
2889 static void
2890 add_param (char const *type, char *decl, location loc)
2891 {
2892 static char const alphanum[26 + 26 + 1 + 10] =
2893 "abcdefghijklmnopqrstuvwxyz"
2894 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2895 "_"
2896 "0123456789";
2897 char const *name_start = NULL;
2898 char *p;
2899
2900 /* Stop on last actual character. */
2901 for (p = decl; p[1]; p++)
2902 if ((p == decl
2903 || ! memchr (alphanum, p[-1], sizeof alphanum))
2904 && memchr (alphanum, p[0], sizeof alphanum - 10))
2905 name_start = p;
2906
2907 /* Strip the surrounding '{' and '}', and any blanks just inside
2908 the braces. */
2909 while (*--p == ' ' || *p == '\t')
2910 continue;
2911 p[1] = '\0';
2912 while (*++decl == ' ' || *decl == '\t')
2913 continue;
2914
2915 if (! name_start)
2916 complain_at (loc, _("missing identifier in parameter declaration"));
2917 else
2918 {
2919 char *name;
2920 size_t name_len;
2921
2922 for (name_len = 1;
2923 memchr (alphanum, name_start[name_len], sizeof alphanum);
2924 name_len++)
2925 continue;
2926
2927 name = xmalloc (name_len + 1);
2928 memcpy (name, name_start, name_len);
2929 name[name_len] = '\0';
2930 muscle_pair_list_grow (type, decl, name);
2931 free (name);
2932 }
2933
2934 gram_scanner_last_string_free ();
2935 }
2936
2937
2938 static void
2939 version_check (location const *loc, char const *version)
2940 {
2941 if (strverscmp (version, PACKAGE_VERSION) > 0)
2942 {
2943 complain_at (*loc, "require bison %s, but have %s",
2944 version, PACKAGE_VERSION);
2945 exit (63);
2946 }
2947 }
2948
2949 static void
2950 gram_error (location const *loc, char const *msg)
2951 {
2952 complain_at (*loc, "%s", msg);
2953 }
2954
2955 char const *
2956 token_name (int type)
2957 {
2958 return yytname[YYTRANSLATE (type)];
2959 }
2960
2961 static char const *
2962 char_name (char c)
2963 {
2964 if (c == '\'')
2965 return "'\\''";
2966 else
2967 {
2968 char buf[4];
2969 buf[0] = '\''; buf[1] = c; buf[2] = '\''; buf[3] = '\0';
2970 return quotearg_style (escape_quoting_style, buf);
2971 }
2972 }