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