1 /* A Bison parser, made by GNU Bison 2.3. */
2
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
22
23 /* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work
25 under terms of your choice, so long as that work isn't itself a
26 parser generator using the skeleton or a modified version thereof
27 as a parser skeleton. Alternatively, if you modify or redistribute
28 the parser skeleton itself, you may (at your option) remove this
29 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public
31 License without this special exception.
32
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
35
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
38
39 /* All symbols defined below should begin with yy or YY, to avoid
40 infringing on user name space. This should be done even for local
41 variables, as they might otherwise be expanded by user macros.
42 There are some unavoidable exceptions within include files to
43 define necessary library symbols; they are noted "INFRINGES ON
44 USER NAME SPACE" below. */
45
46 /* Identify Bison output. */
47 #define YYBISON 1
48
49 /* Bison version. */
50 #define YYBISON_VERSION "2.3"
51
52 /* Skeleton name. */
53 #define YYSKELETON_NAME "yacc.c"
54
55 /* Pure parsers. */
56 #define YYPURE 0
57
58 /* Using locations. */
59 #define YYLSP_NEEDED 0
60
61
62
63 /* Tokens. */
64 #ifndef YYTOKENTYPE
65 # define YYTOKENTYPE
66 /* Put the tokens into the symbol table, so that GDB and other debuggers
67 know about them. */
68 enum yytokentype {
69 DEFAULT = 258,
70 INTERPRETER = 259,
71 REVISION = 260,
72 FONT = 261,
73 COLOURS = 262,
74 GAME = 263,
75 ROMAN = 264,
76 BOLD = 265,
77 ITALIC = 266,
78 FIXED = 267,
79 SYMBOLIC = 268,
80 GAMEDIR = 269,
81 SAVEDIR = 270,
82 SOUNDS = 271,
83 GRAPHICS = 272,
84 SIZE = 273,
85 ANTIALIAS = 274,
86 YES = 275,
87 NO = 276,
88 GAMEID = 277,
89 NUMBER = 278,
90 STRING = 279,
91 CHARACTER = 280
92 };
93 #endif
94 /* Tokens. */
95 #define DEFAULT 258
96 #define INTERPRETER 259
97 #define REVISION 260
98 #define FONT 261
99 #define COLOURS 262
100 #define GAME 263
101 #define ROMAN 264
102 #define BOLD 265
103 #define ITALIC 266
104 #define FIXED 267
105 #define SYMBOLIC 268
106 #define GAMEDIR 269
107 #define SAVEDIR 270
108 #define SOUNDS 271
109 #define GRAPHICS 272
110 #define SIZE 273
111 #define ANTIALIAS 274
112 #define YES 275
113 #define NO 276
114 #define GAMEID 277
115 #define NUMBER 278
116 #define STRING 279
117 #define CHARACTER 280
118
119
120
121
122 /* Copy the first part of user declarations. */
123 #line 1 "rc_parse.y"
124
125 #include <stdio.h>
126 #include <stdlib.h>
127 #include <string.h>
128
129 #include "../config.h"
130 #include "zmachine.h"
131 #include "rc.h"
132 #include "rcp.h"
133 #include "hash.h"
134
135 #define YYERROR_VERBOSE 1
136
137 extern int _rc_line;
138 extern hash rc_hash;
139
140 extern void rc_error(char*);
141 extern int rc_lex(void);
142
143 int rc_merging = 0;
144
145 #define EMPTY_GAME(x) x.fg_col = -1; x.bg_col = -1; x.interpreter = -1; x.revision = -1; x.name = NULL; x.fonts = NULL; x.n_fonts = -1; x.colours = NULL; x.n_colours = -1; x.gamedir = x.savedir = x.sounds = x.graphics = NULL; x.xsize = x.ysize = -1; x.antialias = -1;
146
merge_games(const rc_game * a,const rc_game * b)147 static inline rc_game merge_games(const rc_game* a, const rc_game* b)
148 {
149 rc_game r;
150
151 if (a->fg_col == -1)
152 r.fg_col = b->fg_col;
153 else
154 r.fg_col = a->fg_col;
155 if (a->bg_col == -1)
156 r.bg_col = b->bg_col;
157 else
158 r.bg_col = a->bg_col;
159
160 if (a->interpreter == -1)
161 r.interpreter = b->interpreter;
162 else
163 r.interpreter = a->interpreter;
164
165 if (a->antialias == -1)
166 r.antialias = b->antialias;
167 else
168 r.antialias = a->antialias;
169
170 if (a->revision == -1)
171 r.revision = b->revision;
172 else
173 r.revision = a->revision;
174
175 if (a->name == NULL)
176 r.name = b->name;
177 else
178 r.name = a->name;
179
180 if (a->fonts == NULL)
181 {
182 r.fonts = b->fonts;
183 r.n_fonts = b->n_fonts;
184 }
185 else if (b->fonts == NULL)
186 {
187 r.fonts = a->fonts;
188 r.n_fonts = a->n_fonts;
189 }
190 else
191 {
192 int x;
193
194 r.n_fonts = a->n_fonts + b->n_fonts;
195 r.fonts = malloc(r.n_fonts*sizeof(rc_font));
196
197 for (x=0; x<a->n_fonts; x++)
198 r.fonts[x] = a->fonts[x];
199 for (x=0; x<b->n_fonts; x++)
200 r.fonts[x+a->n_fonts] = b->fonts[x];
201
202 free(a->fonts);
203 free(b->fonts);
204 }
205
206 if (a->colours == NULL)
207 {
208 r.colours = b->colours;
209 r.n_colours = b->n_colours;
210 }
211 else if (b->colours == NULL)
212 {
213 r.colours = a->colours;
214 r.n_colours = a->n_colours;
215 }
216 else
217 rc_error("Can only have one set of colours per block");
218
219 if (a->gamedir == NULL)
220 r.gamedir = b->gamedir;
221 else
222 r.gamedir = a->gamedir;
223
224 if (a->savedir == NULL)
225 r.savedir = b->savedir;
226 else
227 r.savedir = a->savedir;
228
229 if (a->sounds == NULL)
230 r.sounds = b->sounds;
231 else
232 r.sounds = a->sounds;
233 if (a->graphics == NULL)
234 r.graphics = b->graphics;
235 else
236 r.graphics = a->graphics;
237
238 if (a->xsize == -1)
239 r.xsize = b->xsize;
240 else
241 r.xsize = a->xsize;
242 if (a->ysize == -1)
243 r.ysize = b->ysize;
244 else
245 r.ysize = a->ysize;
246
247 return r;
248 }
249
250
251 /* Enabling traces. */
252 #ifndef YYDEBUG
253 # define YYDEBUG 0
254 #endif
255
256 /* Enabling verbose error messages. */
257 #ifdef YYERROR_VERBOSE
258 # undef YYERROR_VERBOSE
259 # define YYERROR_VERBOSE 1
260 #else
261 # define YYERROR_VERBOSE 0
262 #endif
263
264 /* Enabling the token table. */
265 #ifndef YYTOKEN_TABLE
266 # define YYTOKEN_TABLE 0
267 #endif
268
269 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
270 typedef union YYSTYPE
271 #line 128 "rc_parse.y"
272 {
273 char* str;
274 int num;
275 char chr;
276
277 rc_font font;
278 rc_game game;
279 rc_colour col;
280 stringlist* slist;
281 }
282 /* Line 193 of yacc.c. */
283 #line 284 "rc_parse.c"
284 YYSTYPE;
285 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
286 # define YYSTYPE_IS_DECLARED 1
287 # define YYSTYPE_IS_TRIVIAL 1
288 #endif
289
290
291
292 /* Copy the second part of user declarations. */
293 #line 176 "rc_parse.y"
294
check_collision(char * ourid,char * name)295 static int check_collision(char* ourid, char* name)
296 {
297 rc_game* game;
298
299 game = hash_get(rc_hash, ourid, strlen(ourid));
300 if (game != NULL && strcmp(name, game->name) != 0)
301 {
302 if (!rc_merging)
303 zmachine_info("Namespace collision: identifier '%s' (for game '%s') already used for game '%s'", ourid, name, game->name);
304 return 0;
305 }
306
307 return 1;
308 }
309
310
311 /* Line 216 of yacc.c. */
312 #line 313 "rc_parse.c"
313
314 #ifdef short
315 # undef short
316 #endif
317
318 #ifdef YYTYPE_UINT8
319 typedef YYTYPE_UINT8 yytype_uint8;
320 #else
321 typedef unsigned char yytype_uint8;
322 #endif
323
324 #ifdef YYTYPE_INT8
325 typedef YYTYPE_INT8 yytype_int8;
326 #elif (defined __STDC__ || defined __C99__FUNC__ \
327 || defined __cplusplus || defined _MSC_VER)
328 typedef signed char yytype_int8;
329 #else
330 typedef short int yytype_int8;
331 #endif
332
333 #ifdef YYTYPE_UINT16
334 typedef YYTYPE_UINT16 yytype_uint16;
335 #else
336 typedef unsigned short int yytype_uint16;
337 #endif
338
339 #ifdef YYTYPE_INT16
340 typedef YYTYPE_INT16 yytype_int16;
341 #else
342 typedef short int yytype_int16;
343 #endif
344
345 #ifndef YYSIZE_T
346 # ifdef __SIZE_TYPE__
347 # define YYSIZE_T __SIZE_TYPE__
348 # elif defined size_t
349 # define YYSIZE_T size_t
350 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
351 || defined __cplusplus || defined _MSC_VER)
352 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
353 # define YYSIZE_T size_t
354 # else
355 # define YYSIZE_T unsigned int
356 # endif
357 #endif
358
359 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
360
361 #ifndef YY_
362 # if defined YYENABLE_NLS && YYENABLE_NLS
363 # if ENABLE_NLS
364 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
365 # define YY_(msgid) dgettext ("bison-runtime", msgid)
366 # endif
367 # endif
368 # ifndef YY_
369 # define YY_(msgid) msgid
370 # endif
371 #endif
372
373 /* Suppress unused-variable warnings by "using" E. */
374 #if ! defined lint || defined __GNUC__
375 # define YYUSE(e) ((void) (e))
376 #else
377 # define YYUSE(e) /* empty */
378 #endif
379
380 /* Identity function, used to suppress warnings about constant conditions. */
381 #ifndef lint
382 # define YYID(n) (n)
383 #else
384 #if (defined __STDC__ || defined __C99__FUNC__ \
385 || defined __cplusplus || defined _MSC_VER)
386 static int
YYID(int i)387 YYID (int i)
388 #else
389 static int
390 YYID (i)
391 int i;
392 #endif
393 {
394 return i;
395 }
396 #endif
397
398 #if ! defined yyoverflow || YYERROR_VERBOSE
399
400 /* The parser invokes alloca or malloc; define the necessary symbols. */
401
402 # ifdef YYSTACK_USE_ALLOCA
403 # if YYSTACK_USE_ALLOCA
404 # ifdef __GNUC__
405 # define YYSTACK_ALLOC __builtin_alloca
406 # elif defined __BUILTIN_VA_ARG_INCR
407 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
408 # elif defined _AIX
409 # define YYSTACK_ALLOC __alloca
410 # elif defined _MSC_VER
411 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
412 # define alloca _alloca
413 # else
414 # define YYSTACK_ALLOC alloca
415 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
416 || defined __cplusplus || defined _MSC_VER)
417 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
418 # ifndef _STDLIB_H
419 # define _STDLIB_H 1
420 # endif
421 # endif
422 # endif
423 # endif
424 # endif
425
426 # ifdef YYSTACK_ALLOC
427 /* Pacify GCC's `empty if-body' warning. */
428 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
429 # ifndef YYSTACK_ALLOC_MAXIMUM
430 /* The OS might guarantee only one guard page at the bottom of the stack,
431 and a page size can be as small as 4096 bytes. So we cannot safely
432 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
433 to allow for a few compiler-allocated temporary stack slots. */
434 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
435 # endif
436 # else
437 # define YYSTACK_ALLOC YYMALLOC
438 # define YYSTACK_FREE YYFREE
439 # ifndef YYSTACK_ALLOC_MAXIMUM
440 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
441 # endif
442 # if (defined __cplusplus && ! defined _STDLIB_H \
443 && ! ((defined YYMALLOC || defined malloc) \
444 && (defined YYFREE || defined free)))
445 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
446 # ifndef _STDLIB_H
447 # define _STDLIB_H 1
448 # endif
449 # endif
450 # ifndef YYMALLOC
451 # define YYMALLOC malloc
452 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
453 || defined __cplusplus || defined _MSC_VER)
454 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
455 # endif
456 # endif
457 # ifndef YYFREE
458 # define YYFREE free
459 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
460 || defined __cplusplus || defined _MSC_VER)
461 void free (void *); /* INFRINGES ON USER NAME SPACE */
462 # endif
463 # endif
464 # endif
465 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
466
467
468 #if (! defined yyoverflow \
469 && (! defined __cplusplus \
470 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
471
472 /* A type that is properly aligned for any stack member. */
473 union yyalloc
474 {
475 yytype_int16 yyss;
476 YYSTYPE yyvs;
477 };
478
479 /* The size of the maximum gap between one aligned stack and the next. */
480 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
481
482 /* The size of an array large to enough to hold all stacks, each with
483 N elements. */
484 # define YYSTACK_BYTES(N) \
485 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
486 + YYSTACK_GAP_MAXIMUM)
487
488 /* Copy COUNT objects from FROM to TO. The source and destination do
489 not overlap. */
490 # ifndef YYCOPY
491 # if defined __GNUC__ && 1 < __GNUC__
492 # define YYCOPY(To, From, Count) \
493 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
494 # else
495 # define YYCOPY(To, From, Count) \
496 do \
497 { \
498 YYSIZE_T yyi; \
499 for (yyi = 0; yyi < (Count); yyi++) \
500 (To)[yyi] = (From)[yyi]; \
501 } \
502 while (YYID (0))
503 # endif
504 # endif
505
506 /* Relocate STACK from its old location to the new one. The
507 local variables YYSIZE and YYSTACKSIZE give the old and new number of
508 elements in the stack, and YYPTR gives the new location of the
509 stack. Advance YYPTR to a properly aligned location for the next
510 stack. */
511 # define YYSTACK_RELOCATE(Stack) \
512 do \
513 { \
514 YYSIZE_T yynewbytes; \
515 YYCOPY (&yyptr->Stack, Stack, yysize); \
516 Stack = &yyptr->Stack; \
517 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
518 yyptr += yynewbytes / sizeof (*yyptr); \
519 } \
520 while (YYID (0))
521
522 #endif
523
524 /* YYFINAL -- State number of the termination state. */
525 #define YYFINAL 9
526 /* YYLAST -- Last index in YYTABLE. */
527 #define YYLAST 77
528
529 /* YYNTOKENS -- Number of terminals. */
530 #define YYNTOKENS 32
531 /* YYNNTS -- Number of nonterminals. */
532 #define YYNNTS 16
533 /* YYNRULES -- Number of rules. */
534 #define YYNRULES 43
535 /* YYNRULES -- Number of states. */
536 #define YYNSTATES 76
537
538 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
539 #define YYUNDEFTOK 2
540 #define YYMAXUTOK 280
541
542 #define YYTRANSLATE(YYX) \
543 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
544
545 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
546 static const yytype_uint8 yytranslate[] =
547 {
548 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
549 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
550 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
551 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
552 30, 31, 2, 2, 28, 29, 2, 2, 2, 2,
553 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
554 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
555 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
556 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
557 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
558 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
559 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
560 2, 2, 2, 26, 2, 27, 2, 2, 2, 2,
561 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
562 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
563 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
564 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
565 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
566 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
567 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
568 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
569 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
570 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
571 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
572 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
573 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
574 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
575 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
576 25
577 };
578
579 #if YYDEBUG
580 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
581 YYRHS. */
582 static const yytype_uint8 yyprhs[] =
583 {
584 0, 0, 3, 5, 8, 12, 15, 19, 24, 28,
585 31, 34, 38, 40, 43, 45, 47, 50, 53, 56,
586 61, 64, 67, 70, 73, 76, 81, 83, 87, 89,
587 93, 95, 97, 99, 101, 103, 105, 109, 117, 119,
588 121, 123, 125, 129
589 };
590
591 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
592 static const yytype_int8 yyrhs[] =
593 {
594 33, 0, -1, 34, -1, 33, 34, -1, 3, 24,
595 35, -1, 3, 35, -1, 8, 24, 44, -1, 8,
596 24, 44, 35, -1, 26, 36, 27, -1, 26, 27,
597 -1, 26, 47, -1, 26, 36, 47, -1, 38, -1,
598 36, 38, -1, 20, -1, 21, -1, 4, 23, -1,
599 19, 37, -1, 5, 25, -1, 6, 23, 24, 39,
600 -1, 7, 42, -1, 14, 24, -1, 15, 24, -1,
601 16, 24, -1, 17, 24, -1, 18, 23, 28, 23,
602 -1, 40, -1, 39, 28, 40, -1, 41, -1, 40,
603 29, 41, -1, 9, -1, 10, -1, 11, -1, 12,
604 -1, 13, -1, 43, -1, 42, 28, 43, -1, 30,
605 23, 28, 23, 28, 23, 31, -1, 46, -1, 45,
606 -1, 47, -1, 22, -1, 44, 28, 22, -1, 1,
607 27, -1
608 };
609
610 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
611 static const yytype_uint16 yyrline[] =
612 {
613 0, 195, 195, 196, 199, 214, 230, 259, 290, 294,
614 298, 304, 313, 314, 320, 321, 324, 329, 334, 339,
615 349, 353, 358, 363, 368, 373, 381, 388, 396, 400,
616 406, 407, 408, 409, 410, 413, 420, 430, 438, 439,
617 443, 447, 453, 468
618 };
619 #endif
620
621 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
622 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
623 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
624 static const char *const yytname[] =
625 {
626 "$end", "error", "$undefined", "DEFAULT", "INTERPRETER", "REVISION",
627 "FONT", "COLOURS", "GAME", "ROMAN", "BOLD", "ITALIC", "FIXED",
628 "SYMBOLIC", "GAMEDIR", "SAVEDIR", "SOUNDS", "GRAPHICS", "SIZE",
629 "ANTIALIAS", "YES", "NO", "GAMEID", "NUMBER", "STRING", "CHARACTER",
630 "'{'", "'}'", "','", "'-'", "'('", "')'", "$accept", "RCFile", "RCDefn",
631 "RCBlock", "RCOptionList", "YesOrNo", "RCOption", "FontType", "FontDefn",
632 "FontQual", "ColourList", "ColourDefn", "RevisionList",
633 "BadRevisionList", "GoodRevisionList", "ErrorList", 0
634 };
635 #endif
636
637 # ifdef YYPRINT
638 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
639 token YYLEX-NUM. */
640 static const yytype_uint16 yytoknum[] =
641 {
642 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
643 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
644 275, 276, 277, 278, 279, 280, 123, 125, 44, 45,
645 40, 41
646 };
647 # endif
648
649 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
650 static const yytype_uint8 yyr1[] =
651 {
652 0, 32, 33, 33, 34, 34, 34, 34, 35, 35,
653 35, 35, 36, 36, 37, 37, 38, 38, 38, 38,
654 38, 38, 38, 38, 38, 38, 39, 39, 40, 40,
655 41, 41, 41, 41, 41, 42, 42, 43, 44, 44,
656 45, 46, 46, 47
657 };
658
659 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
660 static const yytype_uint8 yyr2[] =
661 {
662 0, 2, 1, 2, 3, 2, 3, 4, 3, 2,
663 2, 3, 1, 2, 1, 1, 2, 2, 2, 4,
664 2, 2, 2, 2, 2, 4, 1, 3, 1, 3,
665 1, 1, 1, 1, 1, 1, 3, 7, 1, 1,
666 1, 1, 3, 2
667 };
668
669 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
670 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
671 means the default is an error. */
672 static const yytype_uint8 yydefact[] =
673 {
674 0, 0, 0, 0, 2, 0, 0, 5, 0, 1,
675 3, 4, 0, 0, 0, 0, 0, 0, 0, 0,
676 0, 0, 0, 9, 0, 12, 10, 41, 6, 39,
677 38, 40, 43, 16, 18, 0, 0, 20, 35, 21,
678 22, 23, 24, 0, 14, 15, 17, 8, 13, 11,
679 0, 7, 0, 0, 0, 0, 42, 30, 31, 32,
680 33, 34, 19, 26, 28, 0, 36, 25, 0, 0,
681 0, 27, 29, 0, 0, 37
682 };
683
684 /* YYDEFGOTO[NTERM-NUM]. */
685 static const yytype_int8 yydefgoto[] =
686 {
687 -1, 3, 4, 7, 24, 46, 25, 62, 63, 64,
688 37, 38, 28, 29, 30, 26
689 };
690
691 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
692 STATE-NUM. */
693 #define YYPACT_NINF -20
694 static const yytype_int8 yypact[] =
695 {
696 36, -14, -15, 38, -20, -6, -1, -20, 7, -20,
697 -20, -20, 1, -2, 6, 20, 17, 29, 30, 31,
698 32, 34, -19, -20, 18, -20, -20, -20, 14, -20,
699 -20, -20, -20, -20, -20, 35, 37, 33, -20, -20,
700 -20, -20, -20, 40, -20, -20, -20, -20, -20, -20,
701 41, -20, 39, 42, 17, 43, -20, -20, -20, -20,
702 -20, -20, 44, 45, -20, 46, -20, -20, 39, 39,
703 47, 45, -20, 48, 27, -20
704 };
705
706 /* YYPGOTO[NTERM-NUM]. */
707 static const yytype_int8 yypgoto[] =
708 {
709 -20, -20, 59, 2, -20, -20, 49, -20, -4, 8,
710 -20, 11, -20, -20, -20, 3
711 };
712
713 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
714 positive, shift that token. If negative, reduce the rule which
715 number is the opposite. If zero, do what YYDEFACT says.
716 If YYTABLE_NINF, syntax error. */
717 #define YYTABLE_NINF -1
718 static const yytype_uint8 yytable[] =
719 {
720 12, 44, 45, 13, 14, 15, 16, 11, 12, 8,
721 5, 31, 6, 17, 18, 19, 20, 21, 22, 12,
722 6, 33, 13, 14, 15, 16, 23, 49, 32, 27,
723 51, 34, 17, 18, 19, 20, 21, 22, 9, 1,
724 6, 1, 50, 35, 2, 47, 2, 36, 57, 58,
725 59, 60, 61, 39, 40, 41, 42, 43, 75, 52,
726 53, 54, 10, 56, 71, 66, 67, 0, 55, 70,
727 65, 74, 68, 48, 69, 73, 0, 72
728 };
729
730 static const yytype_int8 yycheck[] =
731 {
732 1, 20, 21, 4, 5, 6, 7, 5, 1, 24,
733 24, 8, 26, 14, 15, 16, 17, 18, 19, 1,
734 26, 23, 4, 5, 6, 7, 27, 24, 27, 22,
735 28, 25, 14, 15, 16, 17, 18, 19, 0, 3,
736 26, 3, 28, 23, 8, 27, 8, 30, 9, 10,
737 11, 12, 13, 24, 24, 24, 24, 23, 31, 24,
738 23, 28, 3, 22, 68, 54, 23, -1, 28, 23,
739 28, 23, 28, 24, 29, 28, -1, 69
740 };
741
742 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
743 symbol of state STATE-NUM. */
744 static const yytype_uint8 yystos[] =
745 {
746 0, 3, 8, 33, 34, 24, 26, 35, 24, 0,
747 34, 35, 1, 4, 5, 6, 7, 14, 15, 16,
748 17, 18, 19, 27, 36, 38, 47, 22, 44, 45,
749 46, 47, 27, 23, 25, 23, 30, 42, 43, 24,
750 24, 24, 24, 23, 20, 21, 37, 27, 38, 47,
751 28, 35, 24, 23, 28, 28, 22, 9, 10, 11,
752 12, 13, 39, 40, 41, 28, 43, 23, 28, 29,
753 23, 40, 41, 28, 23, 31
754 };
755
756 #define yyerrok (yyerrstatus = 0)
757 #define yyclearin (yychar = YYEMPTY)
758 #define YYEMPTY (-2)
759 #define YYEOF 0
760
761 #define YYACCEPT goto yyacceptlab
762 #define YYABORT goto yyabortlab
763 #define YYERROR goto yyerrorlab
764
765
766 /* Like YYERROR except do call yyerror. This remains here temporarily
767 to ease the transition to the new meaning of YYERROR, for GCC.
768 Once GCC version 2 has supplanted version 1, this can go. */
769
770 #define YYFAIL goto yyerrlab
771
772 #define YYRECOVERING() (!!yyerrstatus)
773
774 #define YYBACKUP(Token, Value) \
775 do \
776 if (yychar == YYEMPTY && yylen == 1) \
777 { \
778 yychar = (Token); \
779 yylval = (Value); \
780 yytoken = YYTRANSLATE (yychar); \
781 YYPOPSTACK (1); \
782 goto yybackup; \
783 } \
784 else \
785 { \
786 yyerror (YY_("syntax error: cannot back up")); \
787 YYERROR; \
788 } \
789 while (YYID (0))
790
791
792 #define YYTERROR 1
793 #define YYERRCODE 256
794
795
796 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
797 If N is 0, then set CURRENT to the empty location which ends
798 the previous symbol: RHS[0] (always defined). */
799
800 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
801 #ifndef YYLLOC_DEFAULT
802 # define YYLLOC_DEFAULT(Current, Rhs, N) \
803 do \
804 if (YYID (N)) \
805 { \
806 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
807 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
808 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
809 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
810 } \
811 else \
812 { \
813 (Current).first_line = (Current).last_line = \
814 YYRHSLOC (Rhs, 0).last_line; \
815 (Current).first_column = (Current).last_column = \
816 YYRHSLOC (Rhs, 0).last_column; \
817 } \
818 while (YYID (0))
819 #endif
820
821
822 /* YY_LOCATION_PRINT -- Print the location on the stream.
823 This macro was not mandated originally: define only if we know
824 we won't break user code: when these are the locations we know. */
825
826 #ifndef YY_LOCATION_PRINT
827 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
828 # define YY_LOCATION_PRINT(File, Loc) \
829 fprintf (File, "%d.%d-%d.%d", \
830 (Loc).first_line, (Loc).first_column, \
831 (Loc).last_line, (Loc).last_column)
832 # else
833 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
834 # endif
835 #endif
836
837
838 /* YYLEX -- calling `yylex' with the right arguments. */
839
840 #ifdef YYLEX_PARAM
841 # define YYLEX yylex (YYLEX_PARAM)
842 #else
843 # define YYLEX yylex ()
844 #endif
845
846 /* Enable debugging if requested. */
847 #if YYDEBUG
848
849 # ifndef YYFPRINTF
850 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
851 # define YYFPRINTF fprintf
852 # endif
853
854 # define YYDPRINTF(Args) \
855 do { \
856 if (yydebug) \
857 YYFPRINTF Args; \
858 } while (YYID (0))
859
860 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
861 do { \
862 if (yydebug) \
863 { \
864 YYFPRINTF (stderr, "%s ", Title); \
865 yy_symbol_print (stderr, \
866 Type, Value); \
867 YYFPRINTF (stderr, "\n"); \
868 } \
869 } while (YYID (0))
870
871
872 /*--------------------------------.
873 | Print this symbol on YYOUTPUT. |
874 `--------------------------------*/
875
876 /*ARGSUSED*/
877 #if (defined __STDC__ || defined __C99__FUNC__ \
878 || defined __cplusplus || defined _MSC_VER)
879 static void
yy_symbol_value_print(FILE * yyoutput,int yytype,YYSTYPE const * const yyvaluep)880 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
881 #else
882 static void
883 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
884 FILE *yyoutput;
885 int yytype;
886 YYSTYPE const * const yyvaluep;
887 #endif
888 {
889 if (!yyvaluep)
890 return;
891 # ifdef YYPRINT
892 if (yytype < YYNTOKENS)
893 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
894 # else
895 YYUSE (yyoutput);
896 # endif
897 switch (yytype)
898 {
899 default:
900 break;
901 }
902 }
903
904
905 /*--------------------------------.
906 | Print this symbol on YYOUTPUT. |
907 `--------------------------------*/
908
909 #if (defined __STDC__ || defined __C99__FUNC__ \
910 || defined __cplusplus || defined _MSC_VER)
911 static void
yy_symbol_print(FILE * yyoutput,int yytype,YYSTYPE const * const yyvaluep)912 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
913 #else
914 static void
915 yy_symbol_print (yyoutput, yytype, yyvaluep)
916 FILE *yyoutput;
917 int yytype;
918 YYSTYPE const * const yyvaluep;
919 #endif
920 {
921 if (yytype < YYNTOKENS)
922 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
923 else
924 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
925
926 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
927 YYFPRINTF (yyoutput, ")");
928 }
929
930 /*------------------------------------------------------------------.
931 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
932 | TOP (included). |
933 `------------------------------------------------------------------*/
934
935 #if (defined __STDC__ || defined __C99__FUNC__ \
936 || defined __cplusplus || defined _MSC_VER)
937 static void
yy_stack_print(yytype_int16 * bottom,yytype_int16 * top)938 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
939 #else
940 static void
941 yy_stack_print (bottom, top)
942 yytype_int16 *bottom;
943 yytype_int16 *top;
944 #endif
945 {
946 YYFPRINTF (stderr, "Stack now");
947 for (; bottom <= top; ++bottom)
948 YYFPRINTF (stderr, " %d", *bottom);
949 YYFPRINTF (stderr, "\n");
950 }
951
952 # define YY_STACK_PRINT(Bottom, Top) \
953 do { \
954 if (yydebug) \
955 yy_stack_print ((Bottom), (Top)); \
956 } while (YYID (0))
957
958
959 /*------------------------------------------------.
960 | Report that the YYRULE is going to be reduced. |
961 `------------------------------------------------*/
962
963 #if (defined __STDC__ || defined __C99__FUNC__ \
964 || defined __cplusplus || defined _MSC_VER)
965 static void
yy_reduce_print(YYSTYPE * yyvsp,int yyrule)966 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
967 #else
968 static void
969 yy_reduce_print (yyvsp, yyrule)
970 YYSTYPE *yyvsp;
971 int yyrule;
972 #endif
973 {
974 int yynrhs = yyr2[yyrule];
975 int yyi;
976 unsigned long int yylno = yyrline[yyrule];
977 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
978 yyrule - 1, yylno);
979 /* The symbols being reduced. */
980 for (yyi = 0; yyi < yynrhs; yyi++)
981 {
982 fprintf (stderr, " $%d = ", yyi + 1);
983 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
984 &(yyvsp[(yyi + 1) - (yynrhs)])
985 );
986 fprintf (stderr, "\n");
987 }
988 }
989
990 # define YY_REDUCE_PRINT(Rule) \
991 do { \
992 if (yydebug) \
993 yy_reduce_print (yyvsp, Rule); \
994 } while (YYID (0))
995
996 /* Nonzero means print parse trace. It is left uninitialized so that
997 multiple parsers can coexist. */
998 int yydebug;
999 #else /* !YYDEBUG */
1000 # define YYDPRINTF(Args)
1001 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1002 # define YY_STACK_PRINT(Bottom, Top)
1003 # define YY_REDUCE_PRINT(Rule)
1004 #endif /* !YYDEBUG */
1005
1006
1007 /* YYINITDEPTH -- initial size of the parser's stacks. */
1008 #ifndef YYINITDEPTH
1009 # define YYINITDEPTH 200
1010 #endif
1011
1012 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1013 if the built-in stack extension method is used).
1014
1015 Do not make this value too large; the results are undefined if
1016 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1017 evaluated with infinite-precision integer arithmetic. */
1018
1019 #ifndef YYMAXDEPTH
1020 # define YYMAXDEPTH 10000
1021 #endif
1022
1023
1024
1025 #if YYERROR_VERBOSE
1026
1027 # ifndef yystrlen
1028 # if defined __GLIBC__ && defined _STRING_H
1029 # define yystrlen strlen
1030 # else
1031 /* Return the length of YYSTR. */
1032 #if (defined __STDC__ || defined __C99__FUNC__ \
1033 || defined __cplusplus || defined _MSC_VER)
1034 static YYSIZE_T
yystrlen(const char * yystr)1035 yystrlen (const char *yystr)
1036 #else
1037 static YYSIZE_T
1038 yystrlen (yystr)
1039 const char *yystr;
1040 #endif
1041 {
1042 YYSIZE_T yylen;
1043 for (yylen = 0; yystr[yylen]; yylen++)
1044 continue;
1045 return yylen;
1046 }
1047 # endif
1048 # endif
1049
1050 # ifndef yystpcpy
1051 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1052 # define yystpcpy stpcpy
1053 # else
1054 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1055 YYDEST. */
1056 #if (defined __STDC__ || defined __C99__FUNC__ \
1057 || defined __cplusplus || defined _MSC_VER)
1058 static char *
yystpcpy(char * yydest,const char * yysrc)1059 yystpcpy (char *yydest, const char *yysrc)
1060 #else
1061 static char *
1062 yystpcpy (yydest, yysrc)
1063 char *yydest;
1064 const char *yysrc;
1065 #endif
1066 {
1067 char *yyd = yydest;
1068 const char *yys = yysrc;
1069
1070 while ((*yyd++ = *yys++) != '\0')
1071 continue;
1072
1073 return yyd - 1;
1074 }
1075 # endif
1076 # endif
1077
1078 # ifndef yytnamerr
1079 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1080 quotes and backslashes, so that it's suitable for yyerror. The
1081 heuristic is that double-quoting is unnecessary unless the string
1082 contains an apostrophe, a comma, or backslash (other than
1083 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1084 null, do not copy; instead, return the length of what the result
1085 would have been. */
1086 static YYSIZE_T
yytnamerr(char * yyres,const char * yystr)1087 yytnamerr (char *yyres, const char *yystr)
1088 {
1089 if (*yystr == '"')
1090 {
1091 YYSIZE_T yyn = 0;
1092 char const *yyp = yystr;
1093
1094 for (;;)
1095 switch (*++yyp)
1096 {
1097 case '\'':
1098 case ',':
1099 goto do_not_strip_quotes;
1100
1101 case '\\':
1102 if (*++yyp != '\\')
1103 goto do_not_strip_quotes;
1104 /* Fall through. */
1105 default:
1106 if (yyres)
1107 yyres[yyn] = *yyp;
1108 yyn++;
1109 break;
1110
1111 case '"':
1112 if (yyres)
1113 yyres[yyn] = '\0';
1114 return yyn;
1115 }
1116 do_not_strip_quotes: ;
1117 }
1118
1119 if (! yyres)
1120 return yystrlen (yystr);
1121
1122 return yystpcpy (yyres, yystr) - yyres;
1123 }
1124 # endif
1125
1126 /* Copy into YYRESULT an error message about the unexpected token
1127 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1128 including the terminating null byte. If YYRESULT is null, do not
1129 copy anything; just return the number of bytes that would be
1130 copied. As a special case, return 0 if an ordinary "syntax error"
1131 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1132 size calculation. */
1133 static YYSIZE_T
yysyntax_error(char * yyresult,int yystate,int yychar)1134 yysyntax_error (char *yyresult, int yystate, int yychar)
1135 {
1136 int yyn = yypact[yystate];
1137
1138 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1139 return 0;
1140 else
1141 {
1142 int yytype = YYTRANSLATE (yychar);
1143 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1144 YYSIZE_T yysize = yysize0;
1145 YYSIZE_T yysize1;
1146 int yysize_overflow = 0;
1147 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1148 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1149 int yyx;
1150
1151 # if 0
1152 /* This is so xgettext sees the translatable formats that are
1153 constructed on the fly. */
1154 YY_("syntax error, unexpected %s");
1155 YY_("syntax error, unexpected %s, expecting %s");
1156 YY_("syntax error, unexpected %s, expecting %s or %s");
1157 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1158 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1159 # endif
1160 char *yyfmt;
1161 char const *yyf;
1162 static char const yyunexpected[] = "syntax error, unexpected %s";
1163 static char const yyexpecting[] = ", expecting %s";
1164 static char const yyor[] = " or %s";
1165 char yyformat[sizeof yyunexpected
1166 + sizeof yyexpecting - 1
1167 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1168 * (sizeof yyor - 1))];
1169 char const *yyprefix = yyexpecting;
1170
1171 /* Start YYX at -YYN if negative to avoid negative indexes in
1172 YYCHECK. */
1173 int yyxbegin = yyn < 0 ? -yyn : 0;
1174
1175 /* Stay within bounds of both yycheck and yytname. */
1176 int yychecklim = YYLAST - yyn + 1;
1177 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1178 int yycount = 1;
1179
1180 yyarg[0] = yytname[yytype];
1181 yyfmt = yystpcpy (yyformat, yyunexpected);
1182
1183 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1184 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1185 {
1186 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1187 {
1188 yycount = 1;
1189 yysize = yysize0;
1190 yyformat[sizeof yyunexpected - 1] = '\0';
1191 break;
1192 }
1193 yyarg[yycount++] = yytname[yyx];
1194 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1195 yysize_overflow |= (yysize1 < yysize);
1196 yysize = yysize1;
1197 yyfmt = yystpcpy (yyfmt, yyprefix);
1198 yyprefix = yyor;
1199 }
1200
1201 yyf = YY_(yyformat);
1202 yysize1 = yysize + yystrlen (yyf);
1203 yysize_overflow |= (yysize1 < yysize);
1204 yysize = yysize1;
1205
1206 if (yysize_overflow)
1207 return YYSIZE_MAXIMUM;
1208
1209 if (yyresult)
1210 {
1211 /* Avoid sprintf, as that infringes on the user's name space.
1212 Don't have undefined behavior even if the translation
1213 produced a string with the wrong number of "%s"s. */
1214 char *yyp = yyresult;
1215 int yyi = 0;
1216 while ((*yyp = *yyf) != '\0')
1217 {
1218 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1219 {
1220 yyp += yytnamerr (yyp, yyarg[yyi++]);
1221 yyf += 2;
1222 }
1223 else
1224 {
1225 yyp++;
1226 yyf++;
1227 }
1228 }
1229 }
1230 return yysize;
1231 }
1232 }
1233 #endif /* YYERROR_VERBOSE */
1234
1235
1236 /*-----------------------------------------------.
1237 | Release the memory associated to this symbol. |
1238 `-----------------------------------------------*/
1239
1240 /*ARGSUSED*/
1241 #if (defined __STDC__ || defined __C99__FUNC__ \
1242 || defined __cplusplus || defined _MSC_VER)
1243 static void
yydestruct(const char * yymsg,int yytype,YYSTYPE * yyvaluep)1244 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1245 #else
1246 static void
1247 yydestruct (yymsg, yytype, yyvaluep)
1248 const char *yymsg;
1249 int yytype;
1250 YYSTYPE *yyvaluep;
1251 #endif
1252 {
1253 YYUSE (yyvaluep);
1254
1255 if (!yymsg)
1256 yymsg = "Deleting";
1257 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1258
1259 switch (yytype)
1260 {
1261
1262 default:
1263 break;
1264 }
1265 }
1266
1267
1268 /* Prevent warnings from -Wmissing-prototypes. */
1269
1270 #ifdef YYPARSE_PARAM
1271 #if defined __STDC__ || defined __cplusplus
1272 int yyparse (void *YYPARSE_PARAM);
1273 #else
1274 int yyparse ();
1275 #endif
1276 #else /* ! YYPARSE_PARAM */
1277 #if defined __STDC__ || defined __cplusplus
1278 int yyparse (void);
1279 #else
1280 int yyparse ();
1281 #endif
1282 #endif /* ! YYPARSE_PARAM */
1283
1284
1285
1286 /* The look-ahead symbol. */
1287 int yychar;
1288
1289 /* The semantic value of the look-ahead symbol. */
1290 YYSTYPE yylval;
1291
1292 /* Number of syntax errors so far. */
1293 int yynerrs;
1294
1295
1296
1297 /*----------.
1298 | yyparse. |
1299 `----------*/
1300
1301 #ifdef YYPARSE_PARAM
1302 #if (defined __STDC__ || defined __C99__FUNC__ \
1303 || defined __cplusplus || defined _MSC_VER)
1304 int
yyparse(void * YYPARSE_PARAM)1305 yyparse (void *YYPARSE_PARAM)
1306 #else
1307 int
1308 yyparse (YYPARSE_PARAM)
1309 void *YYPARSE_PARAM;
1310 #endif
1311 #else /* ! YYPARSE_PARAM */
1312 #if (defined __STDC__ || defined __C99__FUNC__ \
1313 || defined __cplusplus || defined _MSC_VER)
1314 int
1315 yyparse (void)
1316 #else
1317 int
1318 yyparse ()
1319
1320 #endif
1321 #endif
1322 {
1323
1324 int yystate;
1325 int yyn;
1326 int yyresult;
1327 /* Number of tokens to shift before error messages enabled. */
1328 int yyerrstatus;
1329 /* Look-ahead token as an internal (translated) token number. */
1330 int yytoken = 0;
1331 #if YYERROR_VERBOSE
1332 /* Buffer for error messages, and its allocated size. */
1333 char yymsgbuf[128];
1334 char *yymsg = yymsgbuf;
1335 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1336 #endif
1337
1338 /* Three stacks and their tools:
1339 `yyss': related to states,
1340 `yyvs': related to semantic values,
1341 `yyls': related to locations.
1342
1343 Refer to the stacks thru separate pointers, to allow yyoverflow
1344 to reallocate them elsewhere. */
1345
1346 /* The state stack. */
1347 yytype_int16 yyssa[YYINITDEPTH];
1348 yytype_int16 *yyss = yyssa;
1349 yytype_int16 *yyssp;
1350
1351 /* The semantic value stack. */
1352 YYSTYPE yyvsa[YYINITDEPTH];
1353 YYSTYPE *yyvs = yyvsa;
1354 YYSTYPE *yyvsp;
1355
1356
1357
1358 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1359
1360 YYSIZE_T yystacksize = YYINITDEPTH;
1361
1362 /* The variables used to return semantic value and location from the
1363 action routines. */
1364 YYSTYPE yyval;
1365
1366
1367 /* The number of symbols on the RHS of the reduced rule.
1368 Keep to zero when no symbol should be popped. */
1369 int yylen = 0;
1370
1371 YYDPRINTF ((stderr, "Starting parse\n"));
1372
1373 yystate = 0;
1374 yyerrstatus = 0;
1375 yynerrs = 0;
1376 yychar = YYEMPTY; /* Cause a token to be read. */
1377
1378 /* Initialize stack pointers.
1379 Waste one element of value and location stack
1380 so that they stay on the same level as the state stack.
1381 The wasted elements are never initialized. */
1382
1383 yyssp = yyss;
1384 yyvsp = yyvs;
1385
1386 goto yysetstate;
1387
1388 /*------------------------------------------------------------.
1389 | yynewstate -- Push a new state, which is found in yystate. |
1390 `------------------------------------------------------------*/
1391 yynewstate:
1392 /* In all cases, when you get here, the value and location stacks
1393 have just been pushed. So pushing a state here evens the stacks. */
1394 yyssp++;
1395
1396 yysetstate:
1397 *yyssp = yystate;
1398
1399 if (yyss + yystacksize - 1 <= yyssp)
1400 {
1401 /* Get the current used size of the three stacks, in elements. */
1402 YYSIZE_T yysize = yyssp - yyss + 1;
1403
1404 #ifdef yyoverflow
1405 {
1406 /* Give user a chance to reallocate the stack. Use copies of
1407 these so that the &'s don't force the real ones into
1408 memory. */
1409 YYSTYPE *yyvs1 = yyvs;
1410 yytype_int16 *yyss1 = yyss;
1411
1412
1413 /* Each stack pointer address is followed by the size of the
1414 data in use in that stack, in bytes. This used to be a
1415 conditional around just the two extra args, but that might
1416 be undefined if yyoverflow is a macro. */
1417 yyoverflow (YY_("memory exhausted"),
1418 &yyss1, yysize * sizeof (*yyssp),
1419 &yyvs1, yysize * sizeof (*yyvsp),
1420
1421 &yystacksize);
1422
1423 yyss = yyss1;
1424 yyvs = yyvs1;
1425 }
1426 #else /* no yyoverflow */
1427 # ifndef YYSTACK_RELOCATE
1428 goto yyexhaustedlab;
1429 # else
1430 /* Extend the stack our own way. */
1431 if (YYMAXDEPTH <= yystacksize)
1432 goto yyexhaustedlab;
1433 yystacksize *= 2;
1434 if (YYMAXDEPTH < yystacksize)
1435 yystacksize = YYMAXDEPTH;
1436
1437 {
1438 yytype_int16 *yyss1 = yyss;
1439 union yyalloc *yyptr =
1440 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1441 if (! yyptr)
1442 goto yyexhaustedlab;
1443 YYSTACK_RELOCATE (yyss);
1444 YYSTACK_RELOCATE (yyvs);
1445
1446 # undef YYSTACK_RELOCATE
1447 if (yyss1 != yyssa)
1448 YYSTACK_FREE (yyss1);
1449 }
1450 # endif
1451 #endif /* no yyoverflow */
1452
1453 yyssp = yyss + yysize - 1;
1454 yyvsp = yyvs + yysize - 1;
1455
1456
1457 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1458 (unsigned long int) yystacksize));
1459
1460 if (yyss + yystacksize - 1 <= yyssp)
1461 YYABORT;
1462 }
1463
1464 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1465
1466 goto yybackup;
1467
1468 /*-----------.
1469 | yybackup. |
1470 `-----------*/
1471 yybackup:
1472
1473 /* Do appropriate processing given the current state. Read a
1474 look-ahead token if we need one and don't already have one. */
1475
1476 /* First try to decide what to do without reference to look-ahead token. */
1477 yyn = yypact[yystate];
1478 if (yyn == YYPACT_NINF)
1479 goto yydefault;
1480
1481 /* Not known => get a look-ahead token if don't already have one. */
1482
1483 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1484 if (yychar == YYEMPTY)
1485 {
1486 YYDPRINTF ((stderr, "Reading a token: "));
1487 yychar = YYLEX;
1488 }
1489
1490 if (yychar <= YYEOF)
1491 {
1492 yychar = yytoken = YYEOF;
1493 YYDPRINTF ((stderr, "Now at end of input.\n"));
1494 }
1495 else
1496 {
1497 yytoken = YYTRANSLATE (yychar);
1498 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1499 }
1500
1501 /* If the proper action on seeing token YYTOKEN is to reduce or to
1502 detect an error, take that action. */
1503 yyn += yytoken;
1504 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1505 goto yydefault;
1506 yyn = yytable[yyn];
1507 if (yyn <= 0)
1508 {
1509 if (yyn == 0 || yyn == YYTABLE_NINF)
1510 goto yyerrlab;
1511 yyn = -yyn;
1512 goto yyreduce;
1513 }
1514
1515 if (yyn == YYFINAL)
1516 YYACCEPT;
1517
1518 /* Count tokens shifted since error; after three, turn off error
1519 status. */
1520 if (yyerrstatus)
1521 yyerrstatus--;
1522
1523 /* Shift the look-ahead token. */
1524 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1525
1526 /* Discard the shifted token unless it is eof. */
1527 if (yychar != YYEOF)
1528 yychar = YYEMPTY;
1529
1530 yystate = yyn;
1531 *++yyvsp = yylval;
1532
1533 goto yynewstate;
1534
1535
1536 /*-----------------------------------------------------------.
1537 | yydefault -- do the default action for the current state. |
1538 `-----------------------------------------------------------*/
1539 yydefault:
1540 yyn = yydefact[yystate];
1541 if (yyn == 0)
1542 goto yyerrlab;
1543 goto yyreduce;
1544
1545
1546 /*-----------------------------.
1547 | yyreduce -- Do a reduction. |
1548 `-----------------------------*/
1549 yyreduce:
1550 /* yyn is the number of a rule to reduce with. */
1551 yylen = yyr2[yyn];
1552
1553 /* If YYLEN is nonzero, implement the default value of the action:
1554 `$$ = $1'.
1555
1556 Otherwise, the following line sets YYVAL to garbage.
1557 This behavior is undocumented and Bison
1558 users should not rely upon it. Assigning to YYVAL
1559 unconditionally makes the parser a bit smaller, and it avoids a
1560 GCC warning that YYVAL may be used uninitialized. */
1561 yyval = yyvsp[1-yylen];
1562
1563
1564 YY_REDUCE_PRINT (yyn);
1565 switch (yyn)
1566 {
1567 case 4:
1568 #line 200 "rc_parse.y"
1569 {
1570 rc_game* game;
1571
1572 if (!rc_merging)
1573 {
1574 game = malloc(sizeof(rc_game));
1575 *game = (yyvsp[(3) - (3)].game);
1576 game->name = (yyvsp[(2) - (3)].str);
1577 hash_store(rc_hash,
1578 (unsigned char*)"default",
1579 7,
1580 game);
1581 }
1582 }
1583 break;
1584
1585 case 5:
1586 #line 215 "rc_parse.y"
1587 {
1588 rc_game* game;
1589
1590 if (!rc_merging)
1591 {
1592 game = malloc(sizeof(rc_game));
1593 *game = (yyvsp[(2) - (2)].game);
1594 game->name = "%s";
1595 hash_store(rc_hash,
1596 (unsigned char*)"default",
1597 7,
1598 game);
1599 }
1600
1601 }
1602 break;
1603
1604 case 6:
1605 #line 231 "rc_parse.y"
1606 {
1607 if ((yyvsp[(3) - (3)].slist) != NULL)
1608 {
1609 rc_game* game;
1610 stringlist* next;
1611
1612 game = malloc(sizeof(rc_game));
1613 EMPTY_GAME((*game));
1614 game->name = (yyvsp[(2) - (3)].str);
1615
1616 next = (yyvsp[(3) - (3)].slist);
1617 while (next != NULL)
1618 {
1619 if (check_collision(next->string, game->name))
1620 {
1621 hash_store(rc_hash,
1622 (unsigned char*)next->string,
1623 strlen(next->string),
1624 game);
1625 }
1626 next = next->next;
1627 }
1628 }
1629 else
1630 {
1631 zmachine_info(".zoomrc has erroneous entry for game '%s' (line %i)", (yyvsp[(2) - (3)].str), _rc_line);
1632 }
1633 }
1634 break;
1635
1636 case 7:
1637 #line 260 "rc_parse.y"
1638 {
1639 if ((yyvsp[(3) - (4)].slist) != NULL)
1640 {
1641 rc_game* game;
1642 stringlist* next;
1643
1644 game = malloc(sizeof(rc_game));
1645 *game = (yyvsp[(4) - (4)].game);
1646 game->name = (yyvsp[(2) - (4)].str);
1647
1648 next = (yyvsp[(3) - (4)].slist);
1649 while (next != NULL)
1650 {
1651 if (check_collision(next->string, game->name))
1652 {
1653 hash_store(rc_hash,
1654 (unsigned char*)next->string,
1655 strlen(next->string),
1656 game);
1657 }
1658 next = next->next;
1659 }
1660 }
1661 else
1662 {
1663 zmachine_info(".zoomrc has erroneous entry for game '%s' (line %i)", (yyvsp[(2) - (4)].str), _rc_line);
1664 }
1665 }
1666 break;
1667
1668 case 8:
1669 #line 291 "rc_parse.y"
1670 {
1671 (yyval.game) = (yyvsp[(2) - (3)].game);
1672 }
1673 break;
1674
1675 case 9:
1676 #line 295 "rc_parse.y"
1677 {
1678 EMPTY_GAME((yyval.game));
1679 }
1680 break;
1681
1682 case 10:
1683 #line 299 "rc_parse.y"
1684 {
1685 yyerrok;
1686 zmachine_info(".zoomrc options block ending at line %i makes no sense", _rc_line);
1687 EMPTY_GAME((yyval.game));
1688 }
1689 break;
1690
1691 case 11:
1692 #line 305 "rc_parse.y"
1693 {
1694 yyerrok;
1695 (yyval.game) = (yyvsp[(2) - (3)].game);
1696
1697 zmachine_info(".zoomrc options block at line %i has syntax errors", _rc_line);
1698 }
1699 break;
1700
1701 case 13:
1702 #line 315 "rc_parse.y"
1703 {
1704 (yyval.game) = merge_games(&(yyvsp[(1) - (2)].game), &(yyvsp[(2) - (2)].game));
1705 }
1706 break;
1707
1708 case 14:
1709 #line 320 "rc_parse.y"
1710 { (yyval.num) = 1; }
1711 break;
1712
1713 case 15:
1714 #line 321 "rc_parse.y"
1715 { (yyval.num) = 0; }
1716 break;
1717
1718 case 16:
1719 #line 325 "rc_parse.y"
1720 {
1721 EMPTY_GAME((yyval.game));
1722 (yyval.game).interpreter = (yyvsp[(2) - (2)].num);
1723 }
1724 break;
1725
1726 case 17:
1727 #line 330 "rc_parse.y"
1728 {
1729 EMPTY_GAME((yyval.game));
1730 (yyval.game).antialias = (yyvsp[(2) - (2)].num);
1731 }
1732 break;
1733
1734 case 18:
1735 #line 335 "rc_parse.y"
1736 {
1737 EMPTY_GAME((yyval.game));
1738 (yyval.game).revision = (yyvsp[(2) - (2)].chr);
1739 }
1740 break;
1741
1742 case 19:
1743 #line 340 "rc_parse.y"
1744 {
1745 EMPTY_GAME((yyval.game));
1746 (yyval.game).fonts = malloc(sizeof(rc_font));
1747 (yyval.game).n_fonts = 1;
1748 (yyval.game).fonts[0] = (yyvsp[(4) - (4)].font);
1749
1750 (yyval.game).fonts[0].name = (yyvsp[(3) - (4)].str);
1751 (yyval.game).fonts[0].num = (yyvsp[(2) - (4)].num);
1752 }
1753 break;
1754
1755 case 20:
1756 #line 350 "rc_parse.y"
1757 {
1758 (yyval.game) = (yyvsp[(2) - (2)].game);
1759 }
1760 break;
1761
1762 case 21:
1763 #line 354 "rc_parse.y"
1764 {
1765 EMPTY_GAME((yyval.game));
1766 (yyval.game).gamedir = (yyvsp[(2) - (2)].str);
1767 }
1768 break;
1769
1770 case 22:
1771 #line 359 "rc_parse.y"
1772 {
1773 EMPTY_GAME((yyval.game));
1774 (yyval.game).savedir = (yyvsp[(2) - (2)].str);
1775 }
1776 break;
1777
1778 case 23:
1779 #line 364 "rc_parse.y"
1780 {
1781 EMPTY_GAME((yyval.game));
1782 (yyval.game).sounds = (yyvsp[(2) - (2)].str);
1783 }
1784 break;
1785
1786 case 24:
1787 #line 369 "rc_parse.y"
1788 {
1789 EMPTY_GAME((yyval.game));
1790 (yyval.game).graphics = (yyvsp[(2) - (2)].str);
1791 }
1792 break;
1793
1794 case 25:
1795 #line 374 "rc_parse.y"
1796 {
1797 EMPTY_GAME((yyval.game));
1798 (yyval.game).xsize = (yyvsp[(2) - (4)].num);
1799 (yyval.game).ysize = (yyvsp[(4) - (4)].num);
1800 }
1801 break;
1802
1803 case 26:
1804 #line 382 "rc_parse.y"
1805 {
1806 (yyval.font).name = NULL;
1807 (yyval.font).attributes[0] = (yyvsp[(1) - (1)].num);
1808 (yyval.font).n_attr = 1;
1809 (yyval.font).num = 0;
1810 }
1811 break;
1812
1813 case 27:
1814 #line 389 "rc_parse.y"
1815 {
1816 (yyval.font) = (yyvsp[(1) - (3)].font);
1817 (yyval.font).n_attr++;
1818 (yyval.font).attributes[(yyval.font).n_attr-1] = (yyvsp[(3) - (3)].num);
1819 }
1820 break;
1821
1822 case 28:
1823 #line 397 "rc_parse.y"
1824 {
1825 (yyval.num) = (yyvsp[(1) - (1)].num);
1826 }
1827 break;
1828
1829 case 29:
1830 #line 401 "rc_parse.y"
1831 {
1832 (yyval.num) = (yyvsp[(1) - (3)].num)|(yyvsp[(3) - (3)].num);
1833 }
1834 break;
1835
1836 case 30:
1837 #line 406 "rc_parse.y"
1838 { (yyval.num) = 0; }
1839 break;
1840
1841 case 31:
1842 #line 407 "rc_parse.y"
1843 { (yyval.num) = 1; }
1844 break;
1845
1846 case 32:
1847 #line 408 "rc_parse.y"
1848 { (yyval.num) = 2; }
1849 break;
1850
1851 case 33:
1852 #line 409 "rc_parse.y"
1853 { (yyval.num) = 4; }
1854 break;
1855
1856 case 34:
1857 #line 410 "rc_parse.y"
1858 { (yyval.num) = 8; }
1859 break;
1860
1861 case 35:
1862 #line 414 "rc_parse.y"
1863 {
1864 EMPTY_GAME((yyval.game));
1865 (yyval.game).colours = malloc(sizeof(rc_colour));
1866 (yyval.game).colours[0] = (yyvsp[(1) - (1)].col);
1867 (yyval.game).n_colours = 1;
1868 }
1869 break;
1870
1871 case 36:
1872 #line 421 "rc_parse.y"
1873 {
1874 (yyval.game) = (yyvsp[(1) - (3)].game);
1875 (yyval.game).n_colours++;
1876 (yyval.game).colours = realloc((yyval.game).colours,
1877 sizeof(rc_colour)*(yyval.game).n_colours);
1878 (yyval.game).colours[(yyval.game).n_colours-1]=(yyvsp[(3) - (3)].col);
1879 }
1880 break;
1881
1882 case 37:
1883 #line 431 "rc_parse.y"
1884 {
1885 (yyval.col).r = (yyvsp[(2) - (7)].num)&0xff;
1886 (yyval.col).g = (yyvsp[(4) - (7)].num)&0xff;
1887 (yyval.col).b = (yyvsp[(6) - (7)].num)&0xff;
1888 }
1889 break;
1890
1891 case 39:
1892 #line 440 "rc_parse.y"
1893 { (yyval.slist) = NULL; }
1894 break;
1895
1896 case 40:
1897 #line 444 "rc_parse.y"
1898 { yyerrok; }
1899 break;
1900
1901 case 41:
1902 #line 448 "rc_parse.y"
1903 {
1904 (yyval.slist) = malloc(sizeof(stringlist));
1905 (yyval.slist)->next = NULL;
1906 (yyval.slist)->string = (yyvsp[(1) - (1)].str);
1907 }
1908 break;
1909
1910 case 42:
1911 #line 454 "rc_parse.y"
1912 {
1913 if ((yyvsp[(1) - (3)].slist) == NULL)
1914 {
1915 (yyval.slist) = NULL;
1916 }
1917 else
1918 {
1919 (yyval.slist) = malloc(sizeof(stringlist));
1920 (yyval.slist)->next = (yyvsp[(1) - (3)].slist);
1921 (yyval.slist)->string = (yyvsp[(3) - (3)].str);
1922 }
1923 }
1924 break;
1925
1926 case 43:
1927 #line 468 "rc_parse.y"
1928 { yyerrok; }
1929 break;
1930
1931
1932 /* Line 1267 of yacc.c. */
1933 #line 1934 "rc_parse.c"
1934 default: break;
1935 }
1936 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1937
1938 YYPOPSTACK (yylen);
1939 yylen = 0;
1940 YY_STACK_PRINT (yyss, yyssp);
1941
1942 *++yyvsp = yyval;
1943
1944
1945 /* Now `shift' the result of the reduction. Determine what state
1946 that goes to, based on the state we popped back to and the rule
1947 number reduced by. */
1948
1949 yyn = yyr1[yyn];
1950
1951 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1952 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1953 yystate = yytable[yystate];
1954 else
1955 yystate = yydefgoto[yyn - YYNTOKENS];
1956
1957 goto yynewstate;
1958
1959
1960 /*------------------------------------.
1961 | yyerrlab -- here on detecting error |
1962 `------------------------------------*/
1963 yyerrlab:
1964 /* If not already recovering from an error, report this error. */
1965 if (!yyerrstatus)
1966 {
1967 ++yynerrs;
1968 #if ! YYERROR_VERBOSE
1969 yyerror (YY_("syntax error"));
1970 #else
1971 {
1972 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1973 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1974 {
1975 YYSIZE_T yyalloc = 2 * yysize;
1976 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1977 yyalloc = YYSTACK_ALLOC_MAXIMUM;
1978 if (yymsg != yymsgbuf)
1979 YYSTACK_FREE (yymsg);
1980 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1981 if (yymsg)
1982 yymsg_alloc = yyalloc;
1983 else
1984 {
1985 yymsg = yymsgbuf;
1986 yymsg_alloc = sizeof yymsgbuf;
1987 }
1988 }
1989
1990 if (0 < yysize && yysize <= yymsg_alloc)
1991 {
1992 (void) yysyntax_error (yymsg, yystate, yychar);
1993 yyerror (yymsg);
1994 }
1995 else
1996 {
1997 yyerror (YY_("syntax error"));
1998 if (yysize != 0)
1999 goto yyexhaustedlab;
2000 }
2001 }
2002 #endif
2003 }
2004
2005
2006
2007 if (yyerrstatus == 3)
2008 {
2009 /* If just tried and failed to reuse look-ahead token after an
2010 error, discard it. */
2011
2012 if (yychar <= YYEOF)
2013 {
2014 /* Return failure if at end of input. */
2015 if (yychar == YYEOF)
2016 YYABORT;
2017 }
2018 else
2019 {
2020 yydestruct ("Error: discarding",
2021 yytoken, &yylval);
2022 yychar = YYEMPTY;
2023 }
2024 }
2025
2026 /* Else will try to reuse look-ahead token after shifting the error
2027 token. */
2028 goto yyerrlab1;
2029
2030
2031 /*---------------------------------------------------.
2032 | yyerrorlab -- error raised explicitly by YYERROR. |
2033 `---------------------------------------------------*/
2034 yyerrorlab:
2035
2036 /* Pacify compilers like GCC when the user code never invokes
2037 YYERROR and the label yyerrorlab therefore never appears in user
2038 code. */
2039 if (/*CONSTCOND*/ 0)
2040 goto yyerrorlab;
2041
2042 /* Do not reclaim the symbols of the rule which action triggered
2043 this YYERROR. */
2044 YYPOPSTACK (yylen);
2045 yylen = 0;
2046 YY_STACK_PRINT (yyss, yyssp);
2047 yystate = *yyssp;
2048 goto yyerrlab1;
2049
2050
2051 /*-------------------------------------------------------------.
2052 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2053 `-------------------------------------------------------------*/
2054 yyerrlab1:
2055 yyerrstatus = 3; /* Each real token shifted decrements this. */
2056
2057 for (;;)
2058 {
2059 yyn = yypact[yystate];
2060 if (yyn != YYPACT_NINF)
2061 {
2062 yyn += YYTERROR;
2063 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2064 {
2065 yyn = yytable[yyn];
2066 if (0 < yyn)
2067 break;
2068 }
2069 }
2070
2071 /* Pop the current state because it cannot handle the error token. */
2072 if (yyssp == yyss)
2073 YYABORT;
2074
2075
2076 yydestruct ("Error: popping",
2077 yystos[yystate], yyvsp);
2078 YYPOPSTACK (1);
2079 yystate = *yyssp;
2080 YY_STACK_PRINT (yyss, yyssp);
2081 }
2082
2083 if (yyn == YYFINAL)
2084 YYACCEPT;
2085
2086 *++yyvsp = yylval;
2087
2088
2089 /* Shift the error token. */
2090 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2091
2092 yystate = yyn;
2093 goto yynewstate;
2094
2095
2096 /*-------------------------------------.
2097 | yyacceptlab -- YYACCEPT comes here. |
2098 `-------------------------------------*/
2099 yyacceptlab:
2100 yyresult = 0;
2101 goto yyreturn;
2102
2103 /*-----------------------------------.
2104 | yyabortlab -- YYABORT comes here. |
2105 `-----------------------------------*/
2106 yyabortlab:
2107 yyresult = 1;
2108 goto yyreturn;
2109
2110 #ifndef yyoverflow
2111 /*-------------------------------------------------.
2112 | yyexhaustedlab -- memory exhaustion comes here. |
2113 `-------------------------------------------------*/
2114 yyexhaustedlab:
2115 yyerror (YY_("memory exhausted"));
2116 yyresult = 2;
2117 /* Fall through. */
2118 #endif
2119
2120 yyreturn:
2121 if (yychar != YYEOF && yychar != YYEMPTY)
2122 yydestruct ("Cleanup: discarding lookahead",
2123 yytoken, &yylval);
2124 /* Do not reclaim the symbols of the rule which action triggered
2125 this YYABORT or YYACCEPT. */
2126 YYPOPSTACK (yylen);
2127 YY_STACK_PRINT (yyss, yyssp);
2128 while (yyssp != yyss)
2129 {
2130 yydestruct ("Cleanup: popping",
2131 yystos[*yyssp], yyvsp);
2132 YYPOPSTACK (1);
2133 }
2134 #ifndef yyoverflow
2135 if (yyss != yyssa)
2136 YYSTACK_FREE (yyss);
2137 #endif
2138 #if YYERROR_VERBOSE
2139 if (yymsg != yymsgbuf)
2140 YYSTACK_FREE (yymsg);
2141 #endif
2142 /* Make sure YYID is used. */
2143 return YYID (yyresult);
2144 }
2145
2146
2147 #line 471 "rc_parse.y"
2148
2149
2150