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