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