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