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