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