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