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