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