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