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