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