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