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