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