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