]> git.saurik.com Git - bison.git/blob - src/parse-gram.c
2fe9c9ace3361f723c16c75c0132834b6338c31c
[bison.git] / src / parse-gram.c
1 /* A Bison parser, made by GNU Bison 2.4.1.171-692d. */
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 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.171-692d"
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 252 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 Free
82 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 252 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 277 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 277 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 327 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 _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
450 || defined __cplusplus || defined _MSC_VER)
451 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
452 # ifndef _STDLIB_H
453 # define _STDLIB_H 1
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 _STDLIB_H \
477 && ! ((defined YYMALLOC || defined malloc) \
478 && (defined YYFREE || defined free)))
479 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
480 # ifndef _STDLIB_H
481 # define _STDLIB_H 1
482 # endif
483 # endif
484 # ifndef YYMALLOC
485 # define YYMALLOC malloc
486 # if ! defined malloc && ! defined _STDLIB_H && (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 _STDLIB_H && (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 yytoken = YYTRANSLATE (yychar); \
931 YYPOPSTACK (1); \
932 goto yybackup; \
933 } \
934 else \
935 { \
936 yyerror (YY_("syntax error: cannot back up")); \
937 YYERROR; \
938 } \
939 while (YYID (0))
940
941
942 #define YYTERROR 1
943 #define YYERRCODE 256
944
945
946 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
947 If N is 0, then set CURRENT to the empty location which ends
948 the previous symbol: RHS[0] (always defined). */
949
950 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
951 #ifndef YYLLOC_DEFAULT
952 # define YYLLOC_DEFAULT(Current, Rhs, N) \
953 do \
954 if (YYID (N)) \
955 { \
956 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
957 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
958 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
959 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
960 } \
961 else \
962 { \
963 (Current).first_line = (Current).last_line = \
964 YYRHSLOC (Rhs, 0).last_line; \
965 (Current).first_column = (Current).last_column = \
966 YYRHSLOC (Rhs, 0).last_column; \
967 } \
968 while (YYID (0))
969 #endif
970
971
972 /* YY_LOCATION_PRINT -- Print the location on the stream.
973 This macro was not mandated originally: define only if we know
974 we won't break user code: when these are the locations we know. */
975
976 #ifndef YY_LOCATION_PRINT
977 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
978 # define YY_LOCATION_PRINT(File, Loc) \
979 fprintf (File, "%d.%d-%d.%d", \
980 (Loc).first_line, (Loc).first_column, \
981 (Loc).last_line, (Loc).last_column)
982 # else
983 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
984 # endif
985 #endif
986
987
988 /* YYLEX -- calling `yylex' with the right arguments. */
989
990 #ifdef YYLEX_PARAM
991 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
992 #else
993 # define YYLEX yylex (&yylval, &yylloc)
994 #endif
995
996 /* Enable debugging if requested. */
997 #if YYDEBUG
998
999 # ifndef YYFPRINTF
1000 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1001 # define YYFPRINTF fprintf
1002 # endif
1003
1004 # define YYDPRINTF(Args) \
1005 do { \
1006 if (yydebug) \
1007 YYFPRINTF Args; \
1008 } while (YYID (0))
1009
1010 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1011 do { \
1012 if (yydebug) \
1013 { \
1014 YYFPRINTF (stderr, "%s ", Title); \
1015 yy_symbol_print (stderr, \
1016 Type, Value, Location); \
1017 YYFPRINTF (stderr, "\n"); \
1018 } \
1019 } while (YYID (0))
1020
1021
1022 /*--------------------------------.
1023 | Print this symbol on YYOUTPUT. |
1024 `--------------------------------*/
1025
1026 /*ARGSUSED*/
1027 #if (defined __STDC__ || defined __C99__FUNC__ \
1028 || defined __cplusplus || defined _MSC_VER)
1029 static void
1030 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
1031 #else
1032 static void
1033 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp)
1034 FILE *yyoutput;
1035 int yytype;
1036 YYSTYPE const * const yyvaluep;
1037 YYLTYPE const * const yylocationp;
1038 #endif
1039 {
1040 if (!yyvaluep)
1041 return;
1042 YYUSE (yylocationp);
1043 # ifdef YYPRINT
1044 if (yytype < YYNTOKENS)
1045 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1046 # else
1047 YYUSE (yyoutput);
1048 # endif
1049 switch (yytype)
1050 {
1051 case 3: /* "\"string\"" */
1052
1053 /* Line 799 of yacc.c */
1054 #line 184 "parse-gram.y"
1055 { fputs (quotearg_style (c_quoting_style, (yyvaluep->chars)), stderr); };
1056
1057 /* Line 799 of yacc.c */
1058 #line 1059 "parse-gram.c"
1059 break;
1060 case 4: /* "\"integer\"" */
1061
1062 /* Line 799 of yacc.c */
1063 #line 196 "parse-gram.y"
1064 { fprintf (stderr, "%d", (yyvaluep->integer)); };
1065
1066 /* Line 799 of yacc.c */
1067 #line 1068 "parse-gram.c"
1068 break;
1069 case 43: /* "\"{...}\"" */
1070
1071 /* Line 799 of yacc.c */
1072 #line 186 "parse-gram.y"
1073 { fprintf (stderr, "{\n%s\n}", (yyvaluep->code)); };
1074
1075 /* Line 799 of yacc.c */
1076 #line 1077 "parse-gram.c"
1077 break;
1078 case 44: /* "\"[identifier]\"" */
1079
1080 /* Line 799 of yacc.c */
1081 #line 191 "parse-gram.y"
1082 { fprintf (stderr, "[%s]", (yyvaluep->uniqstr)); };
1083
1084 /* Line 799 of yacc.c */
1085 #line 1086 "parse-gram.c"
1086 break;
1087 case 45: /* "\"char\"" */
1088
1089 /* Line 799 of yacc.c */
1090 #line 178 "parse-gram.y"
1091 { fputs (char_name ((yyvaluep->character)), stderr); };
1092
1093 /* Line 799 of yacc.c */
1094 #line 1095 "parse-gram.c"
1095 break;
1096 case 46: /* "\"epilogue\"" */
1097
1098 /* Line 799 of yacc.c */
1099 #line 186 "parse-gram.y"
1100 { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); };
1101
1102 /* Line 799 of yacc.c */
1103 #line 1104 "parse-gram.c"
1104 break;
1105 case 48: /* "\"identifier\"" */
1106
1107 /* Line 799 of yacc.c */
1108 #line 190 "parse-gram.y"
1109 { fputs ((yyvaluep->uniqstr), stderr); };
1110
1111 /* Line 799 of yacc.c */
1112 #line 1113 "parse-gram.c"
1113 break;
1114 case 49: /* "\"identifier:\"" */
1115
1116 /* Line 799 of yacc.c */
1117 #line 192 "parse-gram.y"
1118 { fprintf (stderr, "%s:", (yyvaluep->uniqstr)); };
1119
1120 /* Line 799 of yacc.c */
1121 #line 1122 "parse-gram.c"
1122 break;
1123 case 52: /* "\"%{...%}\"" */
1124
1125 /* Line 799 of yacc.c */
1126 #line 186 "parse-gram.y"
1127 { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); };
1128
1129 /* Line 799 of yacc.c */
1130 #line 1131 "parse-gram.c"
1131 break;
1132 case 54: /* "\"type\"" */
1133
1134 /* Line 799 of yacc.c */
1135 #line 193 "parse-gram.y"
1136 { fprintf (stderr, "<%s>", (yyvaluep->uniqstr)); };
1137
1138 /* Line 799 of yacc.c */
1139 #line 1140 "parse-gram.c"
1140 break;
1141 case 71: /* "symbol.prec" */
1142
1143 /* Line 799 of yacc.c */
1144 #line 199 "parse-gram.y"
1145 { fprintf (stderr, "%s", (yyvaluep->symbol)->tag); };
1146
1147 /* Line 799 of yacc.c */
1148 #line 1149 "parse-gram.c"
1149 break;
1150 case 84: /* "variable" */
1151
1152 /* Line 799 of yacc.c */
1153 #line 190 "parse-gram.y"
1154 { fputs ((yyvaluep->uniqstr), stderr); };
1155
1156 /* Line 799 of yacc.c */
1157 #line 1158 "parse-gram.c"
1158 break;
1159 case 85: /* "content.opt" */
1160
1161 /* Line 799 of yacc.c */
1162 #line 186 "parse-gram.y"
1163 { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); };
1164
1165 /* Line 799 of yacc.c */
1166 #line 1167 "parse-gram.c"
1167 break;
1168 case 86: /* "braceless" */
1169
1170 /* Line 799 of yacc.c */
1171 #line 186 "parse-gram.y"
1172 { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); };
1173
1174 /* Line 799 of yacc.c */
1175 #line 1176 "parse-gram.c"
1176 break;
1177 case 87: /* "id" */
1178
1179 /* Line 799 of yacc.c */
1180 #line 199 "parse-gram.y"
1181 { fprintf (stderr, "%s", (yyvaluep->symbol)->tag); };
1182
1183 /* Line 799 of yacc.c */
1184 #line 1185 "parse-gram.c"
1185 break;
1186 case 88: /* "id_colon" */
1187
1188 /* Line 799 of yacc.c */
1189 #line 200 "parse-gram.y"
1190 { fprintf (stderr, "%s:", (yyvaluep->symbol)->tag); };
1191
1192 /* Line 799 of yacc.c */
1193 #line 1194 "parse-gram.c"
1194 break;
1195 case 89: /* "symbol" */
1196
1197 /* Line 799 of yacc.c */
1198 #line 199 "parse-gram.y"
1199 { fprintf (stderr, "%s", (yyvaluep->symbol)->tag); };
1200
1201 /* Line 799 of yacc.c */
1202 #line 1203 "parse-gram.c"
1203 break;
1204 case 90: /* "string_as_id" */
1205
1206 /* Line 799 of yacc.c */
1207 #line 199 "parse-gram.y"
1208 { fprintf (stderr, "%s", (yyvaluep->symbol)->tag); };
1209
1210 /* Line 799 of yacc.c */
1211 #line 1212 "parse-gram.c"
1212 break;
1213 default:
1214 break;
1215 }
1216 }
1217
1218
1219 /*--------------------------------.
1220 | Print this symbol on YYOUTPUT. |
1221 `--------------------------------*/
1222
1223 #if (defined __STDC__ || defined __C99__FUNC__ \
1224 || defined __cplusplus || defined _MSC_VER)
1225 static void
1226 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
1227 #else
1228 static void
1229 yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp)
1230 FILE *yyoutput;
1231 int yytype;
1232 YYSTYPE const * const yyvaluep;
1233 YYLTYPE const * const yylocationp;
1234 #endif
1235 {
1236 if (yytype < YYNTOKENS)
1237 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1238 else
1239 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1240
1241 YY_LOCATION_PRINT (yyoutput, *yylocationp);
1242 YYFPRINTF (yyoutput, ": ");
1243 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
1244 YYFPRINTF (yyoutput, ")");
1245 }
1246
1247 /*------------------------------------------------------------------.
1248 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1249 | TOP (included). |
1250 `------------------------------------------------------------------*/
1251
1252 #if (defined __STDC__ || defined __C99__FUNC__ \
1253 || defined __cplusplus || defined _MSC_VER)
1254 static void
1255 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1256 #else
1257 static void
1258 yy_stack_print (yybottom, yytop)
1259 yytype_int16 *yybottom;
1260 yytype_int16 *yytop;
1261 #endif
1262 {
1263 YYFPRINTF (stderr, "Stack now");
1264 for (; yybottom <= yytop; yybottom++)
1265 {
1266 int yybot = *yybottom;
1267 YYFPRINTF (stderr, " %d", yybot);
1268 }
1269 YYFPRINTF (stderr, "\n");
1270 }
1271
1272 # define YY_STACK_PRINT(Bottom, Top) \
1273 do { \
1274 if (yydebug) \
1275 yy_stack_print ((Bottom), (Top)); \
1276 } while (YYID (0))
1277
1278
1279 /*------------------------------------------------.
1280 | Report that the YYRULE is going to be reduced. |
1281 `------------------------------------------------*/
1282
1283 #if (defined __STDC__ || defined __C99__FUNC__ \
1284 || defined __cplusplus || defined _MSC_VER)
1285 static void
1286 yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule)
1287 #else
1288 static void
1289 yy_reduce_print (yyvsp, yylsp, yyrule)
1290 YYSTYPE *yyvsp;
1291 YYLTYPE *yylsp;
1292 int yyrule;
1293 #endif
1294 {
1295 int yynrhs = yyr2[yyrule];
1296 int yyi;
1297 unsigned long int yylno = yyrline[yyrule];
1298 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1299 yyrule - 1, yylno);
1300 /* The symbols being reduced. */
1301 for (yyi = 0; yyi < yynrhs; yyi++)
1302 {
1303 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1304 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1305 &(yyvsp[(yyi + 1) - (yynrhs)])
1306 , &(yylsp[(yyi + 1) - (yynrhs)]) );
1307 YYFPRINTF (stderr, "\n");
1308 }
1309 }
1310
1311 # define YY_REDUCE_PRINT(Rule) \
1312 do { \
1313 if (yydebug) \
1314 yy_reduce_print (yyvsp, yylsp, Rule); \
1315 } while (YYID (0))
1316
1317 /* Nonzero means print parse trace. It is left uninitialized so that
1318 multiple parsers can coexist. */
1319 int yydebug;
1320 #else /* !YYDEBUG */
1321 # define YYDPRINTF(Args)
1322 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1323 # define YY_STACK_PRINT(Bottom, Top)
1324 # define YY_REDUCE_PRINT(Rule)
1325 #endif /* !YYDEBUG */
1326
1327
1328 /* YYINITDEPTH -- initial size of the parser's stacks. */
1329 #ifndef YYINITDEPTH
1330 # define YYINITDEPTH 200
1331 #endif
1332
1333 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1334 if the built-in stack extension method is used).
1335
1336 Do not make this value too large; the results are undefined if
1337 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1338 evaluated with infinite-precision integer arithmetic. */
1339
1340 #ifndef YYMAXDEPTH
1341 # define YYMAXDEPTH 10000
1342 #endif
1343
1344 \f
1345
1346 #if YYERROR_VERBOSE
1347
1348 # ifndef yystrlen
1349 # if defined __GLIBC__ && defined _STRING_H
1350 # define yystrlen strlen
1351 # else
1352 /* Return the length of YYSTR. */
1353 #if (defined __STDC__ || defined __C99__FUNC__ \
1354 || defined __cplusplus || defined _MSC_VER)
1355 static YYSIZE_T
1356 yystrlen (const char *yystr)
1357 #else
1358 static YYSIZE_T
1359 yystrlen (yystr)
1360 const char *yystr;
1361 #endif
1362 {
1363 YYSIZE_T yylen;
1364 for (yylen = 0; yystr[yylen]; yylen++)
1365 continue;
1366 return yylen;
1367 }
1368 # endif
1369 # endif
1370
1371 # ifndef yystpcpy
1372 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1373 # define yystpcpy stpcpy
1374 # else
1375 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1376 YYDEST. */
1377 #if (defined __STDC__ || defined __C99__FUNC__ \
1378 || defined __cplusplus || defined _MSC_VER)
1379 static char *
1380 yystpcpy (char *yydest, const char *yysrc)
1381 #else
1382 static char *
1383 yystpcpy (yydest, yysrc)
1384 char *yydest;
1385 const char *yysrc;
1386 #endif
1387 {
1388 char *yyd = yydest;
1389 const char *yys = yysrc;
1390
1391 while ((*yyd++ = *yys++) != '\0')
1392 continue;
1393
1394 return yyd - 1;
1395 }
1396 # endif
1397 # endif
1398
1399 # ifndef yytnamerr
1400 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1401 quotes and backslashes, so that it's suitable for yyerror. The
1402 heuristic is that double-quoting is unnecessary unless the string
1403 contains an apostrophe, a comma, or backslash (other than
1404 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1405 null, do not copy; instead, return the length of what the result
1406 would have been. */
1407 static YYSIZE_T
1408 yytnamerr (char *yyres, const char *yystr)
1409 {
1410 if (*yystr == '"')
1411 {
1412 YYSIZE_T yyn = 0;
1413 char const *yyp = yystr;
1414
1415 for (;;)
1416 switch (*++yyp)
1417 {
1418 case '\'':
1419 case ',':
1420 goto do_not_strip_quotes;
1421
1422 case '\\':
1423 if (*++yyp != '\\')
1424 goto do_not_strip_quotes;
1425 /* Fall through. */
1426 default:
1427 if (yyres)
1428 yyres[yyn] = *yyp;
1429 yyn++;
1430 break;
1431
1432 case '"':
1433 if (yyres)
1434 yyres[yyn] = '\0';
1435 return yyn;
1436 }
1437 do_not_strip_quotes: ;
1438 }
1439
1440 if (! yyres)
1441 return yystrlen (yystr);
1442
1443 return yystpcpy (yyres, yystr) - yyres;
1444 }
1445 # endif
1446
1447 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1448 about the unexpected token YYTOKEN while in state YYSTATE.
1449
1450 Return 0 if *YYMSG was successfully written. Return 1 if an ordinary
1451 "syntax error" message will suffice instead. Return 2 if *YYMSG is
1452 not large enough to hold the message. In the last case, also set
1453 *YYMSG_ALLOC to either (a) the required number of bytes or (b) zero
1454 if the required number of bytes is too large to store. */
1455 static int
1456 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1457 int yystate, int yytoken)
1458 {
1459 int yyn = yypact[yystate];
1460
1461 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1462 return 1;
1463 else
1464 {
1465 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
1466 YYSIZE_T yysize = yysize0;
1467 YYSIZE_T yysize1;
1468 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1469 /* Internationalized format string. */
1470 const char *yyformat = 0;
1471 /* Arguments of yyformat. */
1472 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1473
1474 /* Start YYX at -YYN if negative to avoid negative indexes in
1475 YYCHECK. In other words, skip the first -YYN actions for this
1476 state because they are default actions. */
1477 int yyxbegin = yyn < 0 ? -yyn : 0;
1478
1479 /* Stay within bounds of both yycheck and yytname. */
1480 int yychecklim = YYLAST - yyn + 1;
1481 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1482 /* Number of reported tokens (one for the "unexpected", one per
1483 "expected"). */
1484 int yycount = 0;
1485 int yyx;
1486
1487 yyarg[yycount++] = yytname[yytoken];
1488
1489 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1490 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1491 && !yytable_value_is_error (yytable[yyx + yyn]))
1492 {
1493 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1494 {
1495 yycount = 1;
1496 yysize = yysize0;
1497 break;
1498 }
1499 yyarg[yycount++] = yytname[yyx];
1500 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1501 if (! (yysize <= yysize1
1502 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1503 {
1504 /* Overflow. */
1505 *yymsg_alloc = 0;
1506 return 2;
1507 }
1508 yysize = yysize1;
1509 }
1510
1511 switch (yycount)
1512 {
1513 #define YYCASE_(N, S) \
1514 case N: \
1515 yyformat = S; \
1516 break
1517 YYCASE_(1, YY_("syntax error, unexpected %s"));
1518 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1519 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1520 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1521 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1522 #undef YYCASE_
1523 }
1524
1525 yysize1 = yysize + yystrlen (yyformat);
1526 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1527 {
1528 /* Overflow. */
1529 *yymsg_alloc = 0;
1530 return 2;
1531 }
1532 yysize = yysize1;
1533
1534 if (*yymsg_alloc < yysize)
1535 {
1536 *yymsg_alloc = 2 * yysize;
1537 if (! (yysize <= *yymsg_alloc
1538 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1539 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1540 return 2;
1541 }
1542
1543 /* Avoid sprintf, as that infringes on the user's name space.
1544 Don't have undefined behavior even if the translation
1545 produced a string with the wrong number of "%s"s. */
1546 {
1547 char *yyp = *yymsg;
1548 int yyi = 0;
1549 while ((*yyp = *yyformat) != '\0')
1550 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1551 {
1552 yyp += yytnamerr (yyp, yyarg[yyi++]);
1553 yyformat += 2;
1554 }
1555 else
1556 {
1557 yyp++;
1558 yyformat++;
1559 }
1560 }
1561 return 0;
1562 }
1563 }
1564 #endif /* YYERROR_VERBOSE */
1565 \f
1566
1567 /*-----------------------------------------------.
1568 | Release the memory associated to this symbol. |
1569 `-----------------------------------------------*/
1570
1571 /*ARGSUSED*/
1572 #if (defined __STDC__ || defined __C99__FUNC__ \
1573 || defined __cplusplus || defined _MSC_VER)
1574 static void
1575 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
1576 #else
1577 static void
1578 yydestruct (yymsg, yytype, yyvaluep, yylocationp)
1579 const char *yymsg;
1580 int yytype;
1581 YYSTYPE *yyvaluep;
1582 YYLTYPE *yylocationp;
1583 #endif
1584 {
1585 YYUSE (yyvaluep);
1586 YYUSE (yylocationp);
1587
1588 if (!yymsg)
1589 yymsg = "Deleting";
1590 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1591
1592 switch (yytype)
1593 {
1594
1595 default:
1596 break;
1597 }
1598 }
1599
1600
1601 /* Prevent warnings from -Wmissing-prototypes. */
1602 #ifdef YYPARSE_PARAM
1603 #if defined __STDC__ || defined __cplusplus
1604 int yyparse (void *YYPARSE_PARAM);
1605 #else
1606 int yyparse ();
1607 #endif
1608 #else /* ! YYPARSE_PARAM */
1609 #if defined __STDC__ || defined __cplusplus
1610 int yyparse (void);
1611 #else
1612 int yyparse ();
1613 #endif
1614 #endif /* ! YYPARSE_PARAM */
1615
1616
1617 /*----------.
1618 | yyparse. |
1619 `----------*/
1620
1621 #ifdef YYPARSE_PARAM
1622 #if (defined __STDC__ || defined __C99__FUNC__ \
1623 || defined __cplusplus || defined _MSC_VER)
1624 int
1625 yyparse (void *YYPARSE_PARAM)
1626 #else
1627 int
1628 yyparse (YYPARSE_PARAM)
1629 void *YYPARSE_PARAM;
1630 #endif
1631 #else /* ! YYPARSE_PARAM */
1632 #if (defined __STDC__ || defined __C99__FUNC__ \
1633 || defined __cplusplus || defined _MSC_VER)
1634 int
1635 yyparse (void)
1636 #else
1637 int
1638 yyparse ()
1639
1640 #endif
1641 #endif
1642 {
1643 /* The lookahead symbol. */
1644 int yychar;
1645
1646 /* The semantic value of the lookahead symbol. */
1647 YYSTYPE yylval;
1648
1649 /* Location data for the lookahead symbol. */
1650 YYLTYPE yylloc;
1651
1652 /* Number of syntax errors so far. */
1653 int yynerrs;
1654
1655 int yystate;
1656 /* Number of tokens to shift before error messages enabled. */
1657 int yyerrstatus;
1658
1659 /* The stacks and their tools:
1660 `yyss': related to states.
1661 `yyvs': related to semantic values.
1662 `yyls': related to locations.
1663
1664 Refer to the stacks thru separate pointers, to allow yyoverflow
1665 to reallocate them elsewhere. */
1666
1667 /* The state stack. */
1668 yytype_int16 yyssa[YYINITDEPTH];
1669 yytype_int16 *yyss;
1670 yytype_int16 *yyssp;
1671
1672 /* The semantic value stack. */
1673 YYSTYPE yyvsa[YYINITDEPTH];
1674 YYSTYPE *yyvs;
1675 YYSTYPE *yyvsp;
1676
1677 /* The location stack. */
1678 YYLTYPE yylsa[YYINITDEPTH];
1679 YYLTYPE *yyls;
1680 YYLTYPE *yylsp;
1681
1682 /* The locations where the error started and ended. */
1683 YYLTYPE yyerror_range[2];
1684
1685 YYSIZE_T yystacksize;
1686
1687 int yyn;
1688 int yyresult;
1689 /* Lookahead token as an internal (translated) token number. */
1690 int yytoken;
1691 /* The variables used to return semantic value and location from the
1692 action routines. */
1693 YYSTYPE yyval;
1694 YYLTYPE yyloc;
1695
1696 #if YYERROR_VERBOSE
1697 /* Buffer for error messages, and its allocated size. */
1698 char yymsgbuf[128];
1699 char *yymsg = yymsgbuf;
1700 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1701 #endif
1702
1703 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1704
1705 /* The number of symbols on the RHS of the reduced rule.
1706 Keep to zero when no symbol should be popped. */
1707 int yylen = 0;
1708
1709 yytoken = 0;
1710 yyss = yyssa;
1711 yyvs = yyvsa;
1712 yyls = yylsa;
1713 yystacksize = YYINITDEPTH;
1714
1715 YYDPRINTF ((stderr, "Starting parse\n"));
1716
1717 yystate = 0;
1718 yyerrstatus = 0;
1719 yynerrs = 0;
1720 yychar = YYEMPTY; /* Cause a token to be read. */
1721
1722 /* Initialize stack pointers.
1723 Waste one element of value and location stack
1724 so that they stay on the same level as the state stack.
1725 The wasted elements are never initialized. */
1726 yyssp = yyss;
1727 yyvsp = yyvs;
1728 yylsp = yyls;
1729
1730 #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1731 /* Initialize the default location before parsing starts. */
1732 yylloc.first_line = yylloc.last_line = 1;
1733 yylloc.first_column = yylloc.last_column = 1;
1734 #endif
1735
1736 /* User initialization code. */
1737
1738 /* Line 1282 of yacc.c */
1739 #line 86 "parse-gram.y"
1740 {
1741 /* Bison's grammar can initial empty locations, hence a default
1742 location is needed. */
1743 boundary_set (&yylloc.start, current_file, 1, 1);
1744 boundary_set (&yylloc.end, current_file, 1, 1);
1745 }
1746
1747 /* Line 1282 of yacc.c */
1748 #line 1749 "parse-gram.c"
1749 yylsp[0] = yylloc;
1750
1751 goto yysetstate;
1752
1753 /*------------------------------------------------------------.
1754 | yynewstate -- Push a new state, which is found in yystate. |
1755 `------------------------------------------------------------*/
1756 yynewstate:
1757 /* In all cases, when you get here, the value and location stacks
1758 have just been pushed. So pushing a state here evens the stacks. */
1759 yyssp++;
1760
1761 yysetstate:
1762 *yyssp = yystate;
1763
1764 if (yyss + yystacksize - 1 <= yyssp)
1765 {
1766 /* Get the current used size of the three stacks, in elements. */
1767 YYSIZE_T yysize = yyssp - yyss + 1;
1768
1769 #ifdef yyoverflow
1770 {
1771 /* Give user a chance to reallocate the stack. Use copies of
1772 these so that the &'s don't force the real ones into
1773 memory. */
1774 YYSTYPE *yyvs1 = yyvs;
1775 yytype_int16 *yyss1 = yyss;
1776 YYLTYPE *yyls1 = yyls;
1777
1778 /* Each stack pointer address is followed by the size of the
1779 data in use in that stack, in bytes. This used to be a
1780 conditional around just the two extra args, but that might
1781 be undefined if yyoverflow is a macro. */
1782 yyoverflow (YY_("memory exhausted"),
1783 &yyss1, yysize * sizeof (*yyssp),
1784 &yyvs1, yysize * sizeof (*yyvsp),
1785 &yyls1, yysize * sizeof (*yylsp),
1786 &yystacksize);
1787
1788 yyls = yyls1;
1789 yyss = yyss1;
1790 yyvs = yyvs1;
1791 }
1792 #else /* no yyoverflow */
1793 # ifndef YYSTACK_RELOCATE
1794 goto yyexhaustedlab;
1795 # else
1796 /* Extend the stack our own way. */
1797 if (YYMAXDEPTH <= yystacksize)
1798 goto yyexhaustedlab;
1799 yystacksize *= 2;
1800 if (YYMAXDEPTH < yystacksize)
1801 yystacksize = YYMAXDEPTH;
1802
1803 {
1804 yytype_int16 *yyss1 = yyss;
1805 union yyalloc *yyptr =
1806 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1807 if (! yyptr)
1808 goto yyexhaustedlab;
1809 YYSTACK_RELOCATE (yyss_alloc, yyss);
1810 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1811 YYSTACK_RELOCATE (yyls_alloc, yyls);
1812 # undef YYSTACK_RELOCATE
1813 if (yyss1 != yyssa)
1814 YYSTACK_FREE (yyss1);
1815 }
1816 # endif
1817 #endif /* no yyoverflow */
1818
1819 yyssp = yyss + yysize - 1;
1820 yyvsp = yyvs + yysize - 1;
1821 yylsp = yyls + yysize - 1;
1822
1823 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1824 (unsigned long int) yystacksize));
1825
1826 if (yyss + yystacksize - 1 <= yyssp)
1827 YYABORT;
1828 }
1829
1830 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1831
1832 if (yystate == YYFINAL)
1833 YYACCEPT;
1834
1835 goto yybackup;
1836
1837 /*-----------.
1838 | yybackup. |
1839 `-----------*/
1840 yybackup:
1841
1842 /* Do appropriate processing given the current state. Read a
1843 lookahead token if we need one and don't already have one. */
1844
1845 /* First try to decide what to do without reference to lookahead token. */
1846 yyn = yypact[yystate];
1847 if (yypact_value_is_default (yyn))
1848 goto yydefault;
1849
1850 /* Not known => get a lookahead token if don't already have one. */
1851
1852 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1853 if (yychar == YYEMPTY)
1854 {
1855 YYDPRINTF ((stderr, "Reading a token: "));
1856 yychar = YYLEX;
1857 }
1858
1859 if (yychar <= YYEOF)
1860 {
1861 yychar = yytoken = YYEOF;
1862 YYDPRINTF ((stderr, "Now at end of input.\n"));
1863 }
1864 else
1865 {
1866 yytoken = YYTRANSLATE (yychar);
1867 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1868 }
1869
1870 /* If the proper action on seeing token YYTOKEN is to reduce or to
1871 detect an error, take that action. */
1872 yyn += yytoken;
1873 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1874 goto yydefault;
1875 yyn = yytable[yyn];
1876 if (yyn <= 0)
1877 {
1878 if (yytable_value_is_error (yyn))
1879 goto yyerrlab;
1880 yyn = -yyn;
1881 goto yyreduce;
1882 }
1883
1884 /* Count tokens shifted since error; after three, turn off error
1885 status. */
1886 if (yyerrstatus)
1887 yyerrstatus--;
1888
1889 /* Shift the lookahead token. */
1890 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1891
1892 /* Discard the shifted token. */
1893 yychar = YYEMPTY;
1894
1895 yystate = yyn;
1896 *++yyvsp = yylval;
1897 *++yylsp = yylloc;
1898 goto yynewstate;
1899
1900
1901 /*-----------------------------------------------------------.
1902 | yydefault -- do the default action for the current state. |
1903 `-----------------------------------------------------------*/
1904 yydefault:
1905 yyn = yydefact[yystate];
1906 if (yyn == 0)
1907 goto yyerrlab;
1908 goto yyreduce;
1909
1910
1911 /*-----------------------------.
1912 | yyreduce -- Do a reduction. |
1913 `-----------------------------*/
1914 yyreduce:
1915 /* yyn is the number of a rule to reduce with. */
1916 yylen = yyr2[yyn];
1917
1918 /* If YYLEN is nonzero, implement the default value of the action:
1919 `$$ = $1'.
1920
1921 Otherwise, the following line sets YYVAL to garbage.
1922 This behavior is undocumented and Bison
1923 users should not rely upon it. Assigning to YYVAL
1924 unconditionally makes the parser a bit smaller, and it avoids a
1925 GCC warning that YYVAL may be used uninitialized. */
1926 yyval = yyvsp[1-yylen];
1927
1928 /* Default location. */
1929 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1930 YY_REDUCE_PRINT (yyn);
1931 switch (yyn)
1932 {
1933 case 6:
1934
1935 /* Line 1495 of yacc.c */
1936 #line 225 "parse-gram.y"
1937 {
1938 code_props plain_code;
1939 code_props_plain_init (&plain_code, (yyvsp[(1) - (1)].chars), (yylsp[(1) - (1)]));
1940 code_props_translate_code (&plain_code);
1941 gram_scanner_last_string_free ();
1942 muscle_code_grow (union_seen ? "post_prologue" : "pre_prologue",
1943 plain_code.code, (yylsp[(1) - (1)]));
1944 code_scanner_last_string_free ();
1945 }
1946 break;
1947
1948 case 7:
1949
1950 /* Line 1495 of yacc.c */
1951 #line 234 "parse-gram.y"
1952 { debug_flag = true; }
1953 break;
1954
1955 case 8:
1956
1957 /* Line 1495 of yacc.c */
1958 #line 236 "parse-gram.y"
1959 {
1960 muscle_percent_define_insert ((yyvsp[(2) - (3)].uniqstr), (yylsp[(2) - (3)]), (yyvsp[(3) - (3)].chars),
1961 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
1962 }
1963 break;
1964
1965 case 9:
1966
1967 /* Line 1495 of yacc.c */
1968 #line 240 "parse-gram.y"
1969 { defines_flag = true; }
1970 break;
1971
1972 case 10:
1973
1974 /* Line 1495 of yacc.c */
1975 #line 242 "parse-gram.y"
1976 {
1977 defines_flag = true;
1978 spec_defines_file = xstrdup ((yyvsp[(2) - (2)].chars));
1979 }
1980 break;
1981
1982 case 11:
1983
1984 /* Line 1495 of yacc.c */
1985 #line 246 "parse-gram.y"
1986 { error_verbose = true; }
1987 break;
1988
1989 case 12:
1990
1991 /* Line 1495 of yacc.c */
1992 #line 247 "parse-gram.y"
1993 { expected_sr_conflicts = (yyvsp[(2) - (2)].integer); }
1994 break;
1995
1996 case 13:
1997
1998 /* Line 1495 of yacc.c */
1999 #line 248 "parse-gram.y"
2000 { expected_rr_conflicts = (yyvsp[(2) - (2)].integer); }
2001 break;
2002
2003 case 14:
2004
2005 /* Line 1495 of yacc.c */
2006 #line 249 "parse-gram.y"
2007 { spec_file_prefix = (yyvsp[(2) - (2)].chars); }
2008 break;
2009
2010 case 15:
2011
2012 /* Line 1495 of yacc.c */
2013 #line 250 "parse-gram.y"
2014 { spec_file_prefix = (yyvsp[(3) - (3)].chars); }
2015 break;
2016
2017 case 16:
2018
2019 /* Line 1495 of yacc.c */
2020 #line 252 "parse-gram.y"
2021 {
2022 nondeterministic_parser = true;
2023 glr_parser = true;
2024 }
2025 break;
2026
2027 case 17:
2028
2029 /* Line 1495 of yacc.c */
2030 #line 257 "parse-gram.y"
2031 {
2032 code_props action;
2033 code_props_symbol_action_init (&action, (yyvsp[(2) - (2)].code), (yylsp[(2) - (2)]));
2034 code_props_translate_code (&action);
2035 gram_scanner_last_string_free ();
2036 muscle_code_grow ("initial_action", action.code, (yylsp[(2) - (2)]));
2037 code_scanner_last_string_free ();
2038 }
2039 break;
2040
2041 case 18:
2042
2043 /* Line 1495 of yacc.c */
2044 #line 265 "parse-gram.y"
2045 { language_argmatch ((yyvsp[(2) - (2)].chars), grammar_prio, (yylsp[(1) - (2)])); }
2046 break;
2047
2048 case 19:
2049
2050 /* Line 1495 of yacc.c */
2051 #line 266 "parse-gram.y"
2052 { add_param ("lex_param", (yyvsp[(2) - (2)].code), (yylsp[(2) - (2)])); }
2053 break;
2054
2055 case 20:
2056
2057 /* Line 1495 of yacc.c */
2058 #line 267 "parse-gram.y"
2059 { locations_flag = true; }
2060 break;
2061
2062 case 21:
2063
2064 /* Line 1495 of yacc.c */
2065 #line 268 "parse-gram.y"
2066 { spec_name_prefix = (yyvsp[(2) - (2)].chars); }
2067 break;
2068
2069 case 22:
2070
2071 /* Line 1495 of yacc.c */
2072 #line 269 "parse-gram.y"
2073 { spec_name_prefix = (yyvsp[(3) - (3)].chars); }
2074 break;
2075
2076 case 23:
2077
2078 /* Line 1495 of yacc.c */
2079 #line 270 "parse-gram.y"
2080 { no_lines_flag = true; }
2081 break;
2082
2083 case 24:
2084
2085 /* Line 1495 of yacc.c */
2086 #line 271 "parse-gram.y"
2087 { nondeterministic_parser = true; }
2088 break;
2089
2090 case 25:
2091
2092 /* Line 1495 of yacc.c */
2093 #line 272 "parse-gram.y"
2094 { spec_outfile = (yyvsp[(2) - (2)].chars); }
2095 break;
2096
2097 case 26:
2098
2099 /* Line 1495 of yacc.c */
2100 #line 273 "parse-gram.y"
2101 { spec_outfile = (yyvsp[(3) - (3)].chars); }
2102 break;
2103
2104 case 27:
2105
2106 /* Line 1495 of yacc.c */
2107 #line 274 "parse-gram.y"
2108 { add_param ("parse_param", (yyvsp[(2) - (2)].code), (yylsp[(2) - (2)])); }
2109 break;
2110
2111 case 28:
2112
2113 /* Line 1495 of yacc.c */
2114 #line 276 "parse-gram.y"
2115 {
2116 /* %pure-parser is deprecated in favor of `%define api.pure', so use
2117 `%define api.pure' in a backward-compatible manner here. First, don't
2118 complain if %pure-parser is specified multiple times. */
2119 if (!muscle_find_const ("percent_define(api.pure)"))
2120 muscle_percent_define_insert ("api.pure", (yylsp[(1) - (1)]), "",
2121 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
2122 /* In all cases, use api.pure now so that the backend doesn't complain if
2123 the skeleton ignores api.pure, but do warn now if there's a previous
2124 conflicting definition from an actual %define. */
2125 if (!muscle_percent_define_flag_if ("api.pure"))
2126 muscle_percent_define_insert ("api.pure", (yylsp[(1) - (1)]), "",
2127 MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
2128 }
2129 break;
2130
2131 case 29:
2132
2133 /* Line 1495 of yacc.c */
2134 #line 290 "parse-gram.y"
2135 { version_check (&(yylsp[(2) - (2)]), (yyvsp[(2) - (2)].chars)); }
2136 break;
2137
2138 case 30:
2139
2140 /* Line 1495 of yacc.c */
2141 #line 292 "parse-gram.y"
2142 {
2143 char const *skeleton_user = (yyvsp[(2) - (2)].chars);
2144 if (strchr (skeleton_user, '/'))
2145 {
2146 size_t dir_length = strlen (current_file);
2147 char *skeleton_build;
2148 while (dir_length && current_file[dir_length - 1] != '/')
2149 --dir_length;
2150 while (dir_length && current_file[dir_length - 1] == '/')
2151 --dir_length;
2152 skeleton_build =
2153 xmalloc (dir_length + 1 + strlen (skeleton_user) + 1);
2154 if (dir_length > 0)
2155 {
2156 strncpy (skeleton_build, current_file, dir_length);
2157 skeleton_build[dir_length++] = '/';
2158 }
2159 strcpy (skeleton_build + dir_length, skeleton_user);
2160 skeleton_user = uniqstr_new (skeleton_build);
2161 free (skeleton_build);
2162 }
2163 skeleton_arg (skeleton_user, grammar_prio, (yylsp[(1) - (2)]));
2164 }
2165 break;
2166
2167 case 31:
2168
2169 /* Line 1495 of yacc.c */
2170 #line 315 "parse-gram.y"
2171 { token_table_flag = true; }
2172 break;
2173
2174 case 32:
2175
2176 /* Line 1495 of yacc.c */
2177 #line 316 "parse-gram.y"
2178 { report_flag |= report_states; }
2179 break;
2180
2181 case 33:
2182
2183 /* Line 1495 of yacc.c */
2184 #line 317 "parse-gram.y"
2185 { yacc_flag = true; }
2186 break;
2187
2188 case 37:
2189
2190 /* Line 1495 of yacc.c */
2191 #line 325 "parse-gram.y"
2192 {
2193 grammar_start_symbol_set ((yyvsp[(2) - (2)].symbol), (yylsp[(2) - (2)]));
2194 }
2195 break;
2196
2197 case 38:
2198
2199 /* Line 1495 of yacc.c */
2200 #line 329 "parse-gram.y"
2201 {
2202 symbol_list *list;
2203 for (list = (yyvsp[(3) - (3)].list); list; list = list->next)
2204 symbol_list_destructor_set (list, (yyvsp[(2) - (3)].code), (yylsp[(2) - (3)]));
2205 symbol_list_free ((yyvsp[(3) - (3)].list));
2206 }
2207 break;
2208
2209 case 39:
2210
2211 /* Line 1495 of yacc.c */
2212 #line 336 "parse-gram.y"
2213 {
2214 symbol_list *list;
2215 for (list = (yyvsp[(3) - (3)].list); list; list = list->next)
2216 symbol_list_printer_set (list, (yyvsp[(2) - (3)].code), (yylsp[(2) - (3)]));
2217 symbol_list_free ((yyvsp[(3) - (3)].list));
2218 }
2219 break;
2220
2221 case 40:
2222
2223 /* Line 1495 of yacc.c */
2224 #line 343 "parse-gram.y"
2225 {
2226 default_prec = true;
2227 }
2228 break;
2229
2230 case 41:
2231
2232 /* Line 1495 of yacc.c */
2233 #line 347 "parse-gram.y"
2234 {
2235 default_prec = false;
2236 }
2237 break;
2238
2239 case 42:
2240
2241 /* Line 1495 of yacc.c */
2242 #line 351 "parse-gram.y"
2243 {
2244 /* Do not invoke muscle_percent_code_grow here since it invokes
2245 muscle_user_name_list_grow. */
2246 muscle_code_grow ("percent_code()", (yyvsp[(2) - (2)].chars), (yylsp[(2) - (2)]));
2247 code_scanner_last_string_free ();
2248 }
2249 break;
2250
2251 case 43:
2252
2253 /* Line 1495 of yacc.c */
2254 #line 358 "parse-gram.y"
2255 {
2256 muscle_percent_code_grow ((yyvsp[(2) - (3)].uniqstr), (yylsp[(2) - (3)]), (yyvsp[(3) - (3)].chars), (yylsp[(3) - (3)]));
2257 code_scanner_last_string_free ();
2258 }
2259 break;
2260
2261 case 44:
2262
2263 /* Line 1495 of yacc.c */
2264 #line 372 "parse-gram.y"
2265 {}
2266 break;
2267
2268 case 45:
2269
2270 /* Line 1495 of yacc.c */
2271 #line 373 "parse-gram.y"
2272 { muscle_code_grow ("union_name", (yyvsp[(1) - (1)].uniqstr), (yylsp[(1) - (1)])); }
2273 break;
2274
2275 case 46:
2276
2277 /* Line 1495 of yacc.c */
2278 #line 378 "parse-gram.y"
2279 {
2280 union_seen = true;
2281 muscle_code_grow ("stype", (yyvsp[(3) - (3)].chars), (yylsp[(3) - (3)]));
2282 code_scanner_last_string_free ();
2283 }
2284 break;
2285
2286 case 47:
2287
2288 /* Line 1495 of yacc.c */
2289 #line 389 "parse-gram.y"
2290 { current_class = nterm_sym; }
2291 break;
2292
2293 case 48:
2294
2295 /* Line 1495 of yacc.c */
2296 #line 390 "parse-gram.y"
2297 {
2298 current_class = unknown_sym;
2299 current_type = NULL;
2300 }
2301 break;
2302
2303 case 49:
2304
2305 /* Line 1495 of yacc.c */
2306 #line 394 "parse-gram.y"
2307 { current_class = token_sym; }
2308 break;
2309
2310 case 50:
2311
2312 /* Line 1495 of yacc.c */
2313 #line 395 "parse-gram.y"
2314 {
2315 current_class = unknown_sym;
2316 current_type = NULL;
2317 }
2318 break;
2319
2320 case 51:
2321
2322 /* Line 1495 of yacc.c */
2323 #line 400 "parse-gram.y"
2324 {
2325 symbol_list *list;
2326 tag_seen = true;
2327 for (list = (yyvsp[(3) - (3)].list); list; list = list->next)
2328 symbol_type_set (list->content.sym, (yyvsp[(2) - (3)].uniqstr), (yylsp[(2) - (3)]));
2329 symbol_list_free ((yyvsp[(3) - (3)].list));
2330 }
2331 break;
2332
2333 case 52:
2334
2335 /* Line 1495 of yacc.c */
2336 #line 411 "parse-gram.y"
2337 {
2338 symbol_list *list;
2339 ++current_prec;
2340 for (list = (yyvsp[(3) - (3)].list); list; list = list->next)
2341 {
2342 symbol_type_set (list->content.sym, current_type, (yylsp[(2) - (3)]));
2343 symbol_precedence_set (list->content.sym, current_prec, (yyvsp[(1) - (3)].assoc), (yylsp[(1) - (3)]));
2344 }
2345 symbol_list_free ((yyvsp[(3) - (3)].list));
2346 current_type = NULL;
2347 }
2348 break;
2349
2350 case 53:
2351
2352 /* Line 1495 of yacc.c */
2353 #line 425 "parse-gram.y"
2354 { (yyval.assoc) = left_assoc; }
2355 break;
2356
2357 case 54:
2358
2359 /* Line 1495 of yacc.c */
2360 #line 426 "parse-gram.y"
2361 { (yyval.assoc) = right_assoc; }
2362 break;
2363
2364 case 55:
2365
2366 /* Line 1495 of yacc.c */
2367 #line 427 "parse-gram.y"
2368 { (yyval.assoc) = non_assoc; }
2369 break;
2370
2371 case 56:
2372
2373 /* Line 1495 of yacc.c */
2374 #line 431 "parse-gram.y"
2375 { current_type = NULL; }
2376 break;
2377
2378 case 57:
2379
2380 /* Line 1495 of yacc.c */
2381 #line 432 "parse-gram.y"
2382 { current_type = (yyvsp[(1) - (1)].uniqstr); tag_seen = true; }
2383 break;
2384
2385 case 58:
2386
2387 /* Line 1495 of yacc.c */
2388 #line 438 "parse-gram.y"
2389 { (yyval.list) = symbol_list_sym_new ((yyvsp[(1) - (1)].symbol), (yylsp[(1) - (1)])); }
2390 break;
2391
2392 case 59:
2393
2394 /* Line 1495 of yacc.c */
2395 #line 440 "parse-gram.y"
2396 { (yyval.list) = symbol_list_prepend ((yyvsp[(1) - (2)].list), symbol_list_sym_new ((yyvsp[(2) - (2)].symbol), (yylsp[(2) - (2)]))); }
2397 break;
2398
2399 case 60:
2400
2401 /* Line 1495 of yacc.c */
2402 #line 444 "parse-gram.y"
2403 { (yyval.symbol) = (yyvsp[(1) - (1)].symbol); }
2404 break;
2405
2406 case 61:
2407
2408 /* Line 1495 of yacc.c */
2409 #line 445 "parse-gram.y"
2410 { (yyval.symbol) = (yyvsp[(1) - (2)].symbol); symbol_user_token_number_set ((yyvsp[(1) - (2)].symbol), (yyvsp[(2) - (2)].integer), (yylsp[(2) - (2)])); }
2411 break;
2412
2413 case 62:
2414
2415 /* Line 1495 of yacc.c */
2416 #line 451 "parse-gram.y"
2417 { (yyval.list) = symbol_list_sym_new ((yyvsp[(1) - (1)].symbol), (yylsp[(1) - (1)])); }
2418 break;
2419
2420 case 63:
2421
2422 /* Line 1495 of yacc.c */
2423 #line 453 "parse-gram.y"
2424 { (yyval.list) = symbol_list_prepend ((yyvsp[(1) - (2)].list), symbol_list_sym_new ((yyvsp[(2) - (2)].symbol), (yylsp[(2) - (2)]))); }
2425 break;
2426
2427 case 64:
2428
2429 /* Line 1495 of yacc.c */
2430 #line 457 "parse-gram.y"
2431 { (yyval.list) = (yyvsp[(1) - (1)].list); }
2432 break;
2433
2434 case 65:
2435
2436 /* Line 1495 of yacc.c */
2437 #line 458 "parse-gram.y"
2438 { (yyval.list) = symbol_list_prepend ((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].list)); }
2439 break;
2440
2441 case 66:
2442
2443 /* Line 1495 of yacc.c */
2444 #line 462 "parse-gram.y"
2445 { (yyval.list) = symbol_list_sym_new ((yyvsp[(1) - (1)].symbol), (yylsp[(1) - (1)])); }
2446 break;
2447
2448 case 67:
2449
2450 /* Line 1495 of yacc.c */
2451 #line 463 "parse-gram.y"
2452 { (yyval.list) = symbol_list_type_new ((yyvsp[(1) - (1)].uniqstr), (yylsp[(1) - (1)])); }
2453 break;
2454
2455 case 68:
2456
2457 /* Line 1495 of yacc.c */
2458 #line 464 "parse-gram.y"
2459 { (yyval.list) = symbol_list_default_tagged_new ((yylsp[(1) - (1)])); }
2460 break;
2461
2462 case 69:
2463
2464 /* Line 1495 of yacc.c */
2465 #line 465 "parse-gram.y"
2466 { (yyval.list) = symbol_list_default_tagless_new ((yylsp[(1) - (1)])); }
2467 break;
2468
2469 case 70:
2470
2471 /* Line 1495 of yacc.c */
2472 #line 471 "parse-gram.y"
2473 {
2474 current_type = (yyvsp[(1) - (1)].uniqstr);
2475 tag_seen = true;
2476 }
2477 break;
2478
2479 case 71:
2480
2481 /* Line 1495 of yacc.c */
2482 #line 476 "parse-gram.y"
2483 {
2484 symbol_class_set ((yyvsp[(1) - (1)].symbol), current_class, (yylsp[(1) - (1)]), true);
2485 symbol_type_set ((yyvsp[(1) - (1)].symbol), current_type, (yylsp[(1) - (1)]));
2486 }
2487 break;
2488
2489 case 72:
2490
2491 /* Line 1495 of yacc.c */
2492 #line 481 "parse-gram.y"
2493 {
2494 symbol_class_set ((yyvsp[(1) - (2)].symbol), current_class, (yylsp[(1) - (2)]), true);
2495 symbol_type_set ((yyvsp[(1) - (2)].symbol), current_type, (yylsp[(1) - (2)]));
2496 symbol_user_token_number_set ((yyvsp[(1) - (2)].symbol), (yyvsp[(2) - (2)].integer), (yylsp[(2) - (2)]));
2497 }
2498 break;
2499
2500 case 73:
2501
2502 /* Line 1495 of yacc.c */
2503 #line 487 "parse-gram.y"
2504 {
2505 symbol_class_set ((yyvsp[(1) - (2)].symbol), current_class, (yylsp[(1) - (2)]), true);
2506 symbol_type_set ((yyvsp[(1) - (2)].symbol), current_type, (yylsp[(1) - (2)]));
2507 symbol_make_alias ((yyvsp[(1) - (2)].symbol), (yyvsp[(2) - (2)].symbol), (yyloc));
2508 }
2509 break;
2510
2511 case 74:
2512
2513 /* Line 1495 of yacc.c */
2514 #line 493 "parse-gram.y"
2515 {
2516 symbol_class_set ((yyvsp[(1) - (3)].symbol), current_class, (yylsp[(1) - (3)]), true);
2517 symbol_type_set ((yyvsp[(1) - (3)].symbol), current_type, (yylsp[(1) - (3)]));
2518 symbol_user_token_number_set ((yyvsp[(1) - (3)].symbol), (yyvsp[(2) - (3)].integer), (yylsp[(2) - (3)]));
2519 symbol_make_alias ((yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol), (yyloc));
2520 }
2521 break;
2522
2523 case 81:
2524
2525 /* Line 1495 of yacc.c */
2526 #line 523 "parse-gram.y"
2527 {
2528 yyerrok;
2529 }
2530 break;
2531
2532 case 82:
2533
2534 /* Line 1495 of yacc.c */
2535 #line 529 "parse-gram.y"
2536 { current_lhs = (yyvsp[(1) - (2)].symbol); current_lhs_location = (yylsp[(1) - (2)]);
2537 current_lhs_named_ref = (yyvsp[(2) - (2)].named_ref); }
2538 break;
2539
2540 case 84:
2541
2542 /* Line 1495 of yacc.c */
2543 #line 534 "parse-gram.y"
2544 { grammar_current_rule_end ((yylsp[(1) - (1)])); }
2545 break;
2546
2547 case 85:
2548
2549 /* Line 1495 of yacc.c */
2550 #line 535 "parse-gram.y"
2551 { grammar_current_rule_end ((yylsp[(3) - (3)])); }
2552 break;
2553
2554 case 87:
2555
2556 /* Line 1495 of yacc.c */
2557 #line 541 "parse-gram.y"
2558 { grammar_current_rule_begin (current_lhs, current_lhs_location,
2559 current_lhs_named_ref); }
2560 break;
2561
2562 case 88:
2563
2564 /* Line 1495 of yacc.c */
2565 #line 544 "parse-gram.y"
2566 { grammar_current_rule_symbol_append ((yyvsp[(2) - (3)].symbol), (yylsp[(2) - (3)]), (yyvsp[(3) - (3)].named_ref)); }
2567 break;
2568
2569 case 89:
2570
2571 /* Line 1495 of yacc.c */
2572 #line 546 "parse-gram.y"
2573 { grammar_current_rule_action_append ((yyvsp[(2) - (3)].code), (yylsp[(2) - (3)]), (yyvsp[(3) - (3)].named_ref)); }
2574 break;
2575
2576 case 90:
2577
2578 /* Line 1495 of yacc.c */
2579 #line 548 "parse-gram.y"
2580 { grammar_current_rule_prec_set ((yyvsp[(3) - (3)].symbol), (yylsp[(3) - (3)])); }
2581 break;
2582
2583 case 91:
2584
2585 /* Line 1495 of yacc.c */
2586 #line 550 "parse-gram.y"
2587 { grammar_current_rule_dprec_set ((yyvsp[(3) - (3)].integer), (yylsp[(3) - (3)])); }
2588 break;
2589
2590 case 92:
2591
2592 /* Line 1495 of yacc.c */
2593 #line 552 "parse-gram.y"
2594 { grammar_current_rule_merge_set ((yyvsp[(3) - (3)].uniqstr), (yylsp[(3) - (3)])); }
2595 break;
2596
2597 case 93:
2598
2599 /* Line 1495 of yacc.c */
2600 #line 556 "parse-gram.y"
2601 { (yyval.named_ref) = 0; }
2602 break;
2603
2604 case 94:
2605
2606 /* Line 1495 of yacc.c */
2607 #line 558 "parse-gram.y"
2608 { (yyval.named_ref) = named_ref_new((yyvsp[(1) - (1)].uniqstr), (yylsp[(1) - (1)])); }
2609 break;
2610
2611 case 96:
2612
2613 /* Line 1495 of yacc.c */
2614 #line 570 "parse-gram.y"
2615 { (yyval.uniqstr) = uniqstr_new ((yyvsp[(1) - (1)].chars)); }
2616 break;
2617
2618 case 97:
2619
2620 /* Line 1495 of yacc.c */
2621 #line 575 "parse-gram.y"
2622 { (yyval.chars) = ""; }
2623 break;
2624
2625 case 98:
2626
2627 /* Line 1495 of yacc.c */
2628 #line 576 "parse-gram.y"
2629 { (yyval.chars) = (yyvsp[(1) - (1)].uniqstr); }
2630 break;
2631
2632 case 100:
2633
2634 /* Line 1495 of yacc.c */
2635 #line 587 "parse-gram.y"
2636 {
2637 code_props plain_code;
2638 (yyvsp[(1) - (1)].code)[strlen ((yyvsp[(1) - (1)].code)) - 1] = '\n';
2639 code_props_plain_init (&plain_code, (yyvsp[(1) - (1)].code)+1, (yylsp[(1) - (1)]));
2640 code_props_translate_code (&plain_code);
2641 gram_scanner_last_string_free ();
2642 (yyval.chars) = plain_code.code;
2643 }
2644 break;
2645
2646 case 101:
2647
2648 /* Line 1495 of yacc.c */
2649 #line 607 "parse-gram.y"
2650 { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[(1) - (1)].uniqstr), (yylsp[(1) - (1)])); }
2651 break;
2652
2653 case 102:
2654
2655 /* Line 1495 of yacc.c */
2656 #line 609 "parse-gram.y"
2657 {
2658 (yyval.symbol) = symbol_get (char_name ((yyvsp[(1) - (1)].character)), (yylsp[(1) - (1)]));
2659 symbol_class_set ((yyval.symbol), token_sym, (yylsp[(1) - (1)]), false);
2660 symbol_user_token_number_set ((yyval.symbol), (yyvsp[(1) - (1)].character), (yylsp[(1) - (1)]));
2661 }
2662 break;
2663
2664 case 103:
2665
2666 /* Line 1495 of yacc.c */
2667 #line 617 "parse-gram.y"
2668 { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[(1) - (1)].uniqstr), (yylsp[(1) - (1)])); }
2669 break;
2670
2671 case 106:
2672
2673 /* Line 1495 of yacc.c */
2674 #line 629 "parse-gram.y"
2675 {
2676 (yyval.symbol) = symbol_get (quotearg_style (c_quoting_style, (yyvsp[(1) - (1)].chars)), (yylsp[(1) - (1)]));
2677 symbol_class_set ((yyval.symbol), token_sym, (yylsp[(1) - (1)]), false);
2678 }
2679 break;
2680
2681 case 108:
2682
2683 /* Line 1495 of yacc.c */
2684 #line 638 "parse-gram.y"
2685 {
2686 code_props plain_code;
2687 code_props_plain_init (&plain_code, (yyvsp[(2) - (2)].chars), (yylsp[(2) - (2)]));
2688 code_props_translate_code (&plain_code);
2689 gram_scanner_last_string_free ();
2690 muscle_code_grow ("epilogue", plain_code.code, (yylsp[(2) - (2)]));
2691 code_scanner_last_string_free ();
2692 }
2693 break;
2694
2695
2696
2697 /* Line 1495 of yacc.c */
2698 #line 2699 "parse-gram.c"
2699 default: break;
2700 }
2701 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2702
2703 YYPOPSTACK (yylen);
2704 yylen = 0;
2705 YY_STACK_PRINT (yyss, yyssp);
2706
2707 *++yyvsp = yyval;
2708 *++yylsp = yyloc;
2709
2710 /* Now `shift' the result of the reduction. Determine what state
2711 that goes to, based on the state we popped back to and the rule
2712 number reduced by. */
2713
2714 yyn = yyr1[yyn];
2715
2716 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2717 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2718 yystate = yytable[yystate];
2719 else
2720 yystate = yydefgoto[yyn - YYNTOKENS];
2721
2722 goto yynewstate;
2723
2724
2725 /*------------------------------------.
2726 | yyerrlab -- here on detecting error |
2727 `------------------------------------*/
2728 yyerrlab:
2729 /* If not already recovering from an error, report this error. */
2730 if (!yyerrstatus)
2731 {
2732 ++yynerrs;
2733 #if ! YYERROR_VERBOSE
2734 yyerror (YY_("syntax error"));
2735 #else
2736 while (1)
2737 {
2738 int yysyntax_error_status =
2739 yysyntax_error (&yymsg_alloc, &yymsg, yystate, yytoken);
2740 if (yysyntax_error_status == 2 && 0 < yymsg_alloc)
2741 {
2742 if (yymsg != yymsgbuf)
2743 YYSTACK_FREE (yymsg);
2744 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2745 if (yymsg)
2746 continue;
2747 yymsg = yymsgbuf;
2748 yymsg_alloc = sizeof yymsgbuf;
2749 }
2750 if (yysyntax_error_status == 0)
2751 yyerror (yymsg);
2752 else
2753 yyerror (YY_("syntax error"));
2754 if (yysyntax_error_status == 2)
2755 goto yyexhaustedlab;
2756 break;
2757 }
2758 #endif
2759 }
2760
2761 yyerror_range[0] = yylloc;
2762
2763 if (yyerrstatus == 3)
2764 {
2765 /* If just tried and failed to reuse lookahead token after an
2766 error, discard it. */
2767
2768 if (yychar <= YYEOF)
2769 {
2770 /* Return failure if at end of input. */
2771 if (yychar == YYEOF)
2772 YYABORT;
2773 }
2774 else
2775 {
2776 yydestruct ("Error: discarding",
2777 yytoken, &yylval, &yylloc);
2778 yychar = YYEMPTY;
2779 }
2780 }
2781
2782 /* Else will try to reuse lookahead token after shifting the error
2783 token. */
2784 goto yyerrlab1;
2785
2786
2787 /*---------------------------------------------------.
2788 | yyerrorlab -- error raised explicitly by YYERROR. |
2789 `---------------------------------------------------*/
2790 yyerrorlab:
2791
2792 /* Pacify compilers like GCC when the user code never invokes
2793 YYERROR and the label yyerrorlab therefore never appears in user
2794 code. */
2795 if (/*CONSTCOND*/ 0)
2796 goto yyerrorlab;
2797
2798 yyerror_range[0] = yylsp[1-yylen];
2799 /* Do not reclaim the symbols of the rule which action triggered
2800 this YYERROR. */
2801 YYPOPSTACK (yylen);
2802 yylen = 0;
2803 YY_STACK_PRINT (yyss, yyssp);
2804 yystate = *yyssp;
2805 goto yyerrlab1;
2806
2807
2808 /*-------------------------------------------------------------.
2809 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2810 `-------------------------------------------------------------*/
2811 yyerrlab1:
2812 yyerrstatus = 3; /* Each real token shifted decrements this. */
2813
2814 for (;;)
2815 {
2816 yyn = yypact[yystate];
2817 if (!yypact_value_is_default (yyn))
2818 {
2819 yyn += YYTERROR;
2820 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2821 {
2822 yyn = yytable[yyn];
2823 if (0 < yyn)
2824 break;
2825 }
2826 }
2827
2828 /* Pop the current state because it cannot handle the error token. */
2829 if (yyssp == yyss)
2830 YYABORT;
2831
2832 yyerror_range[0] = *yylsp;
2833 yydestruct ("Error: popping",
2834 yystos[yystate], yyvsp, yylsp);
2835 YYPOPSTACK (1);
2836 yystate = *yyssp;
2837 YY_STACK_PRINT (yyss, yyssp);
2838 }
2839
2840 *++yyvsp = yylval;
2841
2842 yyerror_range[1] = yylloc;
2843 /* Using YYLLOC is tempting, but would change the location of
2844 the lookahead. YYLOC is available though. */
2845 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
2846 *++yylsp = yyloc;
2847
2848 /* Shift the error token. */
2849 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2850
2851 yystate = yyn;
2852 goto yynewstate;
2853
2854
2855 /*-------------------------------------.
2856 | yyacceptlab -- YYACCEPT comes here. |
2857 `-------------------------------------*/
2858 yyacceptlab:
2859 yyresult = 0;
2860 goto yyreturn;
2861
2862 /*-----------------------------------.
2863 | yyabortlab -- YYABORT comes here. |
2864 `-----------------------------------*/
2865 yyabortlab:
2866 yyresult = 1;
2867 goto yyreturn;
2868
2869 #if !defined(yyoverflow) || YYERROR_VERBOSE
2870 /*-------------------------------------------------.
2871 | yyexhaustedlab -- memory exhaustion comes here. |
2872 `-------------------------------------------------*/
2873 yyexhaustedlab:
2874 yyerror (YY_("memory exhausted"));
2875 yyresult = 2;
2876 /* Fall through. */
2877 #endif
2878
2879 yyreturn:
2880 if (yychar != YYEMPTY)
2881 yydestruct ("Cleanup: discarding lookahead",
2882 yytoken, &yylval, &yylloc);
2883 /* Do not reclaim the symbols of the rule which action triggered
2884 this YYABORT or YYACCEPT. */
2885 YYPOPSTACK (yylen);
2886 YY_STACK_PRINT (yyss, yyssp);
2887 while (yyssp != yyss)
2888 {
2889 yydestruct ("Cleanup: popping",
2890 yystos[*yyssp], yyvsp, yylsp);
2891 YYPOPSTACK (1);
2892 }
2893 #ifndef yyoverflow
2894 if (yyss != yyssa)
2895 YYSTACK_FREE (yyss);
2896 #endif
2897 #if YYERROR_VERBOSE
2898 if (yymsg != yymsgbuf)
2899 YYSTACK_FREE (yymsg);
2900 #endif
2901 /* Make sure YYID is used. */
2902 return YYID (yyresult);
2903 }
2904
2905
2906
2907 /* Line 1706 of yacc.c */
2908 #line 648 "parse-gram.y"
2909
2910
2911
2912 /* Return the location of the left-hand side of a rule whose
2913 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2914 the right-hand side, and return an empty location equal to the end
2915 boundary of RHS[0] if the right-hand side is empty. */
2916
2917 static YYLTYPE
2918 lloc_default (YYLTYPE const *rhs, int n)
2919 {
2920 int i;
2921 YYLTYPE loc;
2922
2923 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2924 The bug is fixed in 7.4.2m, but play it safe for now. */
2925 loc.start = rhs[n].end;
2926 loc.end = rhs[n].end;
2927
2928 /* Ignore empty nonterminals the start of the the right-hand side.
2929 Do not bother to ignore them at the end of the right-hand side,
2930 since empty nonterminals have the same end as their predecessors. */
2931 for (i = 1; i <= n; i++)
2932 if (! equal_boundaries (rhs[i].start, rhs[i].end))
2933 {
2934 loc.start = rhs[i].start;
2935 break;
2936 }
2937
2938 return loc;
2939 }
2940
2941
2942 /* Add a lex-param or a parse-param (depending on TYPE) with
2943 declaration DECL and location LOC. */
2944
2945 static void
2946 add_param (char const *type, char *decl, location loc)
2947 {
2948 static char const alphanum[26 + 26 + 1 + 10] =
2949 "abcdefghijklmnopqrstuvwxyz"
2950 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
2951 "_"
2952 "0123456789";
2953 char const *name_start = NULL;
2954 char *p;
2955
2956 /* Stop on last actual character. */
2957 for (p = decl; p[1]; p++)
2958 if ((p == decl
2959 || ! memchr (alphanum, p[-1], sizeof alphanum))
2960 && memchr (alphanum, p[0], sizeof alphanum - 10))
2961 name_start = p;
2962
2963 /* Strip the surrounding '{' and '}', and any blanks just inside
2964 the braces. */
2965 while (*--p == ' ' || *p == '\t')
2966 continue;
2967 p[1] = '\0';
2968 while (*++decl == ' ' || *decl == '\t')
2969 continue;
2970
2971 if (! name_start)
2972 complain_at (loc, _("missing identifier in parameter declaration"));
2973 else
2974 {
2975 char *name;
2976 size_t name_len;
2977
2978 for (name_len = 1;
2979 memchr (alphanum, name_start[name_len], sizeof alphanum);
2980 name_len++)
2981 continue;
2982
2983 name = xmalloc (name_len + 1);
2984 memcpy (name, name_start, name_len);
2985 name[name_len] = '\0';
2986 muscle_pair_list_grow (type, decl, name);
2987 free (name);
2988 }
2989
2990 gram_scanner_last_string_free ();
2991 }
2992
2993
2994 static void
2995 version_check (location const *loc, char const *version)
2996 {
2997 if (strverscmp (version, PACKAGE_VERSION) > 0)
2998 {
2999 complain_at (*loc, "require bison %s, but have %s",
3000 version, PACKAGE_VERSION);
3001 exit (63);
3002 }
3003 }
3004
3005 static void
3006 gram_error (location const *loc, char const *msg)
3007 {
3008 complain_at (*loc, "%s", msg);
3009 }
3010
3011 char const *
3012 token_name (int type)
3013 {
3014 return yytname[YYTRANSLATE (type)];
3015 }
3016
3017 static char const *
3018 char_name (char c)
3019 {
3020 if (c == '\'')
3021 return "'\\''";
3022 else
3023 {
3024 char buf[4];
3025 buf[0] = '\''; buf[1] = c; buf[2] = '\''; buf[3] = '\0';
3026 return quotearg_style (escape_quoting_style, buf);
3027 }
3028 }
3029