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