1 /* A Bison parser, made by GNU Bison 2.0. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
29 /* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
36 /* Identify Bison output. */
40 #define YYSKELETON_NAME "yacc.c"
45 /* Using locations. */
46 #define YYLSP_NEEDED 1
53 /* Put the tokens into the symbol table, so that GDB and other debuggers
56 INTEGER_LITERAL
= 258,
62 BACKWARD_BRANCH
= 264,
123 #define INTEGER_LITERAL 258
124 #define STRING_LITERAL 259
125 #define FILE_PATH 260
126 #define IDENTIFIER 261
128 #define FORWARD_BRANCH 263
129 #define BACKWARD_BRANCH 264
131 #define LOCAL_LABEL 266
192 /* Copy the first part of user declarations. */
196 * $Id: parser.y,v 1.14 2007/11/11 22:35:51 khansen Exp $
198 * Revision 1.14 2007/11/11 22:35:51 khansen
201 * Revision 1.13 2007/08/19 11:19:47 khansen
202 * --case-insensitive option
204 * Revision 1.12 2007/08/12 18:59:00 khansen
205 * ability to generate pure 6502 binary
207 * Revision 1.11 2007/08/11 01:25:50 khansen
208 * includepaths support (-I option)
210 * Revision 1.10 2007/07/22 13:34:38 khansen
211 * convert tabs to whitespaces
213 * Revision 1.9 2005/01/05 02:28:40 kenth
214 * anonymous union parsing
216 * Revision 1.8 2004/12/29 21:45:26 kenth
220 * Revision 1.7 2004/12/19 19:59:14 kenth
223 * Revision 1.6 2004/12/16 13:22:27 kenth
226 * Revision 1.5 2004/12/14 01:50:42 kenth
229 * Revision 1.4 2004/12/11 02:12:41 kenth
232 * Revision 1.3 2004/12/09 11:17:15 kenth
233 * added: warning_statement, error_statement
235 * Revision 1.2 2004/12/06 05:06:21 kenth
238 * Revision 1.1 2004/06/30 07:57:03 kenth
250 void yyerror(const char *); /* In lexer */
251 int yylex(void); /* In lexer */
252 int yypushandrestart(const char *, int); /* In lexer */
253 void __yy_memcpy(char *, char *, int);
254 extern char *yytext
; /* In lexer */
255 extern YYLTYPE yylloc
; /* In lexer */
256 char *scan_include(int); /* In lexer */
257 extern astnode
*root_node
; /* Root of the generated parse tree */
258 void handle_incsrc(astnode
*); /* See below */
259 void handle_incbin(astnode
*); /* See below */
262 /* Enabling traces. */
267 /* Enabling verbose error messages. */
268 #ifdef YYERROR_VERBOSE
269 # undef YYERROR_VERBOSE
270 # define YYERROR_VERBOSE 1
272 # define YYERROR_VERBOSE 1
275 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
277 typedef union YYSTYPE
{
285 /* Line 185 of yacc.c. */
287 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
288 # define YYSTYPE_IS_DECLARED 1
289 # define YYSTYPE_IS_TRIVIAL 1
292 #if ! defined (YYLTYPE) && ! defined (YYLTYPE_IS_DECLARED)
293 typedef struct YYLTYPE
300 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
301 # define YYLTYPE_IS_DECLARED 1
302 # define YYLTYPE_IS_TRIVIAL 1
306 /* Copy the second part of user declarations. */
309 /* Line 213 of yacc.c. */
312 #if ! defined (yyoverflow) || YYERROR_VERBOSE
318 # define YYMALLOC malloc
321 /* The parser invokes alloca or malloc; define the necessary symbols. */
323 # ifdef YYSTACK_USE_ALLOCA
324 # if YYSTACK_USE_ALLOCA
326 # define YYSTACK_ALLOC __builtin_alloca
328 # define YYSTACK_ALLOC alloca
333 # ifdef YYSTACK_ALLOC
334 /* Pacify GCC's `empty if-body' warning. */
335 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
337 # if defined (__STDC__) || defined (__cplusplus)
338 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
339 # define YYSIZE_T size_t
341 # define YYSTACK_ALLOC YYMALLOC
342 # define YYSTACK_FREE YYFREE
344 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
347 #if (! defined (yyoverflow) \
348 && (! defined (__cplusplus) \
349 || (defined (YYLTYPE_IS_TRIVIAL) && YYLTYPE_IS_TRIVIAL \
350 && defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
352 /* A type that is properly aligned for any stack member. */
360 /* The size of the maximum gap between one aligned stack and the next. */
361 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
363 /* The size of an array large to enough to hold all stacks, each with
365 # define YYSTACK_BYTES(N) \
366 ((N) * (sizeof (short int) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
367 + 2 * YYSTACK_GAP_MAXIMUM)
369 /* Copy COUNT objects from FROM to TO. The source and destination do
372 # if defined (__GNUC__) && 1 < __GNUC__
373 # define YYCOPY(To, From, Count) \
374 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
376 # define YYCOPY(To, From, Count) \
379 register YYSIZE_T yyi; \
380 for (yyi = 0; yyi < (Count); yyi++) \
381 (To)[yyi] = (From)[yyi]; \
387 /* Relocate STACK from its old location to the new one. The
388 local variables YYSIZE and YYSTACKSIZE give the old and new number of
389 elements in the stack, and YYPTR gives the new location of the
390 stack. Advance YYPTR to a properly aligned location for the next
392 # define YYSTACK_RELOCATE(Stack) \
395 YYSIZE_T yynewbytes; \
396 YYCOPY (&yyptr->Stack, Stack, yysize); \
397 Stack = &yyptr->Stack; \
398 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
399 yyptr += yynewbytes / sizeof (*yyptr); \
405 #if defined (__STDC__) || defined (__cplusplus)
406 typedef signed char yysigned_char
;
408 typedef short int yysigned_char
;
411 /* YYFINAL -- State number of the termination state. */
413 /* YYLAST -- Last index in YYTABLE. */
416 /* YYNTOKENS -- Number of terminals. */
418 /* YYNNTS -- Number of nonterminals. */
420 /* YYNRULES -- Number of rules. */
422 /* YYNRULES -- Number of states. */
423 #define YYNSTATES 381
425 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
427 #define YYMAXUTOK 322
429 #define YYTRANSLATE(YYX) \
430 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
432 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
433 static const unsigned char yytranslate
[] =
435 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
436 58, 2, 2, 2, 2, 2, 2, 2, 2, 2,
437 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
438 2, 2, 2, 93, 2, 73, 66, 92, 78, 2,
439 95, 96, 90, 87, 71, 88, 72, 91, 2, 2,
440 2, 2, 2, 2, 2, 2, 2, 2, 59, 2,
441 82, 65, 81, 2, 60, 62, 2, 2, 2, 2,
442 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
443 2, 2, 2, 2, 2, 2, 2, 2, 63, 64,
444 2, 69, 2, 70, 77, 2, 2, 2, 2, 2,
445 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447 2, 2, 2, 67, 76, 68, 94, 2, 2, 2,
448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
451 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
452 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
460 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
461 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
462 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
463 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
464 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
465 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
466 55, 56, 57, 61, 74, 75, 79, 80, 83, 84,
471 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
473 static const unsigned short int yyprhs
[] =
475 0, 0, 3, 6, 9, 10, 12, 15, 17, 18,
476 21, 23, 25, 27, 29, 31, 33, 35, 37, 39,
477 41, 43, 45, 47, 49, 51, 53, 55, 57, 59,
478 61, 63, 65, 67, 69, 71, 73, 75, 77, 79,
479 81, 83, 85, 87, 90, 94, 99, 103, 107, 111,
480 117, 120, 121, 124, 125, 132, 139, 146, 153, 160,
481 167, 169, 172, 174, 177, 182, 184, 188, 192, 196,
482 199, 203, 206, 208, 210, 212, 214, 216, 219, 221,
483 224, 228, 231, 236, 241, 248, 255, 260, 262, 265,
484 267, 269, 271, 273, 275, 277, 279, 283, 285, 287,
485 289, 291, 294, 296, 301, 306, 308, 310, 312, 314,
486 316, 317, 321, 325, 329, 333, 335, 336, 338, 342,
487 344, 345, 347, 351, 355, 359, 363, 367, 371, 375,
488 379, 383, 387, 390, 393, 396, 399, 402, 405, 409,
489 413, 417, 421, 425, 429, 431, 433, 435, 437, 439,
490 441, 443, 445, 446, 448, 450, 459, 461, 462, 464,
491 467, 472, 476, 477, 485, 493, 496, 499, 502, 506,
492 510, 515, 520, 523, 525, 530, 532, 534, 536, 538,
493 541, 544, 546, 550, 554, 558, 560, 562, 570, 572,
494 573, 577, 579, 580, 582, 586, 591, 596, 600, 605,
495 609, 616, 619, 620, 622, 624, 626, 628, 630, 632,
496 635, 639, 643, 648, 653, 657, 659, 661
499 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
500 static const short int yyrhs
[] =
502 98, 0, -1, 100, 99, -1, 38, 128, -1, -1,
503 102, -1, 100, 102, -1, 100, -1, -1, 127, 103,
504 -1, 103, -1, 150, -1, 155, -1, 156, -1, 165,
505 -1, 167, -1, 162, -1, 163, -1, 170, -1, 171,
506 -1, 173, -1, 174, -1, 130, -1, 157, -1, 177,
507 -1, 124, -1, 125, -1, 123, -1, 115, -1, 116,
508 -1, 117, -1, 120, -1, 114, -1, 113, -1, 112,
509 -1, 109, -1, 108, -1, 106, -1, 107, -1, 172,
510 -1, 105, -1, 104, -1, 126, -1, 1, 128, -1,
511 57, 132, 128, -1, 35, 169, 132, 128, -1, 54,
512 132, 128, -1, 55, 132, 128, -1, 53, 132, 128,
513 -1, 13, 147, 110, 111, 128, -1, 65, 132, -1,
514 -1, 59, 176, -1, -1, 33, 132, 128, 101, 34,
515 128, -1, 32, 132, 128, 101, 34, 128, -1, 48,
516 147, 128, 101, 49, 128, -1, 42, 147, 128, 101,
517 44, 128, -1, 43, 148, 128, 101, 44, 128, -1,
518 46, 147, 128, 118, 47, 128, -1, 119, -1, 118,
519 119, -1, 171, -1, 147, 128, -1, 45, 147, 121,
520 128, -1, 122, -1, 121, 71, 122, -1, 147, 59,
521 132, -1, 41, 164, 128, -1, 21, 128, -1, 21,
522 56, 128, -1, 22, 128, -1, 128, -1, 146, -1,
523 129, -1, 59, -1, 58, -1, 131, 128, -1, 12,
524 -1, 12, 62, -1, 12, 73, 132, -1, 12, 132,
525 -1, 12, 132, 71, 63, -1, 12, 132, 71, 64,
526 -1, 12, 69, 132, 71, 63, 70, -1, 12, 69,
527 132, 70, 71, 64, -1, 12, 69, 132, 70, -1,
528 133, -1, 50, 135, -1, 137, -1, 138, -1, 143,
529 -1, 149, -1, 66, -1, 144, -1, 145, -1, 95,
530 132, 96, -1, 87, -1, 88, -1, 8, -1, 9,
531 -1, 51, 137, -1, 147, -1, 147, 69, 132, 70,
532 -1, 147, 95, 132, 96, -1, 132, -1, 139, -1,
533 147, -1, 160, -1, 132, -1, -1, 147, 61, 147,
534 -1, 133, 72, 138, -1, 133, 72, 133, -1, 67,
535 140, 68, -1, 141, -1, -1, 142, -1, 141, 71,
536 142, -1, 134, -1, -1, 7, -1, 132, 87, 132,
537 -1, 132, 88, 132, -1, 132, 90, 132, -1, 132,
538 91, 132, -1, 132, 92, 132, -1, 132, 78, 132,
539 -1, 132, 76, 132, -1, 132, 77, 132, -1, 132,
540 86, 132, -1, 132, 85, 132, -1, 94, 132, -1,
541 93, 132, -1, 77, 147, -1, 82, 132, -1, 81,
542 132, -1, 88, 132, -1, 132, 80, 132, -1, 132,
543 79, 132, -1, 132, 81, 132, -1, 132, 82, 132,
544 -1, 132, 83, 132, -1, 132, 84, 132, -1, 10,
545 -1, 11, -1, 87, -1, 88, -1, 8, -1, 9,
546 -1, 6, -1, 147, -1, -1, 3, -1, 4, -1,
547 23, 132, 128, 101, 151, 154, 28, 128, -1, 152,
548 -1, -1, 153, -1, 152, 153, -1, 27, 132, 128,
549 101, -1, 26, 128, 101, -1, -1, 24, 147, 128,
550 101, 154, 28, 128, -1, 25, 147, 128, 101, 154,
551 28, 128, -1, 158, 128, -1, 159, 128, -1, 147,
552 159, -1, 56, 147, 159, -1, 39, 147, 159, -1,
553 56, 39, 147, 159, -1, 39, 56, 147, 159, -1,
554 160, 161, -1, 160, -1, 160, 69, 132, 70, -1,
555 14, -1, 15, -1, 16, -1, 17, -1, 52, 147,
556 -1, 72, 147, -1, 134, -1, 161, 71, 134, -1,
557 29, 164, 128, -1, 30, 164, 128, -1, 4, -1,
558 82, -1, 31, 147, 166, 128, 101, 34, 128, -1,
559 169, -1, -1, 147, 168, 128, -1, 161, -1, -1,
560 147, -1, 169, 71, 147, -1, 147, 36, 134, 128,
561 -1, 147, 65, 134, 128, -1, 37, 147, 128, -1,
562 37, 147, 134, 128, -1, 39, 169, 128, -1, 40,
563 169, 59, 176, 175, 128, -1, 60, 147, -1, -1,
564 160, -1, 147, -1, 48, -1, 13, -1, 178, -1,
565 179, -1, 147, 179, -1, 56, 147, 179, -1, 39,
566 147, 179, -1, 56, 39, 147, 179, -1, 39, 56,
567 147, 179, -1, 180, 136, 128, -1, 18, -1, 19,
571 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
572 static const unsigned short int yyrline
[] =
574 0, 123, 123, 127, 128, 132, 133, 140, 141, 145,
575 146, 150, 151, 152, 153, 154, 155, 156, 157, 158,
576 159, 160, 161, 162, 163, 164, 165, 166, 167, 168,
577 169, 170, 171, 172, 173, 174, 175, 176, 177, 178,
578 179, 180, 181, 182, 186, 190, 194, 198, 202, 206,
579 210, 211, 215, 216, 220, 224, 228, 232, 236, 240,
580 244, 245, 249, 250, 254, 258, 259, 263, 267, 271,
581 272, 275, 279, 283, 287, 288, 292, 296, 300, 301,
582 302, 303, 304, 305, 306, 307, 308, 312, 313, 314,
583 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
584 325, 326, 330, 331, 332, 336, 337, 341, 342, 346,
585 347, 351, 355, 356, 360, 364, 365, 369, 370, 374,
586 375, 379, 383, 384, 385, 386, 387, 388, 389, 390,
587 391, 392, 393, 394, 395, 396, 397, 398, 402, 403,
588 404, 405, 406, 407, 411, 412, 413, 414, 415, 416,
589 420, 424, 425, 429, 430, 434, 438, 439, 443, 444,
590 448, 452, 453, 457, 461, 465, 466, 470, 471, 472,
591 473, 474, 478, 479, 480, 484, 485, 486, 487, 488,
592 489, 493, 494, 498, 502, 506, 507, 511, 515, 516,
593 520, 524, 525, 529, 530, 534, 538, 542, 543, 547,
594 551, 555, 556, 560, 561, 562, 563, 567, 568, 572,
595 573, 574, 575, 576, 580, 584, 585, 586
599 #if YYDEBUG || YYERROR_VERBOSE
600 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
601 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
602 static const char *const yytname
[] =
604 "$end", "error", "$undefined", "INTEGER_LITERAL", "STRING_LITERAL",
605 "FILE_PATH", "IDENTIFIER", "LOCAL_ID", "FORWARD_BRANCH",
606 "BACKWARD_BRANCH", "LABEL", "LOCAL_LABEL", "MNEMONIC", "_LABEL_", "BYTE",
607 "CHAR", "WORD", "DWORD", "DSB", "DSW", "DSD", "DATASEG", "CODESEG", "IF",
608 "IFDEF", "IFNDEF", "ELSE", "ELIF", "ENDIF", "INCSRC", "INCBIN", "MACRO",
609 "REPT", "WHILE", "ENDM", "ALIGN", "EQU", "DEFINE", "END", "PUBLIC",
610 "EXTRN", "CHARMAP", "STRUC", "UNION", "ENDS", "RECORD", "ENUM", "ENDE",
611 "PROC", "ENDP", "SIZEOF", "MASK", "TAG", "MESSAGE", "WARNING", "ERROR",
612 "ZEROPAGE", "ORG", "'\\n'", "':'", "'@'", "SCOPE_OP", "'A'", "'X'",
613 "'Y'", "'='", "'$'", "'{'", "'}'", "'['", "']'", "','", "'.'", "'#'",
614 "HI_OP", "LO_OP", "'|'", "'^'", "'&'", "NE_OP", "EQ_OP", "'>'", "'<'",
615 "GE_OP", "LE_OP", "SHR_OP", "SHL_OP", "'+'", "'-'", "UMINUS", "'*'",
616 "'/'", "'%'", "'!'", "'~'", "'('", "')'", "$accept", "assembly_unit",
617 "end_opt", "statement_list", "statement_list_opt", "labelable_statement",
618 "statement", "org_statement", "align_statement", "warning_statement",
619 "error_statement", "message_statement", "label_statement",
620 "label_addr_part_opt", "label_type_part_opt", "while_statement",
621 "rept_statement", "proc_statement", "struc_decl_statement",
622 "union_decl_statement", "enum_decl_statement", "enum_item_list",
623 "enum_item", "record_decl_statement", "record_field_list",
624 "record_field", "charmap_statement", "dataseg_statement",
625 "codeseg_statement", "null_statement", "label_decl", "line_tail",
626 "newline", "instruction_statement", "instruction", "expression",
627 "indexed_identifier", "extended_expression", "sizeof_arg",
628 "expression_opt", "scope_access", "struc_access", "struc_initializer",
629 "field_initializer_list_opt", "field_initializer_list",
630 "field_initializer", "local_id", "arithmetic_expression",
631 "comparison_expression", "label", "identifier", "identifier_opt",
632 "literal", "if_statement", "elif_statement_list_opt",
633 "elif_statement_list", "elif_statement", "else_part_opt",
634 "ifdef_statement", "ifndef_statement", "data_statement",
635 "named_data_statement", "unnamed_data_statement", "datatype",
636 "expression_list", "incsrc_statement", "incbin_statement",
637 "file_specifier", "macro_decl_statement", "param_list_opt",
638 "macro_statement", "arg_list_opt", "identifier_list", "equ_statement",
639 "assign_statement", "define_statement", "public_statement",
640 "extrn_statement", "from_part_opt", "symbol_type", "storage_statement",
641 "named_storage_statement", "unnamed_storage_statement", "storage", 0
646 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
648 static const unsigned short int yytoknum
[] =
650 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
651 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
652 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
653 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
654 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
655 305, 306, 307, 308, 309, 310, 311, 312, 10, 58,
656 64, 313, 65, 88, 89, 61, 36, 123, 125, 91,
657 93, 44, 46, 35, 314, 315, 124, 94, 38, 316,
658 317, 62, 60, 318, 319, 320, 321, 43, 45, 322,
659 42, 47, 37, 33, 126, 40, 41
663 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
664 static const unsigned char yyr1
[] =
666 0, 97, 98, 99, 99, 100, 100, 101, 101, 102,
667 102, 103, 103, 103, 103, 103, 103, 103, 103, 103,
668 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
669 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
670 103, 103, 103, 103, 104, 105, 106, 107, 108, 109,
671 110, 110, 111, 111, 112, 113, 114, 115, 116, 117,
672 118, 118, 119, 119, 120, 121, 121, 122, 123, 124,
673 124, 125, 126, 127, 128, 128, 129, 130, 131, 131,
674 131, 131, 131, 131, 131, 131, 131, 132, 132, 132,
675 132, 132, 132, 132, 132, 132, 132, 132, 132, 132,
676 132, 132, 133, 133, 133, 134, 134, 135, 135, 136,
677 136, 137, 138, 138, 139, 140, 140, 141, 141, 142,
678 142, 143, 144, 144, 144, 144, 144, 144, 144, 144,
679 144, 144, 144, 144, 144, 144, 144, 144, 145, 145,
680 145, 145, 145, 145, 146, 146, 146, 146, 146, 146,
681 147, 148, 148, 149, 149, 150, 151, 151, 152, 152,
682 153, 154, 154, 155, 156, 157, 157, 158, 158, 158,
683 158, 158, 159, 159, 159, 160, 160, 160, 160, 160,
684 160, 161, 161, 162, 163, 164, 164, 165, 166, 166,
685 167, 168, 168, 169, 169, 170, 171, 172, 172, 173,
686 174, 175, 175, 176, 176, 176, 176, 177, 177, 178,
687 178, 178, 178, 178, 179, 180, 180, 180
690 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
691 static const unsigned char yyr2
[] =
693 0, 2, 2, 2, 0, 1, 2, 1, 0, 2,
694 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
695 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
696 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
697 1, 1, 1, 2, 3, 4, 3, 3, 3, 5,
698 2, 0, 2, 0, 6, 6, 6, 6, 6, 6,
699 1, 2, 1, 2, 4, 1, 3, 3, 3, 2,
700 3, 2, 1, 1, 1, 1, 1, 2, 1, 2,
701 3, 2, 4, 4, 6, 6, 4, 1, 2, 1,
702 1, 1, 1, 1, 1, 1, 3, 1, 1, 1,
703 1, 2, 1, 4, 4, 1, 1, 1, 1, 1,
704 0, 3, 3, 3, 3, 1, 0, 1, 3, 1,
705 0, 1, 3, 3, 3, 3, 3, 3, 3, 3,
706 3, 3, 2, 2, 2, 2, 2, 2, 3, 3,
707 3, 3, 3, 3, 1, 1, 1, 1, 1, 1,
708 1, 1, 0, 1, 1, 8, 1, 0, 1, 2,
709 4, 3, 0, 7, 7, 2, 2, 2, 3, 3,
710 4, 4, 2, 1, 4, 1, 1, 1, 1, 2,
711 2, 1, 3, 3, 3, 1, 1, 7, 1, 0,
712 3, 1, 0, 1, 3, 4, 4, 3, 4, 3,
713 6, 2, 0, 1, 1, 1, 1, 1, 1, 2,
714 3, 3, 4, 4, 3, 1, 1, 1
717 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
718 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
719 means the default is an error. */
720 static const unsigned char yydefact
[] =
722 0, 0, 150, 148, 149, 144, 145, 78, 0, 175,
723 176, 177, 178, 215, 216, 217, 0, 0, 0, 0,
724 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
725 0, 0, 152, 0, 0, 0, 0, 0, 0, 0,
726 0, 0, 76, 75, 0, 146, 147, 0, 0, 5,
727 10, 41, 40, 37, 38, 36, 35, 34, 33, 32,
728 28, 29, 30, 31, 27, 25, 26, 42, 0, 72,
729 74, 22, 0, 73, 192, 11, 12, 13, 23, 0,
730 0, 173, 16, 17, 14, 15, 18, 19, 39, 20,
731 21, 24, 207, 208, 110, 43, 153, 154, 121, 99,
732 100, 0, 0, 79, 93, 0, 0, 0, 0, 0,
733 97, 98, 0, 0, 0, 81, 87, 89, 90, 91,
734 94, 95, 102, 92, 51, 0, 69, 71, 0, 0,
735 0, 185, 186, 0, 0, 189, 0, 0, 193, 0,
736 0, 0, 193, 0, 0, 0, 0, 151, 0, 0,
737 0, 0, 179, 0, 0, 0, 0, 0, 0, 180,
738 1, 0, 2, 6, 9, 77, 0, 0, 116, 105,
739 181, 106, 167, 191, 0, 209, 165, 166, 0, 172,
740 109, 0, 88, 107, 108, 101, 0, 0, 80, 134,
741 136, 135, 137, 133, 132, 0, 0, 0, 0, 0,
742 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
743 0, 0, 0, 0, 0, 0, 0, 0, 53, 70,
744 0, 0, 0, 183, 184, 0, 188, 0, 0, 0,
745 0, 197, 0, 0, 169, 211, 199, 0, 68, 0,
746 0, 0, 65, 0, 0, 0, 48, 46, 47, 0,
747 168, 210, 44, 3, 0, 0, 119, 0, 115, 117,
748 0, 190, 0, 214, 86, 0, 96, 82, 83, 128,
749 129, 127, 139, 138, 140, 141, 142, 143, 131, 130,
750 122, 123, 124, 125, 126, 113, 112, 102, 111, 0,
751 0, 50, 0, 0, 0, 157, 162, 162, 0, 0,
752 0, 194, 45, 198, 171, 213, 206, 205, 204, 203,
753 202, 0, 0, 0, 64, 0, 0, 60, 0, 62,
754 0, 170, 212, 195, 196, 114, 120, 182, 174, 0,
755 0, 103, 104, 52, 49, 0, 162, 156, 158, 0,
756 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,
757 67, 0, 61, 63, 0, 118, 85, 84, 0, 0,
758 159, 0, 0, 0, 0, 55, 54, 201, 200, 57,
759 58, 59, 56, 0, 0, 161, 163, 164, 187, 160,
763 /* YYDEFGOTO[NTERM-NUM]. */
764 static const short int yydefgoto
[] =
766 -1, 47, 162, 294, 295, 49, 50, 51, 52, 53,
767 54, 55, 56, 218, 293, 57, 58, 59, 60, 61,
768 62, 316, 317, 63, 241, 242, 64, 65, 66, 67,
769 68, 69, 70, 71, 72, 169, 116, 170, 182, 181,
770 117, 118, 171, 257, 258, 259, 119, 120, 121, 73,
771 122, 148, 123, 75, 336, 337, 338, 340, 76, 77,
772 78, 79, 80, 81, 173, 82, 83, 133, 84, 225,
773 85, 174, 139, 86, 87, 88, 89, 90, 346, 310,
777 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
779 #define YYPACT_NINF -290
780 static const short int yypact
[] =
782 1502, 8, -290, -290, -290, -290, -290, 378, 38, -290,
783 -290, -290, -290, -290, -290, -290, -17, 8, 748, 38,
784 38, 2, 2, 38, 748, 748, 38, 38, 1, 38,
785 2, 38, 38, 38, 38, 38, 38, 748, 748, 748,
786 13, 748, -290, -290, 38, -290, -290, 49, 838, -290,
787 -290, -290, -290, -290, -290, -290, -290, -290, -290, -290,
788 -290, -290, -290, -290, -290, -290, -290, -290, 1563, -290,
789 -290, -290, 8, -290, 501, -290, -290, -290, -290, 8,
790 8, 536, -290, -290, -290, -290, -290, -290, -290, -290,
791 -290, -290, -290, -290, 748, -290, -290, -290, -290, -290,
792 -290, 160, 38, -290, -290, 748, 748, 38, 748, 748,
793 -290, 14, 748, 748, 748, 1597, -16, -290, -290, -290,
794 -290, -290, -26, -290, -2, 8, -290, -290, 682, 8,
795 8, -290, -290, 8, 8, 38, 682, 682, -290, 636,
796 192, 38, 246, -45, -21, 8, 8, -290, 8, 38,
797 8, 8, -290, 682, 682, 682, 38, 246, 682, -290,
798 -290, 8, -290, -290, -290, -290, 655, 655, 603, 1635,
799 -290, -290, -290, -3, 8, -290, -290, -290, 748, -3,
800 1635, 8, -290, -290, -290, -290, 15, 705, 1635, -290,
801 1635, 1635, -32, -290, -290, 725, 9, 748, 748, 748,
802 748, 748, 748, 748, 748, 748, 748, 748, 748, 748,
803 748, 748, 748, 38, 38, 748, 748, 748, 16, -290,
804 1004, 1087, 1087, -290, -290, 8, 3, 1170, 1170, 38,
805 682, -290, 8, 246, -290, -290, -290, 200, -290, 1253,
806 1253, -34, -290, 27, 38, 1336, -290, -290, -290, 246,
807 -290, -290, -290, -290, 8, 8, -290, 19, 28, -290,
808 655, -290, 1560, -290, 30, 40, -290, -290, -290, 821,
809 330, 249, 441, 441, 135, 135, 135, 135, 26, 26,
810 -32, -32, -290, -290, -290, -16, -290, -59, -290, 1579,
811 1614, 1635, 200, 8, 921, 78, 86, 86, 1170, 85,
812 87, -290, -290, -290, -290, -290, -290, -290, -290, -290,
813 60, 81, 82, 38, -290, 748, 6, -290, -4, -290,
814 73, -290, -290, -290, -290, -290, 655, -290, -290, 67,
815 64, -290, -290, -290, -290, 748, 86, 78, -290, 8,
816 109, 112, 107, 8, 8, 38, 8, 8, 8, -290,
817 1635, 8, -290, -290, 8, -290, -290, -290, 682, 115,
818 -290, 1419, 8, 8, 8, -290, -290, -290, -290, -290,
819 -290, -290, -290, 1004, 8, -290, -290, -290, -290, -290,
823 /* YYPGOTO[NTERM-NUM]. */
824 static const short int yypgoto
[] =
826 -290, -290, -290, 146, -194, -47, 80, -290, -290, -290,
827 -290, -290, -290, -290, -290, -290, -290, -290, -290, -290,
828 -290, -290, -165, -290, -290, -158, -290, -290, -290, -290,
829 -290, -1, -290, -290, -290, 286, -57, -137, -290, -290,
830 56, -54, -290, -290, -290, -164, -290, -290, -290, -290,
831 62, -290, -290, -290, -290, -290, -176, -289, -290, -290,
832 -290, -290, -65, -99, 84, -290, -290, 18, -290, -290,
833 -290, -290, -24, -290, -233, -290, -290, -290, -290, -122,
834 -290, -290, -42, -290
837 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
838 positive, shift that token. If negative, reduce the rule which
839 number is the opposite. If zero, do what YYDEFACT says.
840 If YYTABLE_NINF, syntax error. */
841 #define YYTABLE_NINF -121
842 static const short int yytable
[] =
844 95, 163, 184, 232, 143, 144, 131, 2, 341, 172,
845 215, 319, 2, 42, 43, 126, 127, 96, 97, 2,
846 2, 98, 99, 100, 42, 43, 229, 296, 297, 254,
847 255, 256, 175, 299, 300, 214, 216, 313, 237, 125,
848 134, 42, 43, 215, 2, 311, 312, 359, 145, 160,
849 229, 320, 156, 351, 42, 43, 213, 141, 210, 211,
850 212, 167, 74, 217, 101, 102, 42, 43, 260, 216,
851 124, 165, 267, 268, 229, 292, 214, 234, 176, 177,
852 104, 129, 130, 319, 132, 135, 315, 325, 138, 140,
853 142, 138, 250, 146, 147, 149, 150, 151, 152, 326,
854 235, 329, 157, 330, 342, 335, 159, 112, 113, 114,
855 74, 226, 339, 208, 209, 251, 210, 211, 212, 343,
856 345, 344, 354, 327, 219, 347, 348, 220, 221, 222,
857 74, 356, 223, 224, 357, 227, 228, 362, 309, 231,
858 363, 364, 236, 374, 238, 239, 48, 240, 164, 244,
859 245, 352, 246, 247, 248, 349, 285, 252, 185, 286,
860 253, 360, 355, 183, 186, 179, 2, 375, 304, 189,
861 333, 0, 0, 261, 9, 10, 11, 12, 0, 379,
862 263, 0, 0, 0, 321, 0, 0, 0, 0, 256,
863 0, 305, 0, 309, 0, 96, 97, 138, 2, 98,
864 99, 100, 0, 233, 0, 0, 2, 322, 0, 0,
865 0, 243, 36, 306, 9, 10, 11, 12, 249, 0,
866 206, 207, 208, 209, 298, 210, 211, 212, 0, 302,
867 0, 303, 44, 0, 0, 0, 0, 0, 0, 0,
868 314, 0, 101, 102, 0, 0, 0, 163, 307, 0,
869 42, 43, 36, 323, 324, 0, 0, 0, 104, 168,
870 9, 10, 11, 12, 13, 14, 15, 0, 0, 107,
871 0, 0, 44, 108, 109, 287, 288, 0, 0, 110,
872 111, 0, 74, 74, 74, 112, 113, 114, 0, 74,
873 74, 301, 334, 115, 0, 0, 0, 0, 36, 308,
874 0, 74, 74, 0, 128, 0, 318, 74, 0, 0,
875 136, 137, 0, 0, 0, 0, 0, 353, 44, 0,
876 0, 0, 0, 153, 154, 155, 0, 158, 200, 201,
877 202, 203, 204, 205, 206, 207, 208, 209, 361, 210,
878 211, 212, 365, 366, 0, 368, 369, 370, 0, 0,
879 371, 0, 0, 372, 308, 0, 74, 373, 0, 0,
880 74, 376, 377, 378, 0, 0, 0, 0, 0, 0,
881 0, 0, 0, 380, 0, 243, 0, 0, 318, 0,
882 180, 96, 97, 0, 2, 98, 99, 100, 0, 0,
883 0, 187, 188, 0, 190, 191, 0, 192, 193, 194,
884 195, 0, 0, 0, 0, 0, 0, 367, 199, 200,
885 201, 202, 203, 204, 205, 206, 207, 208, 209, 0,
886 210, 211, 212, 74, 0, 230, 0, 0, 101, 102,
887 0, 0, 0, 0, 0, 74, 0, 0, 0, 0,
888 103, 0, 0, 0, 104, 0, 0, 105, 0, 0,
889 0, 106, 0, 0, 0, 107, 0, 0, 0, 108,
890 109, 0, 0, 0, 262, 110, 111, 0, 0, 0,
891 0, 112, 113, 114, 0, 0, 0, 0, 0, 0,
892 0, 0, 0, 269, 270, 271, 272, 273, 274, 275,
893 276, 277, 278, 279, 280, 281, 282, 283, 284, 0,
894 0, 289, 290, 291, 96, 97, 0, 2, 98, 99,
895 100, 0, 0, 0, 0, 9, 10, 11, 12, 13,
896 14, 15, 202, 203, 204, 205, 206, 207, 208, 209,
897 0, 210, 211, 212, 0, 0, 0, 166, 0, 96,
898 97, 0, 2, 98, 99, 100, 0, 0, 0, 0,
899 0, 101, 102, 36, 0, 0, 0, 0, 0, 0,
900 0, 0, 0, 0, 0, 0, 167, 104, 168, 0,
901 0, 0, 0, 44, 0, 0, 0, 0, 107, 0,
902 0, 0, 108, 109, 0, 0, 101, 102, 110, 111,
903 0, 0, 0, 0, 112, 113, 114, 0, 0, 0,
904 0, 350, 104, 168, 0, 178, 96, 97, 0, 2,
905 98, 99, 100, 107, 0, 0, 0, 108, 109, 0,
906 0, 358, 0, 110, 111, 0, 0, 0, 0, 112,
907 113, 114, 0, 0, 0, 0, 0, 0, 0, 96,
908 97, 0, 2, 98, 99, 100, 0, 0, 0, 0,
909 0, 0, 0, 101, 102, 0, 0, 0, 96, 97,
910 0, 2, 98, 99, 100, 0, 0, 0, 0, 104,
911 168, 0, 0, 0, -120, 0, 0, 0, 0, 0,
912 107, 0, 0, 0, 108, 109, 101, 102, 0, 0,
913 110, 111, 0, 0, 0, 0, 112, 113, 114, 0,
914 0, 0, 104, 0, 0, 101, 102, 229, 0, 0,
915 0, 0, 0, 107, 0, 0, 0, 108, 109, 0,
916 0, 104, 168, 110, 111, 0, 0, 0, 0, 112,
917 113, 114, 107, 0, 0, 0, 108, 109, 0, 0,
918 42, 43, 110, 111, 0, 0, 0, 0, 112, 113,
919 114, 96, 97, 0, 2, 98, 99, 100, 197, 198,
920 199, 200, 201, 202, 203, 204, 205, 206, 207, 208,
921 209, 0, 210, 211, 212, 264, 265, 0, 0, 0,
922 0, 197, 198, 199, 200, 201, 202, 203, 204, 205,
923 206, 207, 208, 209, 0, 210, 211, 212, 101, 102,
924 0, 197, 198, 199, 200, 201, 202, 203, 204, 205,
925 206, 207, 208, 209, 104, 210, 211, 212, 0, 0,
926 0, 266, 0, 0, 0, 107, 0, 0, 0, 108,
927 109, 0, 0, 0, 0, 110, 111, 0, -4, 1,
928 0, 112, 113, 114, 2, 0, 3, 4, 5, 6,
929 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
930 17, 18, 19, 20, 0, 0, 0, 21, 22, 23,
931 24, 25, 0, 26, 0, 27, 161, 28, 29, 30,
932 31, 32, 0, 33, 34, 0, 35, 0, 0, 0,
933 36, 37, 38, 39, 40, 41, 42, 43, 198, 199,
934 200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
935 44, 210, 211, 212, 0, 0, 0, 0, 0, 0,
936 0, 0, 1, 0, 0, 45, 46, 2, 0, 3,
937 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
938 14, 15, 16, 17, 18, 19, 20, -7, -7, -7,
939 21, 22, 23, 24, 25, -7, 26, 0, 27, 0,
940 28, 29, 30, 31, 32, -7, 33, 34, 0, 35,
941 -7, 0, 0, 36, 37, 38, 39, 40, 41, 42,
942 43, 0, 0, 0, 0, 0, 0, 0, 0, 0,
943 0, 0, 0, 44, 0, 0, 0, 0, 0, 0,
944 0, 0, 0, 0, 0, 1, 0, 0, 45, 46,
945 2, 0, 3, 4, 5, 6, 7, 8, 9, 10,
946 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
947 -8, -8, -8, 21, 22, 23, 24, 25, 0, 26,
948 0, 27, 0, 28, 29, 30, 31, 32, 0, 33,
949 34, 0, 35, 0, 0, 0, 36, 37, 38, 39,
950 40, 41, 42, 43, 0, 0, 0, 0, 0, 0,
951 0, 0, 0, 0, 0, 0, 44, 0, 0, 0,
952 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
953 0, 45, 46, 2, 0, 3, 4, 5, 6, 7,
954 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
955 18, 19, 20, -8, 0, -8, 21, 22, 23, 24,
956 25, 0, 26, 0, 27, 0, 28, 29, 30, 31,
957 32, 0, 33, 34, 0, 35, 0, 0, 0, 36,
958 37, 38, 39, 40, 41, 42, 43, 0, 0, 0,
959 0, 0, 0, 0, 0, 0, 0, 0, 0, 44,
960 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
961 0, 1, 0, 0, 45, 46, 2, 0, 3, 4,
962 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
963 15, 16, 17, 18, 19, 20, 0, 0, 0, 21,
964 22, 23, 24, 25, -8, 26, 0, 27, 0, 28,
965 29, 30, 31, 32, 0, 33, 34, 0, 35, 0,
966 0, 0, 36, 37, 38, 39, 40, 41, 42, 43,
967 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
968 0, 0, 44, 0, 0, 0, 0, 0, 0, 0,
969 0, 0, 0, 0, 1, 0, 0, 45, 46, 2,
970 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
971 12, 13, 14, 15, 16, 17, 18, 19, 20, 0,
972 0, 0, 21, 22, 23, 24, 25, 0, 26, 0,
973 27, 0, 28, 29, 30, 31, 32, -8, 33, 34,
974 0, 35, 0, 0, 0, 36, 37, 38, 39, 40,
975 41, 42, 43, 0, 0, 0, 0, 0, 0, 0,
976 0, 0, 0, 0, 0, 44, 0, 0, 0, 0,
977 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
978 45, 46, 2, 0, 3, 4, 5, 6, 7, 8,
979 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
980 19, 20, 0, 0, 0, 21, 22, 23, 24, 25,
981 0, 26, 0, 27, 0, 28, 29, 30, 31, 32,
982 0, 33, 34, 0, 35, -8, 0, 0, 36, 37,
983 38, 39, 40, 41, 42, 43, 0, 0, 0, 0,
984 0, 0, 0, 0, 0, 0, 0, 0, 44, 0,
985 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
986 1, 0, 0, 45, 46, 2, 0, 3, 4, 5,
987 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
988 16, 17, 18, 19, 20, 0, 0, -8, 21, 22,
989 23, 24, 25, 0, 26, 0, 27, 0, 28, 29,
990 30, 31, 32, 0, 33, 34, 0, 35, 0, 0,
991 0, 36, 37, 38, 39, 40, 41, 42, 43, 0,
992 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
993 0, 44, 0, 0, 0, 0, 0, 0, 0, 0,
994 0, 0, 0, 1, 0, 0, 45, 46, 2, 0,
995 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
996 13, 14, 15, 16, 17, 18, 19, 20, 0, 0,
997 0, 21, 22, 23, 24, 25, 0, 26, 0, 27,
998 0, 28, 29, 30, 31, 32, 0, 33, 34, 0,
999 35, 0, 0, 0, 36, 37, 38, 39, 40, 41,
1000 42, 43, 0, 0, 1, 0, 0, 0, 0, 2,
1001 0, 0, 0, 0, 44, 7, 8, 9, 10, 11,
1002 12, 13, 14, 15, 16, 17, 18, 19, 20, 45,
1003 46, 0, 21, 22, 23, 24, 25, 0, 26, 0,
1004 27, 0, 28, 29, 30, 31, 32, 0, 33, 34,
1005 0, 35, 0, 0, 0, 36, 37, 38, 39, 40,
1006 41, 42, 43, 0, 0, 0, 0, 0, 0, 0,
1007 328, 0, 0, 0, 0, 44, 197, 198, 199, 200,
1008 201, 202, 203, 204, 205, 206, 207, 208, 209, 331,
1009 210, 211, 212, 0, 0, 197, 198, 199, 200, 201,
1010 202, 203, 204, 205, 206, 207, 208, 209, 196, 210,
1011 211, 212, 0, 197, 198, 199, 200, 201, 202, 203,
1012 204, 205, 206, 207, 208, 209, 0, 210, 211, 212,
1013 197, 198, 199, 200, 201, 202, 203, 204, 205, 206,
1014 207, 208, 209, 0, 210, 211, 212, 0, 0, 0,
1015 332, 197, 198, 199, 200, 201, 202, 203, 204, 205,
1016 206, 207, 208, 209, 0, 210, 211, 212
1019 static const short int yycheck
[] =
1021 1, 48, 101, 140, 28, 29, 4, 6, 297, 74,
1022 69, 244, 6, 58, 59, 16, 17, 3, 4, 6,
1023 6, 7, 8, 9, 58, 59, 71, 221, 222, 166,
1024 167, 168, 74, 227, 228, 61, 95, 71, 59, 56,
1025 22, 58, 59, 69, 6, 239, 240, 336, 30, 0,
1026 71, 245, 39, 47, 58, 59, 72, 56, 90, 91,
1027 92, 65, 0, 65, 50, 51, 58, 59, 71, 95,
1028 8, 72, 63, 64, 71, 59, 61, 142, 79, 80,
1029 66, 19, 20, 316, 82, 23, 59, 68, 26, 27,
1030 28, 29, 157, 31, 32, 33, 34, 35, 36, 71,
1031 142, 71, 40, 63, 298, 27, 44, 93, 94, 95,
1032 48, 135, 26, 87, 88, 157, 90, 91, 92, 34,
1033 60, 34, 49, 260, 125, 44, 44, 128, 129, 130,
1034 68, 64, 133, 134, 70, 136, 137, 28, 237, 140,
1035 28, 34, 143, 28, 145, 146, 0, 148, 68, 150,
1036 151, 316, 153, 154, 155, 313, 213, 158, 102, 213,
1037 161, 337, 326, 101, 102, 81, 6, 361, 233, 107,
1038 292, -1, -1, 174, 14, 15, 16, 17, -1, 373,
1039 181, -1, -1, -1, 249, -1, -1, -1, -1, 326,
1040 -1, 233, -1, 292, -1, 3, 4, 135, 6, 7,
1041 8, 9, -1, 141, -1, -1, 6, 249, -1, -1,
1042 -1, 149, 52, 13, 14, 15, 16, 17, 156, -1,
1043 85, 86, 87, 88, 225, 90, 91, 92, -1, 230,
1044 -1, 232, 72, -1, -1, -1, -1, -1, -1, -1,
1045 241, -1, 50, 51, -1, -1, -1, 294, 48, -1,
1046 58, 59, 52, 254, 255, -1, -1, -1, 66, 67,
1047 14, 15, 16, 17, 18, 19, 20, -1, -1, 77,
1048 -1, -1, 72, 81, 82, 213, 214, -1, -1, 87,
1049 88, -1, 220, 221, 222, 93, 94, 95, -1, 227,
1050 228, 229, 293, 7, -1, -1, -1, -1, 52, 237,
1051 -1, 239, 240, -1, 18, -1, 244, 245, -1, -1,
1052 24, 25, -1, -1, -1, -1, -1, 318, 72, -1,
1053 -1, -1, -1, 37, 38, 39, -1, 41, 79, 80,
1054 81, 82, 83, 84, 85, 86, 87, 88, 339, 90,
1055 91, 92, 343, 344, -1, 346, 347, 348, -1, -1,
1056 351, -1, -1, 354, 292, -1, 294, 358, -1, -1,
1057 298, 362, 363, 364, -1, -1, -1, -1, -1, -1,
1058 -1, -1, -1, 374, -1, 313, -1, -1, 316, -1,
1059 94, 3, 4, -1, 6, 7, 8, 9, -1, -1,
1060 -1, 105, 106, -1, 108, 109, -1, 111, 112, 113,
1061 114, -1, -1, -1, -1, -1, -1, 345, 78, 79,
1062 80, 81, 82, 83, 84, 85, 86, 87, 88, -1,
1063 90, 91, 92, 361, -1, 139, -1, -1, 50, 51,
1064 -1, -1, -1, -1, -1, 373, -1, -1, -1, -1,
1065 62, -1, -1, -1, 66, -1, -1, 69, -1, -1,
1066 -1, 73, -1, -1, -1, 77, -1, -1, -1, 81,
1067 82, -1, -1, -1, 178, 87, 88, -1, -1, -1,
1068 -1, 93, 94, 95, -1, -1, -1, -1, -1, -1,
1069 -1, -1, -1, 197, 198, 199, 200, 201, 202, 203,
1070 204, 205, 206, 207, 208, 209, 210, 211, 212, -1,
1071 -1, 215, 216, 217, 3, 4, -1, 6, 7, 8,
1072 9, -1, -1, -1, -1, 14, 15, 16, 17, 18,
1073 19, 20, 81, 82, 83, 84, 85, 86, 87, 88,
1074 -1, 90, 91, 92, -1, -1, -1, 36, -1, 3,
1075 4, -1, 6, 7, 8, 9, -1, -1, -1, -1,
1076 -1, 50, 51, 52, -1, -1, -1, -1, -1, -1,
1077 -1, -1, -1, -1, -1, -1, 65, 66, 67, -1,
1078 -1, -1, -1, 72, -1, -1, -1, -1, 77, -1,
1079 -1, -1, 81, 82, -1, -1, 50, 51, 87, 88,
1080 -1, -1, -1, -1, 93, 94, 95, -1, -1, -1,
1081 -1, 315, 66, 67, -1, 69, 3, 4, -1, 6,
1082 7, 8, 9, 77, -1, -1, -1, 81, 82, -1,
1083 -1, 335, -1, 87, 88, -1, -1, -1, -1, 93,
1084 94, 95, -1, -1, -1, -1, -1, -1, -1, 3,
1085 4, -1, 6, 7, 8, 9, -1, -1, -1, -1,
1086 -1, -1, -1, 50, 51, -1, -1, -1, 3, 4,
1087 -1, 6, 7, 8, 9, -1, -1, -1, -1, 66,
1088 67, -1, -1, -1, 71, -1, -1, -1, -1, -1,
1089 77, -1, -1, -1, 81, 82, 50, 51, -1, -1,
1090 87, 88, -1, -1, -1, -1, 93, 94, 95, -1,
1091 -1, -1, 66, -1, -1, 50, 51, 71, -1, -1,
1092 -1, -1, -1, 77, -1, -1, -1, 81, 82, -1,
1093 -1, 66, 67, 87, 88, -1, -1, -1, -1, 93,
1094 94, 95, 77, -1, -1, -1, 81, 82, -1, -1,
1095 58, 59, 87, 88, -1, -1, -1, -1, 93, 94,
1096 95, 3, 4, -1, 6, 7, 8, 9, 76, 77,
1097 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
1098 88, -1, 90, 91, 92, 70, 71, -1, -1, -1,
1099 -1, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1100 85, 86, 87, 88, -1, 90, 91, 92, 50, 51,
1101 -1, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1102 85, 86, 87, 88, 66, 90, 91, 92, -1, -1,
1103 -1, 96, -1, -1, -1, 77, -1, -1, -1, 81,
1104 82, -1, -1, -1, -1, 87, 88, -1, 0, 1,
1105 -1, 93, 94, 95, 6, -1, 8, 9, 10, 11,
1106 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1107 22, 23, 24, 25, -1, -1, -1, 29, 30, 31,
1108 32, 33, -1, 35, -1, 37, 38, 39, 40, 41,
1109 42, 43, -1, 45, 46, -1, 48, -1, -1, -1,
1110 52, 53, 54, 55, 56, 57, 58, 59, 77, 78,
1111 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
1112 72, 90, 91, 92, -1, -1, -1, -1, -1, -1,
1113 -1, -1, 1, -1, -1, 87, 88, 6, -1, 8,
1114 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
1115 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
1116 29, 30, 31, 32, 33, 34, 35, -1, 37, -1,
1117 39, 40, 41, 42, 43, 44, 45, 46, -1, 48,
1118 49, -1, -1, 52, 53, 54, 55, 56, 57, 58,
1119 59, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1120 -1, -1, -1, 72, -1, -1, -1, -1, -1, -1,
1121 -1, -1, -1, -1, -1, 1, -1, -1, 87, 88,
1122 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
1123 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
1124 26, 27, 28, 29, 30, 31, 32, 33, -1, 35,
1125 -1, 37, -1, 39, 40, 41, 42, 43, -1, 45,
1126 46, -1, 48, -1, -1, -1, 52, 53, 54, 55,
1127 56, 57, 58, 59, -1, -1, -1, -1, -1, -1,
1128 -1, -1, -1, -1, -1, -1, 72, -1, -1, -1,
1129 -1, -1, -1, -1, -1, -1, -1, -1, 1, -1,
1130 -1, 87, 88, 6, -1, 8, 9, 10, 11, 12,
1131 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1132 23, 24, 25, 26, -1, 28, 29, 30, 31, 32,
1133 33, -1, 35, -1, 37, -1, 39, 40, 41, 42,
1134 43, -1, 45, 46, -1, 48, -1, -1, -1, 52,
1135 53, 54, 55, 56, 57, 58, 59, -1, -1, -1,
1136 -1, -1, -1, -1, -1, -1, -1, -1, -1, 72,
1137 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1138 -1, 1, -1, -1, 87, 88, 6, -1, 8, 9,
1139 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1140 20, 21, 22, 23, 24, 25, -1, -1, -1, 29,
1141 30, 31, 32, 33, 34, 35, -1, 37, -1, 39,
1142 40, 41, 42, 43, -1, 45, 46, -1, 48, -1,
1143 -1, -1, 52, 53, 54, 55, 56, 57, 58, 59,
1144 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1145 -1, -1, 72, -1, -1, -1, -1, -1, -1, -1,
1146 -1, -1, -1, -1, 1, -1, -1, 87, 88, 6,
1147 -1, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1148 17, 18, 19, 20, 21, 22, 23, 24, 25, -1,
1149 -1, -1, 29, 30, 31, 32, 33, -1, 35, -1,
1150 37, -1, 39, 40, 41, 42, 43, 44, 45, 46,
1151 -1, 48, -1, -1, -1, 52, 53, 54, 55, 56,
1152 57, 58, 59, -1, -1, -1, -1, -1, -1, -1,
1153 -1, -1, -1, -1, -1, 72, -1, -1, -1, -1,
1154 -1, -1, -1, -1, -1, -1, -1, 1, -1, -1,
1155 87, 88, 6, -1, 8, 9, 10, 11, 12, 13,
1156 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1157 24, 25, -1, -1, -1, 29, 30, 31, 32, 33,
1158 -1, 35, -1, 37, -1, 39, 40, 41, 42, 43,
1159 -1, 45, 46, -1, 48, 49, -1, -1, 52, 53,
1160 54, 55, 56, 57, 58, 59, -1, -1, -1, -1,
1161 -1, -1, -1, -1, -1, -1, -1, -1, 72, -1,
1162 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1163 1, -1, -1, 87, 88, 6, -1, 8, 9, 10,
1164 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1165 21, 22, 23, 24, 25, -1, -1, 28, 29, 30,
1166 31, 32, 33, -1, 35, -1, 37, -1, 39, 40,
1167 41, 42, 43, -1, 45, 46, -1, 48, -1, -1,
1168 -1, 52, 53, 54, 55, 56, 57, 58, 59, -1,
1169 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1170 -1, 72, -1, -1, -1, -1, -1, -1, -1, -1,
1171 -1, -1, -1, 1, -1, -1, 87, 88, 6, -1,
1172 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
1173 18, 19, 20, 21, 22, 23, 24, 25, -1, -1,
1174 -1, 29, 30, 31, 32, 33, -1, 35, -1, 37,
1175 -1, 39, 40, 41, 42, 43, -1, 45, 46, -1,
1176 48, -1, -1, -1, 52, 53, 54, 55, 56, 57,
1177 58, 59, -1, -1, 1, -1, -1, -1, -1, 6,
1178 -1, -1, -1, -1, 72, 12, 13, 14, 15, 16,
1179 17, 18, 19, 20, 21, 22, 23, 24, 25, 87,
1180 88, -1, 29, 30, 31, 32, 33, -1, 35, -1,
1181 37, -1, 39, 40, 41, 42, 43, -1, 45, 46,
1182 -1, 48, -1, -1, -1, 52, 53, 54, 55, 56,
1183 57, 58, 59, -1, -1, -1, -1, -1, -1, -1,
1184 70, -1, -1, -1, -1, 72, 76, 77, 78, 79,
1185 80, 81, 82, 83, 84, 85, 86, 87, 88, 70,
1186 90, 91, 92, -1, -1, 76, 77, 78, 79, 80,
1187 81, 82, 83, 84, 85, 86, 87, 88, 71, 90,
1188 91, 92, -1, 76, 77, 78, 79, 80, 81, 82,
1189 83, 84, 85, 86, 87, 88, -1, 90, 91, 92,
1190 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
1191 86, 87, 88, -1, 90, 91, 92, -1, -1, -1,
1192 96, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1193 85, 86, 87, 88, -1, 90, 91, 92
1196 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1197 symbol of state STATE-NUM. */
1198 static const unsigned char yystos
[] =
1200 0, 1, 6, 8, 9, 10, 11, 12, 13, 14,
1201 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1202 25, 29, 30, 31, 32, 33, 35, 37, 39, 40,
1203 41, 42, 43, 45, 46, 48, 52, 53, 54, 55,
1204 56, 57, 58, 59, 72, 87, 88, 98, 100, 102,
1205 103, 104, 105, 106, 107, 108, 109, 112, 113, 114,
1206 115, 116, 117, 120, 123, 124, 125, 126, 127, 128,
1207 129, 130, 131, 146, 147, 150, 155, 156, 157, 158,
1208 159, 160, 162, 163, 165, 167, 170, 171, 172, 173,
1209 174, 177, 178, 179, 180, 128, 3, 4, 7, 8,
1210 9, 50, 51, 62, 66, 69, 73, 77, 81, 82,
1211 87, 88, 93, 94, 95, 132, 133, 137, 138, 143,
1212 144, 145, 147, 149, 147, 56, 128, 128, 132, 147,
1213 147, 4, 82, 164, 164, 147, 132, 132, 147, 169,
1214 147, 56, 147, 169, 169, 164, 147, 147, 148, 147,
1215 147, 147, 147, 132, 132, 132, 39, 147, 132, 147,
1216 0, 38, 99, 102, 103, 128, 36, 65, 67, 132,
1217 134, 139, 159, 161, 168, 179, 128, 128, 69, 161,
1218 132, 136, 135, 147, 160, 137, 147, 132, 132, 147,
1219 132, 132, 132, 132, 132, 132, 71, 76, 77, 78,
1220 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
1221 90, 91, 92, 72, 61, 69, 95, 65, 110, 128,
1222 128, 128, 128, 128, 128, 166, 169, 128, 128, 71,
1223 132, 128, 134, 147, 159, 179, 128, 59, 128, 128,
1224 128, 121, 122, 147, 128, 128, 128, 128, 128, 147,
1225 159, 179, 128, 128, 134, 134, 134, 140, 141, 142,
1226 71, 128, 132, 128, 70, 71, 96, 63, 64, 132,
1227 132, 132, 132, 132, 132, 132, 132, 132, 132, 132,
1228 132, 132, 132, 132, 132, 133, 138, 147, 147, 132,
1229 132, 132, 59, 111, 100, 101, 101, 101, 128, 101,
1230 101, 147, 128, 128, 159, 179, 13, 48, 147, 160,
1231 176, 101, 101, 71, 128, 59, 118, 119, 147, 171,
1232 101, 159, 179, 128, 128, 68, 71, 134, 70, 71,
1233 63, 70, 96, 176, 128, 27, 151, 152, 153, 26,
1234 154, 154, 101, 34, 34, 60, 175, 44, 44, 122,
1235 132, 47, 119, 128, 49, 142, 64, 70, 132, 154,
1236 153, 128, 28, 28, 34, 128, 128, 147, 128, 128,
1237 128, 128, 128, 128, 28, 101, 128, 128, 128, 101,
1241 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
1242 # define YYSIZE_T __SIZE_TYPE__
1244 #if ! defined (YYSIZE_T) && defined (size_t)
1245 # define YYSIZE_T size_t
1247 #if ! defined (YYSIZE_T)
1248 # if defined (__STDC__) || defined (__cplusplus)
1249 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1250 # define YYSIZE_T size_t
1253 #if ! defined (YYSIZE_T)
1254 # define YYSIZE_T unsigned int
1257 #define yyerrok (yyerrstatus = 0)
1258 #define yyclearin (yychar = YYEMPTY)
1259 #define YYEMPTY (-2)
1262 #define YYACCEPT goto yyacceptlab
1263 #define YYABORT goto yyabortlab
1264 #define YYERROR goto yyerrorlab
1267 /* Like YYERROR except do call yyerror. This remains here temporarily
1268 to ease the transition to the new meaning of YYERROR, for GCC.
1269 Once GCC version 2 has supplanted version 1, this can go. */
1271 #define YYFAIL goto yyerrlab
1273 #define YYRECOVERING() (!!yyerrstatus)
1275 #define YYBACKUP(Token, Value) \
1277 if (yychar == YYEMPTY && yylen == 1) \
1281 yytoken = YYTRANSLATE (yychar); \
1287 yyerror ("syntax error: cannot back up");\
1294 #define YYERRCODE 256
1297 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1298 If N is 0, then set CURRENT to the empty location which ends
1299 the previous symbol: RHS[0] (always defined). */
1301 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1302 #ifndef YYLLOC_DEFAULT
1303 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1307 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1308 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1309 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1310 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1314 (Current).first_line = (Current).last_line = \
1315 YYRHSLOC (Rhs, 0).last_line; \
1316 (Current).first_column = (Current).last_column = \
1317 YYRHSLOC (Rhs, 0).last_column; \
1323 /* YY_LOCATION_PRINT -- Print the location on the stream.
1324 This macro was not mandated originally: define only if we know
1325 we won't break user code: when these are the locations we know. */
1327 #ifndef YY_LOCATION_PRINT
1328 # if YYLTYPE_IS_TRIVIAL
1329 # define YY_LOCATION_PRINT(File, Loc) \
1330 fprintf (File, "%d.%d-%d.%d", \
1331 (Loc).first_line, (Loc).first_column, \
1332 (Loc).last_line, (Loc).last_column)
1334 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1339 /* YYLEX -- calling `yylex' with the right arguments. */
1342 # define YYLEX yylex (YYLEX_PARAM)
1344 # define YYLEX yylex ()
1347 /* Enable debugging if requested. */
1351 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1352 # define YYFPRINTF fprintf
1355 # define YYDPRINTF(Args) \
1361 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1365 YYFPRINTF (stderr, "%s ", Title); \
1366 yysymprint (stderr, \
1367 Type, Value, Location); \
1368 YYFPRINTF (stderr, "\n"); \
1372 /*------------------------------------------------------------------.
1373 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1375 `------------------------------------------------------------------*/
1377 #if defined (__STDC__) || defined (__cplusplus)
1379 yy_stack_print (short int *bottom
, short int *top
)
1382 yy_stack_print (bottom
, top
)
1387 YYFPRINTF (stderr
, "Stack now");
1388 for (/* Nothing. */; bottom
<= top
; ++bottom
)
1389 YYFPRINTF (stderr
, " %d", *bottom
);
1390 YYFPRINTF (stderr
, "\n");
1393 # define YY_STACK_PRINT(Bottom, Top) \
1396 yy_stack_print ((Bottom), (Top)); \
1400 /*------------------------------------------------.
1401 | Report that the YYRULE is going to be reduced. |
1402 `------------------------------------------------*/
1404 #if defined (__STDC__) || defined (__cplusplus)
1406 yy_reduce_print (int yyrule
)
1409 yy_reduce_print (yyrule
)
1414 unsigned int yylno
= yyrline
[yyrule
];
1415 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %u), ",
1417 /* Print the symbols being reduced, and their result. */
1418 for (yyi
= yyprhs
[yyrule
]; 0 <= yyrhs
[yyi
]; yyi
++)
1419 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1420 YYFPRINTF (stderr
, "-> %s\n", yytname
[yyr1
[yyrule
]]);
1423 # define YY_REDUCE_PRINT(Rule) \
1426 yy_reduce_print (Rule); \
1429 /* Nonzero means print parse trace. It is left uninitialized so that
1430 multiple parsers can coexist. */
1432 #else /* !YYDEBUG */
1433 # define YYDPRINTF(Args)
1434 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1435 # define YY_STACK_PRINT(Bottom, Top)
1436 # define YY_REDUCE_PRINT(Rule)
1437 #endif /* !YYDEBUG */
1440 /* YYINITDEPTH -- initial size of the parser's stacks. */
1442 # define YYINITDEPTH 200
1445 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1446 if the built-in stack extension method is used).
1448 Do not make this value too large; the results are undefined if
1449 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1450 evaluated with infinite-precision integer arithmetic. */
1453 # define YYMAXDEPTH 10000
1461 # if defined (__GLIBC__) && defined (_STRING_H)
1462 # define yystrlen strlen
1464 /* Return the length of YYSTR. */
1466 # if defined (__STDC__) || defined (__cplusplus)
1467 yystrlen (const char *yystr
)
1473 register const char *yys
= yystr
;
1475 while (*yys
++ != '\0')
1478 return yys
- yystr
- 1;
1484 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1485 # define yystpcpy stpcpy
1487 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1490 # if defined (__STDC__) || defined (__cplusplus)
1491 yystpcpy (char *yydest
, const char *yysrc
)
1493 yystpcpy (yydest
, yysrc
)
1498 register char *yyd
= yydest
;
1499 register const char *yys
= yysrc
;
1501 while ((*yyd
++ = *yys
++) != '\0')
1509 #endif /* !YYERROR_VERBOSE */
1514 /*--------------------------------.
1515 | Print this symbol on YYOUTPUT. |
1516 `--------------------------------*/
1518 #if defined (__STDC__) || defined (__cplusplus)
1520 yysymprint (FILE *yyoutput
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1523 yysymprint (yyoutput
, yytype
, yyvaluep
, yylocationp
)
1527 YYLTYPE
*yylocationp
;
1530 /* Pacify ``unused variable'' warnings. */
1534 if (yytype
< YYNTOKENS
)
1535 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1537 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1539 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1540 fprintf (yyoutput
, ": ");
1543 if (yytype
< YYNTOKENS
)
1544 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1551 YYFPRINTF (yyoutput
, ")");
1554 #endif /* ! YYDEBUG */
1555 /*-----------------------------------------------.
1556 | Release the memory associated to this symbol. |
1557 `-----------------------------------------------*/
1559 #if defined (__STDC__) || defined (__cplusplus)
1561 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
)
1564 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
)
1568 YYLTYPE
*yylocationp
;
1571 /* Pacify ``unused variable'' warnings. */
1577 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1588 /* Prevent warnings from -Wmissing-prototypes. */
1590 #ifdef YYPARSE_PARAM
1591 # if defined (__STDC__) || defined (__cplusplus)
1592 int yyparse (void *YYPARSE_PARAM
);
1596 #else /* ! YYPARSE_PARAM */
1597 #if defined (__STDC__) || defined (__cplusplus)
1602 #endif /* ! YYPARSE_PARAM */
1606 /* The look-ahead symbol. */
1609 /* The semantic value of the look-ahead symbol. */
1612 /* Number of syntax errors so far. */
1614 /* Location data for the look-ahead symbol. */
1623 #ifdef YYPARSE_PARAM
1624 # if defined (__STDC__) || defined (__cplusplus)
1625 int yyparse (void *YYPARSE_PARAM
)
1627 int yyparse (YYPARSE_PARAM
)
1628 void *YYPARSE_PARAM
;
1630 #else /* ! YYPARSE_PARAM */
1631 #if defined (__STDC__) || defined (__cplusplus)
1642 register int yystate
;
1645 /* Number of tokens to shift before error messages enabled. */
1647 /* Look-ahead token as an internal (translated) token number. */
1650 /* Three stacks and their tools:
1651 `yyss': related to states,
1652 `yyvs': related to semantic values,
1653 `yyls': related to locations.
1655 Refer to the stacks thru separate pointers, to allow yyoverflow
1656 to reallocate them elsewhere. */
1658 /* The state stack. */
1659 short int yyssa
[YYINITDEPTH
];
1660 short int *yyss
= yyssa
;
1661 register short int *yyssp
;
1663 /* The semantic value stack. */
1664 YYSTYPE yyvsa
[YYINITDEPTH
];
1665 YYSTYPE
*yyvs
= yyvsa
;
1666 register YYSTYPE
*yyvsp
;
1668 /* The location stack. */
1669 YYLTYPE yylsa
[YYINITDEPTH
];
1670 YYLTYPE
*yyls
= yylsa
;
1672 /* The locations where the error started and ended. */
1673 YYLTYPE yyerror_range
[2];
1675 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
1677 YYSIZE_T yystacksize
= YYINITDEPTH
;
1679 /* The variables used to return semantic value and location from the
1684 /* When reducing, the number of symbols on the RHS of the reduced
1688 YYDPRINTF ((stderr
, "Starting parse\n"));
1693 yychar
= YYEMPTY
; /* Cause a token to be read. */
1695 /* Initialize stack pointers.
1696 Waste one element of value and location stack
1697 so that they stay on the same level as the state stack.
1698 The wasted elements are never initialized. */
1703 #if YYLTYPE_IS_TRIVIAL
1704 /* Initialize the default location before parsing starts. */
1705 yylloc
.first_line
= yylloc
.last_line
= 1;
1706 yylloc
.first_column
= yylloc
.last_column
= 0;
1715 /*------------------------------------------------------------.
1716 | yynewstate -- Push a new state, which is found in yystate. |
1717 `------------------------------------------------------------*/
1719 /* In all cases, when you get here, the value and location stacks
1720 have just been pushed. so pushing a state here evens the stacks.
1727 if (yyss
+ yystacksize
- 1 <= yyssp
)
1729 /* Get the current used size of the three stacks, in elements. */
1730 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1734 /* Give user a chance to reallocate the stack. Use copies of
1735 these so that the &'s don't force the real ones into
1737 YYSTYPE
*yyvs1
= yyvs
;
1738 short int *yyss1
= yyss
;
1739 YYLTYPE
*yyls1
= yyls
;
1741 /* Each stack pointer address is followed by the size of the
1742 data in use in that stack, in bytes. This used to be a
1743 conditional around just the two extra args, but that might
1744 be undefined if yyoverflow is a macro. */
1745 yyoverflow ("parser stack overflow",
1746 &yyss1
, yysize
* sizeof (*yyssp
),
1747 &yyvs1
, yysize
* sizeof (*yyvsp
),
1748 &yyls1
, yysize
* sizeof (*yylsp
),
1754 #else /* no yyoverflow */
1755 # ifndef YYSTACK_RELOCATE
1758 /* Extend the stack our own way. */
1759 if (YYMAXDEPTH
<= yystacksize
)
1762 if (YYMAXDEPTH
< yystacksize
)
1763 yystacksize
= YYMAXDEPTH
;
1766 short int *yyss1
= yyss
;
1767 union yyalloc
*yyptr
=
1768 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1771 YYSTACK_RELOCATE (yyss
);
1772 YYSTACK_RELOCATE (yyvs
);
1773 YYSTACK_RELOCATE (yyls
);
1774 # undef YYSTACK_RELOCATE
1776 YYSTACK_FREE (yyss1
);
1779 #endif /* no yyoverflow */
1781 yyssp
= yyss
+ yysize
- 1;
1782 yyvsp
= yyvs
+ yysize
- 1;
1783 yylsp
= yyls
+ yysize
- 1;
1785 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1786 (unsigned long int) yystacksize
));
1788 if (yyss
+ yystacksize
- 1 <= yyssp
)
1792 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1801 /* Do appropriate processing given the current state. */
1802 /* Read a look-ahead token if we need one and don't already have one. */
1805 /* First try to decide what to do without reference to look-ahead token. */
1807 yyn
= yypact
[yystate
];
1808 if (yyn
== YYPACT_NINF
)
1811 /* Not known => get a look-ahead token if don't already have one. */
1813 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1814 if (yychar
== YYEMPTY
)
1816 YYDPRINTF ((stderr
, "Reading a token: "));
1820 if (yychar
<= YYEOF
)
1822 yychar
= yytoken
= YYEOF
;
1823 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1827 yytoken
= YYTRANSLATE (yychar
);
1828 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1831 /* If the proper action on seeing token YYTOKEN is to reduce or to
1832 detect an error, take that action. */
1834 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1839 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1848 /* Shift the look-ahead token. */
1849 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1851 /* Discard the token being shifted unless it is eof. */
1852 if (yychar
!= YYEOF
)
1858 /* Count tokens shifted since error; after three, turn off error
1867 /*-----------------------------------------------------------.
1868 | yydefault -- do the default action for the current state. |
1869 `-----------------------------------------------------------*/
1871 yyn
= yydefact
[yystate
];
1877 /*-----------------------------.
1878 | yyreduce -- Do a reduction. |
1879 `-----------------------------*/
1881 /* yyn is the number of a rule to reduce with. */
1884 /* If YYLEN is nonzero, implement the default value of the action:
1887 Otherwise, the following line sets YYVAL to garbage.
1888 This behavior is undocumented and Bison
1889 users should not rely upon it. Assigning to YYVAL
1890 unconditionally makes the parser a bit smaller, and it avoids a
1891 GCC warning that YYVAL may be used uninitialized. */
1892 yyval
= yyvsp
[1-yylen
];
1894 /* Default location. */
1895 YYLLOC_DEFAULT (yyloc
, yylsp
- yylen
, yylen
);
1896 YY_REDUCE_PRINT (yyn
);
1900 #line 123 "parser.y"
1901 { root_node
= astnode_create_list((yyvsp
[-1].node
)); }
1905 #line 127 "parser.y"
1910 #line 132 "parser.y"
1911 { (yyval
.node
) = (yyvsp
[0].node
); }
1915 #line 133 "parser.y"
1917 if ((yyvsp
[-1].node
) != NULL
) { (yyval
.node
) = (yyvsp
[-1].node
); astnode_add_sibling((yyval
.node
), (yyvsp
[0].node
)); }
1918 else { (yyval
.node
) = (yyvsp
[0].node
); }
1923 #line 140 "parser.y"
1924 { (yyval
.node
) = (yyvsp
[0].node
); }
1928 #line 141 "parser.y"
1929 { (yyval
.node
) = NULL
; }
1933 #line 145 "parser.y"
1934 { (yyval
.node
) = (yyvsp
[-1].node
); astnode_add_sibling((yyval
.node
), (yyvsp
[0].node
)); }
1938 #line 146 "parser.y"
1939 { (yyval
.node
) = (yyvsp
[0].node
); }
1943 #line 150 "parser.y"
1944 { (yyval
.node
) = (yyvsp
[0].node
); }
1948 #line 151 "parser.y"
1949 { (yyval
.node
) = (yyvsp
[0].node
); }
1953 #line 152 "parser.y"
1954 { (yyval
.node
) = (yyvsp
[0].node
); }
1958 #line 153 "parser.y"
1959 { (yyval
.node
) = (yyvsp
[0].node
); }
1963 #line 154 "parser.y"
1964 { (yyval
.node
) = (yyvsp
[0].node
); }
1968 #line 155 "parser.y"
1969 { (yyval
.node
) = (yyvsp
[0].node
); }
1973 #line 156 "parser.y"
1974 { (yyval
.node
) = (yyvsp
[0].node
); }
1978 #line 157 "parser.y"
1979 { (yyval
.node
) = (yyvsp
[0].node
); }
1983 #line 158 "parser.y"
1984 { (yyval
.node
) = (yyvsp
[0].node
); }
1988 #line 159 "parser.y"
1989 { (yyval
.node
) = (yyvsp
[0].node
); }
1993 #line 160 "parser.y"
1994 { (yyval
.node
) = (yyvsp
[0].node
); }
1998 #line 161 "parser.y"
1999 { (yyval
.node
) = (yyvsp
[0].node
); }
2003 #line 162 "parser.y"
2004 { (yyval
.node
) = (yyvsp
[0].node
); }
2008 #line 163 "parser.y"
2009 { (yyval
.node
) = (yyvsp
[0].node
); }
2013 #line 164 "parser.y"
2014 { (yyval
.node
) = (yyvsp
[0].node
); }
2018 #line 165 "parser.y"
2019 { (yyval
.node
) = (yyvsp
[0].node
); }
2023 #line 166 "parser.y"
2024 { (yyval
.node
) = (yyvsp
[0].node
); }
2028 #line 167 "parser.y"
2029 { (yyval
.node
) = (yyvsp
[0].node
); }
2033 #line 168 "parser.y"
2034 { (yyval
.node
) = (yyvsp
[0].node
); }
2038 #line 169 "parser.y"
2039 { (yyval
.node
) = (yyvsp
[0].node
); }
2043 #line 170 "parser.y"
2044 { (yyval
.node
) = (yyvsp
[0].node
); }
2048 #line 171 "parser.y"
2049 { (yyval
.node
) = (yyvsp
[0].node
); }
2053 #line 172 "parser.y"
2054 { (yyval
.node
) = (yyvsp
[0].node
); }
2058 #line 173 "parser.y"
2059 { (yyval
.node
) = (yyvsp
[0].node
); }
2063 #line 174 "parser.y"
2064 { (yyval
.node
) = (yyvsp
[0].node
); }
2068 #line 175 "parser.y"
2069 { (yyval
.node
) = (yyvsp
[0].node
); }
2073 #line 176 "parser.y"
2074 { (yyval
.node
) = (yyvsp
[0].node
); }
2078 #line 177 "parser.y"
2079 { (yyval
.node
) = (yyvsp
[0].node
); }
2083 #line 178 "parser.y"
2084 { (yyval
.node
) = (yyvsp
[0].node
); }
2088 #line 179 "parser.y"
2089 { (yyval
.node
) = (yyvsp
[0].node
); }
2093 #line 180 "parser.y"
2094 { (yyval
.node
) = (yyvsp
[0].node
); }
2098 #line 181 "parser.y"
2099 { (yyval
.node
) = (yyvsp
[0].node
); }
2103 #line 182 "parser.y"
2104 { (yyval
.node
) = NULL
; }
2108 #line 186 "parser.y"
2109 { (yyval
.node
) = astnode_create_org((yyvsp
[-1].node
), (yyloc
)); }
2113 #line 190 "parser.y"
2114 { (yyval
.node
) = astnode_create_align((yyvsp
[-2].node
), (yyvsp
[-1].node
), (yyloc
)); }
2118 #line 194 "parser.y"
2119 { (yyval
.node
) = astnode_create_warning((yyvsp
[-1].node
), (yyloc
)); }
2123 #line 198 "parser.y"
2124 { (yyval
.node
) = astnode_create_error((yyvsp
[-1].node
), (yyloc
)); }
2128 #line 202 "parser.y"
2129 { (yyval
.node
) = astnode_create_message((yyvsp
[-1].node
), (yyloc
)); }
2133 #line 206 "parser.y"
2134 { (yyval
.node
) = astnode_create_label((yyvsp
[-3].node
)->label
, (yyvsp
[-2].node
), (yyvsp
[-1].node
), (yyloc
)); astnode_finalize((yyvsp
[-3].node
)); }
2138 #line 210 "parser.y"
2139 { (yyval
.node
) = (yyvsp
[0].node
); }
2143 #line 211 "parser.y"
2144 { (yyval
.node
) = NULL
; }
2148 #line 215 "parser.y"
2149 { (yyval
.node
) = (yyvsp
[0].node
); }
2153 #line 216 "parser.y"
2154 { (yyval
.node
) = NULL
; }
2158 #line 220 "parser.y"
2159 { (yyval
.node
) = astnode_create_while((yyvsp
[-4].node
), (yyvsp
[-2].node
), (yyloc
)); }
2163 #line 224 "parser.y"
2164 { (yyval
.node
) = astnode_create_rept((yyvsp
[-4].node
), (yyvsp
[-2].node
), (yyloc
)); }
2168 #line 228 "parser.y"
2169 { (yyval
.node
) = astnode_create_proc((yyvsp
[-4].node
), (yyvsp
[-2].node
), (yyloc
)); }
2173 #line 232 "parser.y"
2174 { (yyval
.node
) = astnode_create_struc_decl((yyvsp
[-4].node
), (yyvsp
[-2].node
), (yyloc
)); }
2178 #line 236 "parser.y"
2179 { (yyval
.node
) = astnode_create_union_decl((yyvsp
[-4].node
), (yyvsp
[-2].node
), (yyloc
)); }
2183 #line 240 "parser.y"
2184 { (yyval
.node
) = astnode_create_enum_decl((yyvsp
[-4].node
), (yyvsp
[-2].node
), (yyloc
)); }
2188 #line 244 "parser.y"
2189 { (yyval
.node
) = (yyvsp
[0].node
); }
2193 #line 245 "parser.y"
2194 { (yyval
.node
) = (yyvsp
[-1].node
); astnode_add_sibling((yyval
.node
), (yyvsp
[0].node
)); }
2198 #line 249 "parser.y"
2199 { (yyval
.node
) = (yyvsp
[0].node
); }
2203 #line 250 "parser.y"
2204 { (yyval
.node
) = (yyvsp
[-1].node
); }
2208 #line 254 "parser.y"
2209 { (yyval
.node
) = astnode_create_record_decl((yyvsp
[-2].node
), (yyvsp
[-1].node
), (yyloc
)); }
2213 #line 258 "parser.y"
2214 { (yyval
.node
) = (yyvsp
[0].node
); }
2218 #line 259 "parser.y"
2219 { (yyval
.node
) = (yyvsp
[-2].node
); astnode_add_sibling((yyval
.node
), (yyvsp
[0].node
)); }
2223 #line 263 "parser.y"
2224 { (yyval
.node
) = astnode_create_bitfield_decl((yyvsp
[-2].node
), (yyvsp
[0].node
), (yyloc
)); }
2228 #line 267 "parser.y"
2229 { (yyval
.node
) = astnode_create_charmap((yyvsp
[-1].node
), (yyloc
)); }
2233 #line 271 "parser.y"
2234 { (yyval
.node
) = astnode_create_dataseg(0, (yyloc
)); }
2238 #line 272 "parser.y"
2239 { (yyval
.node
) = astnode_create_dataseg(ZEROPAGE_FLAG
, (yyloc
)); }
2243 #line 275 "parser.y"
2244 { (yyval
.node
) = astnode_create_codeseg((yyloc
)); }
2248 #line 279 "parser.y"
2249 { (yyval
.node
) = NULL
; }
2253 #line 283 "parser.y"
2254 { (yyval
.node
) = (yyvsp
[0].node
); }
2258 #line 287 "parser.y"
2263 #line 288 "parser.y"
2268 #line 292 "parser.y"
2273 #line 296 "parser.y"
2274 { (yyval
.node
) = (yyvsp
[-1].node
); }
2278 #line 300 "parser.y"
2279 { (yyval
.node
) = astnode_create_instruction((yyvsp
[0].mnemonic
), IMPLIED_MODE
, NULL
, (yyloc
)); }
2283 #line 301 "parser.y"
2284 { (yyval
.node
) = astnode_create_instruction((yyvsp
[-1].mnemonic
), ACCUMULATOR_MODE
, NULL
, (yyloc
)); }
2288 #line 302 "parser.y"
2289 { (yyval
.node
) = astnode_create_instruction((yyvsp
[-2].mnemonic
), IMMEDIATE_MODE
, (yyvsp
[0].node
), (yyloc
)); }
2293 #line 303 "parser.y"
2294 { (yyval
.node
) = astnode_create_instruction((yyvsp
[-1].mnemonic
), ABSOLUTE_MODE
, (yyvsp
[0].node
), (yyloc
)); }
2298 #line 304 "parser.y"
2299 { (yyval
.node
) = astnode_create_instruction((yyvsp
[-3].mnemonic
), ABSOLUTE_X_MODE
, (yyvsp
[-2].node
), (yyloc
)); }
2303 #line 305 "parser.y"
2304 { (yyval
.node
) = astnode_create_instruction((yyvsp
[-3].mnemonic
), ABSOLUTE_Y_MODE
, (yyvsp
[-2].node
), (yyloc
)); }
2308 #line 306 "parser.y"
2309 { (yyval
.node
) = astnode_create_instruction((yyvsp
[-5].mnemonic
), PREINDEXED_INDIRECT_MODE
, (yyvsp
[-3].node
), (yyloc
)); }
2313 #line 307 "parser.y"
2314 { (yyval
.node
) = astnode_create_instruction((yyvsp
[-5].mnemonic
), POSTINDEXED_INDIRECT_MODE
, (yyvsp
[-3].node
), (yyloc
)); }
2318 #line 308 "parser.y"
2319 { (yyval
.node
) = astnode_create_instruction((yyvsp
[-3].mnemonic
), INDIRECT_MODE
, (yyvsp
[-1].node
), (yyloc
)); }
2323 #line 312 "parser.y"
2324 { (yyval
.node
) = (yyvsp
[0].node
); }
2328 #line 313 "parser.y"
2329 { (yyval
.node
) = astnode_create_sizeof((yyvsp
[0].node
), (yyloc
)); }
2333 #line 314 "parser.y"
2334 { (yyval
.node
) = (yyvsp
[0].node
); }
2338 #line 315 "parser.y"
2339 { (yyval
.node
) = (yyvsp
[0].node
); }
2343 #line 316 "parser.y"
2344 { (yyval
.node
) = (yyvsp
[0].node
); }
2348 #line 317 "parser.y"
2349 { (yyval
.node
) = (yyvsp
[0].node
); }
2353 #line 318 "parser.y"
2354 { (yyval
.node
) = astnode_create_pc((yyloc
)); }
2358 #line 319 "parser.y"
2359 { (yyval
.node
) = (yyvsp
[0].node
); }
2363 #line 320 "parser.y"
2364 { (yyval
.node
) = (yyvsp
[0].node
); }
2368 #line 321 "parser.y"
2369 { (yyval
.node
) = (yyvsp
[-1].node
); }
2373 #line 322 "parser.y"
2374 { (yyval
.node
) = astnode_create_forward_branch("+", (yyloc
)); }
2378 #line 323 "parser.y"
2379 { (yyval
.node
) = astnode_create_backward_branch("-", (yyloc
)); }
2383 #line 324 "parser.y"
2384 { (yyval
.node
) = astnode_create_forward_branch((yyvsp
[0].ident
), (yyloc
)); }
2388 #line 325 "parser.y"
2389 { (yyval
.node
) = astnode_create_backward_branch((yyvsp
[0].ident
), (yyloc
)); }
2393 #line 326 "parser.y"
2394 { (yyval
.node
) = astnode_create_mask((yyvsp
[0].node
), (yyloc
)); }
2398 #line 330 "parser.y"
2399 { (yyval
.node
) = (yyvsp
[0].node
); }
2403 #line 331 "parser.y"
2404 { (yyval
.node
) = astnode_create_index((yyvsp
[-3].node
), (yyvsp
[-1].node
), (yyloc
)); }
2408 #line 332 "parser.y"
2409 { (yyval
.node
) = astnode_create_index((yyvsp
[-3].node
), (yyvsp
[-1].node
), (yyloc
)); }
2413 #line 336 "parser.y"
2414 { (yyval
.node
) = (yyvsp
[0].node
); }
2418 #line 337 "parser.y"
2419 { (yyval
.node
) = (yyvsp
[0].node
); }
2423 #line 341 "parser.y"
2424 { (yyval
.node
) = (yyvsp
[0].node
); }
2428 #line 342 "parser.y"
2429 { (yyval
.node
) = (yyvsp
[0].node
); }
2433 #line 346 "parser.y"
2434 { (yyval
.node
) = (yyvsp
[0].node
); }
2438 #line 347 "parser.y"
2439 { (yyval
.node
) = NULL
; }
2443 #line 351 "parser.y"
2444 { (yyval
.node
) = astnode_create_scope((yyvsp
[-2].node
), (yyvsp
[0].node
), (yyloc
)); }
2448 #line 355 "parser.y"
2449 { (yyval
.node
) = astnode_create_dot((yyvsp
[-2].node
), (yyvsp
[0].node
), (yyloc
)); }
2453 #line 356 "parser.y"
2454 { (yyval
.node
) = astnode_create_dot((yyvsp
[-2].node
), (yyvsp
[0].node
), (yyloc
)); }
2458 #line 360 "parser.y"
2459 { (yyval
.node
) = astnode_create_struc((yyvsp
[-1].node
), (yyloc
)); }
2463 #line 364 "parser.y"
2464 { (yyval
.node
) = (yyvsp
[0].node
); }
2468 #line 365 "parser.y"
2469 { (yyval
.node
) = NULL
; }
2473 #line 369 "parser.y"
2474 { (yyval
.node
) = (yyvsp
[0].node
); }
2478 #line 370 "parser.y"
2479 { (yyval
.node
) = (yyvsp
[-2].node
); astnode_add_sibling((yyval
.node
), (yyvsp
[0].node
)); }
2483 #line 374 "parser.y"
2484 { (yyval
.node
) = (yyvsp
[0].node
); }
2488 #line 375 "parser.y"
2489 { (yyval
.node
) = astnode_create_null((yyloc
)); }
2493 #line 379 "parser.y"
2494 { (yyval
.node
) = astnode_create_local_id((yyvsp
[0].ident
), (yyloc
)); }
2498 #line 383 "parser.y"
2499 { (yyval
.node
) = astnode_create_arithmetic(PLUS_OPERATOR
, (yyvsp
[-2].node
), (yyvsp
[0].node
), (yyloc
)); }
2503 #line 384 "parser.y"
2504 { (yyval
.node
) = astnode_create_arithmetic(MINUS_OPERATOR
, (yyvsp
[-2].node
), (yyvsp
[0].node
), (yyloc
)); }
2508 #line 385 "parser.y"
2509 { (yyval
.node
) = astnode_create_arithmetic(MUL_OPERATOR
, (yyvsp
[-2].node
), (yyvsp
[0].node
), (yyloc
)); }
2513 #line 386 "parser.y"
2514 { (yyval
.node
) = astnode_create_arithmetic(DIV_OPERATOR
, (yyvsp
[-2].node
), (yyvsp
[0].node
), (yyloc
)); }
2518 #line 387 "parser.y"
2519 { (yyval
.node
) = astnode_create_arithmetic(MOD_OPERATOR
, (yyvsp
[-2].node
), (yyvsp
[0].node
), (yyloc
)); }
2523 #line 388 "parser.y"
2524 { (yyval
.node
) = astnode_create_arithmetic(AND_OPERATOR
, (yyvsp
[-2].node
), (yyvsp
[0].node
), (yyloc
)); }
2528 #line 389 "parser.y"
2529 { (yyval
.node
) = astnode_create_arithmetic(OR_OPERATOR
, (yyvsp
[-2].node
), (yyvsp
[0].node
), (yyloc
)); }
2533 #line 390 "parser.y"
2534 { (yyval
.node
) = astnode_create_arithmetic(XOR_OPERATOR
, (yyvsp
[-2].node
), (yyvsp
[0].node
), (yyloc
)); }
2538 #line 391 "parser.y"
2539 { (yyval
.node
) = astnode_create_arithmetic(SHL_OPERATOR
, (yyvsp
[-2].node
), (yyvsp
[0].node
), (yyloc
)); }
2543 #line 392 "parser.y"
2544 { (yyval
.node
) = astnode_create_arithmetic(SHR_OPERATOR
, (yyvsp
[-2].node
), (yyvsp
[0].node
), (yyloc
)); }
2548 #line 393 "parser.y"
2549 { (yyval
.node
) = astnode_create_arithmetic(NEG_OPERATOR
, (yyvsp
[0].node
), NULL
, (yyloc
)); }
2553 #line 394 "parser.y"
2554 { (yyval
.node
) = astnode_create_arithmetic(NOT_OPERATOR
, (yyvsp
[0].node
), NULL
, (yyloc
)); }
2558 #line 395 "parser.y"
2559 { (yyval
.node
) = astnode_create_arithmetic(BANK_OPERATOR
, (yyvsp
[0].node
), NULL
, (yyloc
)); }
2563 #line 396 "parser.y"
2564 { (yyval
.node
) = astnode_create_arithmetic(LO_OPERATOR
, (yyvsp
[0].node
), NULL
, (yyloc
)); }
2568 #line 397 "parser.y"
2569 { (yyval
.node
) = astnode_create_arithmetic(HI_OPERATOR
, (yyvsp
[0].node
), NULL
, (yyloc
)); }
2573 #line 398 "parser.y"
2574 { (yyval
.node
) = astnode_create_arithmetic(UMINUS_OPERATOR
, (yyvsp
[0].node
), NULL
, (yyloc
)); }
2578 #line 402 "parser.y"
2579 { (yyval
.node
) = astnode_create_arithmetic(EQ_OPERATOR
, (yyvsp
[-2].node
), (yyvsp
[0].node
), (yyloc
)); }
2583 #line 403 "parser.y"
2584 { (yyval
.node
) = astnode_create_arithmetic(NE_OPERATOR
, (yyvsp
[-2].node
), (yyvsp
[0].node
), (yyloc
)); }
2588 #line 404 "parser.y"
2589 { (yyval
.node
) = astnode_create_arithmetic(GT_OPERATOR
, (yyvsp
[-2].node
), (yyvsp
[0].node
), (yyloc
)); }
2593 #line 405 "parser.y"
2594 { (yyval
.node
) = astnode_create_arithmetic(LT_OPERATOR
, (yyvsp
[-2].node
), (yyvsp
[0].node
), (yyloc
)); }
2598 #line 406 "parser.y"
2599 { (yyval
.node
) = astnode_create_arithmetic(GE_OPERATOR
, (yyvsp
[-2].node
), (yyvsp
[0].node
), (yyloc
)); }
2603 #line 407 "parser.y"
2604 { (yyval
.node
) = astnode_create_arithmetic(LE_OPERATOR
, (yyvsp
[-2].node
), (yyvsp
[0].node
), (yyloc
)); }
2608 #line 411 "parser.y"
2609 { (yyval
.node
) = astnode_create_label((yyvsp
[0].label
), NULL
, NULL
, (yyloc
)); }
2613 #line 412 "parser.y"
2614 { (yyval
.node
) = astnode_create_local_label((yyvsp
[0].label
), (yyloc
)); }
2618 #line 413 "parser.y"
2619 { (yyval
.node
) = astnode_create_forward_branch_decl("+", (yyloc
)); }
2623 #line 414 "parser.y"
2624 { (yyval
.node
) = astnode_create_backward_branch_decl("-", (yyloc
)); }
2628 #line 415 "parser.y"
2629 { (yyval
.node
) = astnode_create_forward_branch_decl((yyvsp
[0].ident
), (yyloc
)); }
2633 #line 416 "parser.y"
2634 { (yyval
.node
) = astnode_create_backward_branch_decl((yyvsp
[0].ident
), (yyloc
)); }
2638 #line 420 "parser.y"
2639 { (yyval
.node
) = astnode_create_identifier((yyvsp
[0].ident
), (yyloc
)); }
2643 #line 424 "parser.y"
2644 { (yyval
.node
) = (yyvsp
[0].node
); }
2648 #line 425 "parser.y"
2649 { (yyval
.node
) = astnode_create_null((yyloc
)); }
2653 #line 429 "parser.y"
2654 { (yyval
.node
) = astnode_create_integer((yyvsp
[0].integer
), (yyloc
)); }
2658 #line 430 "parser.y"
2659 { (yyval
.node
) = astnode_create_string((yyvsp
[0].string
), (yyloc
)); }
2663 #line 434 "parser.y"
2664 { (yyval
.node
) = astnode_create_if((yyvsp
[-6].node
), (yyvsp
[-4].node
), (yyvsp
[-3].node
), (yyvsp
[-2].node
), (yyloc
)); }
2668 #line 438 "parser.y"
2669 { (yyval
.node
) = (yyvsp
[0].node
); }
2673 #line 439 "parser.y"
2674 { (yyval
.node
) = NULL
; }
2678 #line 443 "parser.y"
2679 { (yyval
.node
) = (yyvsp
[0].node
); }
2683 #line 444 "parser.y"
2684 { (yyval
.node
) = (yyvsp
[-1].node
); astnode_add_sibling((yyval
.node
), (yyvsp
[0].node
)); }
2688 #line 448 "parser.y"
2689 { (yyval
.node
) = astnode_create_case((yyvsp
[-2].node
), (yyvsp
[0].node
), (yyloc
)); }
2693 #line 452 "parser.y"
2694 { (yyval
.node
) = (yyvsp
[0].node
); }
2698 #line 453 "parser.y"
2699 { (yyval
.node
) = NULL
; }
2703 #line 457 "parser.y"
2704 { (yyval
.node
) = astnode_create_ifdef((yyvsp
[-5].node
), (yyvsp
[-3].node
), (yyvsp
[-2].node
), (yyloc
)); }
2708 #line 461 "parser.y"
2709 { (yyval
.node
) = astnode_create_ifndef((yyvsp
[-5].node
), (yyvsp
[-3].node
), (yyvsp
[-2].node
), (yyloc
)); }
2713 #line 465 "parser.y"
2714 { (yyval
.node
) = (yyvsp
[-1].node
); }
2718 #line 466 "parser.y"
2719 { (yyval
.node
) = (yyvsp
[-1].node
); }
2723 #line 470 "parser.y"
2724 { (yyval
.node
) = astnode_create_var_decl(0, (yyvsp
[-1].node
), (yyvsp
[0].node
), (yyloc
)); }
2728 #line 471 "parser.y"
2729 { (yyval
.node
) = astnode_create_var_decl(ZEROPAGE_FLAG
, (yyvsp
[-1].node
), (yyvsp
[0].node
), (yyloc
)); }
2733 #line 472 "parser.y"
2734 { (yyval
.node
) = astnode_create_var_decl(PUBLIC_FLAG
, (yyvsp
[-1].node
), (yyvsp
[0].node
), (yyloc
)); }
2738 #line 473 "parser.y"
2739 { (yyval
.node
) = astnode_create_var_decl(ZEROPAGE_FLAG
| PUBLIC_FLAG
, (yyvsp
[-1].node
), (yyvsp
[0].node
), (yyloc
)); }
2743 #line 474 "parser.y"
2744 { (yyval
.node
) = astnode_create_var_decl(PUBLIC_FLAG
| ZEROPAGE_FLAG
, (yyvsp
[-1].node
), (yyvsp
[0].node
), (yyloc
)); }
2748 #line 478 "parser.y"
2749 { (yyval
.node
) = astnode_create_data((yyvsp
[-1].node
), (yyvsp
[0].node
), (yyloc
)); }
2753 #line 479 "parser.y"
2754 { (yyval
.node
) = astnode_create_storage((yyvsp
[0].node
), NULL
, (yyloc
)); }
2758 #line 480 "parser.y"
2759 { (yyval
.node
) = astnode_create_storage((yyvsp
[-3].node
), (yyvsp
[-1].node
), (yyloc
)); }
2763 #line 484 "parser.y"
2764 { (yyval
.node
) = astnode_create_datatype(BYTE_DATATYPE
, NULL
, (yyloc
)); }
2768 #line 485 "parser.y"
2769 { (yyval
.node
) = astnode_create_datatype(CHAR_DATATYPE
, NULL
, (yyloc
)); }
2773 #line 486 "parser.y"
2774 { (yyval
.node
) = astnode_create_datatype(WORD_DATATYPE
, NULL
, (yyloc
)); }
2778 #line 487 "parser.y"
2779 { (yyval
.node
) = astnode_create_datatype(DWORD_DATATYPE
, NULL
, (yyloc
)); }
2783 #line 488 "parser.y"
2784 { (yyval
.node
) = astnode_create_datatype(USER_DATATYPE
, (yyvsp
[0].node
), (yyloc
)); }
2788 #line 489 "parser.y"
2789 { (yyval
.node
) = astnode_create_datatype(USER_DATATYPE
, (yyvsp
[0].node
), (yyloc
)); }
2793 #line 493 "parser.y"
2794 { (yyval
.node
) = (yyvsp
[0].node
); }
2798 #line 494 "parser.y"
2799 { (yyval
.node
) = (yyvsp
[-2].node
); astnode_add_sibling((yyval
.node
), (yyvsp
[0].node
)); }
2803 #line 498 "parser.y"
2804 { (yyval
.node
) = astnode_create_incsrc((yyvsp
[-1].node
), (yyloc
)); handle_incsrc((yyval
.node
)); }
2808 #line 502 "parser.y"
2809 { (yyval
.node
) = astnode_create_incbin((yyvsp
[-1].node
), (yyloc
)); handle_incbin((yyval
.node
)); }
2813 #line 506 "parser.y"
2814 { (yyval
.node
) = astnode_create_string((yyvsp
[0].string
), (yyloc
)); }
2818 #line 507 "parser.y"
2819 { (yyval
.node
) = astnode_create_file_path(scan_include('>'), (yyloc
)); }
2823 #line 511 "parser.y"
2824 { (yyval
.node
) = astnode_create_macro_decl((yyvsp
[-5].node
), (yyvsp
[-4].node
), (yyvsp
[-2].node
), (yyloc
)); }
2828 #line 515 "parser.y"
2829 { (yyval
.node
) = (yyvsp
[0].node
); }
2833 #line 516 "parser.y"
2834 { (yyval
.node
) = NULL
; }
2838 #line 520 "parser.y"
2839 { (yyval
.node
) = astnode_create_macro((yyvsp
[-2].node
), (yyvsp
[-1].node
), (yyloc
)); }
2843 #line 524 "parser.y"
2844 { (yyval
.node
) = (yyvsp
[0].node
); }
2848 #line 525 "parser.y"
2849 { (yyval
.node
) = NULL
; }
2853 #line 529 "parser.y"
2854 { (yyval
.node
) = (yyvsp
[0].node
); }
2858 #line 530 "parser.y"
2859 { (yyval
.node
) = (yyvsp
[-2].node
); astnode_add_sibling((yyval
.node
), (yyvsp
[0].node
)); }
2863 #line 534 "parser.y"
2864 { (yyval
.node
) = astnode_create_equ((yyvsp
[-3].node
), (yyvsp
[-1].node
), (yyloc
)); }
2868 #line 538 "parser.y"
2869 { (yyval
.node
) = astnode_create_assign((yyvsp
[-3].node
), (yyvsp
[-1].node
), (yyloc
)); }
2873 #line 542 "parser.y"
2874 { (yyval
.node
) = astnode_create_equ((yyvsp
[-1].node
), astnode_create_integer(0, (yyloc
)), (yyloc
)); }
2878 #line 543 "parser.y"
2879 { (yyval
.node
) = astnode_create_equ((yyvsp
[-2].node
), (yyvsp
[-1].node
), (yyloc
)); }
2883 #line 547 "parser.y"
2884 { (yyval
.node
) = astnode_create_public((yyvsp
[-1].node
), (yyloc
)); }
2888 #line 551 "parser.y"
2889 { (yyval
.node
) = astnode_create_extrn((yyvsp
[-4].node
), (yyvsp
[-2].node
), (yyvsp
[-1].node
), (yyloc
)); }
2893 #line 555 "parser.y"
2894 { (yyval
.node
) = (yyvsp
[0].node
); }
2898 #line 556 "parser.y"
2899 { (yyval
.node
) = NULL
; }
2903 #line 560 "parser.y"
2904 { (yyval
.node
) = (yyvsp
[0].node
); }
2908 #line 561 "parser.y"
2909 { (yyval
.node
) = astnode_create_datatype(USER_DATATYPE
, (yyvsp
[0].node
), (yyloc
)); }
2913 #line 562 "parser.y"
2914 { (yyval
.node
) = astnode_create_integer(PROC_SYMBOL
, (yyloc
)); }
2918 #line 563 "parser.y"
2919 { (yyval
.node
) = astnode_create_integer(LABEL_SYMBOL
, (yyloc
)); }
2923 #line 567 "parser.y"
2924 { (yyval
.node
) = (yyvsp
[0].node
); }
2928 #line 568 "parser.y"
2929 { (yyval
.node
) = (yyvsp
[0].node
); }
2933 #line 572 "parser.y"
2934 { (yyval
.node
) = astnode_create_var_decl(0, (yyvsp
[-1].node
), (yyvsp
[0].node
), (yyloc
)); }
2938 #line 573 "parser.y"
2939 { (yyval
.node
) = astnode_create_var_decl(ZEROPAGE_FLAG
, (yyvsp
[-1].node
), (yyvsp
[0].node
), (yyloc
)); }
2943 #line 574 "parser.y"
2944 { (yyval
.node
) = astnode_create_var_decl(PUBLIC_FLAG
, (yyvsp
[-1].node
), (yyvsp
[0].node
), (yyloc
)); }
2948 #line 575 "parser.y"
2949 { (yyval
.node
) = astnode_create_var_decl(ZEROPAGE_FLAG
| PUBLIC_FLAG
, (yyvsp
[-1].node
), (yyvsp
[0].node
), (yyloc
)); }
2953 #line 576 "parser.y"
2954 { (yyval
.node
) = astnode_create_var_decl(PUBLIC_FLAG
| ZEROPAGE_FLAG
, (yyvsp
[-1].node
), (yyvsp
[0].node
), (yyloc
)); }
2958 #line 580 "parser.y"
2959 { (yyval
.node
) = astnode_create_storage((yyvsp
[-2].node
), (yyvsp
[-1].node
), (yyloc
)); }
2963 #line 584 "parser.y"
2964 { (yyval
.node
) = astnode_create_datatype(BYTE_DATATYPE
, NULL
, (yyloc
)); }
2968 #line 585 "parser.y"
2969 { (yyval
.node
) = astnode_create_datatype(WORD_DATATYPE
, NULL
, (yyloc
)); }
2973 #line 586 "parser.y"
2974 { (yyval
.node
) = astnode_create_datatype(DWORD_DATATYPE
, NULL
, (yyloc
)); }
2980 /* Line 1037 of yacc.c. */
2981 #line 2982 "parser.c"
2987 YY_STACK_PRINT (yyss
, yyssp
);
2992 /* Now `shift' the result of the reduction. Determine what state
2993 that goes to, based on the state we popped back to and the rule
2994 number reduced by. */
2998 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2999 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
3000 yystate
= yytable
[yystate
];
3002 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
3007 /*------------------------------------.
3008 | yyerrlab -- here on detecting error |
3009 `------------------------------------*/
3011 /* If not already recovering from an error, report this error. */
3016 yyn
= yypact
[yystate
];
3018 if (YYPACT_NINF
< yyn
&& yyn
< YYLAST
)
3020 YYSIZE_T yysize
= 0;
3021 int yytype
= YYTRANSLATE (yychar
);
3022 const char* yyprefix
;
3026 /* Start YYX at -YYN if negative to avoid negative indexes in
3028 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
3030 /* Stay within bounds of both yycheck and yytname. */
3031 int yychecklim
= YYLAST
- yyn
;
3032 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
3035 yyprefix
= ", expecting ";
3036 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
3037 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
3039 yysize
+= yystrlen (yyprefix
) + yystrlen (yytname
[yyx
]);
3047 yysize
+= (sizeof ("syntax error, unexpected ")
3048 + yystrlen (yytname
[yytype
]));
3049 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
3052 char *yyp
= yystpcpy (yymsg
, "syntax error, unexpected ");
3053 yyp
= yystpcpy (yyp
, yytname
[yytype
]);
3057 yyprefix
= ", expecting ";
3058 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
3059 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
3061 yyp
= yystpcpy (yyp
, yyprefix
);
3062 yyp
= yystpcpy (yyp
, yytname
[yyx
]);
3067 YYSTACK_FREE (yymsg
);
3070 yyerror ("syntax error; also virtual memory exhausted");
3073 #endif /* YYERROR_VERBOSE */
3074 yyerror ("syntax error");
3077 yyerror_range
[0] = yylloc
;
3079 if (yyerrstatus
== 3)
3081 /* If just tried and failed to reuse look-ahead token after an
3082 error, discard it. */
3084 if (yychar
<= YYEOF
)
3086 /* If at end of input, pop the error token,
3087 then the rest of the stack, then return failure. */
3088 if (yychar
== YYEOF
)
3091 yyerror_range
[0] = *yylsp
;
3095 yydestruct ("Error: popping",
3096 yystos
[*yyssp
], yyvsp
, yylsp
);
3101 yydestruct ("Error: discarding", yytoken
, &yylval
, &yylloc
);
3106 /* Else will try to reuse look-ahead token after shifting the error
3111 /*---------------------------------------------------.
3112 | yyerrorlab -- error raised explicitly by YYERROR. |
3113 `---------------------------------------------------*/
3117 /* Pacify GCC when the user code never invokes YYERROR and the label
3118 yyerrorlab therefore never appears in user code. */
3123 yyerror_range
[0] = yylsp
[1-yylen
];
3131 /*-------------------------------------------------------------.
3132 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3133 `-------------------------------------------------------------*/
3135 yyerrstatus
= 3; /* Each real token shifted decrements this. */
3139 yyn
= yypact
[yystate
];
3140 if (yyn
!= YYPACT_NINF
)
3143 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
3151 /* Pop the current state because it cannot handle the error token. */
3155 yyerror_range
[0] = *yylsp
;
3156 yydestruct ("Error: popping", yystos
[yystate
], yyvsp
, yylsp
);
3159 YY_STACK_PRINT (yyss
, yyssp
);
3167 yyerror_range
[1] = yylloc
;
3168 /* Using YYLLOC is tempting, but would change the location of
3169 the look-ahead. YYLOC is available though. */
3170 YYLLOC_DEFAULT (yyloc
, yyerror_range
- 1, 2);
3173 /* Shift the error token. */
3174 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
3180 /*-------------------------------------.
3181 | yyacceptlab -- YYACCEPT comes here. |
3182 `-------------------------------------*/
3187 /*-----------------------------------.
3188 | yyabortlab -- YYABORT comes here. |
3189 `-----------------------------------*/
3191 yydestruct ("Error: discarding lookahead",
3192 yytoken
, &yylval
, &yylloc
);
3198 /*----------------------------------------------.
3199 | yyoverflowlab -- parser overflow comes here. |
3200 `----------------------------------------------*/
3202 yyerror ("parser stack overflow");
3210 YYSTACK_FREE (yyss
);
3216 #line 588 "parser.y"
3219 * Takes care of switching to a new scanner input stream when a "incsrc" statement
3220 * has been encountered.
3221 * The current stream is pushed on a stack, and will be popped when EOF is reached
3222 * in the new stream.
3223 * @param n A node of type INCSRC_NODE
3225 void handle_incsrc(astnode
*n
)
3228 /* Get the node which describes the file to include */
3229 astnode
*file
= astnode_get_child(n
, 0);
3230 int quoted_form
= (astnode_get_type(file
) == STRING_NODE
) ? 1 : 0;
3231 switch (yypushandrestart(file
->string
, quoted_form
)) {
3236 /* Failed to open file */
3237 sprintf(errs
, "could not open '%s' for reading", file
->string
);
3241 /* Stack overflow */
3242 yyerror("Maximum include nesting level reached");
3247 // TODO: This shouldn't be done here but rather in astproc module.
3249 FILE *open_included_file(const char *, int, char **);
3252 * Takes care of including the binary contents of the file specified by a parsed
3253 * "incbin" statement.
3254 * Calls yyerror() if the file can't be included for some reason.
3255 * @param n A node of type INCBIN_NODE
3257 void handle_incbin(astnode
*n
)
3260 unsigned char *data
;
3263 /* Get the node which describes the file to include */
3264 astnode
*file
= astnode_get_child(n
, 0);
3265 const char *filename
= file
->string
;
3266 int quoted_form
= (astnode_get_type(file
) == STRING_NODE
) ? 1 : 0;
3267 /* Try to open it */
3268 fp
= open_included_file(filename
, quoted_form
, NULL
);
3271 fseek(fp
, 0, SEEK_END
);
3275 /* Allocate buffer to hold file contents */
3276 data
= (unsigned char *)malloc(size
);
3277 /* Read file contents into buffer */
3278 fread(data
, 1, size
, fp
);
3279 /* Insert binary node */
3280 astnode_add_sibling(n
, astnode_create_binary(data
, size
, n
->loc
) );
3285 /* Couldn't open file */
3286 sprintf(errs
, "could not open '%s' for reading", file
->string
);