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