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