]> git.saurik.com Git - bison.git/blame - src/parse-gram.c
(grammar_rule_check): Rewrite slightly to avoid GCC warnings.
[bison.git] / src / parse-gram.c
CommitLineData
2abdfeef 1/* A Bison parser, made by GNU Bison 2.1a. */
e9955c83 2
c76e14da 3/* Skeleton parser for Yacc-like parsing with Bison,
bd134904 4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
1921f1d7
AD
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
0fb669f9
PE
18 Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA. */
1921f1d7 20
3b0ffc7e
PE
21/* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
1921f1d7 25
66809587
PE
26/* C LALR(1) parser skeleton written by Richard Stallman, by
27 simplifying the original so-called "semantic" parser. */
1921f1d7
AD
28
29/* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
35
36/* Identify Bison output. */
62ddaef6
PE
37#define YYBISON 1
38
f5109f5a 39/* Bison version. */
2abdfeef 40#define YYBISON_VERSION "2.1a"
f5109f5a 41
62ddaef6
PE
42/* Skeleton name. */
43#define YYSKELETON_NAME "yacc.c"
1921f1d7
AD
44
45/* Pure parsers. */
62ddaef6 46#define YYPURE 1
1921f1d7
AD
47
48/* Using locations. */
49#define YYLSP_NEEDED 1
e96c9728 50
76dcf299 51/* Substitute the variable and function names. */
e9955c83 52#define yyparse gram_parse
1921f1d7 53#define yylex gram_lex
e9955c83 54#define yyerror gram_error
1921f1d7
AD
55#define yylval gram_lval
56#define yychar gram_char
e9955c83
AD
57#define yydebug gram_debug
58#define yynerrs gram_nerrs
366eea36 59#define yylloc gram_lloc
e9955c83 60
ae7453f2
AD
61/* Tokens. */
62#ifndef YYTOKENTYPE
63# define YYTOKENTYPE
64 /* Put the tokens into the symbol table, so that GDB and other debuggers
65 know about them. */
66 enum yytokentype {
67 GRAM_EOF = 0,
68 STRING = 258,
62ddaef6
PE
69 INT = 259,
70 PERCENT_TOKEN = 260,
71 PERCENT_NTERM = 261,
72 PERCENT_TYPE = 262,
73 PERCENT_DESTRUCTOR = 263,
74 PERCENT_PRINTER = 264,
75 PERCENT_UNION = 265,
76 PERCENT_LEFT = 266,
77 PERCENT_RIGHT = 267,
78 PERCENT_NONASSOC = 268,
79 PERCENT_PREC = 269,
80 PERCENT_DPREC = 270,
81 PERCENT_MERGE = 271,
82 PERCENT_DEBUG = 272,
92f5e991
AD
83 PERCENT_DEFAULT_PREC = 273,
84 PERCENT_DEFINE = 274,
85 PERCENT_DEFINES = 275,
86 PERCENT_ERROR_VERBOSE = 276,
87 PERCENT_EXPECT = 277,
d6328241
PH
88 PERCENT_EXPECT_RR = 278,
89 PERCENT_FILE_PREFIX = 279,
90 PERCENT_GLR_PARSER = 280,
91 PERCENT_INITIAL_ACTION = 281,
92 PERCENT_LEX_PARAM = 282,
93 PERCENT_LOCATIONS = 283,
94 PERCENT_NAME_PREFIX = 284,
95 PERCENT_NO_DEFAULT_PREC = 285,
96 PERCENT_NO_LINES = 286,
97 PERCENT_NONDETERMINISTIC_PARSER = 287,
98 PERCENT_OUTPUT = 288,
99 PERCENT_PARSE_PARAM = 289,
100 PERCENT_PURE_PARSER = 290,
b50d2359
AD
101 PERCENT_REQUIRE = 291,
102 PERCENT_SKELETON = 292,
103 PERCENT_START = 293,
104 PERCENT_TOKEN_TABLE = 294,
105 PERCENT_VERBOSE = 295,
106 PERCENT_YACC = 296,
107 TYPE = 297,
108 EQUAL = 298,
109 SEMICOLON = 299,
110 PIPE = 300,
111 ID = 301,
112 ID_COLON = 302,
113 PERCENT_PERCENT = 303,
114 PROLOGUE = 304,
115 EPILOGUE = 305,
116 BRACED_CODE = 306
ae7453f2
AD
117 };
118#endif
f5109f5a 119/* Tokens. */
ae7453f2
AD
120#define GRAM_EOF 0
121#define STRING 258
62ddaef6
PE
122#define INT 259
123#define PERCENT_TOKEN 260
124#define PERCENT_NTERM 261
125#define PERCENT_TYPE 262
126#define PERCENT_DESTRUCTOR 263
127#define PERCENT_PRINTER 264
128#define PERCENT_UNION 265
129#define PERCENT_LEFT 266
130#define PERCENT_RIGHT 267
131#define PERCENT_NONASSOC 268
132#define PERCENT_PREC 269
133#define PERCENT_DPREC 270
134#define PERCENT_MERGE 271
135#define PERCENT_DEBUG 272
92f5e991
AD
136#define PERCENT_DEFAULT_PREC 273
137#define PERCENT_DEFINE 274
138#define PERCENT_DEFINES 275
139#define PERCENT_ERROR_VERBOSE 276
140#define PERCENT_EXPECT 277
d6328241
PH
141#define PERCENT_EXPECT_RR 278
142#define PERCENT_FILE_PREFIX 279
143#define PERCENT_GLR_PARSER 280
144#define PERCENT_INITIAL_ACTION 281
145#define PERCENT_LEX_PARAM 282
146#define PERCENT_LOCATIONS 283
147#define PERCENT_NAME_PREFIX 284
148#define PERCENT_NO_DEFAULT_PREC 285
149#define PERCENT_NO_LINES 286
150#define PERCENT_NONDETERMINISTIC_PARSER 287
151#define PERCENT_OUTPUT 288
152#define PERCENT_PARSE_PARAM 289
153#define PERCENT_PURE_PARSER 290
b50d2359
AD
154#define PERCENT_REQUIRE 291
155#define PERCENT_SKELETON 292
156#define PERCENT_START 293
157#define PERCENT_TOKEN_TABLE 294
158#define PERCENT_VERBOSE 295
159#define PERCENT_YACC 296
160#define TYPE 297
161#define EQUAL 298
162#define SEMICOLON 299
163#define PIPE 300
164#define ID 301
165#define ID_COLON 302
166#define PERCENT_PERCENT 303
167#define PROLOGUE 304
168#define EPILOGUE 305
169#define BRACED_CODE 306
ae7453f2
AD
170
171
172
173
1921f1d7 174/* Copy the first part of user declarations. */
8f3596a6 175#line 1 "../../src/parse-gram.y"
a76ca263
PE
176/* Bison Grammar Parser -*- C -*-
177
2ce37586 178 Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
a76ca263
PE
179
180 This file is part of Bison, the GNU Compiler Compiler.
181
182 This program is free software; you can redistribute it and/or modify
183 it under the terms of the GNU General Public License as published by
184 the Free Software Foundation; either version 2 of the License, or
185 (at your option) any later version.
186
187 This program is distributed in the hope that it will be useful,
188 but WITHOUT ANY WARRANTY; without even the implied warranty of
189 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
190 GNU General Public License for more details.
191
192 You should have received a copy of the GNU General Public License
193 along with this program; if not, write to the Free Software
0fb669f9
PE
194 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
195 02110-1301 USA
a76ca263 196*/
e9955c83 197
72c4d336 198#include <config.h>
e9955c83 199#include "system.h"
05d18c24 200
b275314e 201#include "complain.h"
05d18c24 202#include "conflicts.h"
e9955c83
AD
203#include "files.h"
204#include "getargs.h"
e9955c83 205#include "gram.h"
05d18c24
PE
206#include "muscle_tab.h"
207#include "output.h"
2ce37586 208#include "quotearg.h"
e9955c83 209#include "reader.h"
05d18c24 210#include "symlist.h"
b50d2359 211#include "strverscmp.h"
e9955c83 212
05d18c24
PE
213#define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
214static YYLTYPE lloc_default (YYLTYPE const *, int);
e9955c83 215
8a8dc872
AD
216#define YY_LOCATION_PRINT(File, Loc) \
217 location_print (File, Loc)
218
b50d2359
AD
219static void version_check (location const *loc, char const *version);
220
f0616f0b 221/* Request detailed syntax error messages, and pass them to GRAM_ERROR.
05d18c24 222 FIXME: depends on the undocumented availability of YYLLOC. */
e9955c83
AD
223#undef yyerror
224#define yyerror(Msg) \
fc5734fe 225 gram_error (&yylloc, Msg)
05d18c24 226static void gram_error (location const *, char const *);
e9955c83 227
73521d9f 228static void add_param (char const *, char *, location);
e9955c83 229
5f3df396
PE
230static symbol_class current_class = unknown_sym;
231static uniqstr current_type = 0;
7029f892
PE
232static symbol *current_lhs;
233static location current_lhs_location;
5f3df396 234static int current_prec = 0;
e9955c83 235
1921f1d7 236
1921f1d7
AD
237/* Enabling traces. */
238#ifndef YYDEBUG
239# define YYDEBUG 1
240#endif
241
242/* Enabling verbose error messages. */
243#ifdef YYERROR_VERBOSE
244# undef YYERROR_VERBOSE
245# define YYERROR_VERBOSE 1
246#else
cd3684cf 247# define YYERROR_VERBOSE 1
1921f1d7
AD
248#endif
249
5f3df396
PE
250/* Enabling the token table. */
251#ifndef YYTOKEN_TABLE
252# define YYTOKEN_TABLE 0
253#endif
254
73521d9f 255#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
8f3596a6 256#line 82 "../../src/parse-gram.y"
73521d9f 257typedef union YYSTYPE {
05d18c24
PE
258 symbol *symbol;
259 symbol_list *list;
e9955c83 260 int integer;
05d18c24
PE
261 char *chars;
262 assoc assoc;
263 uniqstr uniqstr;
73521d9f 264} YYSTYPE;
3b0ffc7e 265/* Line 196 of yacc.c. */
8f3596a6 266#line 267 "../../src/parse-gram.c"
73521d9f
PE
267# define yystype YYSTYPE /* obsolescent; will be withdrawn */
268# define YYSTYPE_IS_DECLARED 1
e9955c83
AD
269# define YYSTYPE_IS_TRIVIAL 1
270#endif
271
73521d9f
PE
272#if ! defined (YYLTYPE) && ! defined (YYLTYPE_IS_DECLARED)
273typedef struct YYLTYPE
e9955c83
AD
274{
275 int first_line;
276 int first_column;
277 int last_line;
278 int last_column;
73521d9f
PE
279} YYLTYPE;
280# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
281# define YYLTYPE_IS_DECLARED 1
e9955c83
AD
282# define YYLTYPE_IS_TRIVIAL 1
283#endif
284
73521d9f 285
1921f1d7 286/* Copy the second part of user declarations. */
0c15323d 287
0c15323d 288
3b0ffc7e 289/* Line 219 of yacc.c. */
8f3596a6 290#line 291 "../../src/parse-gram.c"
2ed28444
PE
291
292/* Define YYMODERN_C if this compiler supports C89 or better. If
293 __STDC__ is defined, the compiler is modern. IBM xlc 7.0 when run
294 as 'cc' doesn't define __STDC__ (or __STDC_VERSION__) for pedantic
295 reasons, but it defines __C99__FUNC__ so check that as well.
296 Consider a C++ compiler to be modern if it defines __cplusplus. */
297#ifndef YYMODERN_C
298# if defined (__STDC__) || defined (__C99__FUNC__) || defined (__cplusplus)
299# define YYMODERN_C 1
300# else
301# define YYMODERN_C 0
302# endif
52d9d411
PE
303#endif
304
ac243428
PE
305#ifndef YYSIZE_T
306# if defined (__SIZE_TYPE__)
307# define YYSIZE_T __SIZE_TYPE__
308# elif defined (size_t)
309# define YYSIZE_T size_t
52d9d411 310# elif ! defined (YYSIZE_T) && YYMODERN_C
ac243428
PE
311# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
312# define YYSIZE_T size_t
313# else
314# define YYSIZE_T unsigned int
315# endif
4b43d402 316#endif
e9955c83 317
2abdfeef
PE
318#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
319
6088a2a0
PE
320#ifndef YY_
321# if YYENABLE_NLS
322# if ENABLE_NLS
323# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
324# define YY_(msgid) dgettext ("bison-runtime", msgid)
325# endif
326# endif
327# ifndef YY_
328# define YY_(msgid) msgid
329# endif
330#endif
331
e764d4df 332/* Suppress unused-variable warnings by "using" E. */
7029f892
PE
333#ifndef lint
334# define YYUSE(e) ((void) (e))
335#else
336# define YYUSE(e) /* empty */
337#endif
338
339/* Identity function, used to suppress warnings about constant conditions. */
340#ifndef lint
341# define YYID(n) (n)
342#else
343#if defined (__STDC__) || defined (__C99__FUNC__) || defined (__cplusplus)
344static int
345YYID (int i)
346#else
347static int
348YYID (i)
349 int i;
350#endif
351{
352 return i;
353}
354#endif
e764d4df 355
4b43d402 356#if ! defined (yyoverflow) || YYERROR_VERBOSE
cd3684cf 357
e9955c83
AD
358/* The parser invokes alloca or malloc; define the necessary symbols. */
359
eae34f44
PE
360# ifdef YYSTACK_USE_ALLOCA
361# if YYSTACK_USE_ALLOCA
eae34f44
PE
362# ifdef __GNUC__
363# define YYSTACK_ALLOC __builtin_alloca
ac243428
PE
364# elif defined (__BUILTIN_VA_ARG_INCR)
365# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
366# elif defined (_AIX)
367# define YYSTACK_ALLOC __alloca
368# elif defined (_MSC_VER)
369# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
370# define alloca _alloca
da436e43
PE
371# else
372# define YYSTACK_ALLOC alloca
52d9d411 373# if ! defined (_ALLOCA_H) && ! defined (_STDLIB_H) && YYMODERN_C
4b43d402 374# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
ac243428
PE
375# ifndef _STDLIB_H
376# define _STDLIB_H 1
377# endif
4b43d402 378# endif
e9955c83
AD
379# endif
380# endif
381# endif
382
383# ifdef YYSTACK_ALLOC
3b0ffc7e 384 /* Pacify GCC's `empty if-body' warning. */
7029f892 385# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
2ce37586 386# ifndef YYSTACK_ALLOC_MAXIMUM
7768896a
PE
387 /* The OS might guarantee only one guard page at the bottom of the stack,
388 and a page size can be as small as 4096 bytes. So we cannot safely
389 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
390 to allow for a few compiler-allocated temporary stack slots. */
2ce37586
PE
391# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
392# endif
e9955c83 393# else
cd3684cf
AD
394# define YYSTACK_ALLOC YYMALLOC
395# define YYSTACK_FREE YYFREE
2ce37586 396# ifndef YYSTACK_ALLOC_MAXIMUM
2abdfeef 397# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
2ce37586 398# endif
0925ebb4
PE
399# ifdef __cplusplus
400extern "C" {
401# endif
4b43d402
PE
402# ifndef YYMALLOC
403# define YYMALLOC malloc
52d9d411 404# if ! defined (malloc) && ! defined (_STDLIB_H) && YYMODERN_C
4b43d402
PE
405void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
406# endif
407# endif
408# ifndef YYFREE
409# define YYFREE free
52d9d411 410# if ! defined (free) && ! defined (_STDLIB_H) && YYMODERN_C
4b43d402
PE
411void free (void *); /* INFRINGES ON USER NAME SPACE */
412# endif
413# endif
0925ebb4
PE
414# ifdef __cplusplus
415}
416# endif
e9955c83 417# endif
1921f1d7 418#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
e9955c83
AD
419
420
421#if (! defined (yyoverflow) \
422 && (! defined (__cplusplus) \
465b4444
PE
423 || (defined (YYLTYPE_IS_TRIVIAL) && YYLTYPE_IS_TRIVIAL \
424 && defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
e9955c83
AD
425
426/* A type that is properly aligned for any stack member. */
427union yyalloc
428{
584bbcd8 429 short int yyss;
e9955c83 430 YYSTYPE yyvs;
366eea36 431 YYLTYPE yyls;
e9955c83
AD
432};
433
434/* The size of the maximum gap between one aligned stack and the next. */
05d18c24 435# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
e9955c83
AD
436
437/* The size of an array large to enough to hold all stacks, each with
438 N elements. */
366eea36 439# define YYSTACK_BYTES(N) \
584bbcd8 440 ((N) * (sizeof (short int) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
05d18c24 441 + 2 * YYSTACK_GAP_MAXIMUM)
e9955c83
AD
442
443/* Copy COUNT objects from FROM to TO. The source and destination do
444 not overlap. */
445# ifndef YYCOPY
465b4444 446# if defined (__GNUC__) && 1 < __GNUC__
e9955c83
AD
447# define YYCOPY(To, From, Count) \
448 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
449# else
450# define YYCOPY(To, From, Count) \
451 do \
452 { \
b4fb989f 453 YYSIZE_T yyi; \
e9955c83 454 for (yyi = 0; yyi < (Count); yyi++) \
f0616f0b 455 (To)[yyi] = (From)[yyi]; \
e9955c83 456 } \
7029f892 457 while (YYID (0))
e9955c83
AD
458# endif
459# endif
460
461/* Relocate STACK from its old location to the new one. The
462 local variables YYSIZE and YYSTACKSIZE give the old and new number of
463 elements in the stack, and YYPTR gives the new location of the
464 stack. Advance YYPTR to a properly aligned location for the next
465 stack. */
466# define YYSTACK_RELOCATE(Stack) \
467 do \
468 { \
469 YYSIZE_T yynewbytes; \
470 YYCOPY (&yyptr->Stack, Stack, yysize); \
471 Stack = &yyptr->Stack; \
05d18c24 472 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
e9955c83
AD
473 yyptr += yynewbytes / sizeof (*yyptr); \
474 } \
7029f892 475 while (YYID (0))
e9955c83
AD
476
477#endif
478
52d9d411 479#if YYMODERN_C
ae7453f2
AD
480 typedef signed char yysigned_char;
481#else
584bbcd8 482 typedef short int yysigned_char;
ae7453f2
AD
483#endif
484
3b0ffc7e 485/* YYFINAL -- State number of the termination state. */
1921f1d7 486#define YYFINAL 3
d33cb3ae 487/* YYLAST -- Last index in YYTABLE. */
b50d2359 488#define YYLAST 161
1921f1d7 489
3b0ffc7e 490/* YYNTOKENS -- Number of terminals. */
b50d2359 491#define YYNTOKENS 52
3b0ffc7e 492/* YYNNTS -- Number of nonterminals. */
73521d9f 493#define YYNNTS 25
3b0ffc7e 494/* YYNRULES -- Number of rules. */
b50d2359 495#define YYNRULES 81
3b0ffc7e 496/* YYNRULES -- Number of states. */
b50d2359 497#define YYNSTATES 110
1921f1d7
AD
498
499/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
500#define YYUNDEFTOK 2
b50d2359 501#define YYMAXUTOK 306
1921f1d7 502
5f3df396 503#define YYTRANSLATE(YYX) \
73521d9f 504 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1921f1d7
AD
505
506/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
507static const unsigned char yytranslate[] =
508{
509 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
510 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
511 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
512 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
513 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
514 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
515 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
516 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
517 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
518 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
519 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
520 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
521 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
522 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
523 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
524 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
525 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
526 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
527 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
528 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
529 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
530 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
531 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
532 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
533 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
534 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
535 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
536 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
537 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
ae7453f2 538 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
b50d2359 539 45, 46, 47, 48, 49, 50, 51
1921f1d7
AD
540};
541
542#if YYDEBUG
543/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
544 YYRHS. */
545static const unsigned char yyprhs[] =
546{
fb9712a9
AD
547 0, 0, 3, 8, 9, 12, 14, 16, 18, 21,
548 25, 27, 29, 32, 35, 39, 41, 43, 45, 47,
b50d2359
AD
549 51, 53, 55, 59, 61, 63, 66, 69, 71, 73,
550 75, 77, 79, 81, 84, 86, 89, 92, 94, 96,
551 97, 101, 102, 106, 110, 114, 116, 118, 120, 121,
552 123, 125, 128, 130, 132, 135, 138, 142, 144, 147,
553 149, 152, 154, 157, 160, 161, 165, 167, 171, 174,
554 175, 178, 181, 185, 189, 193, 195, 197, 199, 201,
555 203, 204
1921f1d7
AD
556};
557
3b0ffc7e 558/* YYRHS -- A `-1'-separated list of the rules' RHS. */
ae7453f2 559static const yysigned_char yyrhs[] =
1921f1d7 560{
b50d2359
AD
561 53, 0, -1, 54, 48, 66, 76, -1, -1, 54,
562 55, -1, 56, -1, 49, -1, 17, -1, 19, 75,
563 -1, 19, 75, 75, -1, 20, -1, 21, -1, 22,
564 4, -1, 23, 4, -1, 24, 43, 75, -1, 25,
565 -1, 26, -1, 27, -1, 28, -1, 29, 43, 75,
566 -1, 31, -1, 32, -1, 33, 43, 75, -1, 34,
567 -1, 35, -1, 36, 75, -1, 37, 75, -1, 39,
568 -1, 40, -1, 41, -1, 44, -1, 60, -1, 57,
569 -1, 38, 72, -1, 10, -1, 8, 63, -1, 9,
570 63, -1, 18, -1, 30, -1, -1, 6, 58, 65,
571 -1, -1, 5, 59, 65, -1, 7, 42, 63, -1,
572 61, 62, 63, -1, 11, -1, 12, -1, 13, -1,
573 -1, 42, -1, 72, -1, 63, 72, -1, 42, -1,
574 46, -1, 46, 4, -1, 46, 74, -1, 46, 4,
575 74, -1, 64, -1, 65, 64, -1, 67, -1, 66,
576 67, -1, 68, -1, 56, 44, -1, 1, 44, -1,
577 -1, 47, 69, 70, -1, 71, -1, 70, 45, 71,
578 -1, 70, 44, -1, -1, 71, 72, -1, 71, 73,
579 -1, 71, 14, 72, -1, 71, 15, 4, -1, 71,
580 16, 42, -1, 46, -1, 74, -1, 51, -1, 3,
581 -1, 3, -1, -1, 48, 50, -1
1921f1d7
AD
582};
583
584/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
584bbcd8 585static const unsigned short int yyrline[] =
1921f1d7 586{
72c4d336
PE
587 0, 192, 192, 200, 202, 206, 207, 208, 209, 210,
588 211, 212, 213, 214, 215, 216, 221, 225, 226, 227,
589 228, 229, 230, 231, 232, 233, 234, 235, 236, 237,
590 238, 242, 243, 244, 248, 254, 261, 268, 272, 279,
591 279, 284, 284, 289, 299, 314, 315, 316, 320, 321,
592 327, 328, 333, 337, 342, 348, 354, 365, 366, 375,
593 376, 382, 383, 388, 395, 395, 399, 400, 401, 406,
594 407, 409, 411, 413, 415, 420, 421, 425, 431, 440,
595 445, 447
1921f1d7
AD
596};
597#endif
598
5f3df396 599#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
9cbfdc9e 600/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
3b0ffc7e 601 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1921f1d7
AD
602static const char *const yytname[] =
603{
9cbfdc9e
PE
604 "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
605 "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor {...}\"",
606 "\"%printer {...}\"", "\"%union {...}\"", "\"%left\"", "\"%right\"",
607 "\"%nonassoc\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%debug\"",
608 "\"%default-prec\"", "\"%define\"", "\"%defines\"", "\"%error-verbose\"",
609 "\"%expect\"", "\"%expect-rr\"", "\"%file-prefix\"", "\"%glr-parser\"",
610 "\"%initial-action {...}\"", "\"%lex-param {...}\"", "\"%locations\"",
611 "\"%name-prefix\"", "\"%no-default-prec\"", "\"%no-lines\"",
612 "\"%nondeterministic-parser\"", "\"%output\"", "\"%parse-param {...}\"",
b50d2359
AD
613 "\"%pure-parser\"", "\"%require\"", "\"%skeleton\"", "\"%start\"",
614 "\"%token-table\"", "\"%verbose\"", "\"%yacc\"", "\"type\"", "\"=\"",
615 "\";\"", "\"|\"", "\"identifier\"", "\"identifier:\"", "\"%%\"",
616 "\"%{...%}\"", "\"epilogue\"", "\"{...}\"", "$accept", "input",
617 "declarations", "declaration", "grammar_declaration",
618 "symbol_declaration", "@1", "@2", "precedence_declaration",
619 "precedence_declarator", "type.opt", "symbols.1", "symbol_def",
620 "symbol_defs.1", "grammar", "rules_or_grammar_declaration", "rules",
621 "@3", "rhses.1", "rhs", "symbol", "action", "string_as_id",
622 "string_content", "epilogue.opt", 0
1921f1d7
AD
623};
624#endif
625
3d38c03a 626# ifdef YYPRINT
1921f1d7
AD
627/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
628 token YYLEX-NUM. */
584bbcd8 629static const unsigned short int yytoknum[] =
1921f1d7
AD
630{
631 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
632 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
633 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
634 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
d6328241 635 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
b50d2359 636 305, 306
1921f1d7 637};
3d38c03a 638# endif
1921f1d7
AD
639
640/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
641static const unsigned char yyr1[] =
642{
b50d2359
AD
643 0, 52, 53, 54, 54, 55, 55, 55, 55, 55,
644 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
645 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
646 55, 56, 56, 56, 56, 56, 56, 56, 56, 58,
647 57, 59, 57, 57, 60, 61, 61, 61, 62, 62,
648 63, 63, 64, 64, 64, 64, 64, 65, 65, 66,
649 66, 67, 67, 67, 69, 68, 70, 70, 70, 71,
650 71, 71, 71, 71, 71, 72, 72, 73, 74, 75,
651 76, 76
1921f1d7
AD
652};
653
654/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
655static const unsigned char yyr2[] =
656{
fb9712a9
AD
657 0, 2, 4, 0, 2, 1, 1, 1, 2, 3,
658 1, 1, 2, 2, 3, 1, 1, 1, 1, 3,
b50d2359
AD
659 1, 1, 3, 1, 1, 2, 2, 1, 1, 1,
660 1, 1, 1, 2, 1, 2, 2, 1, 1, 0,
661 3, 0, 3, 3, 3, 1, 1, 1, 0, 1,
662 1, 2, 1, 1, 2, 2, 3, 1, 2, 1,
663 2, 1, 2, 2, 0, 3, 1, 3, 2, 0,
664 2, 2, 3, 3, 3, 1, 1, 1, 1, 1,
665 0, 2
1921f1d7
AD
666};
667
668/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
669 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
670 means the default is an error. */
04b6e11e 671static const unsigned char yydefact[] =
1921f1d7 672{
b50d2359
AD
673 3, 0, 0, 1, 41, 39, 0, 0, 0, 34,
674 45, 46, 47, 7, 37, 0, 10, 11, 0, 0,
675 0, 15, 16, 17, 18, 0, 38, 20, 21, 0,
676 23, 24, 0, 0, 0, 27, 28, 29, 30, 0,
677 6, 4, 5, 32, 31, 48, 0, 0, 0, 78,
678 75, 35, 50, 76, 36, 79, 8, 12, 13, 0,
679 0, 0, 25, 26, 33, 0, 64, 0, 0, 59,
680 61, 49, 0, 52, 53, 57, 42, 40, 43, 51,
681 9, 14, 19, 22, 63, 69, 62, 0, 60, 2,
682 44, 54, 55, 58, 65, 66, 81, 56, 68, 69,
683 0, 0, 0, 77, 70, 71, 67, 72, 73, 74
1921f1d7
AD
684};
685
3b0ffc7e 686/* YYDEFGOTO[NTERM-NUM]. */
ae7453f2 687static const yysigned_char yydefgoto[] =
1921f1d7 688{
b50d2359
AD
689 -1, 1, 2, 41, 67, 43, 47, 46, 44, 45,
690 72, 51, 75, 76, 68, 69, 70, 85, 94, 95,
691 52, 105, 53, 56, 89
1921f1d7
AD
692};
693
694/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
695 STATE-NUM. */
b50d2359 696#define YYPACT_NINF -69
ae7453f2 697static const yysigned_char yypact[] =
1921f1d7 698{
b50d2359
AD
699 -69, 5, 112, -69, -69, -69, -35, 0, 0, -69,
700 -69, -69, -69, -69, -69, 13, -69, -69, 20, 31,
701 -18, -69, -69, -69, -69, -6, -69, -69, -69, -5,
702 -69, -69, 13, 13, 0, -69, -69, -69, -69, 69,
703 -69, -69, -69, -69, -69, -2, -38, -38, 0, -69,
704 -69, 0, -69, -69, 0, -69, 13, -69, -69, 13,
705 13, 13, -69, -69, -69, -8, -69, 3, 21, -69,
706 -69, -69, 0, -69, 6, -69, -38, -38, 0, -69,
707 -69, -69, -69, -69, -69, -69, -69, 2, -69, -69,
708 0, 39, -69, -69, -33, -1, -69, -69, -69, -69,
709 0, 44, 1, -69, -69, -69, -1, -69, -69, -69
1921f1d7
AD
710};
711
712/* YYPGOTO[NTERM-NUM]. */
ae7453f2 713static const yysigned_char yypgoto[] =
1921f1d7 714{
b50d2359
AD
715 -69, -69, -69, -69, 47, -69, -69, -69, -69, -69,
716 -69, -7, -58, 7, -69, -15, -69, -69, -69, -44,
717 -34, -69, -68, 30, -69
1921f1d7
AD
718};
719
720/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
721 positive, shift that token. If negative, reduce the rule which
ae7453f2 722 number is the opposite. If zero, do what YYDEFACT says.
f0616f0b 723 If YYTABLE_NINF, syntax error. */
b50d2359 724#define YYTABLE_NINF -81
ae7453f2 725static const yysigned_char yytable[] =
1921f1d7 726{
b50d2359
AD
727 64, 54, 49, 49, 73, 3, 92, 48, 74, 49,
728 91, 98, 99, 100, 101, 102, 55, 79, 93, 93,
729 79, -80, 65, 97, 57, 59, 4, 5, 6, 7,
730 8, 9, 10, 11, 12, 58, 84, 60, 61, 14,
731 71, 78, 49, 109, 79, 50, 50, 86, 108, 42,
732 103, 26, 96, 88, 77, 106, 79, 0, 0, 34,
733 0, 104, 62, 63, 0, 90, 107, 0, 66, 87,
734 65, 0, 104, 0, 4, 5, 6, 7, 8, 9,
735 10, 11, 12, 0, 0, 0, 80, 14, 0, 81,
736 82, 83, 0, 0, 0, 0, 0, 0, 0, 26,
737 0, 0, 0, 0, 0, 0, 0, 34, 0, 0,
738 0, 0, 0, 0, 0, 0, 66, 4, 5, 6,
739 7, 8, 9, 10, 11, 12, 0, 0, 0, 13,
740 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
741 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
742 34, 35, 36, 37, 0, 0, 38, 0, 0, 0,
743 39, 40
1921f1d7
AD
744};
745
ae7453f2 746static const yysigned_char yycheck[] =
1921f1d7 747{
b50d2359
AD
748 34, 8, 3, 3, 42, 0, 74, 42, 46, 3,
749 4, 44, 45, 14, 15, 16, 3, 51, 76, 77,
750 54, 0, 1, 91, 4, 43, 5, 6, 7, 8,
751 9, 10, 11, 12, 13, 4, 44, 43, 43, 18,
752 42, 48, 3, 42, 78, 46, 46, 44, 4, 2,
753 51, 30, 50, 68, 47, 99, 90, -1, -1, 38,
754 -1, 95, 32, 33, -1, 72, 100, -1, 47, 48,
755 1, -1, 106, -1, 5, 6, 7, 8, 9, 10,
756 11, 12, 13, -1, -1, -1, 56, 18, -1, 59,
757 60, 61, -1, -1, -1, -1, -1, -1, -1, 30,
758 -1, -1, -1, -1, -1, -1, -1, 38, -1, -1,
759 -1, -1, -1, -1, -1, -1, 47, 5, 6, 7,
760 8, 9, 10, 11, 12, 13, -1, -1, -1, 17,
761 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
762 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
763 38, 39, 40, 41, -1, -1, 44, -1, -1, -1,
764 48, 49
1921f1d7
AD
765};
766
1921f1d7
AD
767/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
768 symbol of state STATE-NUM. */
769static const unsigned char yystos[] =
770{
b50d2359 771 0, 53, 54, 0, 5, 6, 7, 8, 9, 10,
62ddaef6
PE
772 11, 12, 13, 17, 18, 19, 20, 21, 22, 23,
773 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
b50d2359
AD
774 34, 35, 36, 37, 38, 39, 40, 41, 44, 48,
775 49, 55, 56, 57, 60, 61, 59, 58, 42, 3,
776 46, 63, 72, 74, 63, 3, 75, 4, 4, 43,
777 43, 43, 75, 75, 72, 1, 47, 56, 66, 67,
778 68, 42, 62, 42, 46, 64, 65, 65, 63, 72,
779 75, 75, 75, 75, 44, 69, 44, 48, 67, 76,
780 63, 4, 74, 64, 70, 71, 50, 74, 44, 45,
781 14, 15, 16, 51, 72, 73, 71, 72, 4, 42
1921f1d7 782};
e9955c83 783
e9955c83 784#define yyerrok (yyerrstatus = 0)
73521d9f
PE
785#define yyclearin (yychar = YYEMPTY)
786#define YYEMPTY (-2)
e9955c83 787#define YYEOF 0
1921f1d7 788
e9955c83 789#define YYACCEPT goto yyacceptlab
1921f1d7 790#define YYABORT goto yyabortlab
465b4444 791#define YYERROR goto yyerrorlab
6d5aa694 792
1921f1d7 793
e9955c83
AD
794/* Like YYERROR except do call yyerror. This remains here temporarily
795 to ease the transition to the new meaning of YYERROR, for GCC.
796 Once GCC version 2 has supplanted version 1, this can go. */
1921f1d7 797
e9955c83 798#define YYFAIL goto yyerrlab
1921f1d7 799
e9955c83 800#define YYRECOVERING() (!!yyerrstatus)
1921f1d7 801
e9955c83
AD
802#define YYBACKUP(Token, Value) \
803do \
73521d9f 804 if (yychar == YYEMPTY && yylen == 1) \
e9955c83
AD
805 { \
806 yychar = (Token); \
807 yylval = (Value); \
886b69d1 808 yytoken = YYTRANSLATE (yychar); \
3b0ffc7e 809 YYPOPSTACK (1); \
e9955c83
AD
810 goto yybackup; \
811 } \
812 else \
5f3df396 813 { \
6088a2a0 814 yyerror (YY_("syntax error: cannot back up")); \
e9955c83
AD
815 YYERROR; \
816 } \
7029f892 817while (YYID (0))
e9955c83 818
8a8dc872 819
e9955c83
AD
820#define YYTERROR 1
821#define YYERRCODE 256
822
8a8dc872
AD
823
824/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
825 If N is 0, then set CURRENT to the empty location which ends
826 the previous symbol: RHS[0] (always defined). */
e9955c83 827
bbd3fa0c 828#define YYRHSLOC(Rhs, K) ((Rhs)[K])
e9955c83 829#ifndef YYLLOC_DEFAULT
bbd3fa0c
PE
830# define YYLLOC_DEFAULT(Current, Rhs, N) \
831 do \
3b0ffc7e 832 if (YYID (N)) \
bbd3fa0c 833 { \
da436e43
PE
834 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
835 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
836 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
837 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
bbd3fa0c
PE
838 } \
839 else \
840 { \
841 (Current).first_line = (Current).last_line = \
da436e43 842 YYRHSLOC (Rhs, 0).last_line; \
bbd3fa0c 843 (Current).first_column = (Current).last_column = \
da436e43 844 YYRHSLOC (Rhs, 0).last_column; \
bbd3fa0c 845 } \
7029f892 846 while (YYID (0))
8a8dc872
AD
847#endif
848
849
850/* YY_LOCATION_PRINT -- Print the location on the stream.
851 This macro was not mandated originally: define only if we know
852 we won't break user code: when these are the locations we know. */
853
854#ifndef YY_LOCATION_PRINT
855# if YYLTYPE_IS_TRIVIAL
856# define YY_LOCATION_PRINT(File, Loc) \
857 fprintf (File, "%d.%d-%d.%d", \
858 (Loc).first_line, (Loc).first_column, \
859 (Loc).last_line, (Loc).last_column)
860# else
861# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
862# endif
e9955c83
AD
863#endif
864
8a8dc872 865
e9955c83
AD
866/* YYLEX -- calling `yylex' with the right arguments. */
867
366eea36 868#ifdef YYLEX_PARAM
d33cb3ae 869# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
366eea36 870#else
d33cb3ae 871# define YYLEX yylex (&yylval, &yylloc)
366eea36 872#endif
e9955c83
AD
873
874/* Enable debugging if requested. */
875#if YYDEBUG
876
74e543d2 877# ifndef YYFPRINTF
e9955c83
AD
878# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
879# define YYFPRINTF fprintf
880# endif
881
882# define YYDPRINTF(Args) \
883do { \
884 if (yydebug) \
885 YYFPRINTF Args; \
7029f892 886} while (YYID (0))
05d18c24 887
4b367315
AD
888# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
889do { \
890 if (yydebug) \
891 { \
892 YYFPRINTF (stderr, "%s ", Title); \
3b0ffc7e 893 yy_symbol_print (stderr, \
4b367315
AD
894 Type, Value, Location); \
895 YYFPRINTF (stderr, "\n"); \
896 } \
7029f892 897} while (YYID (0))
f0616f0b 898
3b0ffc7e 899
66809587
PE
900/*--------------------------------.
901| Print this symbol on YYOUTPUT. |
902`--------------------------------*/
903
7029f892 904/*ARGSUSED*/
66809587
PE
905#if defined (__STDC__) || defined (__C99__FUNC__) || defined (__cplusplus)
906static void
3b0ffc7e 907yy_symbol_value_print (FILE *yyoutput, int yytype, const YYSTYPE * const yyvaluep, const YYLTYPE * const yylocationp)
66809587
PE
908#else
909static void
3b0ffc7e 910yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp)
66809587
PE
911 FILE *yyoutput;
912 int yytype;
913 const YYSTYPE * const yyvaluep;
914 const YYLTYPE * const yylocationp;
915#endif
916{
917 YYUSE (yyvaluep);
918 YYUSE (yylocationp);
66809587
PE
919# ifdef YYPRINT
920 if (yytype < YYNTOKENS)
921 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
922# endif
923 switch (yytype)
924 {
925 case 3: /* "\"string\"" */
8f3596a6 926#line 169 "../../src/parse-gram.y"
66809587 927 { fprintf (stderr, "\"%s\"", (yyvaluep->chars)); };
8f3596a6 928#line 929 "../../src/parse-gram.c"
66809587
PE
929 break;
930 case 4: /* "\"integer\"" */
8f3596a6 931#line 182 "../../src/parse-gram.y"
66809587 932 { fprintf (stderr, "%d", (yyvaluep->integer)); };
8f3596a6 933#line 934 "../../src/parse-gram.c"
66809587
PE
934 break;
935 case 8: /* "\"%destructor {...}\"" */
8f3596a6 936#line 171 "../../src/parse-gram.y"
66809587 937 { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); };
8f3596a6 938#line 939 "../../src/parse-gram.c"
66809587
PE
939 break;
940 case 9: /* "\"%printer {...}\"" */
8f3596a6 941#line 175 "../../src/parse-gram.y"
66809587 942 { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); };
8f3596a6 943#line 944 "../../src/parse-gram.c"
66809587
PE
944 break;
945 case 10: /* "\"%union {...}\"" */
8f3596a6 946#line 176 "../../src/parse-gram.y"
66809587 947 { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); };
8f3596a6 948#line 949 "../../src/parse-gram.c"
66809587
PE
949 break;
950 case 26: /* "\"%initial-action {...}\"" */
8f3596a6 951#line 172 "../../src/parse-gram.y"
66809587 952 { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); };
8f3596a6 953#line 954 "../../src/parse-gram.c"
66809587
PE
954 break;
955 case 27: /* "\"%lex-param {...}\"" */
8f3596a6 956#line 173 "../../src/parse-gram.y"
66809587 957 { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); };
8f3596a6 958#line 959 "../../src/parse-gram.c"
66809587
PE
959 break;
960 case 34: /* "\"%parse-param {...}\"" */
8f3596a6 961#line 174 "../../src/parse-gram.y"
66809587 962 { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); };
8f3596a6 963#line 964 "../../src/parse-gram.c"
66809587
PE
964 break;
965 case 42: /* "\"type\"" */
8f3596a6 966#line 180 "../../src/parse-gram.y"
66809587 967 { fprintf (stderr, "<%s>", (yyvaluep->uniqstr)); };
8f3596a6 968#line 969 "../../src/parse-gram.c"
66809587
PE
969 break;
970 case 46: /* "\"identifier\"" */
8f3596a6 971#line 184 "../../src/parse-gram.y"
66809587 972 { fprintf (stderr, "%s", (yyvaluep->symbol)->tag); };
8f3596a6 973#line 974 "../../src/parse-gram.c"
66809587
PE
974 break;
975 case 47: /* "\"identifier:\"" */
8f3596a6 976#line 186 "../../src/parse-gram.y"
66809587 977 { fprintf (stderr, "%s:", (yyvaluep->symbol)->tag); };
8f3596a6 978#line 979 "../../src/parse-gram.c"
66809587
PE
979 break;
980 case 49: /* "\"%{...%}\"" */
8f3596a6 981#line 178 "../../src/parse-gram.y"
66809587 982 { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); };
8f3596a6 983#line 984 "../../src/parse-gram.c"
66809587
PE
984 break;
985 case 50: /* "\"epilogue\"" */
8f3596a6 986#line 178 "../../src/parse-gram.y"
66809587 987 { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); };
8f3596a6 988#line 989 "../../src/parse-gram.c"
66809587
PE
989 break;
990 case 51: /* "\"{...}\"" */
8f3596a6 991#line 177 "../../src/parse-gram.y"
66809587 992 { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); };
8f3596a6 993#line 994 "../../src/parse-gram.c"
66809587
PE
994 break;
995 case 72: /* "symbol" */
8f3596a6 996#line 184 "../../src/parse-gram.y"
66809587 997 { fprintf (stderr, "%s", (yyvaluep->symbol)->tag); };
8f3596a6 998#line 999 "../../src/parse-gram.c"
66809587
PE
999 break;
1000 case 73: /* "action" */
8f3596a6 1001#line 177 "../../src/parse-gram.y"
66809587 1002 { fprintf (stderr, "{\n%s\n}", (yyvaluep->chars)); };
8f3596a6 1003#line 1004 "../../src/parse-gram.c"
66809587
PE
1004 break;
1005 case 74: /* "string_as_id" */
8f3596a6 1006#line 184 "../../src/parse-gram.y"
66809587 1007 { fprintf (stderr, "%s", (yyvaluep->symbol)->tag); };
8f3596a6 1008#line 1009 "../../src/parse-gram.c"
66809587
PE
1009 break;
1010 case 75: /* "string_content" */
8f3596a6 1011#line 169 "../../src/parse-gram.y"
66809587 1012 { fprintf (stderr, "\"%s\"", (yyvaluep->chars)); };
8f3596a6 1013#line 1014 "../../src/parse-gram.c"
66809587
PE
1014 break;
1015 default:
1016 break;
1017 }
3b0ffc7e
PE
1018}
1019
1020
1021/*--------------------------------.
1022| Print this symbol on YYOUTPUT. |
1023`--------------------------------*/
1024
1025#if defined (__STDC__) || defined (__C99__FUNC__) || defined (__cplusplus)
1026static void
1027yy_symbol_print (FILE *yyoutput, int yytype, const YYSTYPE * const yyvaluep, const YYLTYPE * const yylocationp)
1028#else
1029static void
1030yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp)
1031 FILE *yyoutput;
1032 int yytype;
1033 const YYSTYPE * const yyvaluep;
1034 const YYLTYPE * const yylocationp;
1035#endif
1036{
1037 if (yytype < YYNTOKENS)
1038 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1039 else
1040 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1041
1042 YY_LOCATION_PRINT (yyoutput, *yylocationp);
1043 YYFPRINTF (yyoutput, ": ");
1044 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
66809587
PE
1045 YYFPRINTF (yyoutput, ")");
1046}
1047
05d18c24
PE
1048/*------------------------------------------------------------------.
1049| yy_stack_print -- Print the state stack from its BOTTOM up to its |
cd3684cf 1050| TOP (included). |
05d18c24
PE
1051`------------------------------------------------------------------*/
1052
2ed28444 1053#if defined (__STDC__) || defined (__C99__FUNC__) || defined (__cplusplus)
05d18c24 1054static void
584bbcd8 1055yy_stack_print (short int *bottom, short int *top)
05d18c24
PE
1056#else
1057static void
1058yy_stack_print (bottom, top)
584bbcd8
PE
1059 short int *bottom;
1060 short int *top;
05d18c24
PE
1061#endif
1062{
74e543d2 1063 YYFPRINTF (stderr, "Stack now");
3b0ffc7e 1064 for (; bottom <= top; ++bottom)
05d18c24 1065 YYFPRINTF (stderr, " %d", *bottom);
74e543d2 1066 YYFPRINTF (stderr, "\n");
05d18c24
PE
1067}
1068
1069# define YY_STACK_PRINT(Bottom, Top) \
1070do { \
1071 if (yydebug) \
1072 yy_stack_print ((Bottom), (Top)); \
7029f892 1073} while (YYID (0))
05d18c24
PE
1074
1075
1076/*------------------------------------------------.
1077| Report that the YYRULE is going to be reduced. |
1078`------------------------------------------------*/
1079
2ed28444 1080#if defined (__STDC__) || defined (__C99__FUNC__) || defined (__cplusplus)
05d18c24 1081static void
66809587 1082yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule)
05d18c24
PE
1083#else
1084static void
66809587
PE
1085yy_reduce_print (yyvsp, yylsp, yyrule
1086 )
1087 YYSTYPE *yyvsp;
1088 YYLTYPE *yylsp;
05d18c24
PE
1089 int yyrule;
1090#endif
1091{
66809587 1092 int yynrhs = yyr2[yyrule];
05d18c24 1093 int yyi;
6088a2a0 1094 unsigned long int yylno = yyrline[yyrule];
66809587 1095 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
6d5aa694 1096 yyrule - 1, yylno);
66809587
PE
1097 /* The symbols being reduced. */
1098 for (yyi = 0; yyi < yynrhs; yyi++)
1099 {
1100 fprintf (stderr, " $%d = ", yyi + 1);
3b0ffc7e
PE
1101 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1102 &(yyvsp[(yyi + 1) - (yynrhs)])
1103 , &(yylsp[(yyi + 1) - (yynrhs)]) );
66809587
PE
1104 fprintf (stderr, "\n");
1105 }
05d18c24
PE
1106}
1107
1108# define YY_REDUCE_PRINT(Rule) \
1109do { \
1110 if (yydebug) \
66809587 1111 yy_reduce_print (yyvsp, yylsp, Rule); \
7029f892 1112} while (YYID (0))
05d18c24 1113
e9955c83
AD
1114/* Nonzero means print parse trace. It is left uninitialized so that
1115 multiple parsers can coexist. */
1116int yydebug;
1117#else /* !YYDEBUG */
1118# define YYDPRINTF(Args)
8a8dc872 1119# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
05d18c24
PE
1120# define YY_STACK_PRINT(Bottom, Top)
1121# define YY_REDUCE_PRINT(Rule)
e9955c83
AD
1122#endif /* !YYDEBUG */
1123
05d18c24 1124
e9955c83
AD
1125/* YYINITDEPTH -- initial size of the parser's stacks. */
1126#ifndef YYINITDEPTH
1127# define YYINITDEPTH 200
1128#endif
1129
1130/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1131 if the built-in stack extension method is used).
1132
1133 Do not make this value too large; the results are undefined if
2ce37586 1134 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
e9955c83
AD
1135 evaluated with infinite-precision integer arithmetic. */
1136
e9955c83
AD
1137#ifndef YYMAXDEPTH
1138# define YYMAXDEPTH 10000
1139#endif
1921f1d7 1140
e9955c83 1141\f
1921f1d7
AD
1142
1143#if YYERROR_VERBOSE
e9955c83
AD
1144
1145# ifndef yystrlen
1146# if defined (__GLIBC__) && defined (_STRING_H)
1147# define yystrlen strlen
1148# else
1149/* Return the length of YYSTR. */
1150static YYSIZE_T
52d9d411 1151# if YYMODERN_C
e9955c83
AD
1152yystrlen (const char *yystr)
1153# else
1154yystrlen (yystr)
1155 const char *yystr;
1156# endif
1157{
7029f892
PE
1158 YYSIZE_T yylen;
1159 for (yylen = 0; yystr[yylen]; yylen++)
e9955c83 1160 continue;
7029f892 1161 return yylen;
e9955c83
AD
1162}
1163# endif
1164# endif
1165
1166# ifndef yystpcpy
1167# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1168# define yystpcpy stpcpy
1169# else
1170/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1171 YYDEST. */
1172static char *
52d9d411 1173# if YYMODERN_C
e9955c83
AD
1174yystpcpy (char *yydest, const char *yysrc)
1175# else
1176yystpcpy (yydest, yysrc)
1177 char *yydest;
1178 const char *yysrc;
1179# endif
1180{
b4fb989f
PE
1181 char *yyd = yydest;
1182 const char *yys = yysrc;
e9955c83
AD
1183
1184 while ((*yyd++ = *yys++) != '\0')
1185 continue;
1186
1187 return yyd - 1;
1188}
1189# endif
1190# endif
0c15323d 1191
9cbfdc9e
PE
1192# ifndef yytnamerr
1193/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1194 quotes and backslashes, so that it's suitable for yyerror. The
1195 heuristic is that double-quoting is unnecessary unless the string
1196 contains an apostrophe, a comma, or backslash (other than
1197 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1198 null, do not copy; instead, return the length of what the result
1199 would have been. */
1200static YYSIZE_T
1201yytnamerr (char *yyres, const char *yystr)
1202{
1203 if (*yystr == '"')
1204 {
1205 size_t yyn = 0;
1206 char const *yyp = yystr;
1207
1208 for (;;)
1209 switch (*++yyp)
1210 {
1211 case '\'':
1212 case ',':
1213 goto do_not_strip_quotes;
1214
1215 case '\\':
1216 if (*++yyp != '\\')
1217 goto do_not_strip_quotes;
1218 /* Fall through. */
1219 default:
1220 if (yyres)
1221 yyres[yyn] = *yyp;
1222 yyn++;
1223 break;
1224
1225 case '"':
1226 if (yyres)
1227 yyres[yyn] = '\0';
1228 return yyn;
1229 }
1230 do_not_strip_quotes: ;
1231 }
1232
1233 if (! yyres)
1234 return yystrlen (yystr);
1235
1236 return yystpcpy (yyres, yystr) - yyres;
1237}
1238# endif
1239
2abdfeef
PE
1240/* Copy into YYRESULT an error message about the unexpected token
1241 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1242 including the terminating null byte. If YYRESULT is null, do not
1243 copy anything; just return the number of bytes that would be
1244 copied. As a special case, return 0 if an ordinary "syntax error"
1245 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1246 size calculation. */
1247static YYSIZE_T
1248yysyntax_error (char *yyresult, int yystate, int yychar)
1249{
1250 int yyn = yypact[yystate];
1921f1d7 1251
2abdfeef
PE
1252 if (! (YYPACT_NINF < yyn && yyn < YYLAST))
1253 return 0;
1254 else
1255 {
1256 int yytype = YYTRANSLATE (yychar);
1257 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1258 YYSIZE_T yysize = yysize0;
1259 YYSIZE_T yysize1;
1260 int yysize_overflow = 0;
1261 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1262 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1263 int yyx;
1264
1265# if 0
1266 /* This is so xgettext sees the translatable formats that are
1267 constructed on the fly. */
1268 YY_("syntax error, unexpected %s");
1269 YY_("syntax error, unexpected %s, expecting %s");
1270 YY_("syntax error, unexpected %s, expecting %s or %s");
1271 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1272 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1273# endif
1274 char *yyfmt;
1275 char const *yyf;
1276 static char const yyunexpected[] = "syntax error, unexpected %s";
1277 static char const yyexpecting[] = ", expecting %s";
1278 static char const yyor[] = " or %s";
1279 char yyformat[sizeof yyunexpected
1280 + sizeof yyexpecting - 1
1281 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1282 * (sizeof yyor - 1))];
1283 char const *yyprefix = yyexpecting;
1284
1285 /* Start YYX at -YYN if negative to avoid negative indexes in
1286 YYCHECK. */
1287 int yyxbegin = yyn < 0 ? -yyn : 0;
1288
1289 /* Stay within bounds of both yycheck and yytname. */
1290 int yychecklim = YYLAST - yyn;
1291 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1292 int yycount = 1;
1293
1294 yyarg[0] = yytname[yytype];
1295 yyfmt = yystpcpy (yyformat, yyunexpected);
1296
1297 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1298 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1299 {
1300 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1301 {
1302 yycount = 1;
1303 yysize = yysize0;
1304 yyformat[sizeof yyunexpected - 1] = '\0';
1305 break;
1306 }
1307 yyarg[yycount++] = yytname[yyx];
1308 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
7029f892 1309 yysize_overflow |= (yysize1 < yysize);
2abdfeef
PE
1310 yysize = yysize1;
1311 yyfmt = yystpcpy (yyfmt, yyprefix);
1312 yyprefix = yyor;
1313 }
1314
1315 yyf = YY_(yyformat);
1316 yysize1 = yysize + yystrlen (yyf);
7029f892 1317 yysize_overflow |= (yysize1 < yysize);
2abdfeef
PE
1318 yysize = yysize1;
1319
1320 if (yysize_overflow)
1321 return YYSIZE_MAXIMUM;
1322
1323 if (yyresult)
1324 {
1325 /* Avoid sprintf, as that infringes on the user's name space.
1326 Don't have undefined behavior even if the translation
1327 produced a string with the wrong number of "%s"s. */
1328 char *yyp = yyresult;
1329 int yyi = 0;
7029f892 1330 while ((*yyp = *yyf) != '\0')
2abdfeef
PE
1331 {
1332 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1333 {
1334 yyp += yytnamerr (yyp, yyarg[yyi++]);
1335 yyf += 2;
1336 }
1337 else
1338 {
1339 yyp++;
1340 yyf++;
1341 }
1342 }
1343 }
1344 return yysize;
1345 }
1346}
1347#endif /* YYERROR_VERBOSE */
1921f1d7 1348\f
e9955c83 1349
04b6e11e
PE
1350/*-----------------------------------------------.
1351| Release the memory associated to this symbol. |
1352`-----------------------------------------------*/
1353
7029f892 1354/*ARGSUSED*/
2ed28444 1355#if defined (__STDC__) || defined (__C99__FUNC__) || defined (__cplusplus)
d33cb3ae 1356static void
8a8dc872 1357yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
04b6e11e 1358#else
d33cb3ae 1359static void
8a8dc872
AD
1360yydestruct (yymsg, yytype, yyvaluep, yylocationp)
1361 const char *yymsg;
04b6e11e 1362 int yytype;
886b69d1
AD
1363 YYSTYPE *yyvaluep;
1364 YYLTYPE *yylocationp;
04b6e11e
PE
1365#endif
1366{
e764d4df
PE
1367 YYUSE (yyvaluep);
1368 YYUSE (yylocationp);
04b6e11e 1369
8a8dc872
AD
1370 if (!yymsg)
1371 yymsg = "Deleting";
1372 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1373
04b6e11e
PE
1374 switch (yytype)
1375 {
886b69d1 1376
04b6e11e
PE
1377 default:
1378 break;
1379 }
1380}
04b6e11e
PE
1381\f
1382
d33cb3ae 1383/* Prevent warnings from -Wmissing-prototypes. */
e9955c83
AD
1384
1385#ifdef YYPARSE_PARAM
52d9d411 1386# if YYMODERN_C
d33cb3ae 1387int yyparse (void *YYPARSE_PARAM);
e9955c83 1388# else
d33cb3ae 1389int yyparse ();
e9955c83 1390# endif
d33cb3ae
PE
1391#else /* ! YYPARSE_PARAM */
1392#if defined (__STDC__) || defined (__cplusplus)
e9955c83 1393int yyparse (void);
d33cb3ae
PE
1394#else
1395int yyparse ();
1396#endif
05d18c24 1397#endif /* ! YYPARSE_PARAM */
e776192e 1398
e9955c83 1399
e9955c83 1400
e9955c83 1401
d33cb3ae
PE
1402
1403
1404/*----------.
1405| yyparse. |
1406`----------*/
1407
1408#ifdef YYPARSE_PARAM
52d9d411 1409# if YYMODERN_C
d33cb3ae
PE
1410int yyparse (void *YYPARSE_PARAM)
1411# else
1412int yyparse (YYPARSE_PARAM)
1413 void *YYPARSE_PARAM;
1414# endif
1415#else /* ! YYPARSE_PARAM */
2ed28444 1416#if defined (__STDC__) || defined (__C99__FUNC__) || defined (__cplusplus)
d33cb3ae
PE
1417int
1418yyparse (void)
1419#else
e9955c83 1420int
d33cb3ae 1421yyparse ()
74e543d2 1422
d33cb3ae
PE
1423#endif
1424#endif
e9955c83 1425{
85f23fae 1426 /* The look-ahead symbol. */
366eea36
AD
1427int yychar;
1428
85f23fae 1429/* The semantic value of the look-ahead symbol. */
366eea36
AD
1430YYSTYPE yylval;
1431
f0616f0b 1432/* Number of syntax errors so far. */
366eea36 1433int yynerrs;
85f23fae 1434/* Location data for the look-ahead symbol. */
366eea36 1435YYLTYPE yylloc;
e9955c83 1436
b4fb989f
PE
1437 int yystate;
1438 int yyn;
e9955c83
AD
1439 int yyresult;
1440 /* Number of tokens to shift before error messages enabled. */
1441 int yyerrstatus;
85f23fae 1442 /* Look-ahead token as an internal (translated) token number. */
886b69d1 1443 int yytoken = 0;
2abdfeef
PE
1444#if YYERROR_VERBOSE
1445 /* Buffer for error messages, and its allocated size. */
1446 char yymsgbuf[128];
1447 char *yymsg = yymsgbuf;
1448 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1449#endif
e9955c83
AD
1450
1451 /* Three stacks and their tools:
1452 `yyss': related to states,
1453 `yyvs': related to semantic values,
1454 `yyls': related to locations.
1455
1456 Refer to the stacks thru separate pointers, to allow yyoverflow
1457 to reallocate them elsewhere. */
1458
1921f1d7 1459 /* The state stack. */
584bbcd8
PE
1460 short int yyssa[YYINITDEPTH];
1461 short int *yyss = yyssa;
b4fb989f 1462 short int *yyssp;
e9955c83
AD
1463
1464 /* The semantic value stack. */
1465 YYSTYPE yyvsa[YYINITDEPTH];
1466 YYSTYPE *yyvs = yyvsa;
b4fb989f 1467 YYSTYPE *yyvsp;
e9955c83 1468
e9955c83
AD
1469 /* The location stack. */
1470 YYLTYPE yylsa[YYINITDEPTH];
1471 YYLTYPE *yyls = yylsa;
1472 YYLTYPE *yylsp;
3b0ffc7e 1473 /* The locations where the error started and ended. */
8a8dc872 1474 YYLTYPE yyerror_range[2];
e9955c83 1475
3b0ffc7e 1476#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
e9955c83
AD
1477
1478 YYSIZE_T yystacksize = YYINITDEPTH;
1479
1480 /* The variables used to return semantic value and location from the
1481 action routines. */
1482 YYSTYPE yyval;
e9955c83 1483 YYLTYPE yyloc;
e9955c83 1484
3b0ffc7e
PE
1485 /* The number of symbols on the RHS of the reduced rule.
1486 Keep to zero when no symbol should be popped. */
1487 int yylen = 0;
e9955c83 1488
74e543d2 1489 YYDPRINTF ((stderr, "Starting parse\n"));
e9955c83
AD
1490
1491 yystate = 0;
1492 yyerrstatus = 0;
1493 yynerrs = 0;
73521d9f 1494 yychar = YYEMPTY; /* Cause a token to be read. */
e9955c83
AD
1495
1496 /* Initialize stack pointers.
1497 Waste one element of value and location stack
1498 so that they stay on the same level as the state stack.
1499 The wasted elements are never initialized. */
1500
1501 yyssp = yyss;
1502 yyvsp = yyvs;
e9955c83 1503 yylsp = yyls;
8a8dc872
AD
1504#if YYLTYPE_IS_TRIVIAL
1505 /* Initialize the default location before parsing starts. */
1506 yylloc.first_line = yylloc.last_line = 1;
1507 yylloc.first_column = yylloc.last_column = 0;
1508#endif
1509
cd3684cf 1510
3b0ffc7e 1511 /* User initialization code. */
8f3596a6 1512#line 72 "../../src/parse-gram.y"
cd3684cf
AD
1513{
1514 /* Bison's grammar can initial empty locations, hence a default
1515 location is needed. */
8a8dc872
AD
1516 yylloc.start.file = yylloc.end.file = current_file;
1517 yylloc.start.line = yylloc.end.line = 1;
1518 yylloc.start.column = yylloc.end.column = 0;
cd3684cf 1519}
3b0ffc7e 1520/* Line 1087 of yacc.c. */
8f3596a6 1521#line 1522 "../../src/parse-gram.c"
5f6da1c0 1522 yylsp[0] = yylloc;
e9955c83
AD
1523 goto yysetstate;
1524
1525/*------------------------------------------------------------.
1526| yynewstate -- Push a new state, which is found in yystate. |
1527`------------------------------------------------------------*/
1528 yynewstate:
1529 /* In all cases, when you get here, the value and location stacks
3b0ffc7e 1530 have just been pushed. So pushing a state here evens the stacks. */
e9955c83
AD
1531 yyssp++;
1532
1533 yysetstate:
1534 *yyssp = yystate;
1535
d33cb3ae 1536 if (yyss + yystacksize - 1 <= yyssp)
e9955c83
AD
1537 {
1538 /* Get the current used size of the three stacks, in elements. */
1539 YYSIZE_T yysize = yyssp - yyss + 1;
1540
1541#ifdef yyoverflow
1542 {
3b0ffc7e 1543 /* Give user a chance to reallocate the stack. Use copies of
e9955c83
AD
1544 these so that the &'s don't force the real ones into
1545 memory. */
1546 YYSTYPE *yyvs1 = yyvs;
584bbcd8 1547 short int *yyss1 = yyss;
366eea36 1548 YYLTYPE *yyls1 = yyls;
e9955c83
AD
1549
1550 /* Each stack pointer address is followed by the size of the
366eea36
AD
1551 data in use in that stack, in bytes. This used to be a
1552 conditional around just the two extra args, but that might
1553 be undefined if yyoverflow is a macro. */
6088a2a0 1554 yyoverflow (YY_("memory exhausted"),
e9955c83
AD
1555 &yyss1, yysize * sizeof (*yyssp),
1556 &yyvs1, yysize * sizeof (*yyvsp),
1557 &yyls1, yysize * sizeof (*yylsp),
1558 &yystacksize);
1559 yyls = yyls1;
e9955c83
AD
1560 yyss = yyss1;
1561 yyvs = yyvs1;
1562 }
1563#else /* no yyoverflow */
1564# ifndef YYSTACK_RELOCATE
6088a2a0 1565 goto yyexhaustedlab;
e9955c83
AD
1566# else
1567 /* Extend the stack our own way. */
d33cb3ae 1568 if (YYMAXDEPTH <= yystacksize)
6088a2a0 1569 goto yyexhaustedlab;
e9955c83 1570 yystacksize *= 2;
d33cb3ae 1571 if (YYMAXDEPTH < yystacksize)
e9955c83
AD
1572 yystacksize = YYMAXDEPTH;
1573
1574 {
584bbcd8 1575 short int *yyss1 = yyss;
e9955c83
AD
1576 union yyalloc *yyptr =
1577 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1578 if (! yyptr)
6088a2a0 1579 goto yyexhaustedlab;
e9955c83
AD
1580 YYSTACK_RELOCATE (yyss);
1581 YYSTACK_RELOCATE (yyvs);
e9955c83 1582 YYSTACK_RELOCATE (yyls);
1921f1d7 1583# undef YYSTACK_RELOCATE
e9955c83
AD
1584 if (yyss1 != yyssa)
1585 YYSTACK_FREE (yyss1);
1586 }
1587# endif
1588#endif /* no yyoverflow */
1589
1590 yyssp = yyss + yysize - 1;
1591 yyvsp = yyvs + yysize - 1;
e9955c83 1592 yylsp = yyls + yysize - 1;
e9955c83 1593
6088a2a0 1594 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
e9955c83
AD
1595 (unsigned long int) yystacksize));
1596
d33cb3ae 1597 if (yyss + yystacksize - 1 <= yyssp)
e9955c83
AD
1598 YYABORT;
1599 }
1600
6088a2a0 1601 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
e9955c83
AD
1602
1603 goto yybackup;
1604
1605/*-----------.
1606| yybackup. |
1607`-----------*/
1608yybackup:
1609
3b0ffc7e
PE
1610 /* Do appropriate processing given the current state. Read a
1611 look-ahead token if we need one and don't already have one. */
e9955c83 1612
85f23fae 1613 /* First try to decide what to do without reference to look-ahead token. */
e9955c83 1614 yyn = yypact[yystate];
04b6e11e 1615 if (yyn == YYPACT_NINF)
e9955c83
AD
1616 goto yydefault;
1617
85f23fae 1618 /* Not known => get a look-ahead token if don't already have one. */
e9955c83 1619
85f23fae 1620 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
73521d9f 1621 if (yychar == YYEMPTY)
e9955c83 1622 {
74e543d2 1623 YYDPRINTF ((stderr, "Reading a token: "));
e9955c83
AD
1624 yychar = YYLEX;
1625 }
1626
73521d9f 1627 if (yychar <= YYEOF)
e9955c83 1628 {
73521d9f 1629 yychar = yytoken = YYEOF;
74e543d2 1630 YYDPRINTF ((stderr, "Now at end of input.\n"));
e9955c83
AD
1631 }
1632 else
1633 {
73521d9f 1634 yytoken = YYTRANSLATE (yychar);
6088a2a0 1635 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
e9955c83
AD
1636 }
1637
886b69d1 1638 /* If the proper action on seeing token YYTOKEN is to reduce or to
ae7453f2 1639 detect an error, take that action. */
886b69d1
AD
1640 yyn += yytoken;
1641 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
e9955c83 1642 goto yydefault;
e9955c83 1643 yyn = yytable[yyn];
ae7453f2 1644 if (yyn <= 0)
e9955c83 1645 {
ae7453f2 1646 if (yyn == 0 || yyn == YYTABLE_NINF)
e9955c83
AD
1647 goto yyerrlab;
1648 yyn = -yyn;
1649 goto yyreduce;
1650 }
e9955c83
AD
1651
1652 if (yyn == YYFINAL)
1653 YYACCEPT;
1654
3b0ffc7e
PE
1655 /* Count tokens shifted since error; after three, turn off error
1656 status. */
1657 if (yyerrstatus)
1658 yyerrstatus--;
1659
85f23fae 1660 /* Shift the look-ahead token. */
6088a2a0 1661 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
e9955c83 1662
3b0ffc7e 1663 /* Discard the shifted token unless it is eof. */
73521d9f
PE
1664 if (yychar != YYEOF)
1665 yychar = YYEMPTY;
e9955c83 1666
3b0ffc7e 1667 yystate = yyn;
e9955c83 1668 *++yyvsp = yylval;
e9955c83 1669 *++yylsp = yylloc;
e9955c83
AD
1670 goto yynewstate;
1671
1672
1673/*-----------------------------------------------------------.
1674| yydefault -- do the default action for the current state. |
1675`-----------------------------------------------------------*/
1676yydefault:
1677 yyn = yydefact[yystate];
1678 if (yyn == 0)
1679 goto yyerrlab;
1680 goto yyreduce;
1681
1682
1683/*-----------------------------.
1684| yyreduce -- Do a reduction. |
1685`-----------------------------*/
1686yyreduce:
1687 /* yyn is the number of a rule to reduce with. */
1688 yylen = yyr2[yyn];
1689
1690 /* If YYLEN is nonzero, implement the default value of the action:
1691 `$$ = $1'.
1692
04b6e11e
PE
1693 Otherwise, the following line sets YYVAL to garbage.
1694 This behavior is undocumented and Bison
e9955c83
AD
1695 users should not rely upon it. Assigning to YYVAL
1696 unconditionally makes the parser a bit smaller, and it avoids a
1697 GCC warning that YYVAL may be used uninitialized. */
1698 yyval = yyvsp[1-yylen];
1699
3b0ffc7e 1700 /* Default location. */
cd3684cf 1701 YYLLOC_DEFAULT (yyloc, yylsp - yylen, yylen);
05d18c24 1702 YY_REDUCE_PRINT (yyn);
1921f1d7
AD
1703 switch (yyn)
1704 {
05d18c24 1705 case 6:
8f3596a6 1706#line 207 "../../src/parse-gram.y"
66809587 1707 { prologue_augment ((yyvsp[(1) - (1)].chars), (yylsp[(1) - (1)])); }
1921f1d7
AD
1708 break;
1709
8efe435c 1710 case 7:
8f3596a6 1711#line 208 "../../src/parse-gram.y"
83a457be 1712 { debug_flag = true; }
1921f1d7
AD
1713 break;
1714
8efe435c 1715 case 8:
8f3596a6 1716#line 209 "../../src/parse-gram.y"
66809587 1717 { muscle_insert ((yyvsp[(2) - (2)].chars), "1"); }
1921f1d7
AD
1718 break;
1719
8efe435c 1720 case 9:
8f3596a6 1721#line 210 "../../src/parse-gram.y"
66809587 1722 { muscle_insert ((yyvsp[(2) - (3)].chars), (yyvsp[(3) - (3)].chars)); }
e9955c83 1723 break;
1921f1d7 1724
8efe435c 1725 case 10:
8f3596a6 1726#line 211 "../../src/parse-gram.y"
fb9712a9 1727 { defines_flag = true; }
e9955c83 1728 break;
1921f1d7 1729
8efe435c 1730 case 11:
8f3596a6 1731#line 212 "../../src/parse-gram.y"
fb9712a9 1732 { error_verbose = true; }
e9955c83 1733 break;
1921f1d7 1734
8efe435c 1735 case 12:
8f3596a6 1736#line 213 "../../src/parse-gram.y"
66809587 1737 { expected_sr_conflicts = (yyvsp[(2) - (2)].integer); }
e9955c83 1738 break;
1921f1d7 1739
8efe435c 1740 case 13:
8f3596a6 1741#line 214 "../../src/parse-gram.y"
66809587 1742 { expected_rr_conflicts = (yyvsp[(2) - (2)].integer); }
d6328241
PH
1743 break;
1744
1745 case 14:
8f3596a6 1746#line 215 "../../src/parse-gram.y"
66809587 1747 { spec_file_prefix = (yyvsp[(3) - (3)].chars); }
fb9712a9
AD
1748 break;
1749
1750 case 15:
8f3596a6 1751#line 217 "../../src/parse-gram.y"
cd3684cf
AD
1752 {
1753 nondeterministic_parser = true;
1754 glr_parser = true;
1755 }
e9955c83 1756 break;
1921f1d7 1757
fb9712a9 1758 case 16:
8f3596a6 1759#line 222 "../../src/parse-gram.y"
cd3684cf 1760 {
66809587 1761 muscle_code_grow ("initial_action", (yyvsp[(1) - (1)].chars), (yylsp[(1) - (1)]));
cd3684cf 1762 }
e9955c83 1763 break;
1921f1d7 1764
fb9712a9 1765 case 17:
8f3596a6 1766#line 225 "../../src/parse-gram.y"
66809587 1767 { add_param ("lex_param", (yyvsp[(1) - (1)].chars), (yylsp[(1) - (1)])); }
e9955c83 1768 break;
1921f1d7 1769
fb9712a9 1770 case 18:
8f3596a6 1771#line 226 "../../src/parse-gram.y"
cd3684cf 1772 { locations_flag = true; }
e9955c83 1773 break;
1921f1d7 1774
fb9712a9 1775 case 19:
8f3596a6 1776#line 227 "../../src/parse-gram.y"
66809587 1777 { spec_name_prefix = (yyvsp[(3) - (3)].chars); }
e9955c83 1778 break;
1921f1d7 1779
fb9712a9 1780 case 20:
8f3596a6 1781#line 228 "../../src/parse-gram.y"
cd3684cf 1782 { no_lines_flag = true; }
4cdb01db 1783 break;
1921f1d7 1784
fb9712a9 1785 case 21:
8f3596a6 1786#line 229 "../../src/parse-gram.y"
cd3684cf 1787 { nondeterministic_parser = true; }
4cdb01db 1788 break;
1921f1d7 1789
fb9712a9 1790 case 22:
8f3596a6 1791#line 230 "../../src/parse-gram.y"
66809587 1792 { spec_outfile = (yyvsp[(3) - (3)].chars); }
4cdb01db 1793 break;
1921f1d7 1794
fb9712a9 1795 case 23:
8f3596a6 1796#line 231 "../../src/parse-gram.y"
66809587 1797 { add_param ("parse_param", (yyvsp[(1) - (1)].chars), (yylsp[(1) - (1)])); }
676385e2
PH
1798 break;
1799
fb9712a9 1800 case 24:
8f3596a6 1801#line 232 "../../src/parse-gram.y"
cd3684cf 1802 { pure_parser = true; }
ae7453f2
AD
1803 break;
1804
fb9712a9 1805 case 25:
8f3596a6 1806#line 233 "../../src/parse-gram.y"
66809587 1807 { version_check (&(yylsp[(2) - (2)]), (yyvsp[(2) - (2)].chars)); }
ae7453f2
AD
1808 break;
1809
fb9712a9 1810 case 26:
8f3596a6 1811#line 234 "../../src/parse-gram.y"
66809587 1812 { skeleton = (yyvsp[(2) - (2)].chars); }
916708d5
AD
1813 break;
1814
fb9712a9 1815 case 27:
8f3596a6 1816#line 235 "../../src/parse-gram.y"
b50d2359 1817 { token_table_flag = true; }
cd3684cf
AD
1818 break;
1819
fb9712a9 1820 case 28:
8f3596a6 1821#line 236 "../../src/parse-gram.y"
b50d2359
AD
1822 { report_flag = report_states; }
1823 break;
1824
1825 case 29:
8f3596a6 1826#line 237 "../../src/parse-gram.y"
83a457be 1827 { yacc_flag = true; }
4cdb01db 1828 break;
1921f1d7 1829
b50d2359 1830 case 33:
8f3596a6 1831#line 245 "../../src/parse-gram.y"
1921f1d7 1832 {
66809587 1833 grammar_start_symbol_set ((yyvsp[(2) - (2)].symbol), (yylsp[(2) - (2)]));
4cdb01db 1834 }
e9955c83 1835 break;
1921f1d7 1836
b50d2359 1837 case 34:
8f3596a6 1838#line 249 "../../src/parse-gram.y"
1921f1d7 1839 {
83a457be 1840 typed = true;
66809587
PE
1841 MUSCLE_INSERT_INT ("stype_line", (yylsp[(1) - (1)]).start.line);
1842 muscle_insert ("stype", (yyvsp[(1) - (1)].chars));
4cdb01db 1843 }
e9955c83 1844 break;
1921f1d7 1845
b50d2359 1846 case 35:
8f3596a6 1847#line 255 "../../src/parse-gram.y"
1921f1d7 1848 {
05d18c24 1849 symbol_list *list;
66809587
PE
1850 for (list = (yyvsp[(2) - (2)].list); list; list = list->next)
1851 symbol_destructor_set (list->sym, (yyvsp[(1) - (2)].chars), (yylsp[(1) - (2)]));
1852 symbol_list_free ((yyvsp[(2) - (2)].list));
4cdb01db 1853 }
e9955c83 1854 break;
1921f1d7 1855
b50d2359 1856 case 36:
8f3596a6 1857#line 262 "../../src/parse-gram.y"
1921f1d7 1858 {
05d18c24 1859 symbol_list *list;
66809587
PE
1860 for (list = (yyvsp[(2) - (2)].list); list; list = list->next)
1861 symbol_printer_set (list->sym, (yyvsp[(1) - (2)].chars), list->location);
1862 symbol_list_free ((yyvsp[(2) - (2)].list));
4cdb01db 1863 }
e9955c83 1864 break;
1921f1d7 1865
b50d2359 1866 case 37:
8f3596a6 1867#line 269 "../../src/parse-gram.y"
92f5e991 1868 {
66ef8b9d 1869 default_prec = true;
92f5e991 1870 }
9280d3ef
AD
1871 break;
1872
b50d2359 1873 case 38:
8f3596a6 1874#line 273 "../../src/parse-gram.y"
66ef8b9d
PE
1875 {
1876 default_prec = false;
1877 }
92f5e991
AD
1878 break;
1879
b50d2359 1880 case 39:
8f3596a6 1881#line 279 "../../src/parse-gram.y"
66ef8b9d
PE
1882 { current_class = nterm_sym; }
1883 break;
1884
b50d2359 1885 case 40:
8f3596a6 1886#line 280 "../../src/parse-gram.y"
9280d3ef
AD
1887 {
1888 current_class = unknown_sym;
1889 current_type = NULL;
1890 }
1891 break;
1892
b50d2359 1893 case 41:
8f3596a6 1894#line 284 "../../src/parse-gram.y"
366eea36
AD
1895 { current_class = token_sym; }
1896 break;
1897
b50d2359 1898 case 42:
8f3596a6 1899#line 285 "../../src/parse-gram.y"
366eea36
AD
1900 {
1901 current_class = unknown_sym;
1902 current_type = NULL;
1903 }
1904 break;
1905
b50d2359 1906 case 43:
8f3596a6 1907#line 290 "../../src/parse-gram.y"
1e0bab92 1908 {
05d18c24 1909 symbol_list *list;
66809587
PE
1910 for (list = (yyvsp[(3) - (3)].list); list; list = list->next)
1911 symbol_type_set (list->sym, (yyvsp[(2) - (3)].uniqstr), (yylsp[(2) - (3)]));
1912 symbol_list_free ((yyvsp[(3) - (3)].list));
1e0bab92 1913 }
e9955c83 1914 break;
1921f1d7 1915
b50d2359 1916 case 44:
8f3596a6 1917#line 300 "../../src/parse-gram.y"
1921f1d7 1918 {
05d18c24 1919 symbol_list *list;
1e0bab92 1920 ++current_prec;
66809587 1921 for (list = (yyvsp[(3) - (3)].list); list; list = list->next)
1e0bab92 1922 {
66809587
PE
1923 symbol_type_set (list->sym, current_type, (yylsp[(2) - (3)]));
1924 symbol_precedence_set (list->sym, current_prec, (yyvsp[(1) - (3)].assoc), (yylsp[(1) - (3)]));
1e0bab92 1925 }
66809587 1926 symbol_list_free ((yyvsp[(3) - (3)].list));
2c569025
AD
1927 current_type = NULL;
1928 }
e9955c83 1929 break;
1921f1d7 1930
b50d2359 1931 case 45:
8f3596a6 1932#line 314 "../../src/parse-gram.y"
76dcf299 1933 { (yyval.assoc) = left_assoc; }
e9955c83 1934 break;
1921f1d7 1935
b50d2359 1936 case 46:
8f3596a6 1937#line 315 "../../src/parse-gram.y"
76dcf299 1938 { (yyval.assoc) = right_assoc; }
e9955c83 1939 break;
1921f1d7 1940
b50d2359 1941 case 47:
8f3596a6 1942#line 316 "../../src/parse-gram.y"
76dcf299 1943 { (yyval.assoc) = non_assoc; }
4cdb01db 1944 break;
1921f1d7 1945
b50d2359 1946 case 48:
8f3596a6 1947#line 320 "../../src/parse-gram.y"
62ddaef6 1948 { current_type = NULL; }
e9955c83 1949 break;
1921f1d7 1950
b50d2359 1951 case 49:
8f3596a6 1952#line 321 "../../src/parse-gram.y"
66809587 1953 { current_type = (yyvsp[(1) - (1)].uniqstr); }
e9955c83 1954 break;
1921f1d7 1955
b50d2359 1956 case 50:
8f3596a6 1957#line 327 "../../src/parse-gram.y"
66809587 1958 { (yyval.list) = symbol_list_new ((yyvsp[(1) - (1)].symbol), (yylsp[(1) - (1)])); }
4cdb01db 1959 break;
1921f1d7 1960
b50d2359 1961 case 51:
8f3596a6 1962#line 328 "../../src/parse-gram.y"
66809587 1963 { (yyval.list) = symbol_list_prepend ((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].symbol), (yylsp[(2) - (2)])); }
4cdb01db 1964 break;
1921f1d7 1965
b50d2359 1966 case 52:
8f3596a6 1967#line 334 "../../src/parse-gram.y"
1921f1d7 1968 {
66809587 1969 current_type = (yyvsp[(1) - (1)].uniqstr);
4cdb01db 1970 }
e9955c83 1971 break;
1921f1d7 1972
b50d2359 1973 case 53:
8f3596a6 1974#line 338 "../../src/parse-gram.y"
1921f1d7 1975 {
66809587
PE
1976 symbol_class_set ((yyvsp[(1) - (1)].symbol), current_class, (yylsp[(1) - (1)]));
1977 symbol_type_set ((yyvsp[(1) - (1)].symbol), current_type, (yylsp[(1) - (1)]));
4cdb01db 1978 }
e9955c83 1979 break;
1921f1d7 1980
b50d2359 1981 case 54:
8f3596a6 1982#line 343 "../../src/parse-gram.y"
1921f1d7 1983 {
66809587
PE
1984 symbol_class_set ((yyvsp[(1) - (2)].symbol), current_class, (yylsp[(1) - (2)]));
1985 symbol_type_set ((yyvsp[(1) - (2)].symbol), current_type, (yylsp[(1) - (2)]));
1986 symbol_user_token_number_set ((yyvsp[(1) - (2)].symbol), (yyvsp[(2) - (2)].integer), (yylsp[(2) - (2)]));
4cdb01db 1987 }
e9955c83 1988 break;
1921f1d7 1989
b50d2359 1990 case 55:
8f3596a6 1991#line 349 "../../src/parse-gram.y"
1921f1d7 1992 {
66809587
PE
1993 symbol_class_set ((yyvsp[(1) - (2)].symbol), current_class, (yylsp[(1) - (2)]));
1994 symbol_type_set ((yyvsp[(1) - (2)].symbol), current_type, (yylsp[(1) - (2)]));
1995 symbol_make_alias ((yyvsp[(1) - (2)].symbol), (yyvsp[(2) - (2)].symbol), (yyloc));
4cdb01db 1996 }
e9955c83 1997 break;
1921f1d7 1998
b50d2359 1999 case 56:
8f3596a6 2000#line 355 "../../src/parse-gram.y"
1921f1d7 2001 {
66809587
PE
2002 symbol_class_set ((yyvsp[(1) - (3)].symbol), current_class, (yylsp[(1) - (3)]));
2003 symbol_type_set ((yyvsp[(1) - (3)].symbol), current_type, (yylsp[(1) - (3)]));
2004 symbol_user_token_number_set ((yyvsp[(1) - (3)].symbol), (yyvsp[(2) - (3)].integer), (yylsp[(2) - (3)]));
2005 symbol_make_alias ((yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol), (yyloc));
4cdb01db 2006 }
e9955c83 2007 break;
1921f1d7 2008
b50d2359 2009 case 62:
8f3596a6 2010#line 384 "../../src/parse-gram.y"
b275314e
AD
2011 {
2012 if (yacc_flag)
76dcf299 2013 complain_at ((yyloc), _("POSIX forbids declarations in the grammar"));
b275314e
AD
2014 }
2015 break;
2016
b50d2359 2017 case 63:
8f3596a6 2018#line 389 "../../src/parse-gram.y"
b275314e
AD
2019 {
2020 yyerrok;
2021 }
e9955c83 2022 break;
1921f1d7 2023
b50d2359 2024 case 64:
8f3596a6 2025#line 395 "../../src/parse-gram.y"
66809587 2026 { current_lhs = (yyvsp[(1) - (1)].symbol); current_lhs_location = (yylsp[(1) - (1)]); }
e9955c83 2027 break;
1921f1d7 2028
fb9712a9 2029 case 66:
8f3596a6
AD
2030#line 399 "../../src/parse-gram.y"
2031 { grammar_current_rule_end ((yylsp[(1) - (1)])); }
4cdb01db 2032 break;
1921f1d7 2033
b50d2359 2034 case 67:
8f3596a6
AD
2035#line 400 "../../src/parse-gram.y"
2036 { grammar_current_rule_end ((yylsp[(3) - (3)])); }
e9955c83 2037 break;
1921f1d7 2038
fb9712a9 2039 case 69:
8f3596a6
AD
2040#line 406 "../../src/parse-gram.y"
2041 { grammar_current_rule_begin (current_lhs, current_lhs_location); }
4cdb01db 2042 break;
1921f1d7 2043
fb9712a9 2044 case 70:
8f3596a6 2045#line 408 "../../src/parse-gram.y"
66809587 2046 { grammar_current_rule_symbol_append ((yyvsp[(2) - (2)].symbol), (yylsp[(2) - (2)])); }
0c15323d 2047 break;
1921f1d7 2048
fb9712a9 2049 case 71:
8f3596a6 2050#line 410 "../../src/parse-gram.y"
66809587 2051 { grammar_current_rule_action_append ((yyvsp[(2) - (2)].chars), (yylsp[(2) - (2)])); }
2c569025 2052 break;
1921f1d7 2053
fb9712a9 2054 case 72:
8f3596a6 2055#line 412 "../../src/parse-gram.y"
66809587 2056 { grammar_current_rule_prec_set ((yyvsp[(3) - (3)].symbol), (yylsp[(3) - (3)])); }
676385e2
PH
2057 break;
2058
fb9712a9 2059 case 73:
8f3596a6 2060#line 414 "../../src/parse-gram.y"
66809587 2061 { grammar_current_rule_dprec_set ((yyvsp[(3) - (3)].integer), (yylsp[(3) - (3)])); }
676385e2
PH
2062 break;
2063
fb9712a9 2064 case 74:
8f3596a6 2065#line 416 "../../src/parse-gram.y"
66809587 2066 { grammar_current_rule_merge_set ((yyvsp[(3) - (3)].uniqstr), (yylsp[(3) - (3)])); }
b275314e
AD
2067 break;
2068
fb9712a9 2069 case 75:
8f3596a6 2070#line 420 "../../src/parse-gram.y"
66809587 2071 { (yyval.symbol) = (yyvsp[(1) - (1)].symbol); }
916708d5
AD
2072 break;
2073
fb9712a9 2074 case 76:
8f3596a6 2075#line 421 "../../src/parse-gram.y"
66809587 2076 { (yyval.symbol) = (yyvsp[(1) - (1)].symbol); }
66ef8b9d
PE
2077 break;
2078
fb9712a9 2079 case 77:
8f3596a6 2080#line 426 "../../src/parse-gram.y"
66809587 2081 { (yyval.chars) = (yyvsp[(1) - (1)].chars); }
b50d2359
AD
2082 break;
2083
2084 case 78:
8f3596a6 2085#line 432 "../../src/parse-gram.y"
1921f1d7 2086 {
66809587
PE
2087 (yyval.symbol) = symbol_get (quotearg_style (c_quoting_style, (yyvsp[(1) - (1)].chars)), (yylsp[(1) - (1)]));
2088 symbol_class_set ((yyval.symbol), token_sym, (yylsp[(1) - (1)]));
4cdb01db 2089 }
e9955c83 2090 break;
1921f1d7 2091
b50d2359 2092 case 79:
8f3596a6 2093#line 441 "../../src/parse-gram.y"
66809587 2094 { (yyval.chars) = (yyvsp[(1) - (1)].chars); }
e9955c83 2095 break;
1921f1d7 2096
b50d2359 2097 case 81:
8f3596a6 2098#line 448 "../../src/parse-gram.y"
1921f1d7 2099 {
66809587 2100 muscle_code_grow ("epilogue", (yyvsp[(2) - (2)].chars), (yylsp[(2) - (2)]));
7ec2d4cd 2101 scanner_last_string_free ();
4cdb01db 2102 }
e9955c83
AD
2103 break;
2104
2105
3b0ffc7e 2106/* Line 1276 of yacc.c. */
8f3596a6 2107#line 2108 "../../src/parse-gram.c"
e1054895 2108 default: break;
1921f1d7 2109 }
66809587 2110 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1921f1d7 2111
3b0ffc7e
PE
2112 YYPOPSTACK (yylen);
2113 yylen = 0;
05d18c24 2114 YY_STACK_PRINT (yyss, yyssp);
e9955c83
AD
2115
2116 *++yyvsp = yyval;
e9955c83 2117 *++yylsp = yyloc;
e9955c83
AD
2118
2119 /* Now `shift' the result of the reduction. Determine what state
2120 that goes to, based on the state we popped back to and the rule
2121 number reduced by. */
2122
2123 yyn = yyr1[yyn];
2124
1921f1d7 2125 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
04b6e11e 2126 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
e9955c83
AD
2127 yystate = yytable[yystate];
2128 else
1921f1d7 2129 yystate = yydefgoto[yyn - YYNTOKENS];
e9955c83
AD
2130
2131 goto yynewstate;
2132
2133
2134/*------------------------------------.
2135| yyerrlab -- here on detecting error |
2136`------------------------------------*/
2137yyerrlab:
2138 /* If not already recovering from an error, report this error. */
2139 if (!yyerrstatus)
2140 {
2141 ++yynerrs;
2abdfeef
PE
2142#if ! YYERROR_VERBOSE
2143 yyerror (YY_("syntax error"));
2144#else
2145 {
2146 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2147 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2148 {
2149 YYSIZE_T yyalloc = 2 * yysize;
2150 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2151 yyalloc = YYSTACK_ALLOC_MAXIMUM;
2152 if (yymsg != yymsgbuf)
2153 YYSTACK_FREE (yymsg);
2154 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2155 if (yymsg)
2156 yymsg_alloc = yyalloc;
2157 else
6d5aa694 2158 {
2abdfeef
PE
2159 yymsg = yymsgbuf;
2160 yymsg_alloc = sizeof yymsgbuf;
6d5aa694 2161 }
2abdfeef 2162 }
ae7453f2 2163
2abdfeef
PE
2164 if (0 < yysize && yysize <= yymsg_alloc)
2165 {
2166 (void) yysyntax_error (yymsg, yystate, yychar);
2167 yyerror (yymsg);
2168 }
2169 else
2170 {
2171 yyerror (YY_("syntax error"));
2172 if (yysize != 0)
6088a2a0 2173 goto yyexhaustedlab;
2abdfeef
PE
2174 }
2175 }
2176#endif
e9955c83 2177 }
e9955c83 2178
8a8dc872 2179 yyerror_range[0] = yylloc;
78a00b7d 2180
e9955c83
AD
2181 if (yyerrstatus == 3)
2182 {
85f23fae 2183 /* If just tried and failed to reuse look-ahead token after an
e9955c83
AD
2184 error, discard it. */
2185
465b4444 2186 if (yychar <= YYEOF)
366eea36 2187 {
d11e0cfa 2188 /* Return failure if at end of input. */
465b4444 2189 if (yychar == YYEOF)
7768896a 2190 YYABORT;
366eea36 2191 }
465b4444
PE
2192 else
2193 {
4b367315
AD
2194 yydestruct ("Error: discarding",
2195 yytoken, &yylval, &yylloc);
465b4444 2196 yychar = YYEMPTY;
465b4444 2197 }
e9955c83
AD
2198 }
2199
85f23fae 2200 /* Else will try to reuse look-ahead token after shifting the error
e9955c83 2201 token. */
6d5aa694 2202 goto yyerrlab1;
e9955c83 2203
05d18c24 2204
465b4444
PE
2205/*---------------------------------------------------.
2206| yyerrorlab -- error raised explicitly by YYERROR. |
2207`---------------------------------------------------*/
2208yyerrorlab:
2209
e1054895
PE
2210 /* Pacify compilers like GCC when the user code never invokes
2211 YYERROR and the label yyerrorlab therefore never appears in user
2212 code. */
e764d4df 2213 if (/*CONSTCOND*/ 0)
465b4444 2214 goto yyerrorlab;
465b4444 2215
8a8dc872 2216 yyerror_range[0] = yylsp[1-yylen];
3b0ffc7e
PE
2217 /* Do not reclaim the symbols of the rule which action triggered
2218 this YYERROR. */
2219 YYPOPSTACK (yylen);
2220 yylen = 0;
2221 YY_STACK_PRINT (yyss, yyssp);
465b4444 2222 yystate = *yyssp;
465b4444
PE
2223 goto yyerrlab1;
2224
2225
2226/*-------------------------------------------------------------.
2227| yyerrlab1 -- common code for both syntax error and YYERROR. |
2228`-------------------------------------------------------------*/
05d18c24 2229yyerrlab1:
1921f1d7 2230 yyerrstatus = 3; /* Each real token shifted decrements this. */
e9955c83 2231
1921f1d7
AD
2232 for (;;)
2233 {
2234 yyn = yypact[yystate];
04b6e11e 2235 if (yyn != YYPACT_NINF)
1921f1d7
AD
2236 {
2237 yyn += YYTERROR;
2238 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2239 {
2240 yyn = yytable[yyn];
2241 if (0 < yyn)
2242 break;
2243 }
2244 }
4cdb01db 2245
1921f1d7
AD
2246 /* Pop the current state because it cannot handle the error token. */
2247 if (yyssp == yyss)
2248 YYABORT;
0c15323d 2249
8a8dc872 2250 yyerror_range[0] = *yylsp;
4b367315
AD
2251 yydestruct ("Error: popping",
2252 yystos[yystate], yyvsp, yylsp);
3b0ffc7e 2253 YYPOPSTACK (1);
465b4444 2254 yystate = *yyssp;
05d18c24 2255 YY_STACK_PRINT (yyss, yyssp);
e9955c83
AD
2256 }
2257
2258 if (yyn == YYFINAL)
2259 YYACCEPT;
2260
e9955c83 2261 *++yyvsp = yylval;
8a8dc872
AD
2262
2263 yyerror_range[1] = yylloc;
2264 /* Using YYLLOC is tempting, but would change the location of
3b0ffc7e 2265 the look-ahead. YYLOC is available though. */
8a8dc872 2266 YYLLOC_DEFAULT (yyloc, yyerror_range - 1, 2);
78a00b7d 2267 *++yylsp = yyloc;
e9955c83 2268
3b0ffc7e 2269 /* Shift the error token. */
6088a2a0 2270 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
8a8dc872 2271
e9955c83
AD
2272 yystate = yyn;
2273 goto yynewstate;
2274
2275
2276/*-------------------------------------.
2277| yyacceptlab -- YYACCEPT comes here. |
2278`-------------------------------------*/
2279yyacceptlab:
2280 yyresult = 0;
2281 goto yyreturn;
2282
2283/*-----------------------------------.
2284| yyabortlab -- YYABORT comes here. |
2285`-----------------------------------*/
2286yyabortlab:
2287 yyresult = 1;
2288 goto yyreturn;
2289
366eea36 2290#ifndef yyoverflow
6088a2a0
PE
2291/*-------------------------------------------------.
2292| yyexhaustedlab -- memory exhaustion comes here. |
2293`-------------------------------------------------*/
2294yyexhaustedlab:
2295 yyerror (YY_("memory exhausted"));
e9955c83
AD
2296 yyresult = 2;
2297 /* Fall through. */
366eea36 2298#endif
e9955c83
AD
2299
2300yyreturn:
bd134904 2301 if (yychar != YYEOF && yychar != YYEMPTY)
ec5d1a8a 2302 yydestruct ("Cleanup: discarding lookahead",
bd134904 2303 yytoken, &yylval, &yylloc);
3b0ffc7e
PE
2304 /* Do not reclaim the symbols of the rule which action triggered
2305 this YYABORT or YYACCEPT. */
2306 YYPOPSTACK (yylen);
2307 YY_STACK_PRINT (yyss, yyssp);
d11e0cfa
PE
2308 while (yyssp != yyss)
2309 {
ec5d1a8a 2310 yydestruct ("Cleanup: popping",
d11e0cfa 2311 yystos[*yyssp], yyvsp, yylsp);
3b0ffc7e 2312 YYPOPSTACK (1);
d11e0cfa 2313 }
e9955c83
AD
2314#ifndef yyoverflow
2315 if (yyss != yyssa)
2316 YYSTACK_FREE (yyss);
2abdfeef
PE
2317#endif
2318#if YYERROR_VERBOSE
2319 if (yymsg != yymsgbuf)
2320 YYSTACK_FREE (yymsg);
e9955c83
AD
2321#endif
2322 return yyresult;
2323}
1921f1d7 2324
366eea36 2325
8f3596a6 2326#line 454 "../../src/parse-gram.y"
05d18c24
PE
2327
2328
2329
2330/* Return the location of the left-hand side of a rule whose
2331 right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in
2332 the right-hand side, and return an empty location equal to the end
2333 boundary of RHS[0] if the right-hand side is empty. */
2334
2335static YYLTYPE
2336lloc_default (YYLTYPE const *rhs, int n)
2337{
2338 int i;
1d64f0ba 2339 YYLTYPE loc;
329d23c5
PE
2340
2341 /* SGI MIPSpro 7.4.1m miscompiles "loc.start = loc.end = rhs[n].end;".
2342 The bug is fixed in 7.4.2m, but play it safe for now. */
2343 loc.start = rhs[n].end;
2344 loc.end = rhs[n].end;
05d18c24 2345
73521d9f
PE
2346 /* Ignore empty nonterminals the start of the the right-hand side.
2347 Do not bother to ignore them at the end of the right-hand side,
2348 since empty nonterminals have the same end as their predecessors. */
05d18c24
PE
2349 for (i = 1; i <= n; i++)
2350 if (! equal_boundaries (rhs[i].start, rhs[i].end))
2351 {
1d64f0ba 2352 loc.start = rhs[i].start;
05d18c24
PE
2353 break;
2354 }
2355
1d64f0ba 2356 return loc;
05d18c24
PE
2357}
2358
2359
2360/* Add a lex-param or a parse-param (depending on TYPE) with
2361 declaration DECL and location LOC. */
2362
2363static void
73521d9f 2364add_param (char const *type, char *decl, location loc)
05d18c24 2365{
8a8dc872 2366 static char const alphanum[26 + 26 + 1 + 10] =
05d18c24
PE
2367 "abcdefghijklmnopqrstuvwxyz"
2368 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
8a8dc872
AD
2369 "_"
2370 "0123456789";
05d18c24 2371 char const *name_start = NULL;
73521d9f 2372 char *p;
05d18c24 2373
2ed24dd8 2374 /* Stop on last actual character. */
e503aa60 2375 for (p = decl; p[1]; p++)
8a8dc872
AD
2376 if ((p == decl
2377 || ! memchr (alphanum, p[-1], sizeof alphanum))
2378 && memchr (alphanum, p[0], sizeof alphanum - 10))
05d18c24 2379 name_start = p;
2ed24dd8 2380
8a8dc872
AD
2381 /* Strip the surrounding '{' and '}', and any blanks just inside
2382 the braces. */
2383 while (*--p == ' ' || *p == '\t')
2384 continue;
e503aa60 2385 p[1] = '\0';
8a8dc872
AD
2386 while (*++decl == ' ' || *decl == '\t')
2387 continue;
73521d9f 2388
05d18c24
PE
2389 if (! name_start)
2390 complain_at (loc, _("missing identifier in parameter declaration"));
2391 else
2392 {
2393 char *name;
2394 size_t name_len;
2395
2396 for (name_len = 1;
8a8dc872 2397 memchr (alphanum, name_start[name_len], sizeof alphanum);
05d18c24
PE
2398 name_len++)
2399 continue;
2400
2401 name = xmalloc (name_len + 1);
2402 memcpy (name, name_start, name_len);
2403 name[name_len] = '\0';
2404 muscle_pair_list_grow (type, decl, name);
2405 free (name);
2406 }
2407
2408 scanner_last_string_free ();
2409}
e9955c83 2410
b50d2359
AD
2411static void
2412version_check (location const *loc, char const *version)
2413{
2414 if (strverscmp (version, PACKAGE_VERSION) > 0)
9b8a5ce0
AD
2415 {
2416 complain_at (*loc, "require bison %s, but have %s",
2417 version, PACKAGE_VERSION);
2418 exit (63);
2419 }
b50d2359
AD
2420}
2421
05d18c24
PE
2422static void
2423gram_error (location const *loc, char const *msg)
e9955c83 2424{
05d18c24 2425 complain_at (*loc, "%s", msg);
e9955c83 2426}
1921f1d7 2427
73521d9f
PE
2428char const *
2429token_name (int type)
2430{
e0045d49 2431 return yytname[YYTRANSLATE (type)];
73521d9f
PE
2432}
2433