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