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