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