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