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