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