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