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