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