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