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