1 /* A Bison parser, made by GNU Bison 3.0.4. */
2
3 /* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
6
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
29
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
32
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
35
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
42
43 /* Identify Bison output. */
44 #define YYBISON 1
45
46 /* Bison version. */
47 #define YYBISON_VERSION "3.0.4"
48
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
51
52 /* Pure parsers. */
53 #define YYPURE 0
54
55 /* Push parsers. */
56 #define YYPUSH 0
57
58 /* Pull parsers. */
59 #define YYPULL 1
60
61
62 /* Substitute the variable and function names. */
63 #define yyparse bc_parse
64 #define yylex bc_lex
65 #define yyerror bc_error
66 #define yydebug bc_debug
67 #define yynerrs bc_nerrs
68
69 #define yylval bc_lval
70 #define yychar bc_char
71
72 /* Copy the first part of user declarations. */
73 #line 10 "bincfg/bincfg_grmr_real.y" /* yacc.c:339 */
74
75 /* Clang doesn't like the unreachable code in Bison's generated output. */
76 #ifdef __clang__
77 #pragma clang diagnostic ignored "-Wunreachable-code"
78 #endif
79
80 #include "config.h"
81 #include "lzoe/lzoe.h"
82 #include "bincfg/bincfg.h"
83 #include "bincfg/bincfg_lex.h"
84 #include "misc/types.h"
85
86 static bc_diag_t *bc_diag_list = NULL;
87 static char bc_errbuf[1024];
88 static const char *bc_cursect = NULL;
89
90 static void yyerror(const char *msg);
91
92
93 static bc_diag_t bc_oom_error_struct =
94 {
95 { NULL }, BC_DIAG_ERROR, 0, NULL, NULL
96 };
97
98
99 /* ------------------------------------------------------------------------ */
100 /* BC_OOM_ERROR -- Out of memory error handling. */
101 /* BC_CHKOOM -- Check for out-of-memory condition. */
102 /* BC_DIAG -- Queue up a diagnostic message. */
103 /* */
104 /* I hate making these macros, but YYABORT expands to a 'goto' within the */
105 /* yyparse() function. */
106 /* ------------------------------------------------------------------------ */
107 #define BC_OOM_ERROR \
108 do { \
109 bc_oom_error_struct.line = bc_line_no; \
110 bc_diag_list = &bc_oom_error_struct; \
111 YYABORT; \
112 } while (0)
113
114 #define BC_CHKOOM(m) do { if (!(m)) BC_OOM_ERROR; } while (0)
115
check_line(ll_t * l,void * opq)116 static void check_line(ll_t *l, void *opq)
117 {
118 int *lineno = (int *)opq;
119 bc_diag_t *diag = (bc_diag_t *)l;
120
121 if (diag->line == *lineno)
122 *lineno = -1;
123 }
124
125 #define BC_DIAG(diag, section, line_no, diagmsg) \
126 do { \
127 bc_diag_t *err; \
128 int line_no_tmp = line_no; \
129 \
130 bc_errbuf[sizeof(bc_errbuf)-1] = 0; \
131 \
132 if (yychar == TOK_ERROR_OOM) \
133 BC_OOM_ERROR; \
134 \
135 LL_ACTON(bc_diag_list, check_line, (void*)&line_no_tmp); \
136 \
137 if (line_no_tmp != -1) \
138 { \
139 err = CALLOC(bc_diag_t, 1); \
140 BC_CHKOOM(err); \
141 \
142 err->line = line_no; \
143 err->type = diag; \
144 err->sect = strdup(section); \
145 err->msg = strdup(diagmsg); \
146 BC_CHKOOM(err->sect); \
147 BC_CHKOOM(err->msg); \
148 \
149 LL_CONCAT(bc_diag_list, err, bc_diag_t); \
150 } \
151 } while (0)
152
153
154 static int bc_saved_tok = -1, bc_saved_lineno = 0, bc_dont_save = 0;
155 static const char *bc_saved_sec = NULL;
156
157 /* Ugh: bison magic. Moo. */
158 #define BC_TOK (bc_saved_tok < 0 || bc_saved_tok == YYEMPTY ? "<unknown>" : \
159 yytname[yytranslate[bc_saved_tok]])
160
161 #define BC_SEC (bc_saved_sec ? bc_saved_sec : \
162 bc_cursect ? bc_cursect : "<toplevel>")
163
164 #define S(s) bc_cursect = s
165
166
167 #line 168 "bincfg/bincfg_grmr.tab.c" /* yacc.c:339 */
168
169 # ifndef YY_NULLPTR
170 # if defined __cplusplus && 201103L <= __cplusplus
171 # define YY_NULLPTR nullptr
172 # else
173 # define YY_NULLPTR 0
174 # endif
175 # endif
176
177 /* Enabling verbose error messages. */
178 #ifdef YYERROR_VERBOSE
179 # undef YYERROR_VERBOSE
180 # define YYERROR_VERBOSE 1
181 #else
182 # define YYERROR_VERBOSE 1
183 #endif
184
185 /* In a future release of Bison, this section will be replaced
186 by #include "bincfg_grmr.tab.h". */
187 #ifndef YY_BC_BINCFG_BINCFG_GRMR_TAB_H_INCLUDED
188 # define YY_BC_BINCFG_BINCFG_GRMR_TAB_H_INCLUDED
189 /* Debug traces. */
190 #ifndef YYDEBUG
191 # define YYDEBUG 0
192 #endif
193 #if YYDEBUG
194 extern int bc_debug;
195 #endif
196
197 /* Token type. */
198 #ifndef YYTOKENTYPE
199 # define YYTOKENTYPE
200 enum yytokentype
201 {
202 TOK_SEC_BANKSWITCH = 258,
203 TOK_SEC_MAPPING = 259,
204 TOK_SEC_ECSBANK = 260,
205 TOK_SEC_MEMATTR = 261,
206 TOK_SEC_PRELOAD = 262,
207 TOK_SEC_MACRO = 263,
208 TOK_SEC_VARS = 264,
209 TOK_SEC_JOYSTICK = 265,
210 TOK_SEC_KEYS = 266,
211 TOK_SEC_CAPSLOCK = 267,
212 TOK_SEC_NUMLOCK = 268,
213 TOK_SEC_SCROLLLOCK = 269,
214 TOK_SEC_DISASM = 270,
215 TOK_SEC_VOICES = 271,
216 TOK_SEC_UNKNOWN = 272,
217 TOK_RAM = 273,
218 TOK_ROM = 274,
219 TOK_WOM = 275,
220 TOK_PAGE = 276,
221 TOK_MAC_QUIET = 277,
222 TOK_MAC_REG = 278,
223 TOK_MAC_AHEAD = 279,
224 TOK_MAC_BLANK = 280,
225 TOK_MAC_INSPECT = 281,
226 TOK_MAC_LOAD = 282,
227 TOK_MAC_RUN = 283,
228 TOK_MAC_POKE = 284,
229 TOK_MAC_RUNTO = 285,
230 TOK_MAC_TRACE = 286,
231 TOK_MAC_VIEW = 287,
232 TOK_MAC_WATCH = 288,
233 TOK_DECONLY = 289,
234 TOK_DEC = 290,
235 TOK_HEX = 291,
236 TOK_NAME = 292,
237 TOK_STRING = 293,
238 TOK_ERROR_BAD = 294,
239 TOK_ERROR_OOM = 295
240 };
241 #endif
242
243 /* Value type. */
244 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
245
246 union YYSTYPE
247 {
248 #line 105 "bincfg/bincfg_grmr_real.y" /* yacc.c:355 */
249
250 int intv;
251 char *strv;
252 bc_varlike_t varlike;
253 bc_varlike_types_t varlike_type;
254 cfg_var_t *var_list;
255 val_strnum_t strnum;
256 bc_mac_watch_t mac_watch;
257 bc_macro_t macro;
258 bc_macro_t *macro_list;
259 bc_memspan_t *memspan_list;
260 bc_cfgfile_t *cfgfile;
261 bc_memattr_page_t memattr_page;
262
263 #line 264 "bincfg/bincfg_grmr.tab.c" /* yacc.c:355 */
264 };
265
266 typedef union YYSTYPE YYSTYPE;
267 # define YYSTYPE_IS_TRIVIAL 1
268 # define YYSTYPE_IS_DECLARED 1
269 #endif
270
271
272 extern YYSTYPE bc_lval;
273
274 int bc_parse (void);
275
276 #endif /* !YY_BC_BINCFG_BINCFG_GRMR_TAB_H_INCLUDED */
277
278 /* Copy the second part of user declarations. */
279
280 #line 281 "bincfg/bincfg_grmr.tab.c" /* yacc.c:358 */
281
282 #ifdef short
283 # undef short
284 #endif
285
286 #ifdef YYTYPE_UINT8
287 typedef YYTYPE_UINT8 yytype_uint8;
288 #else
289 typedef unsigned char yytype_uint8;
290 #endif
291
292 #ifdef YYTYPE_INT8
293 typedef YYTYPE_INT8 yytype_int8;
294 #else
295 typedef signed char yytype_int8;
296 #endif
297
298 #ifdef YYTYPE_UINT16
299 typedef YYTYPE_UINT16 yytype_uint16;
300 #else
301 typedef unsigned short int yytype_uint16;
302 #endif
303
304 #ifdef YYTYPE_INT16
305 typedef YYTYPE_INT16 yytype_int16;
306 #else
307 typedef short int yytype_int16;
308 #endif
309
310 #ifndef YYSIZE_T
311 # ifdef __SIZE_TYPE__
312 # define YYSIZE_T __SIZE_TYPE__
313 # elif defined size_t
314 # define YYSIZE_T size_t
315 # elif ! defined YYSIZE_T
316 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
317 # define YYSIZE_T size_t
318 # else
319 # define YYSIZE_T unsigned int
320 # endif
321 #endif
322
323 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
324
325 #ifndef YY_
326 # if defined YYENABLE_NLS && YYENABLE_NLS
327 # if ENABLE_NLS
328 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
329 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
330 # endif
331 # endif
332 # ifndef YY_
333 # define YY_(Msgid) Msgid
334 # endif
335 #endif
336
337 #ifndef YY_ATTRIBUTE
338 # if (defined __GNUC__ \
339 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
340 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
341 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
342 # else
343 # define YY_ATTRIBUTE(Spec) /* empty */
344 # endif
345 #endif
346
347 #ifndef YY_ATTRIBUTE_PURE
348 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
349 #endif
350
351 #ifndef YY_ATTRIBUTE_UNUSED
352 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
353 #endif
354
355 #if !defined _Noreturn \
356 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
357 # if defined _MSC_VER && 1200 <= _MSC_VER
358 # define _Noreturn __declspec (noreturn)
359 # else
360 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
361 # endif
362 #endif
363
364 /* Suppress unused-variable warnings by "using" E. */
365 #if ! defined lint || defined __GNUC__
366 # define YYUSE(E) ((void) (E))
367 #else
368 # define YYUSE(E) /* empty */
369 #endif
370
371 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
372 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
373 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
374 _Pragma ("GCC diagnostic push") \
375 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
376 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
377 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
378 _Pragma ("GCC diagnostic pop")
379 #else
380 # define YY_INITIAL_VALUE(Value) Value
381 #endif
382 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
383 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
384 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
385 #endif
386 #ifndef YY_INITIAL_VALUE
387 # define YY_INITIAL_VALUE(Value) /* Nothing. */
388 #endif
389
390
391 #if ! defined yyoverflow || YYERROR_VERBOSE
392
393 /* The parser invokes alloca or malloc; define the necessary symbols. */
394
395 # ifdef YYSTACK_USE_ALLOCA
396 # if YYSTACK_USE_ALLOCA
397 # ifdef __GNUC__
398 # define YYSTACK_ALLOC __builtin_alloca
399 # elif defined __BUILTIN_VA_ARG_INCR
400 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
401 # elif defined _AIX
402 # define YYSTACK_ALLOC __alloca
403 # elif defined _MSC_VER
404 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
405 # define alloca _alloca
406 # else
407 # define YYSTACK_ALLOC alloca
408 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
409 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
410 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
411 # ifndef EXIT_SUCCESS
412 # define EXIT_SUCCESS 0
413 # endif
414 # endif
415 # endif
416 # endif
417 # endif
418
419 # ifdef YYSTACK_ALLOC
420 /* Pacify GCC's 'empty if-body' warning. */
421 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
422 # ifndef YYSTACK_ALLOC_MAXIMUM
423 /* The OS might guarantee only one guard page at the bottom of the stack,
424 and a page size can be as small as 4096 bytes. So we cannot safely
425 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
426 to allow for a few compiler-allocated temporary stack slots. */
427 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
428 # endif
429 # else
430 # define YYSTACK_ALLOC YYMALLOC
431 # define YYSTACK_FREE YYFREE
432 # ifndef YYSTACK_ALLOC_MAXIMUM
433 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
434 # endif
435 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
436 && ! ((defined YYMALLOC || defined malloc) \
437 && (defined YYFREE || defined free)))
438 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
439 # ifndef EXIT_SUCCESS
440 # define EXIT_SUCCESS 0
441 # endif
442 # endif
443 # ifndef YYMALLOC
444 # define YYMALLOC malloc
445 # if ! defined malloc && ! defined EXIT_SUCCESS
446 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
447 # endif
448 # endif
449 # ifndef YYFREE
450 # define YYFREE free
451 # if ! defined free && ! defined EXIT_SUCCESS
452 void free (void *); /* INFRINGES ON USER NAME SPACE */
453 # endif
454 # endif
455 # endif
456 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
457
458
459 #if (! defined yyoverflow \
460 && (! defined __cplusplus \
461 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
462
463 /* A type that is properly aligned for any stack member. */
464 union yyalloc
465 {
466 yytype_int16 yyss_alloc;
467 YYSTYPE yyvs_alloc;
468 };
469
470 /* The size of the maximum gap between one aligned stack and the next. */
471 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
472
473 /* The size of an array large to enough to hold all stacks, each with
474 N elements. */
475 # define YYSTACK_BYTES(N) \
476 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
477 + YYSTACK_GAP_MAXIMUM)
478
479 # define YYCOPY_NEEDED 1
480
481 /* Relocate STACK from its old location to the new one. The
482 local variables YYSIZE and YYSTACKSIZE give the old and new number of
483 elements in the stack, and YYPTR gives the new location of the
484 stack. Advance YYPTR to a properly aligned location for the next
485 stack. */
486 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
487 do \
488 { \
489 YYSIZE_T yynewbytes; \
490 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
491 Stack = &yyptr->Stack_alloc; \
492 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
493 yyptr += yynewbytes / sizeof (*yyptr); \
494 } \
495 while (0)
496
497 #endif
498
499 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
500 /* Copy COUNT objects from SRC to DST. The source and destination do
501 not overlap. */
502 # ifndef YYCOPY
503 # if defined __GNUC__ && 1 < __GNUC__
504 # define YYCOPY(Dst, Src, Count) \
505 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
506 # else
507 # define YYCOPY(Dst, Src, Count) \
508 do \
509 { \
510 YYSIZE_T yyi; \
511 for (yyi = 0; yyi < (Count); yyi++) \
512 (Dst)[yyi] = (Src)[yyi]; \
513 } \
514 while (0)
515 # endif
516 # endif
517 #endif /* !YYCOPY_NEEDED */
518
519 /* YYFINAL -- State number of the termination state. */
520 #define YYFINAL 9
521 /* YYLAST -- Last index in YYTABLE. */
522 #define YYLAST 565
523
524 /* YYNTOKENS -- Number of terminals. */
525 #define YYNTOKENS 46
526 /* YYNNTS -- Number of nonterminals. */
527 #define YYNNTS 51
528 /* YYNRULES -- Number of rules. */
529 #define YYNRULES 123
530 /* YYNSTATES -- Number of states. */
531 #define YYNSTATES 208
532
533 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
534 by yylex, with out-of-bounds checking. */
535 #define YYUNDEFTOK 2
536 #define YYMAXUTOK 295
537
538 #define YYTRANSLATE(YYX) \
539 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
540
541 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
542 as returned by yylex, without out-of-bounds checking. */
543 static const yytype_uint8 yytranslate[] =
544 {
545 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
546 45, 2, 2, 2, 2, 2, 2, 2, 2, 2,
547 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
548 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
549 2, 2, 2, 2, 44, 41, 2, 2, 2, 2,
550 2, 2, 2, 2, 2, 2, 2, 2, 43, 2,
551 2, 42, 2, 2, 2, 2, 2, 2, 2, 2,
552 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 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, 1, 2, 3, 4,
571 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
572 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
573 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
574 35, 36, 37, 38, 39, 40
575 };
576
577 #if YYDEBUG
578 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
579 static const yytype_uint16 yyrline[] =
580 {
581 0, 204, 204, 223, 228, 233, 284, 285, 286, 299,
582 308, 323, 324, 325, 326, 327, 333, 334, 340, 344,
583 347, 360, 364, 378, 379, 385, 389, 393, 406, 410,
584 425, 426, 432, 436, 440, 453, 457, 471, 472, 479,
585 483, 486, 499, 503, 513, 519, 527, 541, 542, 548,
586 552, 555, 568, 576, 603, 604, 610, 614, 619, 631,
587 643, 647, 653, 659, 667, 673, 680, 687, 694, 699,
588 704, 709, 710, 711, 712, 713, 723, 729, 748, 751,
589 752, 755, 764, 784, 791, 792, 793, 794, 795, 796,
590 799, 803, 806, 814, 815, 829, 831, 832, 833, 880,
591 888, 896, 903, 921, 930, 931, 934, 935, 938, 939,
592 940, 941, 944, 945, 946, 947, 948, 951, 952, 953,
593 956, 957, 960, 963
594 };
595 #endif
596
597 #if YYDEBUG || YYERROR_VERBOSE || 1
598 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
599 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
600 static const char *const yytname[] =
601 {
602 "$end", "error", "$undefined", "TOK_SEC_BANKSWITCH", "TOK_SEC_MAPPING",
603 "TOK_SEC_ECSBANK", "TOK_SEC_MEMATTR", "TOK_SEC_PRELOAD", "TOK_SEC_MACRO",
604 "TOK_SEC_VARS", "TOK_SEC_JOYSTICK", "TOK_SEC_KEYS", "TOK_SEC_CAPSLOCK",
605 "TOK_SEC_NUMLOCK", "TOK_SEC_SCROLLLOCK", "TOK_SEC_DISASM",
606 "TOK_SEC_VOICES", "TOK_SEC_UNKNOWN", "TOK_RAM", "TOK_ROM", "TOK_WOM",
607 "TOK_PAGE", "TOK_MAC_QUIET", "TOK_MAC_REG", "TOK_MAC_AHEAD",
608 "TOK_MAC_BLANK", "TOK_MAC_INSPECT", "TOK_MAC_LOAD", "TOK_MAC_RUN",
609 "TOK_MAC_POKE", "TOK_MAC_RUNTO", "TOK_MAC_TRACE", "TOK_MAC_VIEW",
610 "TOK_MAC_WATCH", "TOK_DECONLY", "TOK_DEC", "TOK_HEX", "TOK_NAME",
611 "TOK_STRING", "TOK_ERROR_BAD", "TOK_ERROR_OOM", "'-'", "'='", "':'",
612 "','", "'\\n'", "$accept", "config_file", "config", "seed_config",
613 "sec_memspan", "banksw_head", "sec_banksw", "banksw_list", "banksw_rec",
614 "mapping_head", "sec_mapping", "mapping_list", "mapping_rec",
615 "ecsbank_head", "sec_ecsbank", "ecsbank_list", "ecsbank_rec",
616 "memattr_head", "sec_memattr", "memattr_list", "memattr_rec",
617 "memattr_page", "preload_head", "sec_preload", "preload_list",
618 "preload_rec", "macro_head", "sec_macro", "macro_list", "macro_rec",
619 "macro_line", "mac_reg", "watch_list", "watch_span", "watch_addr",
620 "watch_range", "sec_varlike", "varlike_head", "var_list", "var_rec",
621 "sec_unsup", "unknown_head", "strnum", "dec_num", "hex_num", "ident",
622 "string", "memattr_tok", "eolns", "eoln", "error_tok", YY_NULLPTR
623 };
624 #endif
625
626 # ifdef YYPRINT
627 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
628 (internal) symbol number NUM (which must be that of a token). */
629 static const yytype_uint16 yytoknum[] =
630 {
631 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
632 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
633 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
634 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
635 295, 45, 61, 58, 44, 10
636 };
637 # endif
638
639 #define YYPACT_NINF -150
640
641 #define yypact_value_is_default(Yystate) \
642 (!!((Yystate) == (-150)))
643
644 #define YYTABLE_NINF -84
645
646 #define yytable_value_is_error(Yytable_value) \
647 0
648
649 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
650 STATE-NUM. */
651 static const yytype_int16 yypact[] =
652 {
653 7, -150, -150, 1, 406, -150, -36, -150, -150, -150,
654 -150, -150, -150, -150, -150, -150, -150, -150, -150, -150,
655 -150, -150, -150, -150, -150, -150, -36, -150, -36, -150,
656 -36, -150, -36, -150, -36, -150, -36, -150, -150, -36,
657 -150, -36, -150, 24, 24, 24, 24, 24, 301, 78,
658 -150, -150, -150, 348, -150, -14, -150, -36, 391, -150,
659 -10, -150, -36, 434, -150, -8, -150, -36, 477, -150,
660 -1, -150, -36, 520, -150, 15, -150, -36, 343, -150,
661 -36, -36, 2, 82, -36, 2, 2, 2, -36, 57,
662 262, -150, -150, 2, -150, -36, -150, -150, -150, -150,
663 305, -150, 22, -150, -36, -150, 2, -150, -150, 2,
664 -150, -150, 2, -150, -150, 2, -150, -150, 2, -150,
665 -150, -150, -150, -150, -36, -150, -150, -150, -150, -150,
666 20, -150, 40, -36, -36, -150, 2, -150, -36, -150,
667 -150, 124, -150, -36, 28, 30, 32, 43, -150, -150,
668 -150, 2, 2, 2, -36, -150, -150, 21, -150, -150,
669 -150, 41, -150, -150, -150, -150, -150, -150, -36, -150,
670 2, 2, -16, 2, -36, 2, 2, -150, 2, -150,
671 2, -150, -16, 44, -150, -150, -150, 2, -150, 20,
672 -150, -36, -150, -36, -36, -150, -150, -150, 2, -16,
673 -16, -150, -150, -150, -36, -150, -150, -150
674 };
675
676 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
677 Performed when YYTABLE does not specify something else to do. Zero
678 means the default is an error. */
679 static const yytype_uint8 yydefact[] =
680 {
681 0, 123, 122, 0, 2, 7, 10, 121, 8, 1,
682 16, 23, 30, 37, 47, 54, 84, 85, 86, 87,
683 88, 89, 96, 97, 98, 3, 0, 11, 0, 12,
684 0, 13, 0, 14, 0, 15, 0, 4, 5, 0,
685 6, 0, 120, 0, 0, 0, 0, 0, 0, 0,
686 95, 107, 106, 0, 19, 0, 21, 0, 0, 26,
687 0, 28, 0, 0, 33, 0, 35, 0, 0, 40,
688 0, 42, 0, 0, 50, 0, 53, 0, 0, 76,
689 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
690 0, 57, 59, 0, 61, 0, 111, 110, 109, 108,
691 0, 91, 0, 93, 0, 18, 0, 22, 25, 0,
692 29, 32, 0, 36, 39, 0, 43, 49, 0, 52,
693 58, 60, 71, 72, 0, 116, 115, 114, 112, 113,
694 0, 73, 0, 0, 0, 74, 0, 56, 0, 75,
695 90, 0, 94, 0, 0, 0, 0, 0, 68, 105,
696 104, 0, 0, 0, 0, 69, 70, 0, 78, 79,
697 80, 81, 62, 103, 102, 101, 99, 100, 0, 20,
698 0, 0, 0, 0, 0, 0, 0, 65, 0, 64,
699 0, 92, 0, 0, 117, 118, 119, 0, 41, 0,
700 44, 0, 63, 0, 0, 77, 82, 27, 0, 0,
701 0, 51, 66, 67, 0, 46, 45, 34
702 };
703
704 /* YYPGOTO[NTERM-NUM]. */
705 static const yytype_int16 yypgoto[] =
706 {
707 -150, -150, -150, -150, -150, -150, -150, -150, -11, -150,
708 -150, -150, 29, -150, -150, -150, 26, -150, -150, -150,
709 31, -149, -150, -150, -150, 23, -150, -150, -150, 8,
710 19, -150, -150, -77, -150, -150, -150, -150, -150, 3,
711 -150, -150, -150, -87, 63, 16, -150, -150, -150, 0,
712 164
713 };
714
715 /* YYDEFGOTO[NTERM-NUM]. */
716 static const yytype_int16 yydefgoto[] =
717 {
718 -1, 3, 4, 5, 25, 26, 27, 53, 54, 28,
719 29, 58, 59, 30, 31, 63, 64, 32, 33, 68,
720 69, 188, 34, 35, 73, 74, 36, 37, 90, 91,
721 92, 93, 157, 158, 159, 160, 38, 39, 100, 101,
722 40, 41, 168, 151, 55, 102, 130, 189, 6, 190,
723 95
724 };
725
726 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
727 positive, shift that token. If negative, reduce the rule whose
728 number is the opposite. If YYTABLE_NINF, syntax error. */
729 static const yytype_int16 yytable[] =
730 {
731 7, 9, 184, 185, 186, 187, 42, -9, 1, 2,
732 -9, -9, -9, -9, -9, -9, -9, -9, -9, -9,
733 -9, -9, -9, -9, -9, 1, 43, 106, 44, 2,
734 45, 109, 46, 197, 47, 112, 48, 51, 52, 49,
735 115, 50, 105, 56, 61, 66, 71, 76, 94, 103,
736 205, 206, 2, 56, 149, 150, 118, 107, 61, 51,
737 52, 152, 110, 66, 141, 178, 2, 113, 71, 2,
738 170, 171, 116, 76, 172, 51, 52, 119, 121, 1,
739 122, 123, 180, 153, 131, 173, 198, 108, 135, 111,
740 94, 96, 97, 98, 99, 139, 117, 120, 137, 114,
741 103, 195, 200, 140, 142, 136, 0, 60, 65, 70,
742 75, 0, 96, 97, 98, 99, 125, 126, 127, 128,
743 129, 60, 0, 2, 148, 0, 65, 0, 0, 0,
744 0, 70, 0, 155, 156, 0, 75, 0, 162, 0,
745 0, 0, 0, 169, 0, 124, 0, 0, 132, 133,
746 134, 0, 0, 0, 177, 0, 138, 179, 163, 164,
747 165, 166, 167, 0, 8, 0, 0, 0, 181, 143,
748 0, 0, 144, 0, 192, 145, 0, 0, 146, 0,
749 0, 147, 0, 0, 0, 0, 0, 0, 0, 0,
750 0, 201, 0, 202, 203, 154, 0, 0, 0, 161,
751 0, 0, 0, 0, 207, 0, 0, 57, 62, 67,
752 72, 77, 0, 104, 174, 175, 176, 57, 0, 0,
753 0, 0, 62, 0, 0, 0, 0, 67, 0, 0,
754 0, 0, 72, 182, 183, 0, 191, 77, 193, 194,
755 0, 161, 0, 196, 0, 0, 0, 0, 0, 0,
756 199, 0, 0, 0, 0, 0, 0, 0, 0, 0,
757 0, 204, -55, 1, 104, -55, -55, -55, -55, -55,
758 -55, -55, -55, -55, -55, -55, -55, -55, -55, -55,
759 0, 0, 0, 0, 78, 79, 80, 81, 82, 83,
760 84, 85, 86, 87, 88, 89, 0, 0, 0, 0,
761 0, 0, 1, 0, 0, -83, 1, 2, -83, -83,
762 -83, -83, -83, -83, -83, -83, -83, -83, -83, -83,
763 -83, -83, -83, 78, 79, 80, 81, 82, 83, 84,
764 85, 86, 87, 88, 89, 0, 0, 0, 0, 96,
765 97, 98, 99, 0, 1, 0, 2, 0, -17, 1,
766 2, -17, -17, -17, -17, -17, -17, -17, -17, -17,
767 -17, -17, -17, -17, -17, -17, 79, 80, 81, 82,
768 83, 84, 85, 86, 87, 88, 89, 0, 0, 0,
769 0, 0, 0, 51, 52, 0, 0, 0, 2, 0,
770 0, -24, 1, 2, -24, -24, -24, -24, -24, -24,
771 -24, -24, -24, -24, -24, -24, -24, -24, -24, 10,
772 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
773 21, 22, 23, 24, 0, 0, 51, 52, 0, 0,
774 0, 0, 0, 0, -31, 1, 2, -31, -31, -31,
775 -31, -31, -31, -31, -31, -31, -31, -31, -31, -31,
776 -31, -31, 0, 0, 0, 0, 0, 0, 0, 0,
777 0, 0, 0, 0, 0, 0, 0, 0, 0, 51,
778 52, 0, 0, 0, 0, 0, 0, -38, 1, 2,
779 -38, -38, -38, -38, -38, -38, -38, -38, -38, -38,
780 -38, -38, -38, -38, -38, 0, 0, 0, 0, 0,
781 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
782 0, 0, 51, 52, 0, 0, 0, 0, 0, 0,
783 -48, 1, 2, -48, -48, -48, -48, -48, -48, -48,
784 -48, -48, -48, -48, -48, -48, -48, -48, 0, 0,
785 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
786 0, 0, 0, 0, 0, 51, 52, 0, 0, 0,
787 0, 0, 0, 0, 0, 2
788 };
789
790 static const yytype_int16 yycheck[] =
791 {
792 0, 0, 18, 19, 20, 21, 6, 0, 1, 45,
793 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
794 13, 14, 15, 16, 17, 1, 26, 41, 28, 45,
795 30, 41, 32, 182, 34, 43, 36, 35, 36, 39,
796 41, 41, 53, 43, 44, 45, 46, 47, 48, 49,
797 199, 200, 45, 53, 34, 35, 41, 57, 58, 35,
798 36, 21, 62, 63, 42, 44, 45, 67, 68, 45,
799 42, 41, 72, 73, 42, 35, 36, 77, 78, 1,
800 80, 81, 41, 43, 84, 42, 42, 58, 88, 63,
801 90, 34, 35, 36, 37, 95, 73, 78, 90, 68,
802 100, 178, 189, 100, 104, 89, -1, 44, 45, 46,
803 47, -1, 34, 35, 36, 37, 34, 35, 36, 37,
804 38, 58, -1, 45, 124, -1, 63, -1, -1, -1,
805 -1, 68, -1, 133, 134, -1, 73, -1, 138, -1,
806 -1, -1, -1, 143, -1, 82, -1, -1, 85, 86,
807 87, -1, -1, -1, 154, -1, 93, 157, 34, 35,
808 36, 37, 38, -1, 0, -1, -1, -1, 168, 106,
809 -1, -1, 109, -1, 174, 112, -1, -1, 115, -1,
810 -1, 118, -1, -1, -1, -1, -1, -1, -1, -1,
811 -1, 191, -1, 193, 194, 132, -1, -1, -1, 136,
812 -1, -1, -1, -1, 204, -1, -1, 43, 44, 45,
813 46, 47, -1, 49, 151, 152, 153, 53, -1, -1,
814 -1, -1, 58, -1, -1, -1, -1, 63, -1, -1,
815 -1, -1, 68, 170, 171, -1, 173, 73, 175, 176,
816 -1, 178, -1, 180, -1, -1, -1, -1, -1, -1,
817 187, -1, -1, -1, -1, -1, -1, -1, -1, -1,
818 -1, 198, 0, 1, 100, 3, 4, 5, 6, 7,
819 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
820 -1, -1, -1, -1, 22, 23, 24, 25, 26, 27,
821 28, 29, 30, 31, 32, 33, -1, -1, -1, -1,
822 -1, -1, 1, -1, -1, 0, 1, 45, 3, 4,
823 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
824 15, 16, 17, 22, 23, 24, 25, 26, 27, 28,
825 29, 30, 31, 32, 33, -1, -1, -1, -1, 34,
826 35, 36, 37, -1, 1, -1, 45, -1, 0, 1,
827 45, 3, 4, 5, 6, 7, 8, 9, 10, 11,
828 12, 13, 14, 15, 16, 17, 23, 24, 25, 26,
829 27, 28, 29, 30, 31, 32, 33, -1, -1, -1,
830 -1, -1, -1, 35, 36, -1, -1, -1, 45, -1,
831 -1, 0, 1, 45, 3, 4, 5, 6, 7, 8,
832 9, 10, 11, 12, 13, 14, 15, 16, 17, 3,
833 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
834 14, 15, 16, 17, -1, -1, 35, 36, -1, -1,
835 -1, -1, -1, -1, 0, 1, 45, 3, 4, 5,
836 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
837 16, 17, -1, -1, -1, -1, -1, -1, -1, -1,
838 -1, -1, -1, -1, -1, -1, -1, -1, -1, 35,
839 36, -1, -1, -1, -1, -1, -1, 0, 1, 45,
840 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
841 13, 14, 15, 16, 17, -1, -1, -1, -1, -1,
842 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
843 -1, -1, 35, 36, -1, -1, -1, -1, -1, -1,
844 0, 1, 45, 3, 4, 5, 6, 7, 8, 9,
845 10, 11, 12, 13, 14, 15, 16, 17, -1, -1,
846 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
847 -1, -1, -1, -1, -1, 35, 36, -1, -1, -1,
848 -1, -1, -1, -1, -1, 45
849 };
850
851 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
852 symbol of state STATE-NUM. */
853 static const yytype_uint8 yystos[] =
854 {
855 0, 1, 45, 47, 48, 49, 94, 95, 96, 0,
856 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
857 13, 14, 15, 16, 17, 50, 51, 52, 55, 56,
858 59, 60, 63, 64, 68, 69, 72, 73, 82, 83,
859 86, 87, 95, 95, 95, 95, 95, 95, 95, 95,
860 95, 35, 36, 53, 54, 90, 95, 96, 57, 58,
861 90, 95, 96, 61, 62, 90, 95, 96, 65, 66,
862 90, 95, 96, 70, 71, 90, 95, 96, 22, 23,
863 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
864 74, 75, 76, 77, 95, 96, 34, 35, 36, 37,
865 84, 85, 91, 95, 96, 54, 41, 95, 58, 41,
866 95, 62, 43, 95, 66, 41, 95, 71, 41, 95,
867 76, 95, 95, 95, 90, 34, 35, 36, 37, 38,
868 92, 95, 90, 90, 90, 95, 91, 75, 90, 95,
869 85, 42, 95, 90, 90, 90, 90, 90, 95, 34,
870 35, 89, 21, 43, 90, 95, 95, 78, 79, 80,
871 81, 90, 95, 34, 35, 36, 37, 38, 88, 95,
872 42, 41, 42, 42, 90, 90, 90, 95, 44, 95,
873 41, 95, 90, 90, 18, 19, 20, 21, 67, 93,
874 95, 90, 95, 90, 90, 79, 90, 67, 42, 90,
875 89, 95, 95, 95, 90, 67, 67, 95
876 };
877
878 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
879 static const yytype_uint8 yyr1[] =
880 {
881 0, 46, 47, 48, 48, 48, 48, 48, 48, 49,
882 49, 50, 50, 50, 50, 50, 51, 52, 53, 53,
883 54, 54, 54, 55, 56, 57, 57, 58, 58, 58,
884 59, 60, 61, 61, 62, 62, 62, 63, 64, 65,
885 65, 66, 66, 66, 67, 67, 67, 68, 69, 70,
886 70, 71, 71, 71, 72, 73, 74, 74, 75, 75,
887 75, 75, 76, 76, 76, 76, 76, 76, 76, 76,
888 76, 76, 76, 76, 76, 76, 77, 78, 78, 79,
889 79, 80, 81, 82, 83, 83, 83, 83, 83, 83,
890 84, 84, 85, 85, 85, 86, 87, 87, 87, 88,
891 88, 88, 88, 88, 89, 89, 90, 90, 91, 91,
892 91, 91, 92, 92, 92, 92, 92, 93, 93, 93,
893 94, 94, 95, 96
894 };
895
896 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
897 static const yytype_uint8 yyr2[] =
898 {
899 0, 2, 1, 2, 2, 2, 2, 1, 1, 0,
900 1, 1, 1, 1, 1, 1, 1, 3, 2, 1,
901 4, 1, 2, 1, 3, 2, 1, 6, 1, 2,
902 1, 3, 2, 1, 8, 1, 2, 1, 3, 2,
903 1, 5, 1, 2, 1, 3, 3, 1, 3, 2,
904 1, 6, 2, 1, 1, 3, 2, 1, 2, 1,
905 2, 1, 3, 5, 4, 4, 6, 6, 3, 3,
906 3, 2, 2, 2, 2, 2, 1, 3, 1, 1,
907 1, 1, 3, 3, 1, 1, 1, 1, 1, 1,
908 2, 1, 4, 1, 2, 2, 1, 1, 1, 1,
909 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
910 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
911 2, 1, 1, 1
912 };
913
914
915 #define yyerrok (yyerrstatus = 0)
916 #define yyclearin (yychar = YYEMPTY)
917 #define YYEMPTY (-2)
918 #define YYEOF 0
919
920 #define YYACCEPT goto yyacceptlab
921 #define YYABORT goto yyabortlab
922 #define YYERROR goto yyerrorlab
923
924
925 #define YYRECOVERING() (!!yyerrstatus)
926
927 #define YYBACKUP(Token, Value) \
928 do \
929 if (yychar == YYEMPTY) \
930 { \
931 yychar = (Token); \
932 yylval = (Value); \
933 YYPOPSTACK (yylen); \
934 yystate = *yyssp; \
935 goto yybackup; \
936 } \
937 else \
938 { \
939 yyerror (YY_("syntax error: cannot back up")); \
940 YYERROR; \
941 } \
942 while (0)
943
944 /* Error token number */
945 #define YYTERROR 1
946 #define YYERRCODE 256
947
948
949
950 /* Enable debugging if requested. */
951 #if YYDEBUG
952
953 # ifndef YYFPRINTF
954 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
955 # define YYFPRINTF fprintf
956 # endif
957
958 # define YYDPRINTF(Args) \
959 do { \
960 if (yydebug) \
961 YYFPRINTF Args; \
962 } while (0)
963
964 /* This macro is provided for backward compatibility. */
965 #ifndef YY_LOCATION_PRINT
966 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
967 #endif
968
969
970 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
971 do { \
972 if (yydebug) \
973 { \
974 YYFPRINTF (stderr, "%s ", Title); \
975 yy_symbol_print (stderr, \
976 Type, Value); \
977 YYFPRINTF (stderr, "\n"); \
978 } \
979 } while (0)
980
981
982 /*----------------------------------------.
983 | Print this symbol's value on YYOUTPUT. |
984 `----------------------------------------*/
985
986 static void
yy_symbol_value_print(FILE * yyoutput,int yytype,YYSTYPE const * const yyvaluep)987 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
988 {
989 FILE *yyo = yyoutput;
990 YYUSE (yyo);
991 if (!yyvaluep)
992 return;
993 # ifdef YYPRINT
994 if (yytype < YYNTOKENS)
995 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
996 # endif
997 YYUSE (yytype);
998 }
999
1000
1001 /*--------------------------------.
1002 | Print this symbol on YYOUTPUT. |
1003 `--------------------------------*/
1004
1005 static void
yy_symbol_print(FILE * yyoutput,int yytype,YYSTYPE const * const yyvaluep)1006 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1007 {
1008 YYFPRINTF (yyoutput, "%s %s (",
1009 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
1010
1011 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1012 YYFPRINTF (yyoutput, ")");
1013 }
1014
1015 /*------------------------------------------------------------------.
1016 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1017 | TOP (included). |
1018 `------------------------------------------------------------------*/
1019
1020 static void
yy_stack_print(yytype_int16 * yybottom,yytype_int16 * yytop)1021 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1022 {
1023 YYFPRINTF (stderr, "Stack now");
1024 for (; yybottom <= yytop; yybottom++)
1025 {
1026 int yybot = *yybottom;
1027 YYFPRINTF (stderr, " %d", yybot);
1028 }
1029 YYFPRINTF (stderr, "\n");
1030 }
1031
1032 # define YY_STACK_PRINT(Bottom, Top) \
1033 do { \
1034 if (yydebug) \
1035 yy_stack_print ((Bottom), (Top)); \
1036 } while (0)
1037
1038
1039 /*------------------------------------------------.
1040 | Report that the YYRULE is going to be reduced. |
1041 `------------------------------------------------*/
1042
1043 static void
yy_reduce_print(yytype_int16 * yyssp,YYSTYPE * yyvsp,int yyrule)1044 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
1045 {
1046 unsigned long int yylno = yyrline[yyrule];
1047 int yynrhs = yyr2[yyrule];
1048 int yyi;
1049 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1050 yyrule - 1, yylno);
1051 /* The symbols being reduced. */
1052 for (yyi = 0; yyi < yynrhs; yyi++)
1053 {
1054 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1055 yy_symbol_print (stderr,
1056 yystos[yyssp[yyi + 1 - yynrhs]],
1057 &(yyvsp[(yyi + 1) - (yynrhs)])
1058 );
1059 YYFPRINTF (stderr, "\n");
1060 }
1061 }
1062
1063 # define YY_REDUCE_PRINT(Rule) \
1064 do { \
1065 if (yydebug) \
1066 yy_reduce_print (yyssp, yyvsp, Rule); \
1067 } while (0)
1068
1069 /* Nonzero means print parse trace. It is left uninitialized so that
1070 multiple parsers can coexist. */
1071 int yydebug;
1072 #else /* !YYDEBUG */
1073 # define YYDPRINTF(Args)
1074 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1075 # define YY_STACK_PRINT(Bottom, Top)
1076 # define YY_REDUCE_PRINT(Rule)
1077 #endif /* !YYDEBUG */
1078
1079
1080 /* YYINITDEPTH -- initial size of the parser's stacks. */
1081 #ifndef YYINITDEPTH
1082 # define YYINITDEPTH 200
1083 #endif
1084
1085 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1086 if the built-in stack extension method is used).
1087
1088 Do not make this value too large; the results are undefined if
1089 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1090 evaluated with infinite-precision integer arithmetic. */
1091
1092 #ifndef YYMAXDEPTH
1093 # define YYMAXDEPTH 10000
1094 #endif
1095
1096
1097 #if YYERROR_VERBOSE
1098
1099 # ifndef yystrlen
1100 # if defined __GLIBC__ && defined _STRING_H
1101 # define yystrlen strlen
1102 # else
1103 /* Return the length of YYSTR. */
1104 static YYSIZE_T
yystrlen(const char * yystr)1105 yystrlen (const char *yystr)
1106 {
1107 YYSIZE_T yylen;
1108 for (yylen = 0; yystr[yylen]; yylen++)
1109 continue;
1110 return yylen;
1111 }
1112 # endif
1113 # endif
1114
1115 # ifndef yystpcpy
1116 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1117 # define yystpcpy stpcpy
1118 # else
1119 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1120 YYDEST. */
1121 static char *
yystpcpy(char * yydest,const char * yysrc)1122 yystpcpy (char *yydest, const char *yysrc)
1123 {
1124 char *yyd = yydest;
1125 const char *yys = yysrc;
1126
1127 while ((*yyd++ = *yys++) != '\0')
1128 continue;
1129
1130 return yyd - 1;
1131 }
1132 # endif
1133 # endif
1134
1135 # ifndef yytnamerr
1136 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1137 quotes and backslashes, so that it's suitable for yyerror. The
1138 heuristic is that double-quoting is unnecessary unless the string
1139 contains an apostrophe, a comma, or backslash (other than
1140 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1141 null, do not copy; instead, return the length of what the result
1142 would have been. */
1143 static YYSIZE_T
yytnamerr(char * yyres,const char * yystr)1144 yytnamerr (char *yyres, const char *yystr)
1145 {
1146 if (*yystr == '"')
1147 {
1148 YYSIZE_T yyn = 0;
1149 char const *yyp = yystr;
1150
1151 for (;;)
1152 switch (*++yyp)
1153 {
1154 case '\'':
1155 case ',':
1156 goto do_not_strip_quotes;
1157
1158 case '\\':
1159 if (*++yyp != '\\')
1160 goto do_not_strip_quotes;
1161 /* Fall through. */
1162 default:
1163 if (yyres)
1164 yyres[yyn] = *yyp;
1165 yyn++;
1166 break;
1167
1168 case '"':
1169 if (yyres)
1170 yyres[yyn] = '\0';
1171 return yyn;
1172 }
1173 do_not_strip_quotes: ;
1174 }
1175
1176 if (! yyres)
1177 return yystrlen (yystr);
1178
1179 return yystpcpy (yyres, yystr) - yyres;
1180 }
1181 # endif
1182
1183 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1184 about the unexpected token YYTOKEN for the state stack whose top is
1185 YYSSP.
1186
1187 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1188 not large enough to hold the message. In that case, also set
1189 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1190 required number of bytes is too large to store. */
1191 static int
yysyntax_error(YYSIZE_T * yymsg_alloc,char ** yymsg,yytype_int16 * yyssp,int yytoken)1192 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1193 yytype_int16 *yyssp, int yytoken)
1194 {
1195 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1196 YYSIZE_T yysize = yysize0;
1197 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1198 /* Internationalized format string. */
1199 const char *yyformat = YY_NULLPTR;
1200 /* Arguments of yyformat. */
1201 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1202 /* Number of reported tokens (one for the "unexpected", one per
1203 "expected"). */
1204 int yycount = 0;
1205
1206 /* There are many possibilities here to consider:
1207 - If this state is a consistent state with a default action, then
1208 the only way this function was invoked is if the default action
1209 is an error action. In that case, don't check for expected
1210 tokens because there are none.
1211 - The only way there can be no lookahead present (in yychar) is if
1212 this state is a consistent state with a default action. Thus,
1213 detecting the absence of a lookahead is sufficient to determine
1214 that there is no unexpected or expected token to report. In that
1215 case, just report a simple "syntax error".
1216 - Don't assume there isn't a lookahead just because this state is a
1217 consistent state with a default action. There might have been a
1218 previous inconsistent state, consistent state with a non-default
1219 action, or user semantic action that manipulated yychar.
1220 - Of course, the expected token list depends on states to have
1221 correct lookahead information, and it depends on the parser not
1222 to perform extra reductions after fetching a lookahead from the
1223 scanner and before detecting a syntax error. Thus, state merging
1224 (from LALR or IELR) and default reductions corrupt the expected
1225 token list. However, the list is correct for canonical LR with
1226 one exception: it will still contain any token that will not be
1227 accepted due to an error action in a later state.
1228 */
1229 if (yytoken != YYEMPTY)
1230 {
1231 int yyn = yypact[*yyssp];
1232 yyarg[yycount++] = yytname[yytoken];
1233 if (!yypact_value_is_default (yyn))
1234 {
1235 /* Start YYX at -YYN if negative to avoid negative indexes in
1236 YYCHECK. In other words, skip the first -YYN actions for
1237 this state because they are default actions. */
1238 int yyxbegin = yyn < 0 ? -yyn : 0;
1239 /* Stay within bounds of both yycheck and yytname. */
1240 int yychecklim = YYLAST - yyn + 1;
1241 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1242 int yyx;
1243
1244 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1245 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1246 && !yytable_value_is_error (yytable[yyx + yyn]))
1247 {
1248 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1249 {
1250 yycount = 1;
1251 yysize = yysize0;
1252 break;
1253 }
1254 yyarg[yycount++] = yytname[yyx];
1255 {
1256 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1257 if (! (yysize <= yysize1
1258 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1259 return 2;
1260 yysize = yysize1;
1261 }
1262 }
1263 }
1264 }
1265
1266 switch (yycount)
1267 {
1268 # define YYCASE_(N, S) \
1269 case N: \
1270 yyformat = S; \
1271 break
1272 YYCASE_(0, YY_("syntax error"));
1273 YYCASE_(1, YY_("syntax error, unexpected %s"));
1274 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1275 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1276 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1277 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1278 # undef YYCASE_
1279 }
1280
1281 {
1282 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1283 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1284 return 2;
1285 yysize = yysize1;
1286 }
1287
1288 if (*yymsg_alloc < yysize)
1289 {
1290 *yymsg_alloc = 2 * yysize;
1291 if (! (yysize <= *yymsg_alloc
1292 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1293 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1294 return 1;
1295 }
1296
1297 /* Avoid sprintf, as that infringes on the user's name space.
1298 Don't have undefined behavior even if the translation
1299 produced a string with the wrong number of "%s"s. */
1300 {
1301 char *yyp = *yymsg;
1302 int yyi = 0;
1303 while ((*yyp = *yyformat) != '\0')
1304 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1305 {
1306 yyp += yytnamerr (yyp, yyarg[yyi++]);
1307 yyformat += 2;
1308 }
1309 else
1310 {
1311 yyp++;
1312 yyformat++;
1313 }
1314 }
1315 return 0;
1316 }
1317 #endif /* YYERROR_VERBOSE */
1318
1319 /*-----------------------------------------------.
1320 | Release the memory associated to this symbol. |
1321 `-----------------------------------------------*/
1322
1323 static void
yydestruct(const char * yymsg,int yytype,YYSTYPE * yyvaluep)1324 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1325 {
1326 YYUSE (yyvaluep);
1327 if (!yymsg)
1328 yymsg = "Deleting";
1329 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1330
1331 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1332 YYUSE (yytype);
1333 YY_IGNORE_MAYBE_UNINITIALIZED_END
1334 }
1335
1336
1337
1338
1339 /* The lookahead symbol. */
1340 int yychar;
1341
1342 /* The semantic value of the lookahead symbol. */
1343 YYSTYPE yylval;
1344 /* Number of syntax errors so far. */
1345 int yynerrs;
1346
1347
1348 /*----------.
1349 | yyparse. |
1350 `----------*/
1351
1352 int
yyparse(void)1353 yyparse (void)
1354 {
1355 int yystate;
1356 /* Number of tokens to shift before error messages enabled. */
1357 int yyerrstatus;
1358
1359 /* The stacks and their tools:
1360 'yyss': related to states.
1361 'yyvs': related to semantic values.
1362
1363 Refer to the stacks through separate pointers, to allow yyoverflow
1364 to reallocate them elsewhere. */
1365
1366 /* The state stack. */
1367 yytype_int16 yyssa[YYINITDEPTH];
1368 yytype_int16 *yyss;
1369 yytype_int16 *yyssp;
1370
1371 /* The semantic value stack. */
1372 YYSTYPE yyvsa[YYINITDEPTH];
1373 YYSTYPE *yyvs;
1374 YYSTYPE *yyvsp;
1375
1376 YYSIZE_T yystacksize;
1377
1378 int yyn;
1379 int yyresult;
1380 /* Lookahead token as an internal (translated) token number. */
1381 int yytoken = 0;
1382 /* The variables used to return semantic value and location from the
1383 action routines. */
1384 YYSTYPE yyval;
1385
1386 #if YYERROR_VERBOSE
1387 /* Buffer for error messages, and its allocated size. */
1388 char yymsgbuf[128];
1389 char *yymsg = yymsgbuf;
1390 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1391 #endif
1392
1393 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1394
1395 /* The number of symbols on the RHS of the reduced rule.
1396 Keep to zero when no symbol should be popped. */
1397 int yylen = 0;
1398
1399 yyssp = yyss = yyssa;
1400 yyvsp = yyvs = yyvsa;
1401 yystacksize = YYINITDEPTH;
1402
1403 YYDPRINTF ((stderr, "Starting parse\n"));
1404
1405 yystate = 0;
1406 yyerrstatus = 0;
1407 yynerrs = 0;
1408 yychar = YYEMPTY; /* Cause a token to be read. */
1409 goto yysetstate;
1410
1411 /*------------------------------------------------------------.
1412 | yynewstate -- Push a new state, which is found in yystate. |
1413 `------------------------------------------------------------*/
1414 yynewstate:
1415 /* In all cases, when you get here, the value and location stacks
1416 have just been pushed. So pushing a state here evens the stacks. */
1417 yyssp++;
1418
1419 yysetstate:
1420 *yyssp = yystate;
1421
1422 if (yyss + yystacksize - 1 <= yyssp)
1423 {
1424 /* Get the current used size of the three stacks, in elements. */
1425 YYSIZE_T yysize = yyssp - yyss + 1;
1426
1427 #ifdef yyoverflow
1428 {
1429 /* Give user a chance to reallocate the stack. Use copies of
1430 these so that the &'s don't force the real ones into
1431 memory. */
1432 YYSTYPE *yyvs1 = yyvs;
1433 yytype_int16 *yyss1 = yyss;
1434
1435 /* Each stack pointer address is followed by the size of the
1436 data in use in that stack, in bytes. This used to be a
1437 conditional around just the two extra args, but that might
1438 be undefined if yyoverflow is a macro. */
1439 yyoverflow (YY_("memory exhausted"),
1440 &yyss1, yysize * sizeof (*yyssp),
1441 &yyvs1, yysize * sizeof (*yyvsp),
1442 &yystacksize);
1443
1444 yyss = yyss1;
1445 yyvs = yyvs1;
1446 }
1447 #else /* no yyoverflow */
1448 # ifndef YYSTACK_RELOCATE
1449 goto yyexhaustedlab;
1450 # else
1451 /* Extend the stack our own way. */
1452 if (YYMAXDEPTH <= yystacksize)
1453 goto yyexhaustedlab;
1454 yystacksize *= 2;
1455 if (YYMAXDEPTH < yystacksize)
1456 yystacksize = YYMAXDEPTH;
1457
1458 {
1459 yytype_int16 *yyss1 = yyss;
1460 union yyalloc *yyptr =
1461 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1462 if (! yyptr)
1463 goto yyexhaustedlab;
1464 YYSTACK_RELOCATE (yyss_alloc, yyss);
1465 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1466 # undef YYSTACK_RELOCATE
1467 if (yyss1 != yyssa)
1468 YYSTACK_FREE (yyss1);
1469 }
1470 # endif
1471 #endif /* no yyoverflow */
1472
1473 yyssp = yyss + yysize - 1;
1474 yyvsp = yyvs + yysize - 1;
1475
1476 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1477 (unsigned long int) yystacksize));
1478
1479 if (yyss + yystacksize - 1 <= yyssp)
1480 YYABORT;
1481 }
1482
1483 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1484
1485 if (yystate == YYFINAL)
1486 YYACCEPT;
1487
1488 goto yybackup;
1489
1490 /*-----------.
1491 | yybackup. |
1492 `-----------*/
1493 yybackup:
1494
1495 /* Do appropriate processing given the current state. Read a
1496 lookahead token if we need one and don't already have one. */
1497
1498 /* First try to decide what to do without reference to lookahead token. */
1499 yyn = yypact[yystate];
1500 if (yypact_value_is_default (yyn))
1501 goto yydefault;
1502
1503 /* Not known => get a lookahead token if don't already have one. */
1504
1505 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1506 if (yychar == YYEMPTY)
1507 {
1508 YYDPRINTF ((stderr, "Reading a token: "));
1509 yychar = yylex ();
1510 }
1511
1512 if (yychar <= YYEOF)
1513 {
1514 yychar = yytoken = YYEOF;
1515 YYDPRINTF ((stderr, "Now at end of input.\n"));
1516 }
1517 else
1518 {
1519 yytoken = YYTRANSLATE (yychar);
1520 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1521 }
1522
1523 /* If the proper action on seeing token YYTOKEN is to reduce or to
1524 detect an error, take that action. */
1525 yyn += yytoken;
1526 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1527 goto yydefault;
1528 yyn = yytable[yyn];
1529 if (yyn <= 0)
1530 {
1531 if (yytable_value_is_error (yyn))
1532 goto yyerrlab;
1533 yyn = -yyn;
1534 goto yyreduce;
1535 }
1536
1537 /* Count tokens shifted since error; after three, turn off error
1538 status. */
1539 if (yyerrstatus)
1540 yyerrstatus--;
1541
1542 /* Shift the lookahead token. */
1543 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1544
1545 /* Discard the shifted token. */
1546 yychar = YYEMPTY;
1547
1548 yystate = yyn;
1549 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1550 *++yyvsp = yylval;
1551 YY_IGNORE_MAYBE_UNINITIALIZED_END
1552
1553 goto yynewstate;
1554
1555
1556 /*-----------------------------------------------------------.
1557 | yydefault -- do the default action for the current state. |
1558 `-----------------------------------------------------------*/
1559 yydefault:
1560 yyn = yydefact[yystate];
1561 if (yyn == 0)
1562 goto yyerrlab;
1563 goto yyreduce;
1564
1565
1566 /*-----------------------------.
1567 | yyreduce -- Do a reduction. |
1568 `-----------------------------*/
1569 yyreduce:
1570 /* yyn is the number of a rule to reduce with. */
1571 yylen = yyr2[yyn];
1572
1573 /* If YYLEN is nonzero, implement the default value of the action:
1574 '$$ = $1'.
1575
1576 Otherwise, the following line sets YYVAL to garbage.
1577 This behavior is undocumented and Bison
1578 users should not rely upon it. Assigning to YYVAL
1579 unconditionally makes the parser a bit smaller, and it avoids a
1580 GCC warning that YYVAL may be used uninitialized. */
1581 yyval = yyvsp[1-yylen];
1582
1583
1584 YY_REDUCE_PRINT (yyn);
1585 switch (yyn)
1586 {
1587 case 2:
1588 #line 205 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1589 {
1590 /* Before the chicken or egg came the rooster */
1591 if (!bc_parsed_cfg)
1592 {
1593 bc_parsed_cfg = CALLOC(bc_cfgfile_t, 1);
1594 BC_CHKOOM(bc_parsed_cfg);
1595 bc_cursect = NULL;
1596 }
1597
1598 bc_parsed_cfg->diags = bc_diag_list;
1599 bc_diag_list = NULL;
1600 }
1601 #line 1602 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1602 break;
1603
1604 case 3:
1605 #line 224 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1606 {
1607 if ((yyvsp[0].memspan_list))
1608 LL_CONCAT(bc_parsed_cfg->span, (yyvsp[0].memspan_list), bc_memspan_t);
1609 }
1610 #line 1611 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1611 break;
1612
1613 case 4:
1614 #line 229 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1615 {
1616 if ((yyvsp[0].macro_list))
1617 LL_CONCAT(bc_parsed_cfg->macro, (yyvsp[0].macro_list), bc_macro_t);
1618 }
1619 #line 1620 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1620 break;
1621
1622 case 5:
1623 #line 234 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1624 {
1625 if ((yyvsp[0].varlike).vars) switch ((yyvsp[0].varlike).type)
1626 {
1627 case BC_VL_VARS:
1628 {
1629 LL_CONCAT(bc_parsed_cfg->vars, (yyvsp[0].varlike).vars, cfg_var_t);
1630 break;
1631 }
1632
1633 case BC_VL_JOYSTICK:
1634 {
1635 LL_CONCAT(bc_parsed_cfg->joystick, (yyvsp[0].varlike).vars, cfg_var_t);
1636 break;
1637 }
1638
1639 case BC_VL_KEYS:
1640 {
1641 LL_CONCAT(bc_parsed_cfg->keys[0], (yyvsp[0].varlike).vars, cfg_var_t);
1642 break;
1643 }
1644
1645 case BC_VL_CAPSLOCK:
1646 {
1647 LL_CONCAT(bc_parsed_cfg->keys[1], (yyvsp[0].varlike).vars, cfg_var_t);
1648 break;
1649 }
1650
1651 case BC_VL_NUMLOCK:
1652 {
1653 LL_CONCAT(bc_parsed_cfg->keys[2], (yyvsp[0].varlike).vars, cfg_var_t);
1654 break;
1655 }
1656
1657 case BC_VL_SCROLLLOCK:
1658 {
1659 LL_CONCAT(bc_parsed_cfg->keys[3], (yyvsp[0].varlike).vars, cfg_var_t);
1660 break;
1661 }
1662
1663 default:
1664 {
1665 /* report the error? */
1666 BC_DIAG(BC_DIAG_ERROR,
1667 bc_cursect ? bc_cursect : "<toplevel>",
1668 bc_line_no,
1669 "Internal error processing variable lists");
1670 break;
1671 }
1672 }
1673 }
1674 #line 1675 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1675 break;
1676
1677 case 8:
1678 #line 287 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1679 {
1680 snprintf(bc_errbuf, sizeof(bc_errbuf),
1681 "Unexpected token/state '%s'", BC_TOK);
1682 BC_DIAG(BC_DIAG_ERROR, BC_SEC,
1683 bc_saved_lineno, bc_errbuf);
1684 }
1685 #line 1686 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1686 break;
1687
1688 case 9:
1689 #line 299 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1690 {
1691 /* Before the chicken or egg came the rooster */
1692 if (!bc_parsed_cfg)
1693 {
1694 bc_parsed_cfg = CALLOC(bc_cfgfile_t, 1);
1695 BC_CHKOOM(bc_parsed_cfg);
1696 bc_cursect = NULL;
1697 }
1698 }
1699 #line 1700 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1700 break;
1701
1702 case 10:
1703 #line 309 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1704 {
1705 if (!bc_parsed_cfg)
1706 {
1707 bc_parsed_cfg = CALLOC(bc_cfgfile_t, 1);
1708 BC_CHKOOM(bc_parsed_cfg);
1709 bc_cursect = NULL;
1710 }
1711 }
1712 #line 1713 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1713 break;
1714
1715 case 16:
1716 #line 333 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1717 { S("[bankswitch]"); }
1718 #line 1719 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1719 break;
1720
1721 case 17:
1722 #line 335 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1723 {
1724 (yyval.memspan_list) = LL_REVERSE((yyvsp[0].memspan_list), bc_memspan_t);
1725 }
1726 #line 1727 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1727 break;
1728
1729 case 18:
1730 #line 341 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1731 {
1732 (yyval.memspan_list) = LL_INSERT((yyvsp[-1].memspan_list), (yyvsp[0].memspan_list), bc_memspan_t);
1733 }
1734 #line 1735 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1735 break;
1736
1737 case 19:
1738 #line 344 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1739 { (yyval.memspan_list) = (yyvsp[0].memspan_list); }
1740 #line 1741 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1741 break;
1742
1743 case 20:
1744 #line 348 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1745 {
1746 (yyval.memspan_list) = CALLOC(bc_memspan_t, 1);
1747 BC_CHKOOM((yyval.memspan_list));
1748 (yyval.memspan_list)->s_fofs = 0;
1749 (yyval.memspan_list)->e_fofs = 0;
1750 (yyval.memspan_list)->s_addr = (yyvsp[-3].intv);
1751 (yyval.memspan_list)->e_addr = (yyvsp[-1].intv);
1752 (yyval.memspan_list)->flags = BC_SPAN_B | BC_SPAN_R;
1753 (yyval.memspan_list)->width = 16;
1754 (yyval.memspan_list)->epage = BC_SPAN_NOPAGE;
1755 (yyval.memspan_list)->f_name = NULL;
1756 }
1757 #line 1758 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1758 break;
1759
1760 case 21:
1761 #line 361 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1762 {
1763 (yyval.memspan_list) = NULL;
1764 }
1765 #line 1766 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1766 break;
1767
1768 case 22:
1769 #line 365 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1770 {
1771 (yyval.memspan_list) = NULL;
1772 snprintf(bc_errbuf, sizeof(bc_errbuf),
1773 "Unexpected token/state '%s'", BC_TOK);
1774 BC_DIAG(BC_DIAG_ERROR, "[bankswitch]",
1775 bc_saved_lineno, bc_errbuf);
1776 }
1777 #line 1778 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1778 break;
1779
1780 case 23:
1781 #line 378 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1782 { S("[mapping]"); }
1783 #line 1784 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1784 break;
1785
1786 case 24:
1787 #line 380 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1788 {
1789 (yyval.memspan_list) = LL_REVERSE((yyvsp[0].memspan_list), bc_memspan_t);
1790 }
1791 #line 1792 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1792 break;
1793
1794 case 25:
1795 #line 386 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1796 {
1797 (yyval.memspan_list) = LL_INSERT((yyvsp[-1].memspan_list), (yyvsp[0].memspan_list), bc_memspan_t);
1798 }
1799 #line 1800 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1800 break;
1801
1802 case 26:
1803 #line 389 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1804 { (yyval.memspan_list) = (yyvsp[0].memspan_list); }
1805 #line 1806 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1806 break;
1807
1808 case 27:
1809 #line 394 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1810 {
1811 (yyval.memspan_list) = CALLOC(bc_memspan_t, 1);
1812 BC_CHKOOM((yyval.memspan_list));
1813 (yyval.memspan_list)->s_fofs = (yyvsp[-5].intv);
1814 (yyval.memspan_list)->e_fofs = (yyvsp[-3].intv);
1815 (yyval.memspan_list)->s_addr = (yyvsp[-1].intv);
1816 (yyval.memspan_list)->e_addr = (yyvsp[-1].intv) + (yyvsp[-3].intv) - (yyvsp[-5].intv);
1817 (yyval.memspan_list)->flags = (yyvsp[0].memattr_page).flags | BC_SPAN_PL;
1818 (yyval.memspan_list)->width = (yyvsp[0].memattr_page).width;
1819 (yyval.memspan_list)->epage = (yyvsp[0].memattr_page).epage;
1820 (yyval.memspan_list)->f_name = NULL;
1821 }
1822 #line 1823 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1823 break;
1824
1825 case 28:
1826 #line 407 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1827 {
1828 (yyval.memspan_list) = NULL;
1829 }
1830 #line 1831 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1831 break;
1832
1833 case 29:
1834 #line 411 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1835 {
1836 (yyval.memspan_list) = NULL;
1837 snprintf(bc_errbuf, sizeof(bc_errbuf),
1838 "Unexpected token/state '%s'", BC_TOK);
1839 BC_DIAG(BC_DIAG_ERROR, "[mapping]",
1840 bc_saved_lineno, bc_errbuf);
1841 }
1842 #line 1843 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1843 break;
1844
1845 case 30:
1846 #line 425 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1847 { S("[ecsbank]"); }
1848 #line 1849 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1849 break;
1850
1851 case 31:
1852 #line 427 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1853 {
1854 (yyval.memspan_list) = LL_REVERSE((yyvsp[0].memspan_list), bc_memspan_t);
1855 }
1856 #line 1857 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1857 break;
1858
1859 case 32:
1860 #line 433 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1861 {
1862 (yyval.memspan_list) = LL_INSERT((yyvsp[-1].memspan_list), (yyvsp[0].memspan_list), bc_memspan_t);
1863 }
1864 #line 1865 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1865 break;
1866
1867 case 33:
1868 #line 436 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1869 { (yyval.memspan_list) = (yyvsp[0].memspan_list); }
1870 #line 1871 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1871 break;
1872
1873 case 34:
1874 #line 441 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1875 {
1876 (yyval.memspan_list) = CALLOC(bc_memspan_t, 1);
1877 BC_CHKOOM((yyval.memspan_list));
1878 (yyval.memspan_list)->s_fofs = (yyvsp[-5].intv);
1879 (yyval.memspan_list)->e_fofs = (yyvsp[-3].intv);
1880 (yyval.memspan_list)->s_addr = (yyvsp[-1].intv);
1881 (yyval.memspan_list)->e_addr = (yyvsp[-1].intv) + (yyvsp[-3].intv) - (yyvsp[-5].intv);
1882 (yyval.memspan_list)->flags = BC_SPAN_PL | BC_SPAN_R | BC_SPAN_EP;
1883 (yyval.memspan_list)->width = 16;
1884 (yyval.memspan_list)->epage = (yyvsp[-7].intv);
1885 (yyval.memspan_list)->f_name = NULL;
1886 }
1887 #line 1888 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1888 break;
1889
1890 case 35:
1891 #line 454 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1892 {
1893 (yyval.memspan_list) = NULL;
1894 }
1895 #line 1896 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1896 break;
1897
1898 case 36:
1899 #line 458 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1900 {
1901 (yyval.memspan_list) = NULL;
1902 snprintf(bc_errbuf, sizeof(bc_errbuf),
1903 "Unexpected token/state '%s'", BC_TOK);
1904 BC_DIAG(BC_DIAG_ERROR, "[ecsbank]",
1905 bc_saved_lineno, bc_errbuf);
1906 }
1907 #line 1908 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1908 break;
1909
1910 case 37:
1911 #line 471 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1912 { S("[memattr]"); }
1913 #line 1914 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1914 break;
1915
1916 case 38:
1917 #line 473 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1918 {
1919 (yyval.memspan_list) = LL_REVERSE((yyvsp[0].memspan_list), bc_memspan_t);
1920 }
1921 #line 1922 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1922 break;
1923
1924 case 39:
1925 #line 480 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1926 {
1927 (yyval.memspan_list) = LL_INSERT((yyvsp[-1].memspan_list), (yyvsp[0].memspan_list), bc_memspan_t);
1928 }
1929 #line 1930 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1930 break;
1931
1932 case 40:
1933 #line 483 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1934 { (yyval.memspan_list) = (yyvsp[0].memspan_list); }
1935 #line 1936 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1936 break;
1937
1938 case 41:
1939 #line 487 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1940 {
1941 (yyval.memspan_list) = CALLOC(bc_memspan_t, 1);
1942 BC_CHKOOM((yyval.memspan_list));
1943 (yyval.memspan_list)->s_fofs = 0;
1944 (yyval.memspan_list)->e_fofs = 0;
1945 (yyval.memspan_list)->s_addr = (yyvsp[-4].intv);
1946 (yyval.memspan_list)->e_addr = (yyvsp[-2].intv);
1947 (yyval.memspan_list)->flags = (yyvsp[0].memattr_page).flags;
1948 (yyval.memspan_list)->width = (yyvsp[0].memattr_page).width;
1949 (yyval.memspan_list)->epage = (yyvsp[0].memattr_page).epage;
1950 (yyval.memspan_list)->f_name = NULL;
1951 }
1952 #line 1953 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1953 break;
1954
1955 case 42:
1956 #line 500 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1957 {
1958 (yyval.memspan_list) = NULL;
1959 }
1960 #line 1961 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1961 break;
1962
1963 case 43:
1964 #line 504 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1965 {
1966 (yyval.memspan_list) = NULL;
1967 snprintf(bc_errbuf, sizeof(bc_errbuf),
1968 "Unexpected token/state '%s'\n", BC_TOK);
1969 BC_DIAG(BC_DIAG_ERROR, "[memattr]",
1970 bc_saved_lineno, bc_errbuf);
1971 }
1972 #line 1973 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1973 break;
1974
1975 case 44:
1976 #line 514 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1977 {
1978 (yyval.memattr_page).flags = BC_SPAN_R;
1979 (yyval.memattr_page).width = 16;
1980 (yyval.memattr_page).epage = BC_SPAN_NOPAGE;
1981 }
1982 #line 1983 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1983 break;
1984
1985 case 45:
1986 #line 520 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1987 {
1988 (yyval.memattr_page).flags = (yyvsp[-2].intv)
1989 | ((yyvsp[-1].intv) < 16 ? BC_SPAN_N : 0)
1990 | ((yyvsp[0].memattr_page).flags & BC_SPAN_EP);
1991 (yyval.memattr_page).width = (yyvsp[-1].intv);
1992 (yyval.memattr_page).epage = (yyvsp[0].memattr_page).epage;
1993 }
1994 #line 1995 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
1995 break;
1996
1997 case 46:
1998 #line 528 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
1999 {
2000 (yyval.memattr_page).flags = (yyvsp[0].memattr_page).flags | BC_SPAN_EP;
2001 (yyval.memattr_page).width = (yyvsp[0].memattr_page).width;
2002 (yyval.memattr_page).epage = (yyvsp[-1].intv);
2003 }
2004 #line 2005 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2005 break;
2006
2007 case 47:
2008 #line 541 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2009 { S("[preload]"); }
2010 #line 2011 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2011 break;
2012
2013 case 48:
2014 #line 543 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2015 {
2016 (yyval.memspan_list) = LL_REVERSE((yyvsp[0].memspan_list), bc_memspan_t);
2017 }
2018 #line 2019 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2019 break;
2020
2021 case 49:
2022 #line 549 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2023 {
2024 (yyval.memspan_list) = LL_INSERT((yyvsp[-1].memspan_list), (yyvsp[0].memspan_list), bc_memspan_t);
2025 }
2026 #line 2027 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2027 break;
2028
2029 case 50:
2030 #line 552 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2031 { (yyval.memspan_list) = (yyvsp[0].memspan_list); }
2032 #line 2033 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2033 break;
2034
2035 case 51:
2036 #line 556 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2037 {
2038 (yyval.memspan_list) = CALLOC(bc_memspan_t, 1);
2039 BC_CHKOOM((yyval.memspan_list));
2040 (yyval.memspan_list)->s_fofs = (yyvsp[-5].intv);
2041 (yyval.memspan_list)->e_fofs = (yyvsp[-3].intv);
2042 (yyval.memspan_list)->s_addr = (yyvsp[-1].intv);
2043 (yyval.memspan_list)->e_addr = (yyvsp[-1].intv) + (yyvsp[-3].intv) - (yyvsp[-5].intv);
2044 (yyval.memspan_list)->flags = BC_SPAN_PL;
2045 (yyval.memspan_list)->width = 16;
2046 (yyval.memspan_list)->epage = BC_SPAN_NOPAGE;
2047 (yyval.memspan_list)->f_name = NULL;
2048 }
2049 #line 2050 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2050 break;
2051
2052 case 52:
2053 #line 569 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2054 {
2055 (yyval.memspan_list) = NULL;
2056 snprintf(bc_errbuf, sizeof(bc_errbuf),
2057 "Unexpected token/state '%s'", BC_TOK);
2058 BC_DIAG(BC_DIAG_ERROR, "[preload]",
2059 bc_saved_lineno, bc_errbuf);
2060 }
2061 #line 2062 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2062 break;
2063
2064 case 53:
2065 #line 577 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2066 {
2067 (yyval.memspan_list) = NULL;
2068 }
2069 #line 2070 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2070 break;
2071
2072 case 54:
2073 #line 603 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2074 { S("[macro]"); }
2075 #line 2076 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2076 break;
2077
2078 case 55:
2079 #line 605 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2080 {
2081 (yyval.macro_list) = LL_REVERSE((yyvsp[0].macro_list), bc_macro_t);
2082 }
2083 #line 2084 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2084 break;
2085
2086 case 56:
2087 #line 611 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2088 {
2089 (yyval.macro_list) = LL_INSERT((yyvsp[-1].macro_list), (yyvsp[0].macro_list), bc_macro_t);
2090 }
2091 #line 2092 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2092 break;
2093
2094 case 57:
2095 #line 614 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2096 { (yyval.macro_list) = (yyvsp[0].macro_list); }
2097 #line 2098 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2098 break;
2099
2100 case 58:
2101 #line 620 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2102 {
2103 if ((yyvsp[0].macro).cmd == BC_MAC_ERROR)
2104 (yyval.macro_list) = NULL;
2105 else
2106 {
2107 (yyval.macro_list) = CALLOC(bc_macro_t, 1);
2108 BC_CHKOOM((yyval.macro_list));
2109 *(yyval.macro_list) = (yyvsp[0].macro);
2110 (yyval.macro_list)->quiet = 1;
2111 }
2112 }
2113 #line 2114 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2114 break;
2115
2116 case 59:
2117 #line 632 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2118 {
2119 if ((yyvsp[0].macro).cmd == BC_MAC_ERROR)
2120 (yyval.macro_list) = NULL;
2121 else
2122 {
2123 (yyval.macro_list) = CALLOC(bc_macro_t, 1);
2124 BC_CHKOOM((yyval.macro_list));
2125 *(yyval.macro_list) = (yyvsp[0].macro);
2126 (yyval.macro_list)->quiet = 0;
2127 }
2128 }
2129 #line 2130 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2130 break;
2131
2132 case 60:
2133 #line 644 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2134 {
2135 (yyval.macro_list) = NULL;
2136 }
2137 #line 2138 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2138 break;
2139
2140 case 61:
2141 #line 648 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2142 {
2143 (yyval.macro_list) = NULL;
2144 }
2145 #line 2146 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2146 break;
2147
2148 case 62:
2149 #line 654 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2150 {
2151 (yyval.macro).cmd = BC_MAC_REG;
2152 (yyval.macro).arg.reg.reg = (yyvsp[-2].intv);
2153 (yyval.macro).arg.reg.value = (yyvsp[-1].intv);
2154 }
2155 #line 2156 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2156 break;
2157
2158 case 63:
2159 #line 660 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2160 {
2161 (yyval.macro).cmd = BC_MAC_LOAD;
2162 //fprintf(stderr, "name = %s\n", $2);
2163 (yyval.macro).arg.load.name = (yyvsp[-3].strv);
2164 (yyval.macro).arg.load.width = (yyvsp[-2].intv);
2165 (yyval.macro).arg.load.addr = (yyvsp[-1].intv);
2166 }
2167 #line 2168 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2168 break;
2169
2170 case 64:
2171 #line 668 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2172 {
2173 (yyval.macro).cmd = BC_MAC_WATCH;
2174 (yyval.macro).arg.watch = (yyvsp[-1].mac_watch);
2175 (yyval.macro).arg.watch.name = (yyvsp[-2].strv);
2176 }
2177 #line 2178 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2178 break;
2179
2180 case 65:
2181 #line 674 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2182 {
2183 (yyval.macro).cmd = BC_MAC_POKE;
2184 (yyval.macro).arg.poke.addr = (yyvsp[-2].intv);
2185 (yyval.macro).arg.poke.epage = BC_SPAN_NOPAGE;
2186 (yyval.macro).arg.poke.value = (yyvsp[-1].intv);
2187 }
2188 #line 2189 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2189 break;
2190
2191 case 66:
2192 #line 681 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2193 {
2194 (yyval.macro).cmd = BC_MAC_POKE;
2195 (yyval.macro).arg.poke.addr = (yyvsp[-4].intv);
2196 (yyval.macro).arg.poke.epage = (yyvsp[-2].intv);
2197 (yyval.macro).arg.poke.value = (yyvsp[-1].intv);
2198 }
2199 #line 2200 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2200 break;
2201
2202 case 67:
2203 #line 688 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2204 {
2205 (yyval.macro).cmd = BC_MAC_POKE;
2206 (yyval.macro).arg.poke.addr = (yyvsp[-4].intv);
2207 (yyval.macro).arg.poke.epage = (yyvsp[-2].intv);
2208 (yyval.macro).arg.poke.value = (yyvsp[-1].intv);
2209 }
2210 #line 2211 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2211 break;
2212
2213 case 68:
2214 #line 695 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2215 {
2216 (yyval.macro).cmd = BC_MAC_INSPECT;
2217 (yyval.macro).arg.inspect.addr = (yyvsp[-1].intv);
2218 }
2219 #line 2220 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2220 break;
2221
2222 case 69:
2223 #line 700 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2224 {
2225 (yyval.macro).cmd = BC_MAC_RUNTO;
2226 (yyval.macro).arg.runto.addr = (yyvsp[-1].intv);
2227 }
2228 #line 2229 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2229 break;
2230
2231 case 70:
2232 #line 705 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2233 {
2234 (yyval.macro).cmd = BC_MAC_TRACE;
2235 (yyval.macro).arg.runto.addr = (yyvsp[-1].intv);
2236 }
2237 #line 2238 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2238 break;
2239
2240 case 71:
2241 #line 709 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2242 { (yyval.macro).cmd = BC_MAC_AHEAD; }
2243 #line 2244 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2244 break;
2245
2246 case 72:
2247 #line 710 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2248 { (yyval.macro).cmd = BC_MAC_BLANK; }
2249 #line 2250 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2250 break;
2251
2252 case 73:
2253 #line 711 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2254 { (yyval.macro).cmd = BC_MAC_RUN; }
2255 #line 2256 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2256 break;
2257
2258 case 74:
2259 #line 712 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2260 { (yyval.macro).cmd = BC_MAC_VIEW; }
2261 #line 2262 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2262 break;
2263
2264 case 75:
2265 #line 714 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2266 {
2267 (yyval.macro).cmd = BC_MAC_ERROR;
2268 snprintf(bc_errbuf, sizeof(bc_errbuf),
2269 "Unexpected token/state '%s'", BC_TOK);
2270 BC_DIAG(BC_DIAG_WARNING, "[macro]",
2271 bc_saved_lineno, bc_errbuf);
2272 }
2273 #line 2274 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2274 break;
2275
2276 case 76:
2277 #line 723 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2278 { (yyval.intv) = bc_hex; }
2279 #line 2280 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2280 break;
2281
2282 case 77:
2283 #line 730 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2284 {
2285 size_t new_size;
2286 int new_spans, i;
2287
2288 new_spans = (yyvsp[-2].mac_watch).spans + (yyvsp[0].mac_watch).spans;
2289 new_size = new_spans*sizeof(uint16_t)*2;
2290
2291 (yyval.mac_watch).addr = (uint16_t *)realloc((yyvsp[-2].mac_watch).addr, new_size);
2292 (yyval.mac_watch).spans = new_spans;
2293 BC_CHKOOM((yyval.mac_watch).addr);
2294
2295 for (i = 0; i < (yyvsp[0].mac_watch).spans*2; i++)
2296 (yyval.mac_watch).addr[i + 2*(yyvsp[-2].mac_watch).spans] = (yyvsp[0].mac_watch).addr[i];
2297
2298 free((yyvsp[0].mac_watch).addr);
2299 (yyvsp[0].mac_watch).addr = NULL;
2300 (yyvsp[-2].mac_watch).addr = NULL;
2301 }
2302 #line 2303 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2303 break;
2304
2305 case 78:
2306 #line 748 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2307 { (yyval.mac_watch) = (yyvsp[0].mac_watch); }
2308 #line 2309 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2309 break;
2310
2311 case 81:
2312 #line 756 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2313 {
2314 (yyval.mac_watch).spans = 1;
2315 (yyval.mac_watch).addr = CALLOC(uint16_t, 2); BC_CHKOOM((yyval.mac_watch).addr);
2316 (yyval.mac_watch).addr[0] = (yyvsp[0].intv);
2317 (yyval.mac_watch).addr[1] = (yyvsp[0].intv);
2318 }
2319 #line 2320 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2320 break;
2321
2322 case 82:
2323 #line 765 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2324 {
2325 (yyval.mac_watch).spans = 1;
2326 (yyval.mac_watch).addr = CALLOC(uint16_t, 2); BC_CHKOOM((yyval.mac_watch).addr);
2327 (yyval.mac_watch).addr[0] = (yyvsp[-2].intv);
2328 (yyval.mac_watch).addr[1] = (yyvsp[0].intv);
2329 }
2330 #line 2331 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2331 break;
2332
2333 case 83:
2334 #line 785 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2335 {
2336 (yyval.varlike).type = (yyvsp[-2].varlike_type);
2337 (yyval.varlike).vars = LL_REVERSE((yyvsp[0].var_list), cfg_var_t);
2338 }
2339 #line 2340 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2340 break;
2341
2342 case 84:
2343 #line 791 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2344 { (yyval.varlike_type)=BC_VL_VARS; S("[vars]" ); }
2345 #line 2346 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2346 break;
2347
2348 case 85:
2349 #line 792 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2350 { (yyval.varlike_type)=BC_VL_JOYSTICK; S("[joystick]" ); }
2351 #line 2352 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2352 break;
2353
2354 case 86:
2355 #line 793 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2356 { (yyval.varlike_type)=BC_VL_KEYS; S("[keys]" ); }
2357 #line 2358 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2358 break;
2359
2360 case 87:
2361 #line 794 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2362 { (yyval.varlike_type)=BC_VL_CAPSLOCK; S("[capslock]" ); }
2363 #line 2364 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2364 break;
2365
2366 case 88:
2367 #line 795 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2368 { (yyval.varlike_type)=BC_VL_NUMLOCK; S("[numlock]" ); }
2369 #line 2370 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2370 break;
2371
2372 case 89:
2373 #line 796 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2374 { (yyval.varlike_type)=BC_VL_SCROLLLOCK; S("[scrolllock]"); }
2375 #line 2376 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2376 break;
2377
2378 case 90:
2379 #line 800 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2380 {
2381 (yyval.var_list) = LL_INSERT((yyvsp[-1].var_list), (yyvsp[0].var_list), cfg_var_t);
2382 }
2383 #line 2384 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2384 break;
2385
2386 case 91:
2387 #line 803 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2388 { (yyval.var_list) = (yyvsp[0].var_list); }
2389 #line 2390 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2390 break;
2391
2392 case 92:
2393 #line 807 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2394 {
2395 (yyval.var_list) = CALLOC(cfg_var_t, 1);
2396 BC_CHKOOM((yyval.var_list));
2397
2398 (yyval.var_list)->name = (yyvsp[-3].strv);
2399 (yyval.var_list)->val = (yyvsp[-1].strnum);
2400 }
2401 #line 2402 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2402 break;
2403
2404 case 93:
2405 #line 814 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2406 { (yyval.var_list) = NULL; }
2407 #line 2408 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2408 break;
2409
2410 case 94:
2411 #line 816 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2412 {
2413 (yyval.var_list) = NULL;
2414 snprintf(bc_errbuf, sizeof(bc_errbuf),
2415 "Unexpected token/state '%s'\n", BC_TOK);
2416 BC_DIAG(BC_DIAG_WARNING, "[vars]",
2417 bc_saved_lineno, bc_errbuf);
2418 }
2419 #line 2420 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2420 break;
2421
2422 case 96:
2423 #line 831 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2424 { S("[disasm]"); }
2425 #line 2426 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2426 break;
2427
2428 case 97:
2429 #line 832 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2430 { S("[voices]"); }
2431 #line 2432 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2432 break;
2433
2434 case 98:
2435 #line 834 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2436 {
2437 static char bc_unknown[256];
2438
2439 if (bc_txt)
2440 {
2441 strncpy(bc_unknown, bc_txt, 255);
2442 bc_unknown[255] = 0;
2443 }
2444
2445 S(bc_unknown);
2446 }
2447 #line 2448 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2448 break;
2449
2450 case 99:
2451 #line 881 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2452 {
2453 (yyval.strnum).flag = VAL_STRING;
2454 (yyval.strnum).str_val = strdup(bc_txt); BC_CHKOOM((yyval.strnum).str_val);
2455 (yyval.strnum).dec_val = 0;
2456 (yyval.strnum).hex_val = 0;
2457 val_try_parse_date( &((yyval.strnum)) );
2458 }
2459 #line 2460 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2460 break;
2461
2462 case 100:
2463 #line 889 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2464 {
2465 (yyval.strnum).flag = VAL_STRING;
2466 (yyval.strnum).str_val = strdup(bc_txt); BC_CHKOOM((yyval.strnum).str_val);
2467 (yyval.strnum).dec_val = 0;
2468 (yyval.strnum).hex_val = 0;
2469 val_try_parse_date( &((yyval.strnum)) );
2470 }
2471 #line 2472 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2472 break;
2473
2474 case 101:
2475 #line 897 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2476 {
2477 (yyval.strnum).flag = VAL_STRING | VAL_HEXNUM;
2478 (yyval.strnum).str_val = strdup(bc_txt); BC_CHKOOM((yyval.strnum).str_val);
2479 (yyval.strnum).dec_val = 0;
2480 (yyval.strnum).hex_val = bc_hex;
2481 }
2482 #line 2483 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2483 break;
2484
2485 case 102:
2486 #line 904 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2487 {
2488 (yyval.strnum).flag = VAL_STRING | VAL_HEXNUM | VAL_DECNUM;
2489 (yyval.strnum).str_val = strdup(bc_txt); BC_CHKOOM((yyval.strnum).str_val);
2490 (yyval.strnum).dec_val = bc_dec;
2491 (yyval.strnum).hex_val = bc_hex;
2492
2493 /* It *may* be a year, so try putting it in date too */
2494 if ( bc_dec > 0 && bc_dec < 100 )
2495 {
2496 (yyval.strnum).flag |= VAL_DATE;
2497 (yyval.strnum).date_val.year = bc_dec + 1900;
2498 } else if ( bc_dec > 1900 && bc_dec < 1900 + 255 )
2499 {
2500 (yyval.strnum).flag |= VAL_DATE;
2501 (yyval.strnum).date_val.year = bc_dec;
2502 }
2503 }
2504 #line 2505 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2505 break;
2506
2507 case 103:
2508 #line 922 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2509 {
2510 (yyval.strnum).flag = VAL_STRING | VAL_DECNUM;
2511 (yyval.strnum).str_val = strdup(bc_txt); BC_CHKOOM((yyval.strnum).str_val);
2512 (yyval.strnum).dec_val = bc_dec;
2513 (yyval.strnum).hex_val = 0;
2514 }
2515 #line 2516 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2516 break;
2517
2518 case 104:
2519 #line 930 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2520 { (yyval.intv) = bc_dec; }
2521 #line 2522 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2522 break;
2523
2524 case 105:
2525 #line 931 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2526 { (yyval.intv) = bc_dec; }
2527 #line 2528 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2528 break;
2529
2530 case 106:
2531 #line 934 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2532 { (yyval.intv) = bc_hex; }
2533 #line 2534 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2534 break;
2535
2536 case 107:
2537 #line 935 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2538 { (yyval.intv) = bc_hex; }
2539 #line 2540 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2540 break;
2541
2542 case 108:
2543 #line 938 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2544 { (yyval.strv) = strdup(bc_txt); BC_CHKOOM((yyval.strv)); }
2545 #line 2546 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2546 break;
2547
2548 case 109:
2549 #line 939 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2550 { (yyval.strv) = strdup(bc_txt); BC_CHKOOM((yyval.strv)); }
2551 #line 2552 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2552 break;
2553
2554 case 110:
2555 #line 940 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2556 { (yyval.strv) = strdup(bc_txt); BC_CHKOOM((yyval.strv)); }
2557 #line 2558 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2558 break;
2559
2560 case 111:
2561 #line 941 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2562 { (yyval.strv) = strdup(bc_txt); BC_CHKOOM((yyval.strv)); }
2563 #line 2564 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2564 break;
2565
2566 case 112:
2567 #line 944 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2568 { (yyval.strv) = strdup(bc_txt); BC_CHKOOM((yyval.strv)); }
2569 #line 2570 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2570 break;
2571
2572 case 113:
2573 #line 945 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2574 { (yyval.strv) = strdup(bc_txt); BC_CHKOOM((yyval.strv)); }
2575 #line 2576 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2576 break;
2577
2578 case 114:
2579 #line 946 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2580 { (yyval.strv) = strdup(bc_txt); BC_CHKOOM((yyval.strv)); }
2581 #line 2582 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2582 break;
2583
2584 case 115:
2585 #line 947 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2586 { (yyval.strv) = strdup(bc_txt); BC_CHKOOM((yyval.strv)); }
2587 #line 2588 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2588 break;
2589
2590 case 116:
2591 #line 948 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2592 { (yyval.strv) = strdup(bc_txt); BC_CHKOOM((yyval.strv)); }
2593 #line 2594 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2594 break;
2595
2596 case 117:
2597 #line 951 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2598 { (yyval.intv) = BC_SPAN_RAM; }
2599 #line 2600 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2600 break;
2601
2602 case 118:
2603 #line 952 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2604 { (yyval.intv) = BC_SPAN_ROM; }
2605 #line 2606 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2606 break;
2607
2608 case 119:
2609 #line 953 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2610 { (yyval.intv) = BC_SPAN_WOM; }
2611 #line 2612 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2612 break;
2613
2614 case 122:
2615 #line 960 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2616 { bc_dont_save = 0; bc_saved_tok = YYEMPTY; }
2617 #line 2618 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2618 break;
2619
2620 case 123:
2621 #line 964 "bincfg/bincfg_grmr_real.y" /* yacc.c:1646 */
2622 {
2623 if (!bc_dont_save)
2624 {
2625 if (yychar > 0 && yychar != YYEMPTY)
2626 {
2627 bc_dont_save = 1;
2628 bc_saved_tok = yychar;
2629 bc_saved_lineno = bc_line_no;
2630 bc_saved_sec = bc_cursect ? bc_cursect : "<toplevel>";
2631 }
2632 }
2633 }
2634 #line 2635 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2635 break;
2636
2637
2638 #line 2639 "bincfg/bincfg_grmr.tab.c" /* yacc.c:1646 */
2639 default: break;
2640 }
2641 /* User semantic actions sometimes alter yychar, and that requires
2642 that yytoken be updated with the new translation. We take the
2643 approach of translating immediately before every use of yytoken.
2644 One alternative is translating here after every semantic action,
2645 but that translation would be missed if the semantic action invokes
2646 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2647 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2648 incorrect destructor might then be invoked immediately. In the
2649 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2650 to an incorrect destructor call or verbose syntax error message
2651 before the lookahead is translated. */
2652 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2653
2654 YYPOPSTACK (yylen);
2655 yylen = 0;
2656 YY_STACK_PRINT (yyss, yyssp);
2657
2658 *++yyvsp = yyval;
2659
2660 /* Now 'shift' the result of the reduction. Determine what state
2661 that goes to, based on the state we popped back to and the rule
2662 number reduced by. */
2663
2664 yyn = yyr1[yyn];
2665
2666 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2667 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2668 yystate = yytable[yystate];
2669 else
2670 yystate = yydefgoto[yyn - YYNTOKENS];
2671
2672 goto yynewstate;
2673
2674
2675 /*--------------------------------------.
2676 | yyerrlab -- here on detecting error. |
2677 `--------------------------------------*/
2678 yyerrlab:
2679 /* Make sure we have latest lookahead translation. See comments at
2680 user semantic actions for why this is necessary. */
2681 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2682
2683 /* If not already recovering from an error, report this error. */
2684 if (!yyerrstatus)
2685 {
2686 ++yynerrs;
2687 #if ! YYERROR_VERBOSE
2688 yyerror (YY_("syntax error"));
2689 #else
2690 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2691 yyssp, yytoken)
2692 {
2693 char const *yymsgp = YY_("syntax error");
2694 int yysyntax_error_status;
2695 yysyntax_error_status = YYSYNTAX_ERROR;
2696 if (yysyntax_error_status == 0)
2697 yymsgp = yymsg;
2698 else if (yysyntax_error_status == 1)
2699 {
2700 if (yymsg != yymsgbuf)
2701 YYSTACK_FREE (yymsg);
2702 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2703 if (!yymsg)
2704 {
2705 yymsg = yymsgbuf;
2706 yymsg_alloc = sizeof yymsgbuf;
2707 yysyntax_error_status = 2;
2708 }
2709 else
2710 {
2711 yysyntax_error_status = YYSYNTAX_ERROR;
2712 yymsgp = yymsg;
2713 }
2714 }
2715 yyerror (yymsgp);
2716 if (yysyntax_error_status == 2)
2717 goto yyexhaustedlab;
2718 }
2719 # undef YYSYNTAX_ERROR
2720 #endif
2721 }
2722
2723
2724
2725 if (yyerrstatus == 3)
2726 {
2727 /* If just tried and failed to reuse lookahead token after an
2728 error, discard it. */
2729
2730 if (yychar <= YYEOF)
2731 {
2732 /* Return failure if at end of input. */
2733 if (yychar == YYEOF)
2734 YYABORT;
2735 }
2736 else
2737 {
2738 yydestruct ("Error: discarding",
2739 yytoken, &yylval);
2740 yychar = YYEMPTY;
2741 }
2742 }
2743
2744 /* Else will try to reuse lookahead token after shifting the error
2745 token. */
2746 goto yyerrlab1;
2747
2748
2749 /*---------------------------------------------------.
2750 | yyerrorlab -- error raised explicitly by YYERROR. |
2751 `---------------------------------------------------*/
2752 yyerrorlab:
2753
2754 /* Pacify compilers like GCC when the user code never invokes
2755 YYERROR and the label yyerrorlab therefore never appears in user
2756 code. */
2757 if (/*CONSTCOND*/ 0)
2758 goto yyerrorlab;
2759
2760 /* Do not reclaim the symbols of the rule whose action triggered
2761 this YYERROR. */
2762 YYPOPSTACK (yylen);
2763 yylen = 0;
2764 YY_STACK_PRINT (yyss, yyssp);
2765 yystate = *yyssp;
2766 goto yyerrlab1;
2767
2768
2769 /*-------------------------------------------------------------.
2770 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2771 `-------------------------------------------------------------*/
2772 yyerrlab1:
2773 yyerrstatus = 3; /* Each real token shifted decrements this. */
2774
2775 for (;;)
2776 {
2777 yyn = yypact[yystate];
2778 if (!yypact_value_is_default (yyn))
2779 {
2780 yyn += YYTERROR;
2781 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2782 {
2783 yyn = yytable[yyn];
2784 if (0 < yyn)
2785 break;
2786 }
2787 }
2788
2789 /* Pop the current state because it cannot handle the error token. */
2790 if (yyssp == yyss)
2791 YYABORT;
2792
2793
2794 yydestruct ("Error: popping",
2795 yystos[yystate], yyvsp);
2796 YYPOPSTACK (1);
2797 yystate = *yyssp;
2798 YY_STACK_PRINT (yyss, yyssp);
2799 }
2800
2801 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2802 *++yyvsp = yylval;
2803 YY_IGNORE_MAYBE_UNINITIALIZED_END
2804
2805
2806 /* Shift the error token. */
2807 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2808
2809 yystate = yyn;
2810 goto yynewstate;
2811
2812
2813 /*-------------------------------------.
2814 | yyacceptlab -- YYACCEPT comes here. |
2815 `-------------------------------------*/
2816 yyacceptlab:
2817 yyresult = 0;
2818 goto yyreturn;
2819
2820 /*-----------------------------------.
2821 | yyabortlab -- YYABORT comes here. |
2822 `-----------------------------------*/
2823 yyabortlab:
2824 yyresult = 1;
2825 goto yyreturn;
2826
2827 #if !defined yyoverflow || YYERROR_VERBOSE
2828 /*-------------------------------------------------.
2829 | yyexhaustedlab -- memory exhaustion comes here. |
2830 `-------------------------------------------------*/
2831 yyexhaustedlab:
2832 yyerror (YY_("memory exhausted"));
2833 yyresult = 2;
2834 /* Fall through. */
2835 #endif
2836
2837 yyreturn:
2838 if (yychar != YYEMPTY)
2839 {
2840 /* Make sure we have latest lookahead translation. See comments at
2841 user semantic actions for why this is necessary. */
2842 yytoken = YYTRANSLATE (yychar);
2843 yydestruct ("Cleanup: discarding lookahead",
2844 yytoken, &yylval);
2845 }
2846 /* Do not reclaim the symbols of the rule whose action triggered
2847 this YYABORT or YYACCEPT. */
2848 YYPOPSTACK (yylen);
2849 YY_STACK_PRINT (yyss, yyssp);
2850 while (yyssp != yyss)
2851 {
2852 yydestruct ("Cleanup: popping",
2853 yystos[*yyssp], yyvsp);
2854 YYPOPSTACK (1);
2855 }
2856 #ifndef yyoverflow
2857 if (yyss != yyssa)
2858 YYSTACK_FREE (yyss);
2859 #endif
2860 #if YYERROR_VERBOSE
2861 if (yymsg != yymsgbuf)
2862 YYSTACK_FREE (yymsg);
2863 #endif
2864 return yyresult;
2865 }
2866 #line 977 "bincfg/bincfg_grmr_real.y" /* yacc.c:1906 */
2867
2868
2869 /* ------------------------------------------------------------------------ */
2870 /* YYERROR -- required by Bison/YACC. */
2871 /* ------------------------------------------------------------------------ */
yyerror(const char * diagmsg)2872 static void yyerror(const char *diagmsg)
2873 {
2874 bc_diag_t *err;
2875 const char *cursect = bc_cursect ? bc_cursect : "<internal>";
2876
2877 err = CALLOC(bc_diag_t, 1);
2878 if (!err) return;
2879
2880 if (bc_txt && yychar == TOK_ERROR_BAD)
2881 snprintf(bc_errbuf, sizeof(bc_errbuf),
2882 "%s. Text at error: '%s'", diagmsg, bc_txt);
2883 else
2884 snprintf(bc_errbuf, sizeof(bc_errbuf), "%s.", diagmsg);
2885
2886 err->line = bc_line_no;
2887 err->type = BC_DIAG_ERROR;
2888 err->sect = strdup(cursect); if (!err->sect) goto oom;
2889 err->msg = strdup(bc_errbuf); if (!err->msg ) goto oom;
2890
2891 LL_CONCAT(bc_diag_list, err, bc_diag_t);
2892 return;
2893 oom:
2894 if (err)
2895 {
2896 CONDFREE(err->msg);
2897 CONDFREE(err->sect);
2898 }
2899 CONDFREE(err);
2900 }
2901
2902 /* ======================================================================== */
2903 /* This program is free software; you can redistribute it and/or modify */
2904 /* it under the terms of the GNU General Public License as published by */
2905 /* the Free Software Foundation; either version 2 of the License, or */
2906 /* (at your option) any later version. */
2907 /* */
2908 /* This program is distributed in the hope that it will be useful, */
2909 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
2910 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */
2911 /* General Public License for more details. */
2912 /* */
2913 /* You should have received a copy of the GNU General Public License along */
2914 /* with this program; if not, write to the Free Software Foundation, Inc., */
2915 /* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
2916 /* ======================================================================== */
2917 /* Copyright (c) 2003-+Inf, Joseph Zbiciak */
2918 /* ======================================================================== */
2919