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