]> 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.931-4323e-dirty. */
2
3 /* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
6
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
29
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
32
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
35
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
42
43 /* Identify Bison output. */
44 #define YYBISON 1
45
46 /* Bison version. */
47 #define YYBISON_VERSION "2.5.1.931-4323e-dirty"
48
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
51
52 /* Pure parsers. */
53 #define YYPURE 1
54
55 /* Push parsers. */
56 #define YYPUSH 0
57
58 /* Pull parsers. */
59 #define YYPULL 1
60
61
62 /* Substitute the variable and function names. */
63 #define yyparse gram_parse
64 #define yylex gram_lex
65 #define yyerror gram_error
66 #define yylval gram_lval
67 #define yychar gram_char
68 #define yydebug gram_debug
69 #define yynerrs gram_nerrs
70 #define yylloc gram_lloc
71
72 /* Copy the first part of user declarations. */
73 /* 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 425 "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, 402,
677 406, 410, 417, 428, 429, 439, 440, 444, 456, 456,
678 461, 461, 466, 477, 492, 493, 494, 495, 499, 500,
679 505, 507, 512, 513, 518, 520, 525, 526, 530, 531,
680 535, 536, 537, 542, 547, 552, 558, 564, 575, 576,
681 585, 586, 592, 593, 594, 601, 601, 609, 610, 611,
682 616, 618, 620, 622, 624, 626, 628, 633, 635, 645,
683 646, 651, 652, 653, 662, 682, 684, 693, 698, 699,
684 704, 711, 713
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 426 "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 goto yysetstate;
2013
2014 /*------------------------------------------------------------.
2015 | yynewstate -- Push a new state, which is found in yystate. |
2016 `------------------------------------------------------------*/
2017 yynewstate:
2018 /* In all cases, when you get here, the value and location stacks
2019 have just been pushed. So pushing a state here evens the stacks. */
2020 yyssp++;
2021
2022 yysetstate:
2023 *yyssp = yystate;
2024
2025 if (yyss + yystacksize - 1 <= yyssp)
2026 {
2027 /* Get the current used size of the three stacks, in elements. */
2028 YYSIZE_T yysize = yyssp - yyss + 1;
2029
2030 #ifdef yyoverflow
2031 {
2032 /* Give user a chance to reallocate the stack. Use copies of
2033 these so that the &'s don't force the real ones into
2034 memory. */
2035 YYSTYPE *yyvs1 = yyvs;
2036 yytype_int16 *yyss1 = yyss;
2037 YYLTYPE *yyls1 = yyls;
2038
2039 /* Each stack pointer address is followed by the size of the
2040 data in use in that stack, in bytes. This used to be a
2041 conditional around just the two extra args, but that might
2042 be undefined if yyoverflow is a macro. */
2043 yyoverflow (YY_("memory exhausted"),
2044 &yyss1, yysize * sizeof (*yyssp),
2045 &yyvs1, yysize * sizeof (*yyvsp),
2046 &yyls1, yysize * sizeof (*yylsp),
2047 &yystacksize);
2048
2049 yyls = yyls1;
2050 yyss = yyss1;
2051 yyvs = yyvs1;
2052 }
2053 #else /* no yyoverflow */
2054 # ifndef YYSTACK_RELOCATE
2055 goto yyexhaustedlab;
2056 # else
2057 /* Extend the stack our own way. */
2058 if (YYMAXDEPTH <= yystacksize)
2059 goto yyexhaustedlab;
2060 yystacksize *= 2;
2061 if (YYMAXDEPTH < yystacksize)
2062 yystacksize = YYMAXDEPTH;
2063
2064 {
2065 yytype_int16 *yyss1 = yyss;
2066 union yyalloc *yyptr =
2067 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2068 if (! yyptr)
2069 goto yyexhaustedlab;
2070 YYSTACK_RELOCATE (yyss_alloc, yyss);
2071 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
2072 YYSTACK_RELOCATE (yyls_alloc, yyls);
2073 # undef YYSTACK_RELOCATE
2074 if (yyss1 != yyssa)
2075 YYSTACK_FREE (yyss1);
2076 }
2077 # endif
2078 #endif /* no yyoverflow */
2079
2080 yyssp = yyss + yysize - 1;
2081 yyvsp = yyvs + yysize - 1;
2082 yylsp = yyls + yysize - 1;
2083
2084 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2085 (unsigned long int) yystacksize));
2086
2087 if (yyss + yystacksize - 1 <= yyssp)
2088 YYABORT;
2089 }
2090
2091 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2092
2093 if (yystate == YYFINAL)
2094 YYACCEPT;
2095
2096 goto yybackup;
2097
2098 /*-----------.
2099 | yybackup. |
2100 `-----------*/
2101 yybackup:
2102
2103 /* Do appropriate processing given the current state. Read a
2104 lookahead token if we need one and don't already have one. */
2105
2106 /* First try to decide what to do without reference to lookahead token. */
2107 yyn = yypact[yystate];
2108 if (yypact_value_is_default (yyn))
2109 goto yydefault;
2110
2111 /* Not known => get a lookahead token if don't already have one. */
2112
2113 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2114 if (yychar == YYEMPTY)
2115 {
2116 YYDPRINTF ((stderr, "Reading a token: "));
2117 yychar = YYLEX;
2118 }
2119
2120 if (yychar <= YYEOF)
2121 {
2122 yychar = yytoken = YYEOF;
2123 YYDPRINTF ((stderr, "Now at end of input.\n"));
2124 }
2125 else
2126 {
2127 yytoken = YYTRANSLATE (yychar);
2128 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2129 }
2130
2131 /* If the proper action on seeing token YYTOKEN is to reduce or to
2132 detect an error, take that action. */
2133 yyn += yytoken;
2134 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2135 {
2136 YY_LAC_ESTABLISH;
2137 goto yydefault;
2138 }
2139 yyn = yytable[yyn];
2140 if (yyn <= 0)
2141 {
2142 if (yytable_value_is_error (yyn))
2143 goto yyerrlab;
2144 YY_LAC_ESTABLISH;
2145 yyn = -yyn;
2146 goto yyreduce;
2147 }
2148
2149 /* Count tokens shifted since error; after three, turn off error
2150 status. */
2151 if (yyerrstatus)
2152 yyerrstatus--;
2153
2154 /* Shift the lookahead token. */
2155 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2156
2157 /* Discard the shifted token. */
2158 yychar = YYEMPTY;
2159 YY_LAC_DISCARD ("shift");
2160
2161 yystate = yyn;
2162 *++yyvsp = yylval;
2163 *++yylsp = yylloc;
2164 goto yynewstate;
2165
2166
2167 /*-----------------------------------------------------------.
2168 | yydefault -- do the default action for the current state. |
2169 `-----------------------------------------------------------*/
2170 yydefault:
2171 yyn = yydefact[yystate];
2172 if (yyn == 0)
2173 goto yyerrlab;
2174 goto yyreduce;
2175
2176
2177 /*-----------------------------.
2178 | yyreduce -- Do a reduction. |
2179 `-----------------------------*/
2180 yyreduce:
2181 /* yyn is the number of a rule to reduce with. */
2182 yylen = yyr2[yyn];
2183
2184 /* If YYLEN is nonzero, implement the default value of the action:
2185 `$$ = $1'.
2186
2187 Otherwise, the following line sets YYVAL to garbage.
2188 This behavior is undocumented and Bison
2189 users should not rely upon it. Assigning to YYVAL
2190 unconditionally makes the parser a bit smaller, and it avoids a
2191 GCC warning that YYVAL may be used uninitialized. */
2192 yyval = yyvsp[1-yylen];
2193
2194 /* Default location. */
2195 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
2196 YY_REDUCE_PRINT (yyn);
2197 {
2198 int yychar_backup = yychar;
2199 switch (yyn)
2200 {
2201 case 6:
2202 /* Line 1701 of yacc.c */
2203 #line 287 "src/parse-gram.y"
2204 {
2205 code_props plain_code;
2206 code_props_plain_init (&plain_code, (yyvsp[0].chars), (yylsp[0]));
2207 code_props_translate_code (&plain_code);
2208 gram_scanner_last_string_free ();
2209 muscle_code_grow (union_seen ? "post_prologue" : "pre_prologue",
2210 plain_code.code, (yylsp[0]));
2211 code_scanner_last_string_free ();
2212 }
2213 /* Line 1701 of yacc.c */
2214 #line 2215 "src/parse-gram.c"
2215 break;
2216
2217 case 7:
2218 /* Line 1701 of yacc.c */
2219 #line 297 "src/parse-gram.y"
2220 {
2221 muscle_percent_define_ensure ((yyvsp[0].uniqstr), (yylsp[0]), true);
2222 }
2223 /* Line 1701 of yacc.c */
2224 #line 2225 "src/parse-gram.c"
2225 break;
2226
2227 case 8:
2228 /* Line 1701 of yacc.c */
2229 #line 301 "src/parse-gram.y"
2230 {
2231 muscle_percent_define_insert ((yyvsp[-1].uniqstr), (yylsp[-1]), (yyvsp[0].chars),
2232 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
2233 }
2234 /* Line 1701 of yacc.c */
2235 #line 2236 "src/parse-gram.c"
2236 break;
2237
2238 case 9:
2239 /* Line 1701 of yacc.c */
2240 #line 305 "src/parse-gram.y"
2241 { defines_flag = true; }
2242 /* Line 1701 of yacc.c */
2243 #line 2244 "src/parse-gram.c"
2244 break;
2245
2246 case 10:
2247 /* Line 1701 of yacc.c */
2248 #line 307 "src/parse-gram.y"
2249 {
2250 defines_flag = true;
2251 spec_defines_file = xstrdup ((yyvsp[0].chars));
2252 }
2253 /* Line 1701 of yacc.c */
2254 #line 2255 "src/parse-gram.c"
2255 break;
2256
2257 case 11:
2258 /* Line 1701 of yacc.c */
2259 #line 312 "src/parse-gram.y"
2260 {
2261 muscle_percent_define_insert ("parse.error", (yylsp[0]), "verbose",
2262 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
2263 }
2264 /* Line 1701 of yacc.c */
2265 #line 2266 "src/parse-gram.c"
2266 break;
2267
2268 case 12:
2269 /* Line 1701 of yacc.c */
2270 #line 316 "src/parse-gram.y"
2271 { expected_sr_conflicts = (yyvsp[0].integer); }
2272 /* Line 1701 of yacc.c */
2273 #line 2274 "src/parse-gram.c"
2274 break;
2275
2276 case 13:
2277 /* Line 1701 of yacc.c */
2278 #line 317 "src/parse-gram.y"
2279 { expected_rr_conflicts = (yyvsp[0].integer); }
2280 /* Line 1701 of yacc.c */
2281 #line 2282 "src/parse-gram.c"
2282 break;
2283
2284 case 14:
2285 /* Line 1701 of yacc.c */
2286 #line 318 "src/parse-gram.y"
2287 { spec_file_prefix = (yyvsp[0].chars); }
2288 /* Line 1701 of yacc.c */
2289 #line 2290 "src/parse-gram.c"
2290 break;
2291
2292 case 15:
2293 /* Line 1701 of yacc.c */
2294 #line 319 "src/parse-gram.y"
2295 { spec_file_prefix = (yyvsp[0].chars); }
2296 /* Line 1701 of yacc.c */
2297 #line 2298 "src/parse-gram.c"
2298 break;
2299
2300 case 16:
2301 /* Line 1701 of yacc.c */
2302 #line 321 "src/parse-gram.y"
2303 {
2304 nondeterministic_parser = true;
2305 glr_parser = true;
2306 }
2307 /* Line 1701 of yacc.c */
2308 #line 2309 "src/parse-gram.c"
2309 break;
2310
2311 case 17:
2312 /* Line 1701 of yacc.c */
2313 #line 326 "src/parse-gram.y"
2314 {
2315 code_props action;
2316 code_props_symbol_action_init (&action, (yyvsp[0].code), (yylsp[0]));
2317 code_props_translate_code (&action);
2318 gram_scanner_last_string_free ();
2319 muscle_code_grow ("initial_action", action.code, (yylsp[0]));
2320 code_scanner_last_string_free ();
2321 }
2322 /* Line 1701 of yacc.c */
2323 #line 2324 "src/parse-gram.c"
2324 break;
2325
2326 case 18:
2327 /* Line 1701 of yacc.c */
2328 #line 334 "src/parse-gram.y"
2329 { language_argmatch ((yyvsp[0].chars), grammar_prio, (yylsp[-1])); }
2330 /* Line 1701 of yacc.c */
2331 #line 2332 "src/parse-gram.c"
2332 break;
2333
2334 case 19:
2335 /* Line 1701 of yacc.c */
2336 #line 335 "src/parse-gram.y"
2337 { spec_name_prefix = (yyvsp[0].chars); }
2338 /* Line 1701 of yacc.c */
2339 #line 2340 "src/parse-gram.c"
2340 break;
2341
2342 case 20:
2343 /* Line 1701 of yacc.c */
2344 #line 336 "src/parse-gram.y"
2345 { spec_name_prefix = (yyvsp[0].chars); }
2346 /* Line 1701 of yacc.c */
2347 #line 2348 "src/parse-gram.c"
2348 break;
2349
2350 case 21:
2351 /* Line 1701 of yacc.c */
2352 #line 337 "src/parse-gram.y"
2353 { no_lines_flag = true; }
2354 /* Line 1701 of yacc.c */
2355 #line 2356 "src/parse-gram.c"
2356 break;
2357
2358 case 22:
2359 /* Line 1701 of yacc.c */
2360 #line 338 "src/parse-gram.y"
2361 { nondeterministic_parser = true; }
2362 /* Line 1701 of yacc.c */
2363 #line 2364 "src/parse-gram.c"
2364 break;
2365
2366 case 23:
2367 /* Line 1701 of yacc.c */
2368 #line 339 "src/parse-gram.y"
2369 { spec_outfile = (yyvsp[0].chars); }
2370 /* Line 1701 of yacc.c */
2371 #line 2372 "src/parse-gram.c"
2372 break;
2373
2374 case 24:
2375 /* Line 1701 of yacc.c */
2376 #line 340 "src/parse-gram.y"
2377 { spec_outfile = (yyvsp[0].chars); }
2378 /* Line 1701 of yacc.c */
2379 #line 2380 "src/parse-gram.c"
2380 break;
2381
2382 case 25:
2383 /* Line 1701 of yacc.c */
2384 #line 341 "src/parse-gram.y"
2385 { current_param = (yyvsp[0].param); }
2386 /* Line 1701 of yacc.c */
2387 #line 2388 "src/parse-gram.c"
2388 break;
2389
2390 case 26:
2391 /* Line 1701 of yacc.c */
2392 #line 341 "src/parse-gram.y"
2393 { current_param = param_none; }
2394 /* Line 1701 of yacc.c */
2395 #line 2396 "src/parse-gram.c"
2396 break;
2397
2398 case 27:
2399 /* Line 1701 of yacc.c */
2400 #line 342 "src/parse-gram.y"
2401 { version_check (&(yylsp[0]), (yyvsp[0].chars)); }
2402 /* Line 1701 of yacc.c */
2403 #line 2404 "src/parse-gram.c"
2404 break;
2405
2406 case 28:
2407 /* Line 1701 of yacc.c */
2408 #line 344 "src/parse-gram.y"
2409 {
2410 char const *skeleton_user = (yyvsp[0].chars);
2411 if (strchr (skeleton_user, '/'))
2412 {
2413 size_t dir_length = strlen (current_file);
2414 char *skeleton_build;
2415 while (dir_length && current_file[dir_length - 1] != '/')
2416 --dir_length;
2417 while (dir_length && current_file[dir_length - 1] == '/')
2418 --dir_length;
2419 skeleton_build =
2420 xmalloc (dir_length + 1 + strlen (skeleton_user) + 1);
2421 if (dir_length > 0)
2422 {
2423 memcpy (skeleton_build, current_file, dir_length);
2424 skeleton_build[dir_length++] = '/';
2425 }
2426 strcpy (skeleton_build + dir_length, skeleton_user);
2427 skeleton_user = uniqstr_new (skeleton_build);
2428 free (skeleton_build);
2429 }
2430 skeleton_arg (skeleton_user, grammar_prio, (yylsp[-1]));
2431 }
2432 /* Line 1701 of yacc.c */
2433 #line 2434 "src/parse-gram.c"
2434 break;
2435
2436 case 29:
2437 /* Line 1701 of yacc.c */
2438 #line 367 "src/parse-gram.y"
2439 { token_table_flag = true; }
2440 /* Line 1701 of yacc.c */
2441 #line 2442 "src/parse-gram.c"
2442 break;
2443
2444 case 30:
2445 /* Line 1701 of yacc.c */
2446 #line 368 "src/parse-gram.y"
2447 { report_flag |= report_states; }
2448 /* Line 1701 of yacc.c */
2449 #line 2450 "src/parse-gram.c"
2450 break;
2451
2452 case 31:
2453 /* Line 1701 of yacc.c */
2454 #line 369 "src/parse-gram.y"
2455 { yacc_flag = true; }
2456 /* Line 1701 of yacc.c */
2457 #line 2458 "src/parse-gram.c"
2458 break;
2459
2460 case 33:
2461 /* Line 1701 of yacc.c */
2462 #line 374 "src/parse-gram.y"
2463 { add_param (current_param, (yyvsp[0].code), (yylsp[0])); }
2464 /* Line 1701 of yacc.c */
2465 #line 2466 "src/parse-gram.c"
2466 break;
2467
2468 case 34:
2469 /* Line 1701 of yacc.c */
2470 #line 375 "src/parse-gram.y"
2471 { add_param (current_param, (yyvsp[0].code), (yylsp[0])); }
2472 /* Line 1701 of yacc.c */
2473 #line 2474 "src/parse-gram.c"
2474 break;
2475
2476 case 37:
2477 /* Line 1701 of yacc.c */
2478 #line 387 "src/parse-gram.y"
2479 {
2480 grammar_start_symbol_set ((yyvsp[0].symbol), (yylsp[0]));
2481 }
2482 /* Line 1701 of yacc.c */
2483 #line 2484 "src/parse-gram.c"
2484 break;
2485
2486 case 38:
2487 /* Line 1701 of yacc.c */
2488 #line 391 "src/parse-gram.y"
2489 {
2490 code_props code;
2491 code_props_symbol_action_init (&code, (yyvsp[-1].code), (yylsp[-1]));
2492 code_props_translate_code (&code);
2493 {
2494 symbol_list *list;
2495 for (list = (yyvsp[0].list); list; list = list->next)
2496 symbol_list_code_props_set (list, (yyvsp[-2].code_type), &code);
2497 symbol_list_free ((yyvsp[0].list));
2498 }
2499 }
2500 /* Line 1701 of yacc.c */
2501 #line 2502 "src/parse-gram.c"
2502 break;
2503
2504 case 39:
2505 /* Line 1701 of yacc.c */
2506 #line 403 "src/parse-gram.y"
2507 {
2508 default_prec = true;
2509 }
2510 /* Line 1701 of yacc.c */
2511 #line 2512 "src/parse-gram.c"
2512 break;
2513
2514 case 40:
2515 /* Line 1701 of yacc.c */
2516 #line 407 "src/parse-gram.y"
2517 {
2518 default_prec = false;
2519 }
2520 /* Line 1701 of yacc.c */
2521 #line 2522 "src/parse-gram.c"
2522 break;
2523
2524 case 41:
2525 /* Line 1701 of yacc.c */
2526 #line 411 "src/parse-gram.y"
2527 {
2528 /* Do not invoke muscle_percent_code_grow here since it invokes
2529 muscle_user_name_list_grow. */
2530 muscle_code_grow ("percent_code()", (yyvsp[0].chars), (yylsp[0]));
2531 code_scanner_last_string_free ();
2532 }
2533 /* Line 1701 of yacc.c */
2534 #line 2535 "src/parse-gram.c"
2535 break;
2536
2537 case 42:
2538 /* Line 1701 of yacc.c */
2539 #line 418 "src/parse-gram.y"
2540 {
2541 muscle_percent_code_grow ((yyvsp[-1].uniqstr), (yylsp[-1]), (yyvsp[0].chars), (yylsp[0]));
2542 code_scanner_last_string_free ();
2543 }
2544 /* Line 1701 of yacc.c */
2545 #line 2546 "src/parse-gram.c"
2546 break;
2547
2548 case 43:
2549 /* Line 1701 of yacc.c */
2550 #line 428 "src/parse-gram.y"
2551 { (yyval.code_type) = destructor; }
2552 /* Line 1701 of yacc.c */
2553 #line 2554 "src/parse-gram.c"
2554 break;
2555
2556 case 44:
2557 /* Line 1701 of yacc.c */
2558 #line 429 "src/parse-gram.y"
2559 { (yyval.code_type) = printer; }
2560 /* Line 1701 of yacc.c */
2561 #line 2562 "src/parse-gram.c"
2562 break;
2563
2564 case 45:
2565 /* Line 1701 of yacc.c */
2566 #line 439 "src/parse-gram.y"
2567 {}
2568 /* Line 1701 of yacc.c */
2569 #line 2570 "src/parse-gram.c"
2570 break;
2571
2572 case 46:
2573 /* Line 1701 of yacc.c */
2574 #line 440 "src/parse-gram.y"
2575 { muscle_code_grow ("union_name", (yyvsp[0].uniqstr), (yylsp[0])); }
2576 /* Line 1701 of yacc.c */
2577 #line 2578 "src/parse-gram.c"
2578 break;
2579
2580 case 47:
2581 /* Line 1701 of yacc.c */
2582 #line 445 "src/parse-gram.y"
2583 {
2584 union_seen = true;
2585 muscle_code_grow ("stype", (yyvsp[0].chars), (yylsp[0]));
2586 code_scanner_last_string_free ();
2587 }
2588 /* Line 1701 of yacc.c */
2589 #line 2590 "src/parse-gram.c"
2590 break;
2591
2592 case 48:
2593 /* Line 1701 of yacc.c */
2594 #line 456 "src/parse-gram.y"
2595 { current_class = nterm_sym; }
2596 /* Line 1701 of yacc.c */
2597 #line 2598 "src/parse-gram.c"
2598 break;
2599
2600 case 49:
2601 /* Line 1701 of yacc.c */
2602 #line 457 "src/parse-gram.y"
2603 {
2604 current_class = unknown_sym;
2605 current_type = NULL;
2606 }
2607 /* Line 1701 of yacc.c */
2608 #line 2609 "src/parse-gram.c"
2609 break;
2610
2611 case 50:
2612 /* Line 1701 of yacc.c */
2613 #line 461 "src/parse-gram.y"
2614 { current_class = token_sym; }
2615 /* Line 1701 of yacc.c */
2616 #line 2617 "src/parse-gram.c"
2617 break;
2618
2619 case 51:
2620 /* Line 1701 of yacc.c */
2621 #line 462 "src/parse-gram.y"
2622 {
2623 current_class = unknown_sym;
2624 current_type = NULL;
2625 }
2626 /* Line 1701 of yacc.c */
2627 #line 2628 "src/parse-gram.c"
2628 break;
2629
2630 case 52:
2631 /* Line 1701 of yacc.c */
2632 #line 467 "src/parse-gram.y"
2633 {
2634 symbol_list *list;
2635 tag_seen = true;
2636 for (list = (yyvsp[0].list); list; list = list->next)
2637 symbol_type_set (list->content.sym, (yyvsp[-1].uniqstr), (yylsp[-1]));
2638 symbol_list_free ((yyvsp[0].list));
2639 }
2640 /* Line 1701 of yacc.c */
2641 #line 2642 "src/parse-gram.c"
2642 break;
2643
2644 case 53:
2645 /* Line 1701 of yacc.c */
2646 #line 478 "src/parse-gram.y"
2647 {
2648 symbol_list *list;
2649 ++current_prec;
2650 for (list = (yyvsp[0].list); list; list = list->next)
2651 {
2652 symbol_type_set (list->content.sym, current_type, (yylsp[-1]));
2653 symbol_precedence_set (list->content.sym, current_prec, (yyvsp[-2].assoc), (yylsp[-2]));
2654 }
2655 symbol_list_free ((yyvsp[0].list));
2656 current_type = NULL;
2657 }
2658 /* Line 1701 of yacc.c */
2659 #line 2660 "src/parse-gram.c"
2660 break;
2661
2662 case 54:
2663 /* Line 1701 of yacc.c */
2664 #line 492 "src/parse-gram.y"
2665 { (yyval.assoc) = left_assoc; }
2666 /* Line 1701 of yacc.c */
2667 #line 2668 "src/parse-gram.c"
2668 break;
2669
2670 case 55:
2671 /* Line 1701 of yacc.c */
2672 #line 493 "src/parse-gram.y"
2673 { (yyval.assoc) = right_assoc; }
2674 /* Line 1701 of yacc.c */
2675 #line 2676 "src/parse-gram.c"
2676 break;
2677
2678 case 56:
2679 /* Line 1701 of yacc.c */
2680 #line 494 "src/parse-gram.y"
2681 { (yyval.assoc) = non_assoc; }
2682 /* Line 1701 of yacc.c */
2683 #line 2684 "src/parse-gram.c"
2684 break;
2685
2686 case 57:
2687 /* Line 1701 of yacc.c */
2688 #line 495 "src/parse-gram.y"
2689 { (yyval.assoc) = precedence_assoc; }
2690 /* Line 1701 of yacc.c */
2691 #line 2692 "src/parse-gram.c"
2692 break;
2693
2694 case 58:
2695 /* Line 1701 of yacc.c */
2696 #line 499 "src/parse-gram.y"
2697 { current_type = NULL; }
2698 /* Line 1701 of yacc.c */
2699 #line 2700 "src/parse-gram.c"
2700 break;
2701
2702 case 59:
2703 /* Line 1701 of yacc.c */
2704 #line 500 "src/parse-gram.y"
2705 { current_type = (yyvsp[0].uniqstr); tag_seen = true; }
2706 /* Line 1701 of yacc.c */
2707 #line 2708 "src/parse-gram.c"
2708 break;
2709
2710 case 60:
2711 /* Line 1701 of yacc.c */
2712 #line 506 "src/parse-gram.y"
2713 { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); }
2714 /* Line 1701 of yacc.c */
2715 #line 2716 "src/parse-gram.c"
2716 break;
2717
2718 case 61:
2719 /* Line 1701 of yacc.c */
2720 #line 508 "src/parse-gram.y"
2721 { (yyval.list) = symbol_list_prepend ((yyvsp[-1].list), symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0]))); }
2722 /* Line 1701 of yacc.c */
2723 #line 2724 "src/parse-gram.c"
2724 break;
2725
2726 case 62:
2727 /* Line 1701 of yacc.c */
2728 #line 512 "src/parse-gram.y"
2729 { (yyval.symbol) = (yyvsp[0].symbol); }
2730 /* Line 1701 of yacc.c */
2731 #line 2732 "src/parse-gram.c"
2732 break;
2733
2734 case 63:
2735 /* Line 1701 of yacc.c */
2736 #line 513 "src/parse-gram.y"
2737 { (yyval.symbol) = (yyvsp[-1].symbol); symbol_user_token_number_set ((yyvsp[-1].symbol), (yyvsp[0].integer), (yylsp[0])); }
2738 /* Line 1701 of yacc.c */
2739 #line 2740 "src/parse-gram.c"
2740 break;
2741
2742 case 64:
2743 /* Line 1701 of yacc.c */
2744 #line 519 "src/parse-gram.y"
2745 { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); }
2746 /* Line 1701 of yacc.c */
2747 #line 2748 "src/parse-gram.c"
2748 break;
2749
2750 case 65:
2751 /* Line 1701 of yacc.c */
2752 #line 521 "src/parse-gram.y"
2753 { (yyval.list) = symbol_list_prepend ((yyvsp[-1].list), symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0]))); }
2754 /* Line 1701 of yacc.c */
2755 #line 2756 "src/parse-gram.c"
2756 break;
2757
2758 case 66:
2759 /* Line 1701 of yacc.c */
2760 #line 525 "src/parse-gram.y"
2761 { (yyval.list) = (yyvsp[0].list); }
2762 /* Line 1701 of yacc.c */
2763 #line 2764 "src/parse-gram.c"
2764 break;
2765
2766 case 67:
2767 /* Line 1701 of yacc.c */
2768 #line 526 "src/parse-gram.y"
2769 { (yyval.list) = symbol_list_prepend ((yyvsp[-1].list), (yyvsp[0].list)); }
2770 /* Line 1701 of yacc.c */
2771 #line 2772 "src/parse-gram.c"
2772 break;
2773
2774 case 68:
2775 /* Line 1701 of yacc.c */
2776 #line 530 "src/parse-gram.y"
2777 { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); }
2778 /* Line 1701 of yacc.c */
2779 #line 2780 "src/parse-gram.c"
2780 break;
2781
2782 case 69:
2783 /* Line 1701 of yacc.c */
2784 #line 531 "src/parse-gram.y"
2785 { (yyval.list) = symbol_list_type_new ((yyvsp[0].uniqstr), (yylsp[0])); }
2786 /* Line 1701 of yacc.c */
2787 #line 2788 "src/parse-gram.c"
2788 break;
2789
2790 case 71:
2791 /* Line 1701 of yacc.c */
2792 #line 536 "src/parse-gram.y"
2793 { (yyval.uniqstr) = uniqstr_new ("*"); }
2794 /* Line 1701 of yacc.c */
2795 #line 2796 "src/parse-gram.c"
2796 break;
2797
2798 case 72:
2799 /* Line 1701 of yacc.c */
2800 #line 537 "src/parse-gram.y"
2801 { (yyval.uniqstr) = uniqstr_new (""); }
2802 /* Line 1701 of yacc.c */
2803 #line 2804 "src/parse-gram.c"
2804 break;
2805
2806 case 73:
2807 /* Line 1701 of yacc.c */
2808 #line 543 "src/parse-gram.y"
2809 {
2810 current_type = (yyvsp[0].uniqstr);
2811 tag_seen = true;
2812 }
2813 /* Line 1701 of yacc.c */
2814 #line 2815 "src/parse-gram.c"
2815 break;
2816
2817 case 74:
2818 /* Line 1701 of yacc.c */
2819 #line 548 "src/parse-gram.y"
2820 {
2821 symbol_class_set ((yyvsp[0].symbol), current_class, (yylsp[0]), true);
2822 symbol_type_set ((yyvsp[0].symbol), current_type, (yylsp[0]));
2823 }
2824 /* Line 1701 of yacc.c */
2825 #line 2826 "src/parse-gram.c"
2826 break;
2827
2828 case 75:
2829 /* Line 1701 of yacc.c */
2830 #line 553 "src/parse-gram.y"
2831 {
2832 symbol_class_set ((yyvsp[-1].symbol), current_class, (yylsp[-1]), true);
2833 symbol_type_set ((yyvsp[-1].symbol), current_type, (yylsp[-1]));
2834 symbol_user_token_number_set ((yyvsp[-1].symbol), (yyvsp[0].integer), (yylsp[0]));
2835 }
2836 /* Line 1701 of yacc.c */
2837 #line 2838 "src/parse-gram.c"
2838 break;
2839
2840 case 76:
2841 /* Line 1701 of yacc.c */
2842 #line 559 "src/parse-gram.y"
2843 {
2844 symbol_class_set ((yyvsp[-1].symbol), current_class, (yylsp[-1]), true);
2845 symbol_type_set ((yyvsp[-1].symbol), current_type, (yylsp[-1]));
2846 symbol_make_alias ((yyvsp[-1].symbol), (yyvsp[0].symbol), (yyloc));
2847 }
2848 /* Line 1701 of yacc.c */
2849 #line 2850 "src/parse-gram.c"
2850 break;
2851
2852 case 77:
2853 /* Line 1701 of yacc.c */
2854 #line 565 "src/parse-gram.y"
2855 {
2856 symbol_class_set ((yyvsp[-2].symbol), current_class, (yylsp[-2]), true);
2857 symbol_type_set ((yyvsp[-2].symbol), current_type, (yylsp[-2]));
2858 symbol_user_token_number_set ((yyvsp[-2].symbol), (yyvsp[-1].integer), (yylsp[-1]));
2859 symbol_make_alias ((yyvsp[-2].symbol), (yyvsp[0].symbol), (yyloc));
2860 }
2861 /* Line 1701 of yacc.c */
2862 #line 2863 "src/parse-gram.c"
2863 break;
2864
2865 case 84:
2866 /* Line 1701 of yacc.c */
2867 #line 595 "src/parse-gram.y"
2868 {
2869 yyerrok;
2870 }
2871 /* Line 1701 of yacc.c */
2872 #line 2873 "src/parse-gram.c"
2873 break;
2874
2875 case 85:
2876 /* Line 1701 of yacc.c */
2877 #line 601 "src/parse-gram.y"
2878 { current_lhs ((yyvsp[-1].symbol), (yylsp[-1]), (yyvsp[0].named_ref)); }
2879 /* Line 1701 of yacc.c */
2880 #line 2881 "src/parse-gram.c"
2881 break;
2882
2883 case 86:
2884 /* Line 1701 of yacc.c */
2885 #line 602 "src/parse-gram.y"
2886 {
2887 /* Free the current lhs. */
2888 current_lhs (0, (yylsp[-3]), 0);
2889 }
2890 /* Line 1701 of yacc.c */
2891 #line 2892 "src/parse-gram.c"
2892 break;
2893
2894 case 87:
2895 /* Line 1701 of yacc.c */
2896 #line 609 "src/parse-gram.y"
2897 { grammar_current_rule_end ((yylsp[0])); }
2898 /* Line 1701 of yacc.c */
2899 #line 2900 "src/parse-gram.c"
2900 break;
2901
2902 case 88:
2903 /* Line 1701 of yacc.c */
2904 #line 610 "src/parse-gram.y"
2905 { grammar_current_rule_end ((yylsp[0])); }
2906 /* Line 1701 of yacc.c */
2907 #line 2908 "src/parse-gram.c"
2908 break;
2909
2910 case 90:
2911 /* Line 1701 of yacc.c */
2912 #line 616 "src/parse-gram.y"
2913 { grammar_current_rule_begin (current_lhs_symbol, current_lhs_location,
2914 current_lhs_named_ref); }
2915 /* Line 1701 of yacc.c */
2916 #line 2917 "src/parse-gram.c"
2917 break;
2918
2919 case 91:
2920 /* Line 1701 of yacc.c */
2921 #line 619 "src/parse-gram.y"
2922 { grammar_current_rule_symbol_append ((yyvsp[-1].symbol), (yylsp[-1]), (yyvsp[0].named_ref)); }
2923 /* Line 1701 of yacc.c */
2924 #line 2925 "src/parse-gram.c"
2925 break;
2926
2927 case 92:
2928 /* Line 1701 of yacc.c */
2929 #line 621 "src/parse-gram.y"
2930 { grammar_current_rule_action_append ((yyvsp[-1].code), (yylsp[-1]), (yyvsp[0].named_ref), false); }
2931 /* Line 1701 of yacc.c */
2932 #line 2933 "src/parse-gram.c"
2933 break;
2934
2935 case 93:
2936 /* Line 1701 of yacc.c */
2937 #line 623 "src/parse-gram.y"
2938 { grammar_current_rule_action_append ((yyvsp[0].code), (yylsp[0]), NULL, true); }
2939 /* Line 1701 of yacc.c */
2940 #line 2941 "src/parse-gram.c"
2941 break;
2942
2943 case 94:
2944 /* Line 1701 of yacc.c */
2945 #line 625 "src/parse-gram.y"
2946 { grammar_current_rule_prec_set ((yyvsp[0].symbol), (yylsp[0])); }
2947 /* Line 1701 of yacc.c */
2948 #line 2949 "src/parse-gram.c"
2949 break;
2950
2951 case 95:
2952 /* Line 1701 of yacc.c */
2953 #line 627 "src/parse-gram.y"
2954 { grammar_current_rule_dprec_set ((yyvsp[0].integer), (yylsp[0])); }
2955 /* Line 1701 of yacc.c */
2956 #line 2957 "src/parse-gram.c"
2957 break;
2958
2959 case 96:
2960 /* Line 1701 of yacc.c */
2961 #line 629 "src/parse-gram.y"
2962 { grammar_current_rule_merge_set ((yyvsp[0].uniqstr), (yylsp[0])); }
2963 /* Line 1701 of yacc.c */
2964 #line 2965 "src/parse-gram.c"
2965 break;
2966
2967 case 97:
2968 /* Line 1701 of yacc.c */
2969 #line 633 "src/parse-gram.y"
2970 { (yyval.named_ref) = 0; }
2971 /* Line 1701 of yacc.c */
2972 #line 2973 "src/parse-gram.c"
2973 break;
2974
2975 case 98:
2976 /* Line 1701 of yacc.c */
2977 #line 635 "src/parse-gram.y"
2978 { (yyval.named_ref) = named_ref_new((yyvsp[0].uniqstr), (yylsp[0])); }
2979 /* Line 1701 of yacc.c */
2980 #line 2981 "src/parse-gram.c"
2981 break;
2982
2983 case 100:
2984 /* Line 1701 of yacc.c */
2985 #line 646 "src/parse-gram.y"
2986 { (yyval.uniqstr) = uniqstr_new ((yyvsp[0].chars)); }
2987 /* Line 1701 of yacc.c */
2988 #line 2989 "src/parse-gram.c"
2989 break;
2990
2991 case 101:
2992 /* Line 1701 of yacc.c */
2993 #line 651 "src/parse-gram.y"
2994 { (yyval.chars) = ""; }
2995 /* Line 1701 of yacc.c */
2996 #line 2997 "src/parse-gram.c"
2997 break;
2998
2999 case 102:
3000 /* Line 1701 of yacc.c */
3001 #line 652 "src/parse-gram.y"
3002 { (yyval.chars) = (yyvsp[0].uniqstr); }
3003 /* Line 1701 of yacc.c */
3004 #line 3005 "src/parse-gram.c"
3005 break;
3006
3007 case 104:
3008 /* Line 1701 of yacc.c */
3009 #line 663 "src/parse-gram.y"
3010 {
3011 code_props plain_code;
3012 (yyvsp[0].code)[strlen ((yyvsp[0].code)) - 1] = '\n';
3013 code_props_plain_init (&plain_code, (yyvsp[0].code)+1, (yylsp[0]));
3014 code_props_translate_code (&plain_code);
3015 gram_scanner_last_string_free ();
3016 (yyval.chars) = plain_code.code;
3017 }
3018 /* Line 1701 of yacc.c */
3019 #line 3020 "src/parse-gram.c"
3020 break;
3021
3022 case 105:
3023 /* Line 1701 of yacc.c */
3024 #line 683 "src/parse-gram.y"
3025 { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); }
3026 /* Line 1701 of yacc.c */
3027 #line 3028 "src/parse-gram.c"
3028 break;
3029
3030 case 106:
3031 /* Line 1701 of yacc.c */
3032 #line 685 "src/parse-gram.y"
3033 {
3034 (yyval.symbol) = symbol_get (char_name ((yyvsp[0].character)), (yylsp[0]));
3035 symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false);
3036 symbol_user_token_number_set ((yyval.symbol), (yyvsp[0].character), (yylsp[0]));
3037 }
3038 /* Line 1701 of yacc.c */
3039 #line 3040 "src/parse-gram.c"
3040 break;
3041
3042 case 107:
3043 /* Line 1701 of yacc.c */
3044 #line 693 "src/parse-gram.y"
3045 { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); }
3046 /* Line 1701 of yacc.c */
3047 #line 3048 "src/parse-gram.c"
3048 break;
3049
3050 case 110:
3051 /* Line 1701 of yacc.c */
3052 #line 705 "src/parse-gram.y"
3053 {
3054 (yyval.symbol) = symbol_get (quotearg_style (c_quoting_style, (yyvsp[0].chars)), (yylsp[0]));
3055 symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false);
3056 }
3057 /* Line 1701 of yacc.c */
3058 #line 3059 "src/parse-gram.c"
3059 break;
3060
3061 case 112:
3062 /* Line 1701 of yacc.c */
3063 #line 714 "src/parse-gram.y"
3064 {
3065 code_props plain_code;
3066 code_props_plain_init (&plain_code, (yyvsp[0].chars), (yylsp[0]));
3067 code_props_translate_code (&plain_code);
3068 gram_scanner_last_string_free ();
3069 muscle_code_grow ("epilogue", plain_code.code, (yylsp[0]));
3070 code_scanner_last_string_free ();
3071 }
3072 /* Line 1701 of yacc.c */
3073 #line 3074 "src/parse-gram.c"
3074 break;
3075
3076
3077 /* Line 1701 of yacc.c */
3078 #line 3079 "src/parse-gram.c"
3079 default: break;
3080 }
3081 if (yychar_backup != yychar)
3082 YY_LAC_DISCARD ("yychar change");
3083 }
3084 /* User semantic actions sometimes alter yychar, and that requires
3085 that yytoken be updated with the new translation. We take the
3086 approach of translating immediately before every use of yytoken.
3087 One alternative is translating here after every semantic action,
3088 but that translation would be missed if the semantic action invokes
3089 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
3090 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
3091 incorrect destructor might then be invoked immediately. In the
3092 case of YYERROR or YYBACKUP, subsequent parser actions might lead
3093 to an incorrect destructor call or verbose syntax error message
3094 before the lookahead is translated. */
3095 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
3096
3097 YYPOPSTACK (yylen);
3098 yylen = 0;
3099 YY_STACK_PRINT (yyss, yyssp);
3100
3101 *++yyvsp = yyval;
3102 *++yylsp = yyloc;
3103
3104 /* Now `shift' the result of the reduction. Determine what state
3105 that goes to, based on the state we popped back to and the rule
3106 number reduced by. */
3107
3108 yyn = yyr1[yyn];
3109
3110 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
3111 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3112 yystate = yytable[yystate];
3113 else
3114 yystate = yydefgoto[yyn - YYNTOKENS];
3115
3116 goto yynewstate;
3117
3118
3119 /*--------------------------------------.
3120 | yyerrlab -- here on detecting error. |
3121 `--------------------------------------*/
3122 yyerrlab:
3123 /* Make sure we have latest lookahead translation. See comments at
3124 user semantic actions for why this is necessary. */
3125 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
3126
3127 /* If not already recovering from an error, report this error. */
3128 if (!yyerrstatus)
3129 {
3130 ++yynerrs;
3131 #if ! YYERROR_VERBOSE
3132 yyerror (YY_("syntax error"));
3133 #else
3134 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3135 yyesa, &yyes, &yyes_capacity, \
3136 yyssp, yytoken)
3137 {
3138 char const *yymsgp = YY_("syntax error");
3139 int yysyntax_error_status;
3140 if (yychar != YYEMPTY)
3141 YY_LAC_ESTABLISH;
3142 yysyntax_error_status = YYSYNTAX_ERROR;
3143 if (yysyntax_error_status == 0)
3144 yymsgp = yymsg;
3145 else if (yysyntax_error_status == 1)
3146 {
3147 if (yymsg != yymsgbuf)
3148 YYSTACK_FREE (yymsg);
3149 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
3150 if (!yymsg)
3151 {
3152 yymsg = yymsgbuf;
3153 yymsg_alloc = sizeof yymsgbuf;
3154 yysyntax_error_status = 2;
3155 }
3156 else
3157 {
3158 yysyntax_error_status = YYSYNTAX_ERROR;
3159 yymsgp = yymsg;
3160 }
3161 }
3162 yyerror (yymsgp);
3163 if (yysyntax_error_status == 2)
3164 goto yyexhaustedlab;
3165 }
3166 # undef YYSYNTAX_ERROR
3167 #endif
3168 }
3169
3170 yyerror_range[1] = yylloc;
3171
3172 if (yyerrstatus == 3)
3173 {
3174 /* If just tried and failed to reuse lookahead token after an
3175 error, discard it. */
3176
3177 if (yychar <= YYEOF)
3178 {
3179 /* Return failure if at end of input. */
3180 if (yychar == YYEOF)
3181 YYABORT;
3182 }
3183 else
3184 {
3185 yydestruct ("Error: discarding",
3186 yytoken, &yylval, &yylloc);
3187 yychar = YYEMPTY;
3188 }
3189 }
3190
3191 /* Else will try to reuse lookahead token after shifting the error
3192 token. */
3193 goto yyerrlab1;
3194
3195
3196 /*---------------------------------------------------.
3197 | yyerrorlab -- error raised explicitly by YYERROR. |
3198 `---------------------------------------------------*/
3199 yyerrorlab:
3200
3201 /* Pacify compilers like GCC when the user code never invokes
3202 YYERROR and the label yyerrorlab therefore never appears in user
3203 code. */
3204 if (/*CONSTCOND*/ 0)
3205 goto yyerrorlab;
3206
3207 yyerror_range[1] = yylsp[1-yylen];
3208 /* Do not reclaim the symbols of the rule which action triggered
3209 this YYERROR. */
3210 YYPOPSTACK (yylen);
3211 yylen = 0;
3212 YY_STACK_PRINT (yyss, yyssp);
3213 yystate = *yyssp;
3214 goto yyerrlab1;
3215
3216
3217 /*-------------------------------------------------------------.
3218 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3219 `-------------------------------------------------------------*/
3220 yyerrlab1:
3221 yyerrstatus = 3; /* Each real token shifted decrements this. */
3222
3223 for (;;)
3224 {
3225 yyn = yypact[yystate];
3226 if (!yypact_value_is_default (yyn))
3227 {
3228 yyn += YYTERROR;
3229 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
3230 {
3231 yyn = yytable[yyn];
3232 if (0 < yyn)
3233 break;
3234 }
3235 }
3236
3237 /* Pop the current state because it cannot handle the error token. */
3238 if (yyssp == yyss)
3239 YYABORT;
3240
3241 yyerror_range[1] = *yylsp;
3242 yydestruct ("Error: popping",
3243 yystos[yystate], yyvsp, yylsp);
3244 YYPOPSTACK (1);
3245 yystate = *yyssp;
3246 YY_STACK_PRINT (yyss, yyssp);
3247 }
3248
3249 /* If the stack popping above didn't lose the initial context for the
3250 current lookahead token, the shift below will for sure. */
3251 YY_LAC_DISCARD ("error recovery");
3252
3253 *++yyvsp = yylval;
3254
3255 yyerror_range[2] = yylloc;
3256 /* Using YYLLOC is tempting, but would change the location of
3257 the lookahead. YYLOC is available though. */
3258 YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
3259 *++yylsp = yyloc;
3260
3261 /* Shift the error token. */
3262 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
3263
3264 yystate = yyn;
3265 goto yynewstate;
3266
3267
3268 /*-------------------------------------.
3269 | yyacceptlab -- YYACCEPT comes here. |
3270 `-------------------------------------*/
3271 yyacceptlab:
3272 yyresult = 0;
3273 goto yyreturn;
3274
3275 /*-----------------------------------.
3276 | yyabortlab -- YYABORT comes here. |
3277 `-----------------------------------*/
3278 yyabortlab:
3279 yyresult = 1;
3280 goto yyreturn;
3281
3282 #if 1
3283 /*-------------------------------------------------.
3284 | yyexhaustedlab -- memory exhaustion comes here. |
3285 `-------------------------------------------------*/
3286 yyexhaustedlab:
3287 yyerror (YY_("memory exhausted"));
3288 yyresult = 2;
3289 /* Fall through. */
3290 #endif
3291
3292 yyreturn:
3293 if (yychar != YYEMPTY)
3294 {
3295 /* Make sure we have latest lookahead translation. See comments at
3296 user semantic actions for why this is necessary. */
3297 yytoken = YYTRANSLATE (yychar);
3298 yydestruct ("Cleanup: discarding lookahead",
3299 yytoken, &yylval, &yylloc);
3300 }
3301 /* Do not reclaim the symbols of the rule which action triggered
3302 this YYABORT or YYACCEPT. */
3303 YYPOPSTACK (yylen);
3304 YY_STACK_PRINT (yyss, yyssp);
3305 while (yyssp != yyss)
3306 {
3307 yydestruct ("Cleanup: popping",
3308 yystos[*yyssp], yyvsp, yylsp);
3309 YYPOPSTACK (1);
3310 }
3311 #ifndef yyoverflow
3312 if (yyss != yyssa)
3313 YYSTACK_FREE (yyss);
3314 #endif
3315 if (yyes != yyesa)
3316 YYSTACK_FREE (yyes);
3317 #if YYERROR_VERBOSE
3318 if (yymsg != yymsgbuf)
3319 YYSTACK_FREE (yymsg);
3320 #endif
3321 /* Make sure YYID is used. */
3322 return YYID (yyresult);
3323 }
3324
3325 /* Line 1961 of yacc.c */
3326 #line 724 "src/parse-gram.y"
3327
3328
3329
3330 /* Return the location of the left-hand side of a rule whose
3331 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
3332 the right-hand side, and return an empty location equal to the end
3333 boundary of RHS[0] if the right-hand side is empty. */
3334
3335 static YYLTYPE
3336 lloc_default (YYLTYPE const *rhs, int n)
3337 {
3338 int i;
3339 YYLTYPE loc;
3340
3341 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
3342 The bug is fixed in 7.4.2m, but play it safe for now. */
3343 loc.start = rhs[n].end;
3344 loc.end = rhs[n].end;
3345
3346 /* Ignore empty nonterminals the start of the right-hand side.
3347 Do not bother to ignore them at the end of the right-hand side,
3348 since empty nonterminals have the same end as their predecessors. */
3349 for (i = 1; i <= n; i++)
3350 if (! equal_boundaries (rhs[i].start, rhs[i].end))
3351 {
3352 loc.start = rhs[i].start;
3353 break;
3354 }
3355
3356 return loc;
3357 }
3358
3359
3360 static void
3361 add_param (param_type type, char *decl, location loc)
3362 {
3363 static char const alphanum[26 + 26 + 1 + 10] =
3364 "abcdefghijklmnopqrstuvwxyz"
3365 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
3366 "_"
3367 "0123456789";
3368
3369 char const *name_start = NULL;
3370 {
3371 char *p;
3372 /* Stop on last actual character. */
3373 for (p = decl; p[1]; p++)
3374 if ((p == decl
3375 || ! memchr (alphanum, p[-1], sizeof alphanum))
3376 && memchr (alphanum, p[0], sizeof alphanum - 10))
3377 name_start = p;
3378
3379 /* Strip the surrounding '{' and '}', and any blanks just inside
3380 the braces. */
3381 while (*--p == ' ' || *p == '\t')
3382 continue;
3383 p[1] = '\0';
3384 while (*++decl == ' ' || *decl == '\t')
3385 continue;
3386 }
3387
3388 if (! name_start)
3389 complain_at (loc, complaint,
3390 _("missing identifier in parameter declaration"));
3391 else
3392 {
3393 char *name = xmemdup0 (name_start, strspn (name_start, alphanum));
3394 if (type & param_lex)
3395 muscle_pair_list_grow ("lex_param", decl, name);
3396 if (type & param_parse)
3397 muscle_pair_list_grow ("parse_param", decl, name);
3398 free (name);
3399 }
3400
3401 gram_scanner_last_string_free ();
3402 }
3403
3404
3405 static void
3406 version_check (location const *loc, char const *version)
3407 {
3408 if (strverscmp (version, PACKAGE_VERSION) > 0)
3409 {
3410 complain_at (*loc, complaint, "require bison %s, but have %s",
3411 version, PACKAGE_VERSION);
3412 exit (EX_MISMATCH);
3413 }
3414 }
3415
3416 static void
3417 gram_error (location const *loc, char const *msg)
3418 {
3419 complain_at (*loc, complaint, "%s", msg);
3420 }
3421
3422 char const *
3423 token_name (int type)
3424 {
3425 return yytname[YYTRANSLATE (type)];
3426 }
3427
3428 static char const *
3429 char_name (char c)
3430 {
3431 if (c == '\'')
3432 return "'\\''";
3433 else
3434 {
3435 char buf[4];
3436 buf[0] = '\''; buf[1] = c; buf[2] = '\''; buf[3] = '\0';
3437 return quotearg_style (escape_quoting_style, buf);
3438 }
3439 }