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