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