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