1 /* A Bison parser, made by GNU Bison 2.5. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
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.
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.
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/>. */
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.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
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. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "2.5"
50 #define YYSKELETON_NAME "yacc.c"
61 /* Using locations. */
62 #define YYLSP_NEEDED 0
66 /* Copy the first part of user declarations. */
68 /* Line 268 of yacc.c */
79 #define YYSTYPE union ystack
81 static unsigned char bytebuf[1024]; /* used by dumplist() */
85 void yyerror(const char *s);
86 int makeop(struct opcode * op, struct mode *m, int add);
88 char *padline(char *line);
89 void dumplist(char *txt, int show);
91 void genstr(const char *s);
92 void genword(unsigned long w);
94 /* ------------------------ G R A M M E R ----------------------------- */
98 /* Line 268 of yacc.c */
101 /* Enabling traces. */
106 /* Enabling verbose error messages. */
107 #ifdef YYERROR_VERBOSE
108 # undef YYERROR_VERBOSE
109 # define YYERROR_VERBOSE 1
111 # define YYERROR_VERBOSE 0
114 /* Enabling the token table. */
115 #ifndef YYTOKEN_TABLE
116 # define YYTOKEN_TABLE 0
123 /* Put the tokens into the symbol table, so that GDB and other debuggers
269 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
271 # define YYSTYPE_IS_TRIVIAL 1
272 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
273 # define YYSTYPE_IS_DECLARED 1
277 /* Copy the second part of user declarations. */
280 /* Line 343 of yacc.c */
288 typedef YYTYPE_UINT8 yytype_uint8;
290 typedef unsigned char yytype_uint8;
294 typedef YYTYPE_INT8 yytype_int8;
295 #elif (defined __STDC__ || defined __C99__FUNC__ \
296 || defined __cplusplus || defined _MSC_VER)
297 typedef signed char yytype_int8;
299 typedef short int yytype_int8;
303 typedef YYTYPE_UINT16 yytype_uint16;
305 typedef unsigned short int yytype_uint16;
309 typedef YYTYPE_INT16 yytype_int16;
311 typedef short int yytype_int16;
315 # ifdef __SIZE_TYPE__
316 # define YYSIZE_T __SIZE_TYPE__
317 # elif defined size_t
318 # define YYSIZE_T size_t
319 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
320 || defined __cplusplus || defined _MSC_VER)
321 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
322 # define YYSIZE_T size_t
324 # define YYSIZE_T unsigned int
328 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
331 # if defined YYENABLE_NLS && YYENABLE_NLS
333 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
334 # define YY_(msgid) dgettext ("bison-runtime", msgid)
338 # define YY_(msgid) msgid
342 /* Suppress unused-variable warnings by "using" E. */
343 #if ! defined lint || defined __GNUC__
344 # define YYUSE(e) ((void) (e))
346 # define YYUSE(e) /* empty */
349 /* Identity function, used to suppress warnings about constant conditions. */
353 #if (defined __STDC__ || defined __C99__FUNC__ \
354 || defined __cplusplus || defined _MSC_VER)
367 #if ! defined yyoverflow || YYERROR_VERBOSE
369 /* The parser invokes alloca or malloc; define the necessary symbols. */
371 # ifdef YYSTACK_USE_ALLOCA
372 # if YYSTACK_USE_ALLOCA
374 # define YYSTACK_ALLOC __builtin_alloca
375 # elif defined __BUILTIN_VA_ARG_INCR
376 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
378 # define YYSTACK_ALLOC __alloca
379 # elif defined _MSC_VER
380 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
381 # define alloca _alloca
383 # define YYSTACK_ALLOC alloca
384 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
385 || defined __cplusplus || defined _MSC_VER)
386 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
387 # ifndef EXIT_SUCCESS
388 # define EXIT_SUCCESS 0
395 # ifdef YYSTACK_ALLOC
396 /* Pacify GCC's `empty if-body' warning. */
397 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
398 # ifndef YYSTACK_ALLOC_MAXIMUM
399 /* The OS might guarantee only one guard page at the bottom of the stack,
400 and a page size can be as small as 4096 bytes. So we cannot safely
401 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
402 to allow for a few compiler-allocated temporary stack slots. */
403 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
406 # define YYSTACK_ALLOC YYMALLOC
407 # define YYSTACK_FREE YYFREE
408 # ifndef YYSTACK_ALLOC_MAXIMUM
409 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
411 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
412 && ! ((defined YYMALLOC || defined malloc) \
413 && (defined YYFREE || defined free)))
414 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
415 # ifndef EXIT_SUCCESS
416 # define EXIT_SUCCESS 0
420 # define YYMALLOC malloc
421 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
422 || defined __cplusplus || defined _MSC_VER)
423 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
428 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
429 || defined __cplusplus || defined _MSC_VER)
430 void free (void *); /* INFRINGES ON USER NAME SPACE */
434 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
437 #if (! defined yyoverflow \
438 && (! defined __cplusplus \
439 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
441 /* A type that is properly aligned for any stack member. */
444 yytype_int16 yyss_alloc;
448 /* The size of the maximum gap between one aligned stack and the next. */
449 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
451 /* The size of an array large to enough to hold all stacks, each with
453 # define YYSTACK_BYTES(N) \
454 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
455 + YYSTACK_GAP_MAXIMUM)
457 # define YYCOPY_NEEDED 1
459 /* Relocate STACK from its old location to the new one. The
460 local variables YYSIZE and YYSTACKSIZE give the old and new number of
461 elements in the stack, and YYPTR gives the new location of the
462 stack. Advance YYPTR to a properly aligned location for the next
464 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
467 YYSIZE_T yynewbytes; \
468 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
469 Stack = &yyptr->Stack_alloc; \
470 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
471 yyptr += yynewbytes / sizeof (*yyptr); \
477 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
478 /* Copy COUNT objects from FROM to TO. The source and destination do
481 # if defined __GNUC__ && 1 < __GNUC__
482 # define YYCOPY(To, From, Count) \
483 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
485 # define YYCOPY(To, From, Count) \
489 for (yyi = 0; yyi < (Count); yyi++) \
490 (To)[yyi] = (From)[yyi]; \
495 #endif /* !YYCOPY_NEEDED */
497 /* YYFINAL -- State number of the termination state. */
499 /* YYLAST -- Last index in YYTABLE. */
502 /* YYNTOKENS -- Number of terminals. */
504 /* YYNNTS -- Number of nonterminals. */
506 /* YYNRULES -- Number of rules. */
508 /* YYNRULES -- Number of states. */
509 #define YYNSTATES 316
511 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
513 #define YYMAXUTOK 325
515 #define YYTRANSLATE(YYX) \
516 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
518 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
519 static const yytype_uint8 yytranslate[] =
521 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
522 81, 2, 2, 2, 2, 2, 2, 2, 2, 2,
523 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
524 2, 2, 2, 88, 2, 87, 2, 75, 77, 2,
525 84, 85, 73, 71, 83, 72, 82, 74, 2, 2,
526 2, 2, 2, 2, 2, 2, 2, 2, 80, 2,
527 79, 2, 78, 2, 86, 2, 2, 2, 2, 2,
528 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
529 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
530 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
531 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
532 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
533 2, 2, 2, 2, 76, 2, 2, 2, 2, 2,
534 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
535 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
536 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
537 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
538 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
539 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
540 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
541 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
542 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
543 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
544 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
545 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
546 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
547 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
548 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
549 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
550 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
551 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
552 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
553 65, 66, 67, 68, 69, 70
557 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
559 static const yytype_uint16 yyprhs[] =
561 0, 0, 3, 5, 8, 10, 14, 16, 19, 22,
562 24, 25, 29, 33, 37, 41, 45, 51, 57, 60,
563 62, 65, 67, 69, 71, 75, 79, 81, 83, 87,
564 89, 91, 95, 98, 102, 106, 110, 114, 118, 122,
565 126, 131, 136, 138, 140, 142, 145, 148, 151, 154,
566 157, 160, 163, 166, 169, 172, 175, 178, 181, 184,
567 187, 190, 193, 196, 199, 205, 211, 214, 216, 218,
568 221, 224, 227, 230, 233, 236, 239, 242, 245, 248,
569 251, 254, 257, 260, 263, 266, 269, 272, 275, 278,
570 281, 284, 287, 290, 293, 296, 304, 312, 320, 328,
571 334, 340, 346, 352, 356, 360, 365, 370, 374, 379,
572 383, 388, 393, 397, 401, 405, 409, 413, 418, 422,
573 426, 431, 436, 441, 447, 452, 456, 460, 465, 467,
574 469, 471, 474, 476, 478, 480, 486, 493, 500, 508,
575 510, 512, 515, 517, 519, 521, 523, 525, 527, 529,
576 531, 533, 535, 537, 539, 541, 543, 545, 547, 549,
577 551, 553, 555, 557, 559, 561
580 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
581 static const yytype_int8 yyrhs[] =
583 90, 0, -1, 91, -1, 91, 92, -1, 92, -1,
584 99, 80, 93, -1, 93, -1, 95, 81, -1, 103,
585 81, -1, 81, -1, -1, 1, 94, 81, -1, 82,
586 4, 96, -1, 82, 5, 100, -1, 82, 6, 101,
587 -1, 82, 7, 96, -1, 82, 8, 99, 83, 102,
588 -1, 82, 9, 70, 83, 97, -1, 82, 10, -1,
589 102, -1, 98, 60, -1, 70, -1, 69, -1, 70,
590 -1, 100, 83, 119, -1, 100, 83, 3, -1, 119,
591 -1, 3, -1, 101, 83, 120, -1, 120, -1, 73,
592 -1, 84, 102, 85, -1, 72, 102, -1, 102, 76,
593 102, -1, 102, 77, 102, -1, 102, 73, 102, -1,
594 102, 74, 102, -1, 102, 75, 102, -1, 102, 72,
595 102, -1, 102, 71, 102, -1, 102, 78, 78, 102,
596 -1, 102, 79, 79, 102, -1, 70, -1, 69, -1,
597 37, -1, 11, 121, -1, 14, 121, -1, 12, 104,
598 -1, 13, 104, -1, 50, 104, -1, 54, 104, -1,
599 54, 105, -1, 15, 104, -1, 15, 105, -1, 15,
600 106, -1, 39, 104, -1, 39, 105, -1, 39, 106,
601 -1, 52, 104, -1, 23, 110, -1, 23, 59, -1,
602 20, 110, -1, 19, 56, -1, 21, 55, -1, 27,
603 86, 56, 71, 59, -1, 27, 86, 59, 71, 56,
604 -1, 38, 55, -1, 42, -1, 43, -1, 44, 56,
605 -1, 45, 56, -1, 46, 56, -1, 47, 56, -1,
606 51, 56, -1, 53, 104, -1, 17, 111, -1, 18,
607 111, -1, 48, 111, -1, 41, 119, -1, 40, 119,
608 -1, 33, 122, -1, 32, 122, -1, 26, 123, -1,
609 29, 123, -1, 30, 123, -1, 31, 123, -1, 49,
610 123, -1, 16, 112, -1, 24, 107, -1, 28, 107,
611 -1, 25, 107, -1, 22, 108, -1, 34, 104, -1,
612 34, 105, -1, 34, 109, -1, 35, 56, 83, 86,
613 56, 71, 59, -1, 35, 56, 83, 86, 59, 71,
614 56, -1, 35, 56, 83, 86, 56, 71, 58, -1,
615 35, 56, 83, 86, 58, 71, 56, -1, 36, 56,
616 83, 86, 118, -1, 36, 56, 83, 86, 59, -1,
617 36, 86, 118, 83, 56, -1, 36, 86, 59, 83,
618 56, -1, 56, 83, 117, -1, 56, 83, 119, -1,
619 56, 83, 86, 118, -1, 56, 83, 87, 119, -1,
620 119, 83, 56, -1, 119, 83, 87, 119, -1, 57,
621 83, 115, -1, 57, 83, 74, 115, -1, 57, 83,
622 88, 115, -1, 115, 83, 113, -1, 117, 83, 114,
623 -1, 119, 83, 113, -1, 117, 83, 56, -1, 117,
624 83, 119, -1, 117, 83, 87, 119, -1, 119, 83,
625 117, -1, 119, 83, 119, -1, 119, 83, 86, 118,
626 -1, 86, 118, 83, 56, -1, 86, 118, 83, 119,
627 -1, 86, 118, 83, 87, 119, -1, 59, 83, 87,
628 120, -1, 57, 83, 115, -1, 119, 83, 57, -1,
629 119, 60, 83, 57, -1, 56, -1, 117, -1, 119,
630 -1, 86, 118, -1, 56, -1, 57, -1, 115, -1,
631 56, 83, 119, 83, 113, -1, 56, 83, 87, 119,
632 83, 113, -1, 117, 83, 87, 119, 83, 113, -1,
633 86, 118, 83, 87, 119, 83, 113, -1, 102, -1,
634 102, -1, 116, 60, -1, 116, -1, 70, -1, 69,
635 -1, 61, -1, 62, -1, 63, -1, 64, -1, 65,
636 -1, 66, -1, 67, -1, 68, -1, 61, -1, 62,
637 -1, 63, -1, 64, -1, 65, -1, 66, -1, 67,
638 -1, 68, -1, 102, -1, 102, -1, 102, -1, 102,
642 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
643 static const yytype_uint16 yyrline[] =
645 0, 126, 126, 131, 132, 135, 145, 148, 153, 159,
646 164, 164, 183, 190, 191, 192, 195, 204, 210, 213,
647 223, 236, 242, 246, 254, 259, 270, 275, 287, 292,
648 306, 309, 312, 315, 318, 321, 324, 327, 330, 333,
649 336, 339, 341, 354, 366, 368, 370, 372, 374, 376,
650 378, 380, 382, 384, 386, 388, 390, 392, 394, 399,
651 401, 403, 405, 407, 409, 411, 413, 415, 417, 419,
652 421, 423, 425, 427, 429, 433, 435, 437, 441, 450,
653 459, 461, 463, 465, 467, 469, 471, 473, 475, 477,
654 479, 481, 483, 485, 487, 491, 493, 495, 497, 500,
655 502, 504, 506, 518, 524, 531, 537, 546, 553, 563,
656 570, 577, 586, 596, 603, 613, 619, 626, 633, 640,
657 648, 655, 661, 668, 675, 683, 699, 706, 725, 732,
658 738, 745, 753, 759, 765, 774, 782, 790, 798, 808,
659 825, 838, 851, 861, 867, 870, 871, 872, 873, 874,
660 875, 876, 877, 880, 881, 882, 885, 888, 891, 894,
661 897, 902, 912, 922, 937, 951
665 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
666 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
667 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
668 static const char *const yytname[] =
670 "$end", "error", "$undefined", "STRING", "D_ORG", "D_BYTE", "D_WORD",
671 "D_SKIP", "D_EQU", "D_FLAG", "D_END", "ACALL", "ADD", "ADDC", "AJMP",
672 "ANL", "CJNE", "CLR", "CPL", "DA", "DEC", "DIV", "DJNZ", "INC", "JB",
673 "JBC", "JC", "JMP", "JNB", "JNC", "JNZ", "JZ", "LCALL", "LJMP", "MOV",
674 "MOVC", "MOVX", "NOP", "MUL", "ORL", "POP", "PUSH", "RET", "RETI", "RL",
675 "RLC", "RR", "RRC", "SETB", "SJMP", "SUBB", "SWAP", "XCH", "XCHD", "XRL",
676 "AB", "A", "C", "PC", "DPTR", "BITPOS", "R0", "R1", "R2", "R3", "R4",
677 "R5", "R6", "R7", "VALUE", "SYMBOL", "'+'", "'-'", "'*'", "'/'", "'%'",
678 "'|'", "'&'", "'>'", "'<'", "':'", "'\\n'", "'.'", "','", "'('", "')'",
679 "'@'", "'#'", "'!'", "$accept", "program", "linelist", "line",
680 "linerest", "$@1", "directive", "defexpr", "flag", "flagv", "undefsym",
681 "blist", "wlist", "expr", "instr", "two_op1", "two_op2", "two_op3",
682 "two_op4", "two_op5", "two_op6", "single_op1", "single_op2", "three_op1",
683 "rel", "rel2", "bit", "bitv", "reg", "regi", "data8", "data16", "addr11",
684 "addr16", "relative", 0
689 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
691 static const yytype_uint16 yytoknum[] =
693 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
694 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
695 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
696 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
697 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
698 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
699 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
700 325, 43, 45, 42, 47, 37, 124, 38, 62, 60,
701 58, 10, 46, 44, 40, 41, 64, 35, 33
705 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
706 static const yytype_uint8 yyr1[] =
708 0, 89, 90, 91, 91, 92, 92, 93, 93, 93,
709 94, 93, 95, 95, 95, 95, 95, 95, 95, 96,
710 97, 98, 98, 99, 100, 100, 100, 100, 101, 101,
711 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
712 102, 102, 102, 102, 103, 103, 103, 103, 103, 103,
713 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
714 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
715 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
716 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
717 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
718 103, 103, 103, 104, 104, 104, 104, 105, 105, 106,
719 106, 106, 107, 108, 108, 109, 109, 109, 109, 109,
720 109, 109, 109, 109, 109, 109, 109, 109, 110, 110,
721 110, 110, 111, 111, 111, 112, 112, 112, 112, 113,
722 114, 115, 115, 116, 116, 117, 117, 117, 117, 117,
723 117, 117, 117, 118, 118, 118, 118, 118, 118, 118,
724 118, 119, 120, 121, 122, 123
727 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
728 static const yytype_uint8 yyr2[] =
730 0, 2, 1, 2, 1, 3, 1, 2, 2, 1,
731 0, 3, 3, 3, 3, 3, 5, 5, 2, 1,
732 2, 1, 1, 1, 3, 3, 1, 1, 3, 1,
733 1, 3, 2, 3, 3, 3, 3, 3, 3, 3,
734 4, 4, 1, 1, 1, 2, 2, 2, 2, 2,
735 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
736 2, 2, 2, 2, 5, 5, 2, 1, 1, 2,
737 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
738 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
739 2, 2, 2, 2, 2, 7, 7, 7, 7, 5,
740 5, 5, 5, 3, 3, 4, 4, 3, 4, 3,
741 4, 4, 3, 3, 3, 3, 3, 4, 3, 3,
742 4, 4, 4, 5, 4, 3, 3, 4, 1, 1,
743 1, 2, 1, 1, 1, 5, 6, 6, 7, 1,
744 1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
745 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
749 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
750 Performed when YYTABLE doesn't specify something else to do. Zero
751 means the default is an error. */
752 static const yytype_uint8 yydefact[] =
754 0, 10, 0, 0, 0, 0, 0, 0, 0, 0,
755 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
756 0, 0, 0, 0, 0, 0, 0, 0, 44, 0,
757 0, 0, 0, 67, 68, 0, 0, 0, 0, 0,
758 0, 0, 0, 0, 0, 0, 23, 9, 0, 0,
759 0, 4, 6, 0, 0, 0, 0, 43, 42, 0,
760 30, 0, 163, 45, 0, 47, 48, 46, 0, 161,
761 52, 53, 54, 0, 0, 145, 146, 147, 148, 149,
762 150, 151, 152, 0, 87, 0, 132, 133, 144, 143,
763 75, 134, 142, 76, 62, 128, 0, 61, 129, 130,
764 63, 91, 0, 0, 60, 59, 88, 0, 90, 165,
765 82, 0, 89, 83, 84, 85, 164, 81, 80, 0,
766 0, 0, 92, 93, 94, 0, 0, 0, 0, 0,
767 66, 55, 56, 57, 79, 78, 69, 70, 71, 72,
768 77, 86, 49, 73, 58, 74, 50, 51, 0, 0,
769 0, 0, 0, 0, 18, 1, 3, 7, 0, 8,
770 11, 32, 0, 0, 0, 0, 0, 0, 0, 0,
771 0, 0, 0, 0, 0, 0, 153, 154, 155, 156,
772 157, 158, 159, 160, 0, 0, 141, 131, 0, 0,
773 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
774 0, 0, 0, 12, 19, 27, 13, 26, 14, 162,
775 29, 15, 0, 0, 5, 31, 39, 38, 35, 36,
776 37, 33, 34, 0, 0, 0, 0, 103, 104, 0,
777 0, 109, 107, 0, 0, 0, 0, 0, 140, 113,
778 139, 114, 112, 0, 0, 125, 0, 0, 115, 0,
779 116, 0, 126, 0, 118, 119, 0, 0, 0, 0,
780 0, 0, 0, 0, 40, 41, 105, 106, 110, 111,
781 108, 0, 0, 0, 0, 64, 65, 124, 121, 0,
782 122, 117, 127, 120, 0, 0, 0, 100, 99, 102,
783 101, 25, 24, 28, 16, 22, 21, 17, 0, 0,
784 135, 0, 0, 123, 0, 0, 0, 20, 136, 0,
785 137, 97, 95, 98, 96, 138
788 /* YYDEFGOTO[NTERM-NUM]. */
789 static const yytype_int16 yydefgoto[] =
791 -1, 49, 50, 51, 52, 56, 53, 203, 297, 298,
792 54, 206, 208, 69, 55, 65, 71, 72, 106, 101,
793 124, 97, 90, 84, 241, 239, 91, 92, 98, 184,
794 73, 210, 63, 117, 110
797 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
799 #define YYPACT_NINF -239
800 static const yytype_int16 yypact[] =
802 370, -239, 139, -24, -24, 139, 120, 70, 15, 15,
803 -19, 470, -12, 292, 441, 23, 23, 139, -45, 23,
804 139, 139, 139, 139, 139, 222, -9, -26, -239, 14,
805 120, 139, 139, -239, -239, 19, 25, 31, 49, 15,
806 139, -24, 54, -24, -24, 85, -239, -239, 440, 89,
807 298, -239, -239, -27, 37, 38, 41, -239, -239, 139,
808 -239, 139, 513, -239, 64, -239, -239, -239, 67, 513,
809 -239, -239, -239, 68, 77, -239, -239, -239, -239, -239,
810 -239, -239, -239, 454, -239, 87, -239, -239, -239, -239,
811 -239, -239, 83, -239, -239, -239, 454, -239, -239, -239,
812 -239, -239, 90, 91, -239, -239, -239, 101, -239, 513,
813 -239, -30, -239, -239, -239, -239, 513, -239, -239, 102,
814 108, 454, -239, -239, -239, 111, -50, 115, 124, 485,
815 -239, -239, -239, -239, -239, -239, -239, -239, -239, -239,
816 -239, -239, -239, -239, -239, -239, -239, -239, 139, 4,
817 139, 139, 140, 143, -239, -239, -239, -239, 442, -239,
818 -239, 104, 354, 139, 139, 139, 139, 139, 139, 139,
819 75, 145, 496, 126, -47, 133, -239, -239, -239, -239,
820 -239, -239, -239, -239, 135, 132, -239, -239, 139, 139,
821 139, 154, 155, 23, 141, 144, -17, 147, 34, 146,
822 148, 150, 152, -239, 513, -239, 156, -239, 158, 513,
823 -239, -239, 159, 160, -239, -239, 520, 520, 104, 104,
824 104, 30, 30, 139, 139, 454, 139, -239, -239, 23,
825 23, -239, -239, 139, 139, 162, 151, 139, 513, -239,
826 513, -239, -239, 172, 190, -239, 139, 55, -239, 139,
827 -239, 191, -239, 454, -239, -239, 56, 511, 193, 195,
828 10, 139, 139, 60, -239, -239, -239, -239, -239, -239,
829 -239, 164, 139, 139, 170, -239, -239, -239, -239, 139,
830 -239, -239, -239, -239, 183, 184, 185, -239, -239, -239,
831 -239, -239, -239, -239, 513, -239, -239, -239, 197, 139,
832 -239, 175, 139, -239, 86, 205, 206, -239, -239, 139,
833 -239, -239, -239, -239, -239, -239
836 /* YYPGOTO[NTERM-NUM]. */
837 static const yytype_int16 yypgoto[] =
839 -239, -239, -239, 214, 107, -239, -239, 116, -239, -239,
840 114, -239, -239, -2, -239, 21, 33, 238, 26, -239,
841 -239, 255, 22, -239, -186, -239, -14, -239, -1, -85,
842 3, -238, 266, 248, 28
845 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
846 positive, shift that token. If negative, reduce the rule which
847 number is the opposite. If YYTABLE_NINF, syntax error. */
848 #define YYTABLE_NINF -3
849 static const yytype_int16 yytable[] =
851 62, 107, 107, 62, 242, 107, 85, 205, 277, 232,
852 197, 187, 102, 291, 99, 109, 103, 99, 109, 109,
853 109, 116, 116, 293, 125, 66, 191, 70, 126, 192,
854 128, 93, 64, 198, 134, 135, 195, 94, 109, 248,
855 233, 111, 108, 100, 202, 112, 122, 127, 113, 114,
856 115, 131, 57, 58, 157, 59, 60, 161, 123, 162,
857 129, 140, 142, 132, 144, 145, 146, 61, 141, 130,
858 249, 86, 87, 57, 58, 136, 59, 60, 147, 57,
859 58, 137, 59, 60, 88, 89, 300, 138, 61, 155,
860 232, 252, 88, 89, 61, 75, 76, 77, 78, 79,
861 80, 81, 82, 57, 58, 139, 59, 60, 170, 171,
862 143, 278, 284, 308, 285, 286, 310, 158, 61, 159,
863 253, 233, 160, 315, 57, 58, 74, 59, 60, 295,
864 296, 75, 76, 77, 78, 79, 80, 81, 82, 61,
865 266, 64, 279, 186, 311, 312, 204, 172, 209, 204,
866 173, 174, 207, 223, 57, 58, 83, 59, 60, 231,
867 175, 216, 217, 218, 219, 220, 221, 222, 283, 61,
868 185, 227, 288, 188, 189, 228, 64, 68, 235, 245,
869 168, 169, 170, 171, 190, 193, 238, 240, 240, 57,
870 58, 194, 59, 60, 196, 88, 89, 254, 199, 250,
871 229, 255, 57, 58, 61, 59, 60, 200, 57, 58,
872 46, 59, 60, 213, 230, 268, 269, 61, 236, 237,
873 234, 264, 265, 61, 224, 243, 244, 247, 246, 267,
874 251, 275, 256, 258, 257, 259, 270, 271, 273, 260,
875 274, 261, 262, 263, 209, 272, 276, 299, 282, 289,
876 280, 290, 281, 302, 304, 305, 306, 307, 309, 209,
877 294, 313, 314, 292, 156, 214, 212, 211, 133, 105,
878 240, 67, 118, 0, 0, 0, 301, 0, 64, 119,
879 0, 120, 303, 75, 76, 77, 78, 79, 80, 81,
880 82, 57, 58, 0, 59, 60, 0, 240, -2, 1,
881 240, 0, 0, 0, 0, 0, 61, 240, 121, 2,
882 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
883 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
884 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
885 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
886 43, 44, 45, 75, 76, 77, 78, 79, 80, 81,
887 82, 57, 58, 0, 59, 60, 0, 0, 46, 0,
888 0, 1, 0, 0, 0, 0, 61, 0, 0, 47,
889 48, 2, 3, 4, 5, 6, 7, 8, 9, 10,
890 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
891 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
892 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
893 41, 42, 43, 44, 45, 163, 164, 165, 166, 167,
894 168, 169, 170, 171, 0, 0, 0, 0, 0, 215,
895 46, 0, 0, 1, 148, 149, 150, 151, 152, 153,
896 154, 47, 48, 2, 3, 4, 5, 6, 7, 8,
897 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
898 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
899 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
900 39, 40, 41, 42, 43, 44, 45, 95, 0, 0,
901 104, 0, 75, 76, 77, 78, 79, 80, 81, 82,
902 57, 58, 0, 59, 60, 176, 177, 178, 179, 180,
903 181, 182, 183, 47, 48, 61, 95, 96, 0, 0,
904 0, 75, 76, 77, 78, 79, 80, 81, 82, 57,
905 58, 0, 59, 60, 201, 0, 176, 177, 178, 179,
906 180, 181, 182, 183, 61, 0, 96, 75, 76, 77,
907 78, 79, 80, 81, 82, 57, 58, 0, 59, 60,
908 287, 0, 176, 177, 178, 179, 180, 181, 182, 183,
909 61, 0, 225, 226, 163, 164, 165, 166, 167, 168,
910 169, 170, 171, 165, 166, 167, 168, 169, 170, 171
913 #define yypact_value_is_default(yystate) \
914 ((yystate) == (-239))
916 #define yytable_value_is_error(yytable_value) \
919 static const yytype_int16 yycheck[] =
921 2, 15, 16, 5, 190, 19, 7, 3, 246, 56,
922 60, 96, 13, 3, 11, 17, 13, 14, 20, 21,
923 22, 23, 24, 261, 25, 4, 56, 6, 25, 59,
924 56, 9, 56, 83, 31, 32, 121, 56, 40, 56,
925 87, 86, 16, 55, 129, 19, 25, 56, 20, 21,
926 22, 30, 69, 70, 81, 72, 73, 59, 25, 61,
927 86, 39, 41, 30, 43, 44, 45, 84, 40, 55,
928 87, 56, 57, 69, 70, 56, 72, 73, 45, 69,
929 70, 56, 72, 73, 69, 70, 272, 56, 84, 0,
930 56, 57, 69, 70, 84, 61, 62, 63, 64, 65,
931 66, 67, 68, 69, 70, 56, 72, 73, 78, 79,
932 56, 56, 56, 299, 58, 59, 302, 80, 84, 81,
933 86, 87, 81, 309, 69, 70, 56, 72, 73, 69,
934 70, 61, 62, 63, 64, 65, 66, 67, 68, 84,
935 225, 56, 87, 60, 58, 59, 148, 83, 150, 151,
936 83, 83, 149, 78, 69, 70, 86, 72, 73, 173,
937 83, 163, 164, 165, 166, 167, 168, 169, 253, 84,
938 83, 172, 257, 83, 83, 172, 56, 57, 175, 193,
939 76, 77, 78, 79, 83, 83, 188, 189, 190, 69,
940 70, 83, 72, 73, 83, 69, 70, 198, 83, 196,
941 74, 198, 69, 70, 84, 72, 73, 83, 69, 70,
942 70, 72, 73, 70, 88, 229, 230, 84, 83, 87,
943 87, 223, 224, 84, 79, 71, 71, 83, 87, 226,
944 83, 59, 86, 83, 86, 83, 233, 234, 87, 83,
945 237, 83, 83, 83, 246, 83, 56, 83, 57, 56,
946 247, 56, 249, 83, 71, 71, 71, 60, 83, 261,
947 262, 56, 56, 260, 50, 158, 152, 151, 30, 14,
948 272, 5, 24, -1, -1, -1, 273, -1, 56, 57,
949 -1, 59, 279, 61, 62, 63, 64, 65, 66, 67,
950 68, 69, 70, -1, 72, 73, -1, 299, 0, 1,
951 302, -1, -1, -1, -1, -1, 84, 309, 86, 11,
952 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
953 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
954 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
955 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
956 52, 53, 54, 61, 62, 63, 64, 65, 66, 67,
957 68, 69, 70, -1, 72, 73, -1, -1, 70, -1,
958 -1, 1, -1, -1, -1, -1, 84, -1, -1, 81,
959 82, 11, 12, 13, 14, 15, 16, 17, 18, 19,
960 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
961 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
962 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
963 50, 51, 52, 53, 54, 71, 72, 73, 74, 75,
964 76, 77, 78, 79, -1, -1, -1, -1, -1, 85,
965 70, -1, -1, 1, 4, 5, 6, 7, 8, 9,
966 10, 81, 82, 11, 12, 13, 14, 15, 16, 17,
967 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
968 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
969 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
970 48, 49, 50, 51, 52, 53, 54, 56, -1, -1,
971 59, -1, 61, 62, 63, 64, 65, 66, 67, 68,
972 69, 70, -1, 72, 73, 61, 62, 63, 64, 65,
973 66, 67, 68, 81, 82, 84, 56, 86, -1, -1,
974 -1, 61, 62, 63, 64, 65, 66, 67, 68, 69,
975 70, -1, 72, 73, 59, -1, 61, 62, 63, 64,
976 65, 66, 67, 68, 84, -1, 86, 61, 62, 63,
977 64, 65, 66, 67, 68, 69, 70, -1, 72, 73,
978 59, -1, 61, 62, 63, 64, 65, 66, 67, 68,
979 84, -1, 86, 87, 71, 72, 73, 74, 75, 76,
980 77, 78, 79, 73, 74, 75, 76, 77, 78, 79
983 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
984 symbol of state STATE-NUM. */
985 static const yytype_uint8 yystos[] =
987 0, 1, 11, 12, 13, 14, 15, 16, 17, 18,
988 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
989 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
990 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
991 49, 50, 51, 52, 53, 54, 70, 81, 82, 90,
992 91, 92, 93, 95, 99, 103, 94, 69, 70, 72,
993 73, 84, 102, 121, 56, 104, 104, 121, 57, 102,
994 104, 105, 106, 119, 56, 61, 62, 63, 64, 65,
995 66, 67, 68, 86, 112, 117, 56, 57, 69, 70,
996 111, 115, 116, 111, 56, 56, 86, 110, 117, 119,
997 55, 108, 117, 119, 59, 110, 107, 115, 107, 102,
998 123, 86, 107, 123, 123, 123, 102, 122, 122, 57,
999 59, 86, 104, 105, 109, 117, 119, 56, 56, 86,
1000 55, 104, 105, 106, 119, 119, 56, 56, 56, 56,
1001 111, 123, 104, 56, 104, 104, 104, 105, 4, 5,
1002 6, 7, 8, 9, 10, 0, 92, 81, 80, 81,
1003 81, 102, 102, 71, 72, 73, 74, 75, 76, 77,
1004 78, 79, 83, 83, 83, 83, 61, 62, 63, 64,
1005 65, 66, 67, 68, 118, 83, 60, 118, 83, 83,
1006 83, 56, 59, 83, 83, 118, 83, 60, 83, 83,
1007 83, 59, 118, 96, 102, 3, 100, 119, 101, 102,
1008 120, 96, 99, 70, 93, 85, 102, 102, 102, 102,
1009 102, 102, 102, 78, 79, 86, 87, 117, 119, 74,
1010 88, 115, 56, 87, 87, 119, 83, 87, 102, 114,
1011 102, 113, 113, 71, 71, 115, 87, 83, 56, 87,
1012 119, 83, 57, 86, 117, 119, 86, 86, 83, 83,
1013 83, 83, 83, 83, 102, 102, 118, 119, 115, 115,
1014 119, 119, 83, 87, 119, 59, 56, 120, 56, 87,
1015 119, 119, 57, 118, 56, 58, 59, 59, 118, 56,
1016 56, 3, 119, 120, 102, 69, 70, 97, 98, 83,
1017 113, 119, 83, 119, 71, 71, 71, 60, 113, 83,
1018 113, 58, 59, 56, 56, 113
1021 #define yyerrok (yyerrstatus = 0)
1022 #define yyclearin (yychar = YYEMPTY)
1023 #define YYEMPTY (-2)
1026 #define YYACCEPT goto yyacceptlab
1027 #define YYABORT goto yyabortlab
1028 #define YYERROR goto yyerrorlab
1031 /* Like YYERROR except do call yyerror. This remains here temporarily
1032 to ease the transition to the new meaning of YYERROR, for GCC.
1033 Once GCC version 2 has supplanted version 1, this can go. However,
1034 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
1035 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
1038 #define YYFAIL goto yyerrlab
1040 /* This is here to suppress warnings from the GCC cpp's
1041 -Wunused-macros. Normally we don't worry about that warning, but
1042 some users do, and we want to make it easy for users to remove
1043 YYFAIL uses, which will produce warnings from Bison 2.5. */
1046 #define YYRECOVERING() (!!yyerrstatus)
1048 #define YYBACKUP(Token, Value) \
1050 if (yychar == YYEMPTY && yylen == 1) \
1059 yyerror (YY_("syntax error: cannot back up")); \
1066 #define YYERRCODE 256
1069 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1070 If N is 0, then set CURRENT to the empty location which ends
1071 the previous symbol: RHS[0] (always defined). */
1073 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1074 #ifndef YYLLOC_DEFAULT
1075 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1079 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1080 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1081 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1082 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1086 (Current).first_line = (Current).last_line = \
1087 YYRHSLOC (Rhs, 0).last_line; \
1088 (Current).first_column = (Current).last_column = \
1089 YYRHSLOC (Rhs, 0).last_column; \
1095 /* This macro is provided for backward compatibility. */
1097 #ifndef YY_LOCATION_PRINT
1098 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1102 /* YYLEX -- calling `yylex' with the right arguments. */
1105 # define YYLEX yylex (YYLEX_PARAM)
1107 # define YYLEX yylex ()
1110 /* Enable debugging if requested. */
1114 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1115 # define YYFPRINTF fprintf
1118 # define YYDPRINTF(Args) \
1124 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1128 YYFPRINTF (stderr, "%s ", Title); \
1129 yy_symbol_print (stderr, \
1131 YYFPRINTF (stderr, "\n"); \
1136 /*--------------------------------.
1137 | Print this symbol on YYOUTPUT. |
1138 `--------------------------------*/
1141 #if (defined __STDC__ || defined __C99__FUNC__ \
1142 || defined __cplusplus || defined _MSC_VER)
1144 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1147 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
1150 YYSTYPE const * const yyvaluep;
1156 if (yytype < YYNTOKENS)
1157 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1169 /*--------------------------------.
1170 | Print this symbol on YYOUTPUT. |
1171 `--------------------------------*/
1173 #if (defined __STDC__ || defined __C99__FUNC__ \
1174 || defined __cplusplus || defined _MSC_VER)
1176 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1179 yy_symbol_print (yyoutput, yytype, yyvaluep)
1182 YYSTYPE const * const yyvaluep;
1185 if (yytype < YYNTOKENS)
1186 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1188 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1190 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1191 YYFPRINTF (yyoutput, ")");
1194 /*------------------------------------------------------------------.
1195 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1197 `------------------------------------------------------------------*/
1199 #if (defined __STDC__ || defined __C99__FUNC__ \
1200 || defined __cplusplus || defined _MSC_VER)
1202 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1205 yy_stack_print (yybottom, yytop)
1206 yytype_int16 *yybottom;
1207 yytype_int16 *yytop;
1210 YYFPRINTF (stderr, "Stack now");
1211 for (; yybottom <= yytop; yybottom++)
1213 int yybot = *yybottom;
1214 YYFPRINTF (stderr, " %d", yybot);
1216 YYFPRINTF (stderr, "\n");
1219 # define YY_STACK_PRINT(Bottom, Top) \
1222 yy_stack_print ((Bottom), (Top)); \
1226 /*------------------------------------------------.
1227 | Report that the YYRULE is going to be reduced. |
1228 `------------------------------------------------*/
1230 #if (defined __STDC__ || defined __C99__FUNC__ \
1231 || defined __cplusplus || defined _MSC_VER)
1233 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1236 yy_reduce_print (yyvsp, yyrule)
1241 int yynrhs = yyr2[yyrule];
1243 unsigned long int yylno = yyrline[yyrule];
1244 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1246 /* The symbols being reduced. */
1247 for (yyi = 0; yyi < yynrhs; yyi++)
1249 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1250 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1251 &(yyvsp[(yyi + 1) - (yynrhs)])
1253 YYFPRINTF (stderr, "\n");
1257 # define YY_REDUCE_PRINT(Rule) \
1260 yy_reduce_print (yyvsp, Rule); \
1263 /* Nonzero means print parse trace. It is left uninitialized so that
1264 multiple parsers can coexist. */
1266 #else /* !YYDEBUG */
1267 # define YYDPRINTF(Args)
1268 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1269 # define YY_STACK_PRINT(Bottom, Top)
1270 # define YY_REDUCE_PRINT(Rule)
1271 #endif /* !YYDEBUG */
1274 /* YYINITDEPTH -- initial size of the parser's stacks. */
1276 # define YYINITDEPTH 200
1279 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1280 if the built-in stack extension method is used).
1282 Do not make this value too large; the results are undefined if
1283 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1284 evaluated with infinite-precision integer arithmetic. */
1287 # define YYMAXDEPTH 10000
1294 # if defined __GLIBC__ && defined _STRING_H
1295 # define yystrlen strlen
1297 /* Return the length of YYSTR. */
1298 #if (defined __STDC__ || defined __C99__FUNC__ \
1299 || defined __cplusplus || defined _MSC_VER)
1301 yystrlen (const char *yystr)
1309 for (yylen = 0; yystr[yylen]; yylen++)
1317 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1318 # define yystpcpy stpcpy
1320 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1322 #if (defined __STDC__ || defined __C99__FUNC__ \
1323 || defined __cplusplus || defined _MSC_VER)
1325 yystpcpy (char *yydest, const char *yysrc)
1328 yystpcpy (yydest, yysrc)
1334 const char *yys = yysrc;
1336 while ((*yyd++ = *yys++) != '\0')
1345 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1346 quotes and backslashes, so that it's suitable for yyerror. The
1347 heuristic is that double-quoting is unnecessary unless the string
1348 contains an apostrophe, a comma, or backslash (other than
1349 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1350 null, do not copy; instead, return the length of what the result
1353 yytnamerr (char *yyres, const char *yystr)
1358 char const *yyp = yystr;
1365 goto do_not_strip_quotes;
1369 goto do_not_strip_quotes;
1382 do_not_strip_quotes: ;
1386 return yystrlen (yystr);
1388 return yystpcpy (yyres, yystr) - yyres;
1392 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1393 about the unexpected token YYTOKEN for the state stack whose top is
1396 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1397 not large enough to hold the message. In that case, also set
1398 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1399 required number of bytes is too large to store. */
1401 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1402 yytype_int16 *yyssp, int yytoken)
1404 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
1405 YYSIZE_T yysize = yysize0;
1407 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1408 /* Internationalized format string. */
1409 const char *yyformat = 0;
1410 /* Arguments of yyformat. */
1411 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1412 /* Number of reported tokens (one for the "unexpected", one per
1416 /* There are many possibilities here to consider:
1417 - Assume YYFAIL is not used. It's too flawed to consider. See
1418 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1419 for details. YYERROR is fine as it does not invoke this
1421 - If this state is a consistent state with a default action, then
1422 the only way this function was invoked is if the default action
1423 is an error action. In that case, don't check for expected
1424 tokens because there are none.
1425 - The only way there can be no lookahead present (in yychar) is if
1426 this state is a consistent state with a default action. Thus,
1427 detecting the absence of a lookahead is sufficient to determine
1428 that there is no unexpected or expected token to report. In that
1429 case, just report a simple "syntax error".
1430 - Don't assume there isn't a lookahead just because this state is a
1431 consistent state with a default action. There might have been a
1432 previous inconsistent state, consistent state with a non-default
1433 action, or user semantic action that manipulated yychar.
1434 - Of course, the expected token list depends on states to have
1435 correct lookahead information, and it depends on the parser not
1436 to perform extra reductions after fetching a lookahead from the
1437 scanner and before detecting a syntax error. Thus, state merging
1438 (from LALR or IELR) and default reductions corrupt the expected
1439 token list. However, the list is correct for canonical LR with
1440 one exception: it will still contain any token that will not be
1441 accepted due to an error action in a later state.
1443 if (yytoken != YYEMPTY)
1445 int yyn = yypact[*yyssp];
1446 yyarg[yycount++] = yytname[yytoken];
1447 if (!yypact_value_is_default (yyn))
1449 /* Start YYX at -YYN if negative to avoid negative indexes in
1450 YYCHECK. In other words, skip the first -YYN actions for
1451 this state because they are default actions. */
1452 int yyxbegin = yyn < 0 ? -yyn : 0;
1453 /* Stay within bounds of both yycheck and yytname. */
1454 int yychecklim = YYLAST - yyn + 1;
1455 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1458 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1459 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1460 && !yytable_value_is_error (yytable[yyx + yyn]))
1462 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1468 yyarg[yycount++] = yytname[yyx];
1469 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1470 if (! (yysize <= yysize1
1471 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1480 # define YYCASE_(N, S) \
1484 YYCASE_(0, YY_("syntax error"));
1485 YYCASE_(1, YY_("syntax error, unexpected %s"));
1486 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1487 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1488 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1489 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1493 yysize1 = yysize + yystrlen (yyformat);
1494 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1498 if (*yymsg_alloc < yysize)
1500 *yymsg_alloc = 2 * yysize;
1501 if (! (yysize <= *yymsg_alloc
1502 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1503 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1507 /* Avoid sprintf, as that infringes on the user's name space.
1508 Don't have undefined behavior even if the translation
1509 produced a string with the wrong number of "%s"s. */
1513 while ((*yyp = *yyformat) != '\0')
1514 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1516 yyp += yytnamerr (yyp, yyarg[yyi++]);
1527 #endif /* YYERROR_VERBOSE */
1529 /*-----------------------------------------------.
1530 | Release the memory associated to this symbol. |
1531 `-----------------------------------------------*/
1534 #if (defined __STDC__ || defined __C99__FUNC__ \
1535 || defined __cplusplus || defined _MSC_VER)
1537 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1540 yydestruct (yymsg, yytype, yyvaluep)
1550 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1561 /* Prevent warnings from -Wmissing-prototypes. */
1562 #ifdef YYPARSE_PARAM
1563 #if defined __STDC__ || defined __cplusplus
1564 int yyparse (void *YYPARSE_PARAM);
1568 #else /* ! YYPARSE_PARAM */
1569 #if defined __STDC__ || defined __cplusplus
1574 #endif /* ! YYPARSE_PARAM */
1577 /* The lookahead symbol. */
1580 /* The semantic value of the lookahead symbol. */
1583 /* Number of syntax errors so far. */
1591 #ifdef YYPARSE_PARAM
1592 #if (defined __STDC__ || defined __C99__FUNC__ \
1593 || defined __cplusplus || defined _MSC_VER)
1595 yyparse (void *YYPARSE_PARAM)
1598 yyparse (YYPARSE_PARAM)
1599 void *YYPARSE_PARAM;
1601 #else /* ! YYPARSE_PARAM */
1602 #if (defined __STDC__ || defined __C99__FUNC__ \
1603 || defined __cplusplus || defined _MSC_VER)
1614 /* Number of tokens to shift before error messages enabled. */
1617 /* The stacks and their tools:
1618 `yyss': related to states.
1619 `yyvs': related to semantic values.
1621 Refer to the stacks thru separate pointers, to allow yyoverflow
1622 to reallocate them elsewhere. */
1624 /* The state stack. */
1625 yytype_int16 yyssa[YYINITDEPTH];
1627 yytype_int16 *yyssp;
1629 /* The semantic value stack. */
1630 YYSTYPE yyvsa[YYINITDEPTH];
1634 YYSIZE_T yystacksize;
1638 /* Lookahead token as an internal (translated) token number. */
1640 /* The variables used to return semantic value and location from the
1645 /* Buffer for error messages, and its allocated size. */
1647 char *yymsg = yymsgbuf;
1648 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1651 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1653 /* The number of symbols on the RHS of the reduced rule.
1654 Keep to zero when no symbol should be popped. */
1660 yystacksize = YYINITDEPTH;
1662 YYDPRINTF ((stderr, "Starting parse\n"));
1667 yychar = YYEMPTY; /* Cause a token to be read. */
1669 /* Initialize stack pointers.
1670 Waste one element of value and location stack
1671 so that they stay on the same level as the state stack.
1672 The wasted elements are never initialized. */
1678 /*------------------------------------------------------------.
1679 | yynewstate -- Push a new state, which is found in yystate. |
1680 `------------------------------------------------------------*/
1682 /* In all cases, when you get here, the value and location stacks
1683 have just been pushed. So pushing a state here evens the stacks. */
1689 if (yyss + yystacksize - 1 <= yyssp)
1691 /* Get the current used size of the three stacks, in elements. */
1692 YYSIZE_T yysize = yyssp - yyss + 1;
1696 /* Give user a chance to reallocate the stack. Use copies of
1697 these so that the &'s don't force the real ones into
1699 YYSTYPE *yyvs1 = yyvs;
1700 yytype_int16 *yyss1 = yyss;
1702 /* Each stack pointer address is followed by the size of the
1703 data in use in that stack, in bytes. This used to be a
1704 conditional around just the two extra args, but that might
1705 be undefined if yyoverflow is a macro. */
1706 yyoverflow (YY_("memory exhausted"),
1707 &yyss1, yysize * sizeof (*yyssp),
1708 &yyvs1, yysize * sizeof (*yyvsp),
1714 #else /* no yyoverflow */
1715 # ifndef YYSTACK_RELOCATE
1716 goto yyexhaustedlab;
1718 /* Extend the stack our own way. */
1719 if (YYMAXDEPTH <= yystacksize)
1720 goto yyexhaustedlab;
1722 if (YYMAXDEPTH < yystacksize)
1723 yystacksize = YYMAXDEPTH;
1726 yytype_int16 *yyss1 = yyss;
1727 union yyalloc *yyptr =
1728 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1730 goto yyexhaustedlab;
1731 YYSTACK_RELOCATE (yyss_alloc, yyss);
1732 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1733 # undef YYSTACK_RELOCATE
1735 YYSTACK_FREE (yyss1);
1738 #endif /* no yyoverflow */
1740 yyssp = yyss + yysize - 1;
1741 yyvsp = yyvs + yysize - 1;
1743 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1744 (unsigned long int) yystacksize));
1746 if (yyss + yystacksize - 1 <= yyssp)
1750 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1752 if (yystate == YYFINAL)
1762 /* Do appropriate processing given the current state. Read a
1763 lookahead token if we need one and don't already have one. */
1765 /* First try to decide what to do without reference to lookahead token. */
1766 yyn = yypact[yystate];
1767 if (yypact_value_is_default (yyn))
1770 /* Not known => get a lookahead token if don't already have one. */
1772 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1773 if (yychar == YYEMPTY)
1775 YYDPRINTF ((stderr, "Reading a token: "));
1779 if (yychar <= YYEOF)
1781 yychar = yytoken = YYEOF;
1782 YYDPRINTF ((stderr, "Now at end of input.\n"));
1786 yytoken = YYTRANSLATE (yychar);
1787 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1790 /* If the proper action on seeing token YYTOKEN is to reduce or to
1791 detect an error, take that action. */
1793 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1798 if (yytable_value_is_error (yyn))
1804 /* Count tokens shifted since error; after three, turn off error
1809 /* Shift the lookahead token. */
1810 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1812 /* Discard the shifted token. */
1821 /*-----------------------------------------------------------.
1822 | yydefault -- do the default action for the current state. |
1823 `-----------------------------------------------------------*/
1825 yyn = yydefact[yystate];
1831 /*-----------------------------.
1832 | yyreduce -- Do a reduction. |
1833 `-----------------------------*/
1835 /* yyn is the number of a rule to reduce with. */
1838 /* If YYLEN is nonzero, implement the default value of the action:
1841 Otherwise, the following line sets YYVAL to garbage.
1842 This behavior is undocumented and Bison
1843 users should not rely upon it. Assigning to YYVAL
1844 unconditionally makes the parser a bit smaller, and it avoids a
1845 GCC warning that YYVAL may be used uninitialized. */
1846 yyval = yyvsp[1-yylen];
1849 YY_REDUCE_PRINT (yyn);
1854 /* Line 1806 of yacc.c */
1855 #line 127 "parser.y"
1862 /* Line 1806 of yacc.c */
1863 #line 136 "parser.y"
1865 if (abort_asap) {YYABORT;}
1867 (yyvsp[(1) - (3)]).sym->type = LABEL;
1868 (yyvsp[(1) - (3)]).sym->value = lc;
1870 inclc((yyvsp[(3) - (3)]).value);
1877 /* Line 1806 of yacc.c */
1878 #line 145 "parser.y"
1879 { inclc((yyvsp[(1) - (1)]).value); bytecount = 0; }
1884 /* Line 1806 of yacc.c */
1885 #line 148 "parser.y"
1887 (yyval).value = (yyvsp[(1) - (2)]).value;
1888 if( dashl && pass2 )
1889 dumplist((yyvsp[(2) - (2)]).str,1);
1895 /* Line 1806 of yacc.c */
1896 #line 153 "parser.y"
1898 (yyval).value = (yyvsp[(1) - (2)]).value;
1899 if( dashl && pass2 )
1900 dumplist((yyvsp[(2) - (2)]).str,1);
1907 /* Line 1806 of yacc.c */
1908 #line 159 "parser.y"
1911 if( dashl && pass2 )
1912 dumplist((yyvsp[(1) - (1)]).str,0);
1918 /* Line 1806 of yacc.c */
1919 #line 164 "parser.y"
1927 /* Line 1806 of yacc.c */
1928 #line 167 "parser.y"
1931 if( dashl && pass2 )
1932 dumplist((yyvsp[(1) - (3)]).str,0);
1938 /* Line 1806 of yacc.c */
1939 #line 184 "parser.y"
1941 lc = (yyvsp[(3) - (3)]).val.v;
1942 if( pass2 ) emitaddr(lc);
1950 /* Line 1806 of yacc.c */
1951 #line 190 "parser.y"
1952 { (yyval).value = (yyvsp[(3) - (3)]).value; }
1957 /* Line 1806 of yacc.c */
1958 #line 191 "parser.y"
1959 { (yyval).value = (yyvsp[(3) - (3)]).value; }
1964 /* Line 1806 of yacc.c */
1965 #line 192 "parser.y"
1966 { (yyval).value = (yyvsp[(3) - (3)]).val.v;
1968 emitaddr(lc+(yyval).value); }
1973 /* Line 1806 of yacc.c */
1974 #line 196 "parser.y"
1976 if( (yyvsp[(5) - (5)]).val.d == 0 )
1977 warn("Expression is undefined in pass 1");
1978 (yyvsp[(3) - (5)]).sym->type = LABEL;
1979 (yyvsp[(3) - (5)]).sym->value = (yyvsp[(5) - (5)]).val.v;
1986 /* Line 1806 of yacc.c */
1987 #line 205 "parser.y"
1989 (yyvsp[(3) - (5)]).sym->type = LABEL;
1990 (yyvsp[(3) - (5)]).sym->value = (yyvsp[(5) - (5)]).value;
1997 /* Line 1806 of yacc.c */
1998 #line 210 "parser.y"
1999 { (yyval).value = 0; }
2004 /* Line 1806 of yacc.c */
2005 #line 214 "parser.y"
2007 if( (yyvsp[(1) - (1)]).val.d == 0 )
2008 warn("Expression is undefined in pass 1");
2009 if( !(isbit16((yyvsp[(1) - (1)]).val.v)) )
2010 warn("Value greater than 16-bits");
2011 (yyval).value = (yyvsp[(1) - (1)]).val.v;
2017 /* Line 1806 of yacc.c */
2018 #line 224 "parser.y"
2020 if( !isbit8((yyvsp[(1) - (2)]).value) )
2021 warn("Bit address exceeds 8-bits");
2022 if( isbmram((yyvsp[(1) - (2)]).value) )
2023 (yyval).value = ((yyvsp[(1) - (2)]).value-0x20)*8+ (yyvsp[(2) - (2)]).value;
2024 else if( isbmsfr((yyvsp[(1) - (2)]).value) )
2025 (yyval).value = (yyvsp[(1) - (2)]).value + (yyvsp[(2) - (2)]).value;
2027 warn("Invalid bit addressable RAM location");
2033 /* Line 1806 of yacc.c */
2034 #line 237 "parser.y"
2036 if( (yyvsp[(1) - (1)]).sym->type == UNDEF )
2037 warn("Symbol %s must be defined in pass 1",(yyvsp[(1) - (1)]).sym->name);
2038 (yyval).value = (yyvsp[(1) - (1)]).sym->value;
2044 /* Line 1806 of yacc.c */
2045 #line 242 "parser.y"
2046 { (yyval).value = (yyvsp[(1) - (1)]).value; }
2051 /* Line 1806 of yacc.c */
2052 #line 247 "parser.y"
2054 if( (yyvsp[(1) - (1)]).sym->type != UNDEF && pass1)
2055 warn("Attempt to redefine symbol: %s",(yyvsp[(1) - (1)]).sym->name);
2056 (yyval).sym = (yyvsp[(1) - (1)]).sym;
2062 /* Line 1806 of yacc.c */
2063 #line 255 "parser.y"
2065 if( pass2 ) genbyte((yyvsp[(3) - (3)]).value);
2066 (yyval).value = (yyvsp[(1) - (3)]).value + 1;
2072 /* Line 1806 of yacc.c */
2073 #line 260 "parser.y"
2076 (yyval).value = (yyvsp[(1) - (3)]).value + (yyvsp[(3) - (3)]).value;
2078 (yyval).value = (yyvsp[(1) - (3)]).value + strlen((yyvsp[(3) - (3)]).str);
2079 genstr((yyvsp[(3) - (3)]).str);
2081 free((yyvsp[(3) - (3)]).str);
2088 /* Line 1806 of yacc.c */
2089 #line 271 "parser.y"
2091 if( pass2 ) genbyte((yyvsp[(1) - (1)]).value);
2098 /* Line 1806 of yacc.c */
2099 #line 276 "parser.y"
2102 (yyval).value = (yyvsp[(1) - (1)]).value;
2104 (yyval).value = strlen((yyvsp[(1) - (1)]).str);
2105 genstr((yyvsp[(1) - (1)]).str);
2106 free((yyvsp[(1) - (1)]).str);
2113 /* Line 1806 of yacc.c */
2114 #line 288 "parser.y"
2116 if( pass2 ) genword((yyvsp[(3) - (3)]).value);
2117 (yyval).value = (yyvsp[(1) - (3)]).value + 2;
2123 /* Line 1806 of yacc.c */
2124 #line 293 "parser.y"
2126 if( pass2 ) genword((yyvsp[(1) - (1)]).value);
2133 /* Line 1806 of yacc.c */
2134 #line 306 "parser.y"
2135 { (yyval).val.v = lc;
2136 (yyval).val.d = 1; }
2141 /* Line 1806 of yacc.c */
2142 #line 309 "parser.y"
2143 { (yyval).val.v = (yyvsp[(2) - (3)]).val.v;
2144 (yyval).val.d = (yyvsp[(2) - (3)]).val.d; }
2149 /* Line 1806 of yacc.c */
2150 #line 312 "parser.y"
2151 { (yyval).val.v = -(yyvsp[(2) - (2)]).val.v;
2152 (yyval).val.d = (yyvsp[(2) - (2)]).val.d; }
2157 /* Line 1806 of yacc.c */
2158 #line 315 "parser.y"
2159 { (yyval).val.v = (yyvsp[(1) - (3)]).val.v | (yyvsp[(3) - (3)]).val.v;
2160 (yyval).val.d = (yyvsp[(1) - (3)]).val.d && (yyvsp[(3) - (3)]).val.d; }
2165 /* Line 1806 of yacc.c */
2166 #line 318 "parser.y"
2167 { (yyval).val.v = (yyvsp[(1) - (3)]).val.v & (yyvsp[(3) - (3)]).val.v;
2168 (yyval).val.d = (yyvsp[(1) - (3)]).val.d && (yyvsp[(3) - (3)]).val.d; }
2173 /* Line 1806 of yacc.c */
2174 #line 321 "parser.y"
2175 { (yyval).val.v = (yyvsp[(1) - (3)]).val.v * (yyvsp[(3) - (3)]).val.v;
2176 (yyval).val.d = (yyvsp[(1) - (3)]).val.d && (yyvsp[(3) - (3)]).val.d; }
2181 /* Line 1806 of yacc.c */
2182 #line 324 "parser.y"
2183 { (yyval).val.v = (yyvsp[(1) - (3)]).val.v / (yyvsp[(3) - (3)]).val.v;
2184 (yyval).val.d = (yyvsp[(1) - (3)]).val.d && (yyvsp[(3) - (3)]).val.d; }
2189 /* Line 1806 of yacc.c */
2190 #line 327 "parser.y"
2191 { (yyval).val.v = (yyvsp[(1) - (3)]).val.v % (yyvsp[(3) - (3)]).val.v;
2192 (yyval).val.d = (yyvsp[(1) - (3)]).val.d && (yyvsp[(3) - (3)]).val.d; }
2197 /* Line 1806 of yacc.c */
2198 #line 330 "parser.y"
2199 { (yyval).val.v = (yyvsp[(1) - (3)]).val.v - (yyvsp[(3) - (3)]).val.v;
2200 (yyval).val.d = (yyvsp[(1) - (3)]).val.d && (yyvsp[(3) - (3)]).val.d; }
2205 /* Line 1806 of yacc.c */
2206 #line 333 "parser.y"
2207 { (yyval).val.v = (yyvsp[(1) - (3)]).val.v + (yyvsp[(3) - (3)]).val.v;
2208 (yyval).val.d = (yyvsp[(1) - (3)]).val.d && (yyvsp[(3) - (3)]).val.d; }
2213 /* Line 1806 of yacc.c */
2214 #line 336 "parser.y"
2215 { (yyval).val.v = (yyvsp[(1) - (4)]).val.v >> (yyvsp[(4) - (4)]).val.v;
2216 (yyval).val.d = (yyvsp[(1) - (4)]).val.d && (yyvsp[(4) - (4)]).val.d; }
2221 /* Line 1806 of yacc.c */
2222 #line 339 "parser.y"
2223 { (yyval).val.v = (yyvsp[(1) - (4)]).val.v << (yyvsp[(4) - (4)]).val.v;
2224 (yyval).val.d = (yyvsp[(1) - (4)]).val.d && (yyvsp[(4) - (4)]).val.d; }
2229 /* Line 1806 of yacc.c */
2230 #line 342 "parser.y"
2233 (yyval).val.v = (yyvsp[(1) - (1)]).sym->value;
2234 (yyval).val.d = ((yyvsp[(1) - (1)]).sym->type != UNDEF);
2237 if( (yyvsp[(1) - (1)]).sym->type == UNDEF )
2238 warn("Undefined symbol %s",(yyvsp[(1) - (1)]).sym->name);
2239 (yyval).val.v = (yyvsp[(1) - (1)]).sym->value;
2247 /* Line 1806 of yacc.c */
2248 #line 354 "parser.y"
2249 { (yyval).val.v = (yyvsp[(1) - (1)]).val.v; (yyval).val.d=1; }
2254 /* Line 1806 of yacc.c */
2255 #line 367 "parser.y"
2256 { (yyval).value = makeop((yyvsp[(1) - (1)]).op,NULL,0); }
2261 /* Line 1806 of yacc.c */
2262 #line 369 "parser.y"
2263 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2268 /* Line 1806 of yacc.c */
2269 #line 371 "parser.y"
2270 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2275 /* Line 1806 of yacc.c */
2276 #line 373 "parser.y"
2277 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2282 /* Line 1806 of yacc.c */
2283 #line 375 "parser.y"
2284 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2289 /* Line 1806 of yacc.c */
2290 #line 377 "parser.y"
2291 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2296 /* Line 1806 of yacc.c */
2297 #line 379 "parser.y"
2298 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2303 /* Line 1806 of yacc.c */
2304 #line 381 "parser.y"
2305 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,4); }
2310 /* Line 1806 of yacc.c */
2311 #line 383 "parser.y"
2312 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2317 /* Line 1806 of yacc.c */
2318 #line 385 "parser.y"
2319 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,4); }
2324 /* Line 1806 of yacc.c */
2325 #line 387 "parser.y"
2326 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,6); }
2331 /* Line 1806 of yacc.c */
2332 #line 389 "parser.y"
2333 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2338 /* Line 1806 of yacc.c */
2339 #line 391 "parser.y"
2340 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,4); }
2345 /* Line 1806 of yacc.c */
2346 #line 393 "parser.y"
2347 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,6); }
2352 /* Line 1806 of yacc.c */
2353 #line 395 "parser.y"
2354 { if( get_md((yyvsp[(2) - (2)]).mode) == 3 )
2355 warn("Immediate mode is illegal");
2356 (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0);
2362 /* Line 1806 of yacc.c */
2363 #line 400 "parser.y"
2364 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2369 /* Line 1806 of yacc.c */
2370 #line 402 "parser.y"
2371 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,NULL,4); }
2376 /* Line 1806 of yacc.c */
2377 #line 404 "parser.y"
2378 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2383 /* Line 1806 of yacc.c */
2384 #line 406 "parser.y"
2385 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,NULL,0); }
2390 /* Line 1806 of yacc.c */
2391 #line 408 "parser.y"
2392 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,NULL,0); }
2397 /* Line 1806 of yacc.c */
2398 #line 410 "parser.y"
2399 { (yyval).value = makeop((yyvsp[(1) - (5)]).op,NULL,0); }
2404 /* Line 1806 of yacc.c */
2405 #line 412 "parser.y"
2406 { (yyval).value = makeop((yyvsp[(1) - (5)]).op,NULL,0); }
2411 /* Line 1806 of yacc.c */
2412 #line 414 "parser.y"
2413 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,NULL,0); }
2418 /* Line 1806 of yacc.c */
2419 #line 416 "parser.y"
2420 { (yyval).value = makeop((yyvsp[(1) - (1)]).op,NULL,0); }
2425 /* Line 1806 of yacc.c */
2426 #line 418 "parser.y"
2427 { (yyval).value = makeop((yyvsp[(1) - (1)]).op,NULL,0); }
2432 /* Line 1806 of yacc.c */
2433 #line 420 "parser.y"
2434 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,NULL,0); }
2439 /* Line 1806 of yacc.c */
2440 #line 422 "parser.y"
2441 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,NULL,0); }
2446 /* Line 1806 of yacc.c */
2447 #line 424 "parser.y"
2448 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,NULL,0); }
2453 /* Line 1806 of yacc.c */
2454 #line 426 "parser.y"
2455 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,NULL,0); }
2460 /* Line 1806 of yacc.c */
2461 #line 428 "parser.y"
2462 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,NULL,0); }
2467 /* Line 1806 of yacc.c */
2468 #line 430 "parser.y"
2469 { if( get_md((yyvsp[(2) - (2)]).mode) != 2 )
2470 warn("Invalid addressing mode");
2471 (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,-2); }
2476 /* Line 1806 of yacc.c */
2477 #line 434 "parser.y"
2478 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2483 /* Line 1806 of yacc.c */
2484 #line 436 "parser.y"
2485 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2490 /* Line 1806 of yacc.c */
2491 #line 438 "parser.y"
2492 { if( get_md((yyvsp[(2) - (2)]).mode) == 0 )
2493 warn("Invalid addressing mode");
2494 (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,-1); }
2499 /* Line 1806 of yacc.c */
2500 #line 442 "parser.y"
2506 set_b1(tmp,(yyvsp[(2) - (2)]).value);
2507 (yyval).value = makeop((yyvsp[(1) - (2)]).op,&tmp,0);
2513 /* Line 1806 of yacc.c */
2514 #line 451 "parser.y"
2520 set_b1(tmp,(yyvsp[(2) - (2)]).value);
2521 (yyval).value = makeop((yyvsp[(1) - (2)]).op,&tmp,0);
2527 /* Line 1806 of yacc.c */
2528 #line 460 "parser.y"
2529 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2534 /* Line 1806 of yacc.c */
2535 #line 462 "parser.y"
2536 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2541 /* Line 1806 of yacc.c */
2542 #line 464 "parser.y"
2543 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2548 /* Line 1806 of yacc.c */
2549 #line 466 "parser.y"
2550 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2555 /* Line 1806 of yacc.c */
2556 #line 468 "parser.y"
2557 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2562 /* Line 1806 of yacc.c */
2563 #line 470 "parser.y"
2564 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2569 /* Line 1806 of yacc.c */
2570 #line 472 "parser.y"
2571 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2576 /* Line 1806 of yacc.c */
2577 #line 474 "parser.y"
2578 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2583 /* Line 1806 of yacc.c */
2584 #line 476 "parser.y"
2585 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2590 /* Line 1806 of yacc.c */
2591 #line 478 "parser.y"
2592 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2597 /* Line 1806 of yacc.c */
2598 #line 480 "parser.y"
2599 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2604 /* Line 1806 of yacc.c */
2605 #line 482 "parser.y"
2606 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2611 /* Line 1806 of yacc.c */
2612 #line 484 "parser.y"
2613 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,0); }
2618 /* Line 1806 of yacc.c */
2619 #line 486 "parser.y"
2620 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,4); }
2625 /* Line 1806 of yacc.c */
2626 #line 488 "parser.y"
2627 { (yyval).value = makeop((yyvsp[(1) - (2)]).op,&(yyvsp[(2) - (2)]).mode,6); }
2632 /* Line 1806 of yacc.c */
2633 #line 492 "parser.y"
2634 { (yyval).value = makeop((yyvsp[(1) - (7)]).op,NULL,0); }
2639 /* Line 1806 of yacc.c */
2640 #line 494 "parser.y"
2641 { (yyval).value = makeop((yyvsp[(1) - (7)]).op,NULL,0); }
2646 /* Line 1806 of yacc.c */
2647 #line 496 "parser.y"
2648 { (yyval).value = makeop((yyvsp[(1) - (7)]).op,NULL,1); }
2653 /* Line 1806 of yacc.c */
2654 #line 498 "parser.y"
2655 { (yyval).value = makeop((yyvsp[(1) - (7)]).op,NULL,1); }
2660 /* Line 1806 of yacc.c */
2661 #line 501 "parser.y"
2662 { (yyval).value = makeop((yyvsp[(1) - (5)]).op,NULL,(yyvsp[(5) - (5)]).value); }
2667 /* Line 1806 of yacc.c */
2668 #line 503 "parser.y"
2669 { (yyval).value = makeop((yyvsp[(1) - (5)]).op,NULL,2); }
2674 /* Line 1806 of yacc.c */
2675 #line 505 "parser.y"
2676 { (yyval).value = makeop((yyvsp[(1) - (5)]).op,NULL,(yyvsp[(3) - (5)]).value+3); }
2681 /* Line 1806 of yacc.c */
2682 #line 507 "parser.y"
2683 { (yyval).value = makeop((yyvsp[(1) - (5)]).op,NULL,5); }
2688 /* Line 1806 of yacc.c */
2689 #line 519 "parser.y"
2691 set_md((yyval).mode,0);
2692 set_ov((yyval).mode, (yyvsp[(3) - (3)]).value);
2693 set_sz((yyval).mode, 0);
2699 /* Line 1806 of yacc.c */
2700 #line 525 "parser.y"
2702 set_md((yyval).mode,1);
2703 set_ov((yyval).mode,0);
2704 set_sz((yyval).mode,1);
2705 set_b1((yyval).mode,(yyvsp[(3) - (3)]).value);
2711 /* Line 1806 of yacc.c */
2712 #line 532 "parser.y"
2714 set_md((yyval).mode,2);
2715 set_ov((yyval).mode,(yyvsp[(4) - (4)]).value);
2716 set_sz((yyval).mode,0);
2722 /* Line 1806 of yacc.c */
2723 #line 538 "parser.y"
2725 set_md((yyval).mode,3);
2726 set_ov((yyval).mode,0);
2727 set_sz((yyval).mode,1);
2728 set_b1((yyval).mode,(yyvsp[(4) - (4)]).value);
2734 /* Line 1806 of yacc.c */
2735 #line 547 "parser.y"
2737 set_md((yyval).mode,0);
2738 set_ov((yyval).mode,0);
2739 set_sz((yyval).mode,1);
2740 set_b1((yyval).mode,(yyvsp[(1) - (3)]).value);
2746 /* Line 1806 of yacc.c */
2747 #line 554 "parser.y"
2749 set_md((yyval).mode,1);
2750 set_ov((yyval).mode,0);
2751 set_sz((yyval).mode,2);
2752 set_b1((yyval).mode,(yyvsp[(1) - (4)]).value);
2753 set_b2((yyval).mode,(yyvsp[(4) - (4)]).value);
2759 /* Line 1806 of yacc.c */
2760 #line 564 "parser.y"
2762 set_md((yyval).mode,0);
2763 set_ov((yyval).mode,0);
2764 set_sz((yyval).mode,1);
2765 set_b1((yyval).mode,(yyvsp[(3) - (3)]).value);
2771 /* Line 1806 of yacc.c */
2772 #line 571 "parser.y"
2774 set_md((yyval).mode,1);
2775 set_ov((yyval).mode,0);
2776 set_sz((yyval).mode,1);
2777 set_b1((yyval).mode,(yyvsp[(4) - (4)]).value);
2783 /* Line 1806 of yacc.c */
2784 #line 578 "parser.y"
2786 set_md((yyval).mode,1);
2787 set_ov((yyval).mode,0);
2788 set_sz((yyval).mode,1);
2789 set_b1((yyval).mode,(yyvsp[(4) - (4)]).value);
2795 /* Line 1806 of yacc.c */
2796 #line 587 "parser.y"
2798 set_md((yyval).mode,0);
2799 set_ov((yyval).mode,0);
2800 set_sz((yyval).mode,2);
2801 set_b1((yyval).mode,(yyvsp[(1) - (3)]).value);
2802 set_b2((yyval).mode,(yyvsp[(3) - (3)]).value);
2808 /* Line 1806 of yacc.c */
2809 #line 597 "parser.y"
2811 set_md((yyval).mode,0);
2812 set_ov((yyval).mode,(yyvsp[(1) - (3)]).value);
2813 set_sz((yyval).mode,1);
2814 set_b1((yyval).mode,(yyvsp[(3) - (3)]).value);
2820 /* Line 1806 of yacc.c */
2821 #line 604 "parser.y"
2823 set_md((yyval).mode,1);
2824 set_ov((yyval).mode,0);
2825 set_sz((yyval).mode,2);
2826 set_b1((yyval).mode,(yyvsp[(1) - (3)]).value);
2827 set_b2((yyval).mode,(yyvsp[(3) - (3)]).value);
2833 /* Line 1806 of yacc.c */
2834 #line 614 "parser.y"
2836 set_md((yyval).mode,0);
2837 set_ov((yyval).mode,(yyvsp[(1) - (3)]).value);
2838 set_sz((yyval).mode,0);
2844 /* Line 1806 of yacc.c */
2845 #line 620 "parser.y"
2847 set_md((yyval).mode,1);
2848 set_ov((yyval).mode,(yyvsp[(1) - (3)]).value);
2849 set_sz((yyval).mode,1);
2850 set_b1((yyval).mode,(yyvsp[(3) - (3)]).value);
2856 /* Line 1806 of yacc.c */
2857 #line 627 "parser.y"
2859 set_md((yyval).mode,2);
2860 set_ov((yyval).mode,(yyvsp[(1) - (4)]).value);
2861 set_sz((yyval).mode,1);
2862 set_b1((yyval).mode,(yyvsp[(4) - (4)]).value);
2868 /* Line 1806 of yacc.c */
2869 #line 634 "parser.y"
2871 set_md((yyval).mode,3);
2872 set_ov((yyval).mode,(yyvsp[(3) - (3)]).value);
2873 set_sz((yyval).mode,1);
2874 set_b1((yyval).mode,(yyvsp[(1) - (3)]).value);
2880 /* Line 1806 of yacc.c */
2881 #line 641 "parser.y"
2883 set_md((yyval).mode,4);
2884 set_ov((yyval).mode,0);
2885 set_sz((yyval).mode,2);
2886 set_b1((yyval).mode,(yyvsp[(3) - (3)]).value);
2887 set_b2((yyval).mode,(yyvsp[(1) - (3)]).value);
2893 /* Line 1806 of yacc.c */
2894 #line 649 "parser.y"
2896 set_md((yyval).mode,5);
2897 set_ov((yyval).mode,(yyvsp[(4) - (4)]).value);
2898 set_sz((yyval).mode,1);
2899 set_b1((yyval).mode,(yyvsp[(1) - (4)]).value);
2905 /* Line 1806 of yacc.c */
2906 #line 656 "parser.y"
2908 set_md((yyval).mode,6);
2909 set_ov((yyval).mode,(yyvsp[(2) - (4)]).value);
2910 set_sz((yyval).mode,0);
2916 /* Line 1806 of yacc.c */
2917 #line 662 "parser.y"
2919 set_md((yyval).mode,7);
2920 set_ov((yyval).mode,(yyvsp[(2) - (4)]).value);
2921 set_sz((yyval).mode,1);
2922 set_b1((yyval).mode,(yyvsp[(4) - (4)]).value);
2928 /* Line 1806 of yacc.c */
2929 #line 669 "parser.y"
2931 set_md((yyval).mode,8);
2932 set_ov((yyval).mode,(yyvsp[(2) - (5)]).value);
2933 set_sz((yyval).mode,1);
2934 set_b1((yyval).mode,(yyvsp[(5) - (5)]).value);
2940 /* Line 1806 of yacc.c */
2941 #line 676 "parser.y"
2943 set_md((yyval).mode,9);
2944 set_ov((yyval).mode,0);
2945 set_sz((yyval).mode,2);
2946 set_b1((yyval).mode, ((yyvsp[(4) - (4)]).value & 0xff00) >> 8 );
2947 set_b2((yyval).mode, ((yyvsp[(4) - (4)]).value & 0x00ff) );
2953 /* Line 1806 of yacc.c */
2954 #line 684 "parser.y"
2956 set_md((yyval).mode,10);
2957 set_ov((yyval).mode,0);
2958 set_sz((yyval).mode,1);
2959 set_b1((yyval).mode,(yyvsp[(3) - (3)]).value);
2965 /* Line 1806 of yacc.c */
2966 #line 700 "parser.y"
2968 set_md((yyval).mode,11);
2969 set_ov((yyval).mode,0);
2970 set_sz((yyval).mode,1);
2971 set_b1((yyval).mode,(yyvsp[(1) - (3)]).value);
2977 /* Line 1806 of yacc.c */
2978 #line 707 "parser.y"
2981 if( !isbit8((yyvsp[(1) - (4)]).value) )
2982 warn("Bit address exceeds 8-bits");
2983 if( isbmram((yyvsp[(1) - (4)]).value) )
2984 set_b1((yyval).mode, ((yyvsp[(1) - (4)]).value-0x20)*8+ (yyvsp[(2) - (4)]).value );
2985 else if( isbmsfr((yyvsp[(1) - (4)]).value) )
2986 set_b1((yyval).mode, (yyvsp[(1) - (4)]).value + (yyvsp[(2) - (4)]).value );
2988 warn("Invalid bit addressable RAM location");
2990 set_md((yyval).mode,11);
2991 set_ov((yyval).mode,0);
2992 set_sz((yyval).mode,1);
2998 /* Line 1806 of yacc.c */
2999 #line 726 "parser.y"
3001 set_md((yyval).mode,0);
3002 set_ov((yyval).mode,0);
3003 set_sz((yyval).mode,0);
3009 /* Line 1806 of yacc.c */
3010 #line 733 "parser.y"
3012 set_md((yyval).mode,1);
3013 set_ov((yyval).mode,(yyvsp[(1) - (1)]).value);
3014 set_sz((yyval).mode,0);
3020 /* Line 1806 of yacc.c */
3021 #line 739 "parser.y"
3023 set_md((yyval).mode,2);
3024 set_ov((yyval).mode,0);
3025 set_sz((yyval).mode,1);
3026 set_b1((yyval).mode,(yyvsp[(1) - (1)]).value);
3032 /* Line 1806 of yacc.c */
3033 #line 746 "parser.y"
3035 set_md((yyval).mode,3);
3036 set_ov((yyval).mode,(yyvsp[(2) - (2)]).value);
3037 set_sz((yyval).mode,0);
3043 /* Line 1806 of yacc.c */
3044 #line 754 "parser.y"
3046 set_md((yyval).mode,0);
3047 set_ov((yyval).mode,0);
3048 set_sz((yyval).mode,0);
3054 /* Line 1806 of yacc.c */
3055 #line 760 "parser.y"
3057 set_md((yyval).mode,1);
3058 set_ov((yyval).mode,0);
3059 set_sz((yyval).mode,0);
3065 /* Line 1806 of yacc.c */
3066 #line 766 "parser.y"
3068 set_md((yyval).mode,2);
3069 set_ov((yyval).mode,0);
3070 set_sz((yyval).mode,1);
3071 set_b1((yyval).mode,(yyvsp[(1) - (1)]).value);
3077 /* Line 1806 of yacc.c */
3078 #line 775 "parser.y"
3080 set_md((yyval).mode,0);
3081 set_ov((yyval).mode,0);
3082 set_sz((yyval).mode,2);
3083 set_b1((yyval).mode,(yyvsp[(3) - (5)]).value);
3084 set_b2((yyval).mode,(yyvsp[(5) - (5)]).value);
3090 /* Line 1806 of yacc.c */
3091 #line 783 "parser.y"
3093 set_md((yyval).mode,1);
3094 set_ov((yyval).mode,0);
3095 set_sz((yyval).mode,2);
3096 set_b1((yyval).mode,(yyvsp[(4) - (6)]).value);
3097 set_b2((yyval).mode,(yyvsp[(6) - (6)]).value);
3103 /* Line 1806 of yacc.c */
3104 #line 791 "parser.y"
3106 set_md((yyval).mode,2);
3107 set_ov((yyval).mode,(yyvsp[(1) - (6)]).value);
3108 set_sz((yyval).mode,2);
3109 set_b1((yyval).mode,(yyvsp[(4) - (6)]).value);
3110 set_b2((yyval).mode,(yyvsp[(6) - (6)]).value);
3116 /* Line 1806 of yacc.c */
3117 #line 799 "parser.y"
3119 set_md((yyval).mode,3);
3120 set_ov((yyval).mode,(yyvsp[(2) - (7)]).value);
3121 set_sz((yyval).mode,2);
3122 set_b1((yyval).mode,(yyvsp[(5) - (7)]).value);
3123 set_b2((yyval).mode,(yyvsp[(7) - (7)]).value);
3129 /* Line 1806 of yacc.c */
3130 #line 809 "parser.y"
3134 offset = (yyvsp[(1) - (1)]).val.v - (lc+3);
3135 if( offset > 127 || offset < -128 )
3136 warn("Relative offset exceeds -128 / +127");
3137 (yyval).value = offset;
3144 /* Line 1806 of yacc.c */
3145 #line 826 "parser.y"
3149 offset = (yyvsp[(1) - (1)]).val.v - (lc+2); /* different! */
3150 if( offset > 127 || offset < -128 )
3151 warn("Relative offset exceeds -128 / +127");
3152 (yyval).value = offset;
3159 /* Line 1806 of yacc.c */
3160 #line 839 "parser.y"
3163 if( !isbit8((yyvsp[(1) - (2)]).value) )
3164 warn("Bit address exceeds 8-bits");
3165 if( isbmram((yyvsp[(1) - (2)]).value) )
3166 (yyval).value = ((yyvsp[(1) - (2)]).value-0x20)*8+(yyvsp[(2) - (2)]).value;
3167 else if( isbmsfr((yyvsp[(1) - (2)]).value) )
3168 (yyval).value = (yyvsp[(1) - (2)]).value + (yyvsp[(2) - (2)]).value;
3170 warn("Invalid bit addressable RAM location");
3177 /* Line 1806 of yacc.c */
3178 #line 852 "parser.y"
3181 if( !isbit8((yyvsp[(1) - (1)]).value) )
3182 warn("Bit address exceeds 8-bits");
3183 (yyval).value = (yyvsp[(1) - (1)]).value;
3190 /* Line 1806 of yacc.c */
3191 #line 862 "parser.y"
3193 if( (yyvsp[(1) - (1)]).sym->type == UNDEF && pass2 )
3194 warn("Symbol %s undefined",(yyvsp[(1) - (1)]).sym->name);
3195 (yyval).value = (yyvsp[(1) - (1)]).sym->value;
3201 /* Line 1806 of yacc.c */
3202 #line 867 "parser.y"
3203 { (yyval).value = (yyvsp[(1) - (1)]).value; }
3208 /* Line 1806 of yacc.c */
3209 #line 870 "parser.y"
3210 { (yyval).value = 0; }
3215 /* Line 1806 of yacc.c */
3216 #line 871 "parser.y"
3217 { (yyval).value = 1; }
3222 /* Line 1806 of yacc.c */
3223 #line 872 "parser.y"
3224 { (yyval).value = 2; }
3229 /* Line 1806 of yacc.c */
3230 #line 873 "parser.y"
3231 { (yyval).value = 3; }
3236 /* Line 1806 of yacc.c */
3237 #line 874 "parser.y"
3238 { (yyval).value = 4; }
3243 /* Line 1806 of yacc.c */
3244 #line 875 "parser.y"
3245 { (yyval).value = 5; }
3250 /* Line 1806 of yacc.c */
3251 #line 876 "parser.y"
3252 { (yyval).value = 6; }
3257 /* Line 1806 of yacc.c */
3258 #line 877 "parser.y"
3259 { (yyval).value = 7; }
3264 /* Line 1806 of yacc.c */
3265 #line 880 "parser.y"
3266 { (yyval).value = 0; }
3271 /* Line 1806 of yacc.c */
3272 #line 881 "parser.y"
3273 { (yyval).value = 1; }
3278 /* Line 1806 of yacc.c */
3279 #line 883 "parser.y"
3280 { (yyval).value = 0;
3281 warn("Illegal indirect register: @r2"); }
3286 /* Line 1806 of yacc.c */
3287 #line 886 "parser.y"
3288 { (yyval).value = 0;
3289 warn("Illegal indirect register: @r3"); }
3294 /* Line 1806 of yacc.c */
3295 #line 889 "parser.y"
3296 { (yyval).value = 0;
3297 warn("Illegal indirect register: @r4"); }
3302 /* Line 1806 of yacc.c */
3303 #line 892 "parser.y"
3304 { (yyval).value = 0;
3305 warn("Illegal indirect register: @r5"); }
3310 /* Line 1806 of yacc.c */
3311 #line 895 "parser.y"
3312 { (yyval).value = 0;
3313 warn("Illegal indirect register: @r6"); }
3318 /* Line 1806 of yacc.c */
3319 #line 898 "parser.y"
3320 { (yyval).value = 0;
3321 warn("Illegal indirect register: @r7"); }
3326 /* Line 1806 of yacc.c */
3327 #line 903 "parser.y"
3330 if( !isbit8((yyvsp[(1) - (1)]).val.v) )
3331 warn("Expression greater than 8-bits");
3333 (yyval).value = (yyvsp[(1) - (1)]).val.v;
3339 /* Line 1806 of yacc.c */
3340 #line 913 "parser.y"
3343 if( !isbit16((yyvsp[(1) - (1)]).val.v) )
3344 warn("Expression greater than 16-bits");
3346 (yyval).value = (yyvsp[(1) - (1)]).val.v;
3352 /* Line 1806 of yacc.c */
3353 #line 923 "parser.y"
3356 if( !isbit16((yyvsp[(1) - (1)]).val.v) )
3357 warn("Address greater than 16-bits");
3358 if( ((yyvsp[(1) - (1)]).val.v & size11) != ((lc+2) & size11) )
3359 warn("Address outside current 2K page");
3361 set_md((yyval).mode,0);
3362 set_ov((yyval).mode, ((yyvsp[(1) - (1)]).val.v&0x0700)>>3 );
3363 set_sz((yyval).mode,1);
3364 set_b1((yyval).mode,(yyvsp[(1) - (1)]).val.v&0x00ff);
3370 /* Line 1806 of yacc.c */
3371 #line 938 "parser.y"
3374 if( !isbit16((yyvsp[(1) - (1)]).val.v) )
3375 warn("Address greater than 16-bits");
3377 set_md((yyval).mode,0);
3378 set_ov((yyval).mode, 0 );
3379 set_sz((yyval).mode,2);
3380 set_b1((yyval).mode, ((yyvsp[(1) - (1)]).val.v & 0xff00 ) >> 8 );
3381 set_b2((yyval).mode, ((yyvsp[(1) - (1)]).val.v & 0x00ff ) );
3387 /* Line 1806 of yacc.c */
3388 #line 952 "parser.y"
3392 offset = (yyvsp[(1) - (1)]).val.v - (lc+2);
3393 if( offset>127 || offset<-128 )
3394 warn("Relative offset exceeds -128 / +127");
3396 set_md((yyval).mode,0);
3397 set_ov((yyval).mode,0);
3398 set_sz((yyval).mode,1);
3399 set_b1((yyval).mode,offset);
3406 /* Line 1806 of yacc.c */
3407 #line 3408 "y.tab.c"
3410 /* User semantic actions sometimes alter yychar, and that requires
3411 that yytoken be updated with the new translation. We take the
3412 approach of translating immediately before every use of yytoken.
3413 One alternative is translating here after every semantic action,
3414 but that translation would be missed if the semantic action invokes
3415 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
3416 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
3417 incorrect destructor might then be invoked immediately. In the
3418 case of YYERROR or YYBACKUP, subsequent parser actions might lead
3419 to an incorrect destructor call or verbose syntax error message
3420 before the lookahead is translated. */
3421 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
3425 YY_STACK_PRINT (yyss, yyssp);
3429 /* Now `shift' the result of the reduction. Determine what state
3430 that goes to, based on the state we popped back to and the rule
3431 number reduced by. */
3435 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
3436 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3437 yystate = yytable[yystate];
3439 yystate = yydefgoto[yyn - YYNTOKENS];
3444 /*------------------------------------.
3445 | yyerrlab -- here on detecting error |
3446 `------------------------------------*/
3448 /* Make sure we have latest lookahead translation. See comments at
3449 user semantic actions for why this is necessary. */
3450 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
3452 /* If not already recovering from an error, report this error. */
3456 #if ! YYERROR_VERBOSE
3457 yyerror (YY_("syntax error"));
3459 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3462 char const *yymsgp = YY_("syntax error");
3463 int yysyntax_error_status;
3464 yysyntax_error_status = YYSYNTAX_ERROR;
3465 if (yysyntax_error_status == 0)
3467 else if (yysyntax_error_status == 1)
3469 if (yymsg != yymsgbuf)
3470 YYSTACK_FREE (yymsg);
3471 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
3475 yymsg_alloc = sizeof yymsgbuf;
3476 yysyntax_error_status = 2;
3480 yysyntax_error_status = YYSYNTAX_ERROR;
3485 if (yysyntax_error_status == 2)
3486 goto yyexhaustedlab;
3488 # undef YYSYNTAX_ERROR
3494 if (yyerrstatus == 3)
3496 /* If just tried and failed to reuse lookahead token after an
3497 error, discard it. */
3499 if (yychar <= YYEOF)
3501 /* Return failure if at end of input. */
3502 if (yychar == YYEOF)
3507 yydestruct ("Error: discarding",
3513 /* Else will try to reuse lookahead token after shifting the error
3518 /*---------------------------------------------------.
3519 | yyerrorlab -- error raised explicitly by YYERROR. |
3520 `---------------------------------------------------*/
3523 /* Pacify compilers like GCC when the user code never invokes
3524 YYERROR and the label yyerrorlab therefore never appears in user
3526 if (/*CONSTCOND*/ 0)
3529 /* Do not reclaim the symbols of the rule which action triggered
3533 YY_STACK_PRINT (yyss, yyssp);
3538 /*-------------------------------------------------------------.
3539 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3540 `-------------------------------------------------------------*/
3542 yyerrstatus = 3; /* Each real token shifted decrements this. */
3546 yyn = yypact[yystate];
3547 if (!yypact_value_is_default (yyn))
3550 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
3558 /* Pop the current state because it cannot handle the error token. */
3563 yydestruct ("Error: popping",
3564 yystos[yystate], yyvsp);
3567 YY_STACK_PRINT (yyss, yyssp);
3573 /* Shift the error token. */
3574 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
3580 /*-------------------------------------.
3581 | yyacceptlab -- YYACCEPT comes here. |
3582 `-------------------------------------*/
3587 /*-----------------------------------.
3588 | yyabortlab -- YYABORT comes here. |
3589 `-----------------------------------*/
3594 #if !defined(yyoverflow) || YYERROR_VERBOSE
3595 /*-------------------------------------------------.
3596 | yyexhaustedlab -- memory exhaustion comes here. |
3597 `-------------------------------------------------*/
3599 yyerror (YY_("memory exhausted"));
3605 if (yychar != YYEMPTY)
3607 /* Make sure we have latest lookahead translation. See comments at
3608 user semantic actions for why this is necessary. */
3609 yytoken = YYTRANSLATE (yychar);
3610 yydestruct ("Cleanup: discarding lookahead",
3613 /* Do not reclaim the symbols of the rule which action triggered
3614 this YYABORT or YYACCEPT. */
3616 YY_STACK_PRINT (yyss, yyssp);
3617 while (yyssp != yyss)
3619 yydestruct ("Cleanup: popping",
3620 yystos[*yyssp], yyvsp);
3625 YYSTACK_FREE (yyss);
3628 if (yymsg != yymsgbuf)
3629 YYSTACK_FREE (yymsg);
3631 /* Make sure YYID is used. */
3632 return YYID (yyresult);
3637 /* Line 2067 of yacc.c */
3638 #line 967 "parser.y"
3641 /* ---------------------------------------------------------------------- */
3643 void yyerror(const char *s)
3645 warn("%s near \"%s\"", s, get_last_token());
3649 /* ----------------------------------------------------------------------
3651 * This function makes an opcode based on the instruction symbol table
3652 * entry, and an addressing mode structure.
3653 * This function is called from both passes, but
3654 * only generates code in pass 2.
3656 * Resultant opcode bytes are passed to genbyte().
3658 * Returns the nuumber of bytes that the instruction
3663 int makeop(struct opcode * op, struct mode *m, int add)
3665 register unsigned int newop;
3668 if(pass2) genbyte(op->bytes[0+add]);
3673 newop = op->bytes[ get_md(*m)+add ] | get_ov(*m);
3675 if( get_sz(*m) > 0 ) genbyte( get_b1(*m) );
3676 if( get_sz(*m) > 1 ) genbyte( get_b2(*m) );
3678 return( get_sz(*m)+1 );
3682 /* ----------------------------------------------------------------------
3684 * Increments the Location Counter by 'i' amount.
3685 * Check to see if 'i' overflows 64K.
3686 * Checks to see if assembler is overlapping previous sections
3687 * of code. (using a large bit field).
3691 #define indx(a) ( (a)/(32) )
3692 #define bit(a) ( 1 << ((a)%(32)) )
3694 #define getloc(a) (regions[indx(a)] & bit(a))
3695 #define setloc(a) (regions[indx(a)] |= bit(a))
3697 static unsigned long regions[ 0x10000/(32) ];
3703 if( pass2 && getloc(lc) )
3704 error("Location counter overlaps");
3705 if( pass2 ) setloc(lc);
3710 error("Location counter has exceeded 16-bits");
3713 void clear_location_counter(void)
3715 memset(regions, 0, sizeof(regions));
3719 /* ----------------------------------------------------------------------
3721 * This routine returns a new string, which is equivilant to
3722 * 'line' except that all tabs have been expanded to spaces, and
3723 * the total length has been truncated to 60 chars.
3726 char *padline(char *line)
3728 static char newline[61];
3732 for(p1=line; pos<sizeof(newline)-1 && *p1; p1++ ) {
3734 nxtpos = pos+8-pos%8;
3735 while(pos<sizeof(newline)-1 && pos <= nxtpos)
3736 newline[pos++] = ' ';
3737 } else if( *p1 != '\n' )
3738 newline[pos++]= *p1;
3740 newline[pos] = '\0';
3745 /* ----------------------------------------------------------------------
3747 * Outputs the current location counter, bytebuf[] array, and
3748 * the string 'txt' to the listing file.
3749 * This routine is called for every source line encountered in the
3750 * source file. (Only in pass 2, and if listing is turned on).
3754 void dumplist(char *txt, int show)
3758 fprintf(listing,show?"%04lX: ":" ",lc);
3761 for(i=0; i<bytecount; i++ ) {
3762 fprintf(listing,"%02X ",bytebuf[i]);
3765 fprintf(listing,"\n ");
3769 fprintf(listing," ");
3771 fprintf(listing," %s\n",padline(txt));
3774 /* ----------------------------------------------------------------------
3776 * Place information into the bytebuf[] array, and also
3777 * call emitbyte with the byte.
3783 if( bytecount < sizeof(bytebuf) )
3784 bytebuf[bytecount++] = b;
3788 void genstr(const char *s)
3794 void genword(unsigned long w)
3796 genbyte( (w & 0xff00) >> 8 );
3797 genbyte( (w & 0x00ff) );