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