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