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