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