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