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