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