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