1 /* A Bison parser, made by GNU Bison 1.875d. */
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 0
53 /* Put the tokens into the symbol table, so that GDB and other debuggers
198 /* Copy the first part of user declarations. */
209 #define YYSTYPE union ystack
211 static unsigned char bytebuf[1024]; /* used by dumplist() */
212 static int bytecount;
215 void yyerror(const char *s);
216 int makeop(struct opcode * op, struct mode *m, int add);
218 char *padline(char *line);
219 void dumplist(char *txt, int show);
221 void genstr(const char *s);
222 void genword(unsigned long w);
224 /* ------------------------ G R A M M E R ----------------------------- */
228 /* Enabling traces. */
233 /* Enabling verbose error messages. */
234 #ifdef YYERROR_VERBOSE
235 # undef YYERROR_VERBOSE
236 # define YYERROR_VERBOSE 1
238 # define YYERROR_VERBOSE 0
241 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
243 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
244 # define YYSTYPE_IS_DECLARED 1
245 # define YYSTYPE_IS_TRIVIAL 1
250 /* Copy the second part of user declarations. */
253 /* Line 214 of yacc.c. */
256 #if ! defined (yyoverflow) || YYERROR_VERBOSE
262 # define YYMALLOC malloc
265 /* The parser invokes alloca or malloc; define the necessary symbols. */
267 # ifdef YYSTACK_USE_ALLOCA
268 # if YYSTACK_USE_ALLOCA
269 # define YYSTACK_ALLOC alloca
272 # if defined (alloca) || defined (_ALLOCA_H)
273 # define YYSTACK_ALLOC alloca
276 # define YYSTACK_ALLOC __builtin_alloca
281 # ifdef YYSTACK_ALLOC
282 /* Pacify GCC's `empty if-body' warning. */
283 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
285 # if defined (__STDC__) || defined (__cplusplus)
286 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
287 # define YYSIZE_T size_t
289 # define YYSTACK_ALLOC YYMALLOC
290 # define YYSTACK_FREE YYFREE
292 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
295 #if (! defined (yyoverflow) \
296 && (! defined (__cplusplus) \
297 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
299 /* A type that is properly aligned for any stack member. */
306 /* The size of the maximum gap between one aligned stack and the next. */
307 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
309 /* The size of an array large to enough to hold all stacks, each with
311 # define YYSTACK_BYTES(N) \
312 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
313 + YYSTACK_GAP_MAXIMUM)
315 /* Copy COUNT objects from FROM to TO. The source and destination do
318 # if defined (__GNUC__) && 1 < __GNUC__
319 # define YYCOPY(To, From, Count) \
320 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
322 # define YYCOPY(To, From, Count) \
325 register YYSIZE_T yyi; \
326 for (yyi = 0; yyi < (Count); yyi++) \
327 (To)[yyi] = (From)[yyi]; \
333 /* Relocate STACK from its old location to the new one. The
334 local variables YYSIZE and YYSTACKSIZE give the old and new number of
335 elements in the stack, and YYPTR gives the new location of the
336 stack. Advance YYPTR to a properly aligned location for the next
338 # define YYSTACK_RELOCATE(Stack) \
341 YYSIZE_T yynewbytes; \
342 YYCOPY (&yyptr->Stack, Stack, yysize); \
343 Stack = &yyptr->Stack; \
344 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
345 yyptr += yynewbytes / sizeof (*yyptr); \
351 #if defined (__STDC__) || defined (__cplusplus)
352 typedef signed char yysigned_char;
354 typedef short int yysigned_char;
357 /* YYFINAL -- State number of the termination state. */
359 /* YYLAST -- Last index in YYTABLE. */
362 /* YYNTOKENS -- Number of terminals. */
364 /* YYNNTS -- Number of nonterminals. */
366 /* YYNRULES -- Number of rules. */
368 /* YYNRULES -- Number of states. */
369 #define YYNSTATES 316
371 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
373 #define YYMAXUTOK 325
375 #define YYTRANSLATE(YYX) \
376 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
378 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
379 static const unsigned char yytranslate[] =
381 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
382 81, 2, 2, 2, 2, 2, 2, 2, 2, 2,
383 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
384 2, 2, 2, 88, 2, 87, 2, 75, 77, 2,
385 84, 85, 73, 71, 83, 72, 82, 74, 2, 2,
386 2, 2, 2, 2, 2, 2, 2, 2, 80, 2,
387 79, 2, 78, 2, 86, 2, 2, 2, 2, 2,
388 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
389 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
390 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
391 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
392 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
393 2, 2, 2, 2, 76, 2, 2, 2, 2, 2,
394 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
395 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
396 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
397 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
398 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
399 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
400 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
401 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
402 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
403 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
404 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
405 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
406 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
407 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
408 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
409 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
410 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
411 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
412 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
413 65, 66, 67, 68, 69, 70
417 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
419 static const unsigned short int yyprhs[] =
421 0, 0, 3, 5, 8, 10, 14, 16, 19, 22,
422 24, 25, 29, 33, 37, 41, 45, 51, 57, 60,
423 62, 65, 67, 69, 71, 75, 79, 81, 83, 87,
424 89, 91, 95, 98, 102, 106, 110, 114, 118, 122,
425 126, 131, 136, 138, 140, 142, 145, 148, 151, 154,
426 157, 160, 163, 166, 169, 172, 175, 178, 181, 184,
427 187, 190, 193, 196, 199, 205, 211, 214, 216, 218,
428 221, 224, 227, 230, 233, 236, 239, 242, 245, 248,
429 251, 254, 257, 260, 263, 266, 269, 272, 275, 278,
430 281, 284, 287, 290, 293, 296, 304, 312, 320, 328,
431 334, 340, 346, 352, 356, 360, 365, 370, 374, 379,
432 383, 388, 393, 397, 401, 405, 409, 413, 418, 422,
433 426, 431, 436, 441, 447, 452, 456, 460, 465, 467,
434 469, 471, 474, 476, 478, 480, 486, 493, 500, 508,
435 510, 512, 515, 517, 519, 521, 523, 525, 527, 529,
436 531, 533, 535, 537, 539, 541, 543, 545, 547, 549,
437 551, 553, 555, 557, 559, 561
440 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
441 static const yysigned_char yyrhs[] =
443 90, 0, -1, 91, -1, 91, 92, -1, 92, -1,
444 99, 80, 93, -1, 93, -1, 95, 81, -1, 103,
445 81, -1, 81, -1, -1, 1, 94, 81, -1, 82,
446 4, 96, -1, 82, 5, 100, -1, 82, 6, 101,
447 -1, 82, 7, 96, -1, 82, 8, 99, 83, 102,
448 -1, 82, 9, 70, 83, 97, -1, 82, 10, -1,
449 102, -1, 98, 60, -1, 70, -1, 69, -1, 70,
450 -1, 100, 83, 119, -1, 100, 83, 3, -1, 119,
451 -1, 3, -1, 101, 83, 120, -1, 120, -1, 73,
452 -1, 84, 102, 85, -1, 72, 102, -1, 102, 76,
453 102, -1, 102, 77, 102, -1, 102, 73, 102, -1,
454 102, 74, 102, -1, 102, 75, 102, -1, 102, 72,
455 102, -1, 102, 71, 102, -1, 102, 78, 78, 102,
456 -1, 102, 79, 79, 102, -1, 70, -1, 69, -1,
457 37, -1, 11, 121, -1, 14, 121, -1, 12, 104,
458 -1, 13, 104, -1, 50, 104, -1, 54, 104, -1,
459 54, 105, -1, 15, 104, -1, 15, 105, -1, 15,
460 106, -1, 39, 104, -1, 39, 105, -1, 39, 106,
461 -1, 52, 104, -1, 23, 110, -1, 23, 59, -1,
462 20, 110, -1, 19, 56, -1, 21, 55, -1, 27,
463 86, 56, 71, 59, -1, 27, 86, 59, 71, 56,
464 -1, 38, 55, -1, 42, -1, 43, -1, 44, 56,
465 -1, 45, 56, -1, 46, 56, -1, 47, 56, -1,
466 51, 56, -1, 53, 104, -1, 17, 111, -1, 18,
467 111, -1, 48, 111, -1, 41, 119, -1, 40, 119,
468 -1, 33, 122, -1, 32, 122, -1, 26, 123, -1,
469 29, 123, -1, 30, 123, -1, 31, 123, -1, 49,
470 123, -1, 16, 112, -1, 24, 107, -1, 28, 107,
471 -1, 25, 107, -1, 22, 108, -1, 34, 104, -1,
472 34, 105, -1, 34, 109, -1, 35, 56, 83, 86,
473 56, 71, 59, -1, 35, 56, 83, 86, 59, 71,
474 56, -1, 35, 56, 83, 86, 56, 71, 58, -1,
475 35, 56, 83, 86, 58, 71, 56, -1, 36, 56,
476 83, 86, 118, -1, 36, 56, 83, 86, 59, -1,
477 36, 86, 118, 83, 56, -1, 36, 86, 59, 83,
478 56, -1, 56, 83, 117, -1, 56, 83, 119, -1,
479 56, 83, 86, 118, -1, 56, 83, 87, 119, -1,
480 119, 83, 56, -1, 119, 83, 87, 119, -1, 57,
481 83, 115, -1, 57, 83, 74, 115, -1, 57, 83,
482 88, 115, -1, 115, 83, 113, -1, 117, 83, 114,
483 -1, 119, 83, 113, -1, 117, 83, 56, -1, 117,
484 83, 119, -1, 117, 83, 87, 119, -1, 119, 83,
485 117, -1, 119, 83, 119, -1, 119, 83, 86, 118,
486 -1, 86, 118, 83, 56, -1, 86, 118, 83, 119,
487 -1, 86, 118, 83, 87, 119, -1, 59, 83, 87,
488 120, -1, 57, 83, 115, -1, 119, 83, 57, -1,
489 119, 60, 83, 57, -1, 56, -1, 117, -1, 119,
490 -1, 86, 118, -1, 56, -1, 57, -1, 115, -1,
491 56, 83, 119, 83, 113, -1, 56, 83, 87, 119,
492 83, 113, -1, 117, 83, 87, 119, 83, 113, -1,
493 86, 118, 83, 87, 119, 83, 113, -1, 102, -1,
494 102, -1, 116, 60, -1, 116, -1, 70, -1, 69,
495 -1, 61, -1, 62, -1, 63, -1, 64, -1, 65,
496 -1, 66, -1, 67, -1, 68, -1, 61, -1, 62,
497 -1, 63, -1, 64, -1, 65, -1, 66, -1, 67,
498 -1, 68, -1, 102, -1, 102, -1, 102, -1, 102,
502 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
503 static const unsigned short int yyrline[] =
505 0, 126, 126, 131, 132, 135, 145, 148, 153, 159,
506 164, 164, 183, 190, 191, 192, 195, 204, 210, 213,
507 223, 236, 242, 246, 254, 259, 270, 275, 287, 292,
508 306, 309, 312, 315, 318, 321, 324, 327, 330, 333,
509 336, 339, 341, 354, 366, 368, 370, 372, 374, 376,
510 378, 380, 382, 384, 386, 388, 390, 392, 394, 399,
511 401, 403, 405, 407, 409, 411, 413, 415, 417, 419,
512 421, 423, 425, 427, 429, 433, 435, 437, 441, 450,
513 459, 461, 463, 465, 467, 469, 471, 473, 475, 477,
514 479, 481, 483, 485, 487, 491, 493, 495, 497, 500,
515 502, 504, 506, 518, 524, 531, 537, 546, 553, 563,
516 570, 577, 586, 596, 603, 613, 619, 626, 633, 640,
517 648, 655, 661, 668, 675, 683, 699, 706, 725, 732,
518 738, 745, 753, 759, 765, 774, 782, 790, 798, 808,
519 825, 838, 851, 861, 867, 870, 871, 872, 873, 874,
520 875, 876, 877, 880, 881, 882, 885, 888, 891, 894,
521 897, 902, 912, 922, 937, 951
525 #if YYDEBUG || YYERROR_VERBOSE
526 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
527 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
528 static const char *const yytname[] =
530 "$end", "error", "$undefined", "STRING", "D_ORG", "D_BYTE", "D_WORD",
531 "D_SKIP", "D_EQU", "D_FLAG", "D_END", "ACALL", "ADD", "ADDC", "AJMP",
532 "ANL", "CJNE", "CLR", "CPL", "DA", "DEC", "DIV", "DJNZ", "INC", "JB",
533 "JBC", "JC", "JMP", "JNB", "JNC", "JNZ", "JZ", "LCALL", "LJMP", "MOV",
534 "MOVC", "MOVX", "NOP", "MUL", "ORL", "POP", "PUSH", "RET", "RETI", "RL",
535 "RLC", "RR", "RRC", "SETB", "SJMP", "SUBB", "SWAP", "XCH", "XCHD", "XRL",
536 "AB", "A", "C", "PC", "DPTR", "BITPOS", "R0", "R1", "R2", "R3", "R4",
537 "R5", "R6", "R7", "VALUE", "SYMBOL", "'+'", "'-'", "'*'", "'/'", "'%'",
538 "'|'", "'&'", "'>'", "'<'", "':'", "'\\n'", "'.'", "','", "'('", "')'",
539 "'@'", "'#'", "'!'", "$accept", "program", "linelist", "line",
540 "linerest", "@1", "directive", "defexpr", "flag", "flagv", "undefsym",
541 "blist", "wlist", "expr", "instr", "two_op1", "two_op2", "two_op3",
542 "two_op4", "two_op5", "two_op6", "single_op1", "single_op2", "three_op1",
543 "rel", "rel2", "bit", "bitv", "reg", "regi", "data8", "data16", "addr11",
544 "addr16", "relative", 0
549 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
551 static const unsigned short int yytoknum[] =
553 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
554 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
555 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
556 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
557 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
558 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
559 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
560 325, 43, 45, 42, 47, 37, 124, 38, 62, 60,
561 58, 10, 46, 44, 40, 41, 64, 35, 33
565 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
566 static const unsigned char yyr1[] =
568 0, 89, 90, 91, 91, 92, 92, 93, 93, 93,
569 94, 93, 95, 95, 95, 95, 95, 95, 95, 96,
570 97, 98, 98, 99, 100, 100, 100, 100, 101, 101,
571 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
572 102, 102, 102, 102, 103, 103, 103, 103, 103, 103,
573 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
574 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
575 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
576 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
577 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
578 103, 103, 103, 104, 104, 104, 104, 105, 105, 106,
579 106, 106, 107, 108, 108, 109, 109, 109, 109, 109,
580 109, 109, 109, 109, 109, 109, 109, 109, 110, 110,
581 110, 110, 111, 111, 111, 112, 112, 112, 112, 113,
582 114, 115, 115, 116, 116, 117, 117, 117, 117, 117,
583 117, 117, 117, 118, 118, 118, 118, 118, 118, 118,
584 118, 119, 120, 121, 122, 123
587 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
588 static const unsigned char yyr2[] =
590 0, 2, 1, 2, 1, 3, 1, 2, 2, 1,
591 0, 3, 3, 3, 3, 3, 5, 5, 2, 1,
592 2, 1, 1, 1, 3, 3, 1, 1, 3, 1,
593 1, 3, 2, 3, 3, 3, 3, 3, 3, 3,
594 4, 4, 1, 1, 1, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 5, 5, 2, 1, 1, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 7, 7, 7, 7, 5,
600 5, 5, 5, 3, 3, 4, 4, 3, 4, 3,
601 4, 4, 3, 3, 3, 3, 3, 4, 3, 3,
602 4, 4, 4, 5, 4, 3, 3, 4, 1, 1,
603 1, 2, 1, 1, 1, 5, 6, 6, 7, 1,
604 1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
605 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
609 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
610 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
611 means the default is an error. */
612 static const unsigned char yydefact[] =
614 0, 10, 0, 0, 0, 0, 0, 0, 0, 0,
615 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
616 0, 0, 0, 0, 0, 0, 0, 0, 44, 0,
617 0, 0, 0, 67, 68, 0, 0, 0, 0, 0,
618 0, 0, 0, 0, 0, 0, 23, 9, 0, 0,
619 0, 4, 6, 0, 0, 0, 0, 43, 42, 0,
620 30, 0, 163, 45, 0, 47, 48, 46, 0, 161,
621 52, 53, 54, 0, 0, 145, 146, 147, 148, 149,
622 150, 151, 152, 0, 87, 0, 132, 133, 144, 143,
623 75, 134, 142, 76, 62, 128, 0, 61, 129, 130,
624 63, 91, 0, 0, 60, 59, 88, 0, 90, 165,
625 82, 0, 89, 83, 84, 85, 164, 81, 80, 0,
626 0, 0, 92, 93, 94, 0, 0, 0, 0, 0,
627 66, 55, 56, 57, 79, 78, 69, 70, 71, 72,
628 77, 86, 49, 73, 58, 74, 50, 51, 0, 0,
629 0, 0, 0, 0, 18, 1, 3, 7, 0, 8,
630 11, 32, 0, 0, 0, 0, 0, 0, 0, 0,
631 0, 0, 0, 0, 0, 0, 153, 154, 155, 156,
632 157, 158, 159, 160, 0, 0, 141, 131, 0, 0,
633 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
634 0, 0, 0, 12, 19, 27, 13, 26, 14, 162,
635 29, 15, 0, 0, 5, 31, 39, 38, 35, 36,
636 37, 33, 34, 0, 0, 0, 0, 103, 104, 0,
637 0, 109, 107, 0, 0, 0, 0, 0, 140, 113,
638 139, 114, 112, 0, 0, 125, 0, 0, 115, 0,
639 116, 0, 126, 0, 118, 119, 0, 0, 0, 0,
640 0, 0, 0, 0, 40, 41, 105, 106, 110, 111,
641 108, 0, 0, 0, 0, 64, 65, 124, 121, 0,
642 122, 117, 127, 120, 0, 0, 0, 100, 99, 102,
643 101, 25, 24, 28, 16, 22, 21, 17, 0, 0,
644 135, 0, 0, 123, 0, 0, 0, 20, 136, 0,
645 137, 97, 95, 98, 96, 138
648 /* YYDEFGOTO[NTERM-NUM]. */
649 static const short int yydefgoto[] =
651 -1, 49, 50, 51, 52, 56, 53, 203, 297, 298,
652 54, 206, 208, 69, 55, 65, 71, 72, 106, 101,
653 124, 97, 90, 84, 241, 239, 91, 92, 98, 184,
654 73, 210, 63, 117, 110
657 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
659 #define YYPACT_NINF -239
660 static const short int yypact[] =
662 370, -239, 139, -24, -24, 139, 120, 70, 15, 15,
663 -19, 470, -12, 292, 441, 23, 23, 139, -45, 23,
664 139, 139, 139, 139, 139, 222, -9, -26, -239, 14,
665 120, 139, 139, -239, -239, 19, 25, 31, 49, 15,
666 139, -24, 54, -24, -24, 85, -239, -239, 440, 89,
667 298, -239, -239, -27, 37, 38, 41, -239, -239, 139,
668 -239, 139, 513, -239, 64, -239, -239, -239, 67, 513,
669 -239, -239, -239, 68, 77, -239, -239, -239, -239, -239,
670 -239, -239, -239, 454, -239, 87, -239, -239, -239, -239,
671 -239, -239, 83, -239, -239, -239, 454, -239, -239, -239,
672 -239, -239, 90, 91, -239, -239, -239, 101, -239, 513,
673 -239, -30, -239, -239, -239, -239, 513, -239, -239, 102,
674 108, 454, -239, -239, -239, 111, -50, 115, 124, 485,
675 -239, -239, -239, -239, -239, -239, -239, -239, -239, -239,
676 -239, -239, -239, -239, -239, -239, -239, -239, 139, 4,
677 139, 139, 140, 143, -239, -239, -239, -239, 442, -239,
678 -239, 104, 354, 139, 139, 139, 139, 139, 139, 139,
679 75, 145, 496, 126, -47, 133, -239, -239, -239, -239,
680 -239, -239, -239, -239, 135, 132, -239, -239, 139, 139,
681 139, 154, 155, 23, 141, 144, -17, 147, 34, 146,
682 148, 150, 152, -239, 513, -239, 156, -239, 158, 513,
683 -239, -239, 159, 160, -239, -239, 520, 520, 104, 104,
684 104, 30, 30, 139, 139, 454, 139, -239, -239, 23,
685 23, -239, -239, 139, 139, 162, 151, 139, 513, -239,
686 513, -239, -239, 172, 190, -239, 139, 55, -239, 139,
687 -239, 191, -239, 454, -239, -239, 56, 511, 193, 195,
688 10, 139, 139, 60, -239, -239, -239, -239, -239, -239,
689 -239, 164, 139, 139, 170, -239, -239, -239, -239, 139,
690 -239, -239, -239, -239, 183, 184, 185, -239, -239, -239,
691 -239, -239, -239, -239, 513, -239, -239, -239, 197, 139,
692 -239, 175, 139, -239, 86, 205, 206, -239, -239, 139,
693 -239, -239, -239, -239, -239, -239
696 /* YYPGOTO[NTERM-NUM]. */
697 static const short int yypgoto[] =
699 -239, -239, -239, 214, 107, -239, -239, 116, -239, -239,
700 114, -239, -239, -2, -239, 21, 33, 238, 26, -239,
701 -239, 255, 22, -239, -186, -239, -14, -239, -1, -85,
702 3, -238, 266, 248, 28
705 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
706 positive, shift that token. If negative, reduce the rule which
707 number is the opposite. If zero, do what YYDEFACT says.
708 If YYTABLE_NINF, syntax error. */
709 #define YYTABLE_NINF -3
710 static const short int yytable[] =
712 62, 107, 107, 62, 242, 107, 85, 205, 277, 232,
713 197, 187, 102, 291, 99, 109, 103, 99, 109, 109,
714 109, 116, 116, 293, 125, 66, 191, 70, 126, 192,
715 128, 93, 64, 198, 134, 135, 195, 94, 109, 248,
716 233, 111, 108, 100, 202, 112, 122, 127, 113, 114,
717 115, 131, 57, 58, 157, 59, 60, 161, 123, 162,
718 129, 140, 142, 132, 144, 145, 146, 61, 141, 130,
719 249, 86, 87, 57, 58, 136, 59, 60, 147, 57,
720 58, 137, 59, 60, 88, 89, 300, 138, 61, 155,
721 232, 252, 88, 89, 61, 75, 76, 77, 78, 79,
722 80, 81, 82, 57, 58, 139, 59, 60, 170, 171,
723 143, 278, 284, 308, 285, 286, 310, 158, 61, 159,
724 253, 233, 160, 315, 57, 58, 74, 59, 60, 295,
725 296, 75, 76, 77, 78, 79, 80, 81, 82, 61,
726 266, 64, 279, 186, 311, 312, 204, 172, 209, 204,
727 173, 174, 207, 223, 57, 58, 83, 59, 60, 231,
728 175, 216, 217, 218, 219, 220, 221, 222, 283, 61,
729 185, 227, 288, 188, 189, 228, 64, 68, 235, 245,
730 168, 169, 170, 171, 190, 193, 238, 240, 240, 57,
731 58, 194, 59, 60, 196, 88, 89, 254, 199, 250,
732 229, 255, 57, 58, 61, 59, 60, 200, 57, 58,
733 46, 59, 60, 213, 230, 268, 269, 61, 236, 237,
734 234, 264, 265, 61, 224, 243, 244, 247, 246, 267,
735 251, 275, 256, 258, 257, 259, 270, 271, 273, 260,
736 274, 261, 262, 263, 209, 272, 276, 299, 282, 289,
737 280, 290, 281, 302, 304, 305, 306, 307, 309, 209,
738 294, 313, 314, 292, 156, 214, 212, 211, 133, 105,
739 240, 67, 118, 0, 0, 0, 301, 0, 64, 119,
740 0, 120, 303, 75, 76, 77, 78, 79, 80, 81,
741 82, 57, 58, 0, 59, 60, 0, 240, -2, 1,
742 240, 0, 0, 0, 0, 0, 61, 240, 121, 2,
743 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
744 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
745 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
746 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
747 43, 44, 45, 75, 76, 77, 78, 79, 80, 81,
748 82, 57, 58, 0, 59, 60, 0, 0, 46, 0,
749 0, 1, 0, 0, 0, 0, 61, 0, 0, 47,
750 48, 2, 3, 4, 5, 6, 7, 8, 9, 10,
751 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
752 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
753 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
754 41, 42, 43, 44, 45, 163, 164, 165, 166, 167,
755 168, 169, 170, 171, 0, 0, 0, 0, 0, 215,
756 46, 0, 0, 1, 148, 149, 150, 151, 152, 153,
757 154, 47, 48, 2, 3, 4, 5, 6, 7, 8,
758 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
759 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
760 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
761 39, 40, 41, 42, 43, 44, 45, 95, 0, 0,
762 104, 0, 75, 76, 77, 78, 79, 80, 81, 82,
763 57, 58, 0, 59, 60, 176, 177, 178, 179, 180,
764 181, 182, 183, 47, 48, 61, 95, 96, 0, 0,
765 0, 75, 76, 77, 78, 79, 80, 81, 82, 57,
766 58, 0, 59, 60, 201, 0, 176, 177, 178, 179,
767 180, 181, 182, 183, 61, 0, 96, 75, 76, 77,
768 78, 79, 80, 81, 82, 57, 58, 0, 59, 60,
769 287, 0, 176, 177, 178, 179, 180, 181, 182, 183,
770 61, 0, 225, 226, 163, 164, 165, 166, 167, 168,
771 169, 170, 171, 165, 166, 167, 168, 169, 170, 171
774 static const short int yycheck[] =
776 2, 15, 16, 5, 190, 19, 7, 3, 246, 56,
777 60, 96, 13, 3, 11, 17, 13, 14, 20, 21,
778 22, 23, 24, 261, 25, 4, 56, 6, 25, 59,
779 56, 9, 56, 83, 31, 32, 121, 56, 40, 56,
780 87, 86, 16, 55, 129, 19, 25, 56, 20, 21,
781 22, 30, 69, 70, 81, 72, 73, 59, 25, 61,
782 86, 39, 41, 30, 43, 44, 45, 84, 40, 55,
783 87, 56, 57, 69, 70, 56, 72, 73, 45, 69,
784 70, 56, 72, 73, 69, 70, 272, 56, 84, 0,
785 56, 57, 69, 70, 84, 61, 62, 63, 64, 65,
786 66, 67, 68, 69, 70, 56, 72, 73, 78, 79,
787 56, 56, 56, 299, 58, 59, 302, 80, 84, 81,
788 86, 87, 81, 309, 69, 70, 56, 72, 73, 69,
789 70, 61, 62, 63, 64, 65, 66, 67, 68, 84,
790 225, 56, 87, 60, 58, 59, 148, 83, 150, 151,
791 83, 83, 149, 78, 69, 70, 86, 72, 73, 173,
792 83, 163, 164, 165, 166, 167, 168, 169, 253, 84,
793 83, 172, 257, 83, 83, 172, 56, 57, 175, 193,
794 76, 77, 78, 79, 83, 83, 188, 189, 190, 69,
795 70, 83, 72, 73, 83, 69, 70, 198, 83, 196,
796 74, 198, 69, 70, 84, 72, 73, 83, 69, 70,
797 70, 72, 73, 70, 88, 229, 230, 84, 83, 87,
798 87, 223, 224, 84, 79, 71, 71, 83, 87, 226,
799 83, 59, 86, 83, 86, 83, 233, 234, 87, 83,
800 237, 83, 83, 83, 246, 83, 56, 83, 57, 56,
801 247, 56, 249, 83, 71, 71, 71, 60, 83, 261,
802 262, 56, 56, 260, 50, 158, 152, 151, 30, 14,
803 272, 5, 24, -1, -1, -1, 273, -1, 56, 57,
804 -1, 59, 279, 61, 62, 63, 64, 65, 66, 67,
805 68, 69, 70, -1, 72, 73, -1, 299, 0, 1,
806 302, -1, -1, -1, -1, -1, 84, 309, 86, 11,
807 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
808 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
809 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
810 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
811 52, 53, 54, 61, 62, 63, 64, 65, 66, 67,
812 68, 69, 70, -1, 72, 73, -1, -1, 70, -1,
813 -1, 1, -1, -1, -1, -1, 84, -1, -1, 81,
814 82, 11, 12, 13, 14, 15, 16, 17, 18, 19,
815 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
816 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
817 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
818 50, 51, 52, 53, 54, 71, 72, 73, 74, 75,
819 76, 77, 78, 79, -1, -1, -1, -1, -1, 85,
820 70, -1, -1, 1, 4, 5, 6, 7, 8, 9,
821 10, 81, 82, 11, 12, 13, 14, 15, 16, 17,
822 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
823 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
824 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
825 48, 49, 50, 51, 52, 53, 54, 56, -1, -1,
826 59, -1, 61, 62, 63, 64, 65, 66, 67, 68,
827 69, 70, -1, 72, 73, 61, 62, 63, 64, 65,
828 66, 67, 68, 81, 82, 84, 56, 86, -1, -1,
829 -1, 61, 62, 63, 64, 65, 66, 67, 68, 69,
830 70, -1, 72, 73, 59, -1, 61, 62, 63, 64,
831 65, 66, 67, 68, 84, -1, 86, 61, 62, 63,
832 64, 65, 66, 67, 68, 69, 70, -1, 72, 73,
833 59, -1, 61, 62, 63, 64, 65, 66, 67, 68,
834 84, -1, 86, 87, 71, 72, 73, 74, 75, 76,
835 77, 78, 79, 73, 74, 75, 76, 77, 78, 79
838 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
839 symbol of state STATE-NUM. */
840 static const unsigned char yystos[] =
842 0, 1, 11, 12, 13, 14, 15, 16, 17, 18,
843 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
844 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
845 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
846 49, 50, 51, 52, 53, 54, 70, 81, 82, 90,
847 91, 92, 93, 95, 99, 103, 94, 69, 70, 72,
848 73, 84, 102, 121, 56, 104, 104, 121, 57, 102,
849 104, 105, 106, 119, 56, 61, 62, 63, 64, 65,
850 66, 67, 68, 86, 112, 117, 56, 57, 69, 70,
851 111, 115, 116, 111, 56, 56, 86, 110, 117, 119,
852 55, 108, 117, 119, 59, 110, 107, 115, 107, 102,
853 123, 86, 107, 123, 123, 123, 102, 122, 122, 57,
854 59, 86, 104, 105, 109, 117, 119, 56, 56, 86,
855 55, 104, 105, 106, 119, 119, 56, 56, 56, 56,
856 111, 123, 104, 56, 104, 104, 104, 105, 4, 5,
857 6, 7, 8, 9, 10, 0, 92, 81, 80, 81,
858 81, 102, 102, 71, 72, 73, 74, 75, 76, 77,
859 78, 79, 83, 83, 83, 83, 61, 62, 63, 64,
860 65, 66, 67, 68, 118, 83, 60, 118, 83, 83,
861 83, 56, 59, 83, 83, 118, 83, 60, 83, 83,
862 83, 59, 118, 96, 102, 3, 100, 119, 101, 102,
863 120, 96, 99, 70, 93, 85, 102, 102, 102, 102,
864 102, 102, 102, 78, 79, 86, 87, 117, 119, 74,
865 88, 115, 56, 87, 87, 119, 83, 87, 102, 114,
866 102, 113, 113, 71, 71, 115, 87, 83, 56, 87,
867 119, 83, 57, 86, 117, 119, 86, 86, 83, 83,
868 83, 83, 83, 83, 102, 102, 118, 119, 115, 115,
869 119, 119, 83, 87, 119, 59, 56, 120, 56, 87,
870 119, 119, 57, 118, 56, 58, 59, 59, 118, 56,
871 56, 3, 119, 120, 102, 69, 70, 97, 98, 83,
872 113, 119, 83, 119, 71, 71, 71, 60, 113, 83,
873 113, 58, 59, 56, 56, 113
876 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
877 # define YYSIZE_T __SIZE_TYPE__
879 #if ! defined (YYSIZE_T) && defined (size_t)
880 # define YYSIZE_T size_t
882 #if ! defined (YYSIZE_T)
883 # if defined (__STDC__) || defined (__cplusplus)
884 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
885 # define YYSIZE_T size_t
888 #if ! defined (YYSIZE_T)
889 # define YYSIZE_T unsigned int
892 #define yyerrok (yyerrstatus = 0)
893 #define yyclearin (yychar = YYEMPTY)
897 #define YYACCEPT goto yyacceptlab
898 #define YYABORT goto yyabortlab
899 #define YYERROR goto yyerrorlab
902 /* Like YYERROR except do call yyerror. This remains here temporarily
903 to ease the transition to the new meaning of YYERROR, for GCC.
904 Once GCC version 2 has supplanted version 1, this can go. */
906 #define YYFAIL goto yyerrlab
908 #define YYRECOVERING() (!!yyerrstatus)
910 #define YYBACKUP(Token, Value) \
912 if (yychar == YYEMPTY && yylen == 1) \
916 yytoken = YYTRANSLATE (yychar); \
922 yyerror ("syntax error: cannot back up");\
928 #define YYERRCODE 256
930 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
933 #ifndef YYLLOC_DEFAULT
934 # define YYLLOC_DEFAULT(Current, Rhs, N) \
935 ((Current).first_line = (Rhs)[1].first_line, \
936 (Current).first_column = (Rhs)[1].first_column, \
937 (Current).last_line = (Rhs)[N].last_line, \
938 (Current).last_column = (Rhs)[N].last_column)
941 /* YYLEX -- calling `yylex' with the right arguments. */
944 # define YYLEX yylex (YYLEX_PARAM)
946 # define YYLEX yylex ()
949 /* Enable debugging if requested. */
953 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
954 # define YYFPRINTF fprintf
957 # define YYDPRINTF(Args) \
963 # define YYDSYMPRINT(Args) \
969 # define YYDSYMPRINTF(Title, Token, Value, Location) \
973 YYFPRINTF (stderr, "%s ", Title); \
974 yysymprint (stderr, \
976 YYFPRINTF (stderr, "\n"); \
980 /*------------------------------------------------------------------.
981 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
983 `------------------------------------------------------------------*/
985 #if defined (__STDC__) || defined (__cplusplus)
987 yy_stack_print (short int *bottom, short int *top)
990 yy_stack_print (bottom, top)
995 YYFPRINTF (stderr, "Stack now");
996 for (/* Nothing. */; bottom <= top; ++bottom)
997 YYFPRINTF (stderr, " %d", *bottom);
998 YYFPRINTF (stderr, "\n");
1001 # define YY_STACK_PRINT(Bottom, Top) \
1004 yy_stack_print ((Bottom), (Top)); \
1008 /*------------------------------------------------.
1009 | Report that the YYRULE is going to be reduced. |
1010 `------------------------------------------------*/
1012 #if defined (__STDC__) || defined (__cplusplus)
1014 yy_reduce_print (int yyrule)
1017 yy_reduce_print (yyrule)
1022 unsigned int yylno = yyrline[yyrule];
1023 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
1025 /* Print the symbols being reduced, and their result. */
1026 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1027 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
1028 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
1031 # define YY_REDUCE_PRINT(Rule) \
1034 yy_reduce_print (Rule); \
1037 /* Nonzero means print parse trace. It is left uninitialized so that
1038 multiple parsers can coexist. */
1040 #else /* !YYDEBUG */
1041 # define YYDPRINTF(Args)
1042 # define YYDSYMPRINT(Args)
1043 # define YYDSYMPRINTF(Title, Token, Value, Location)
1044 # define YY_STACK_PRINT(Bottom, Top)
1045 # define YY_REDUCE_PRINT(Rule)
1046 #endif /* !YYDEBUG */
1049 /* YYINITDEPTH -- initial size of the parser's stacks. */
1051 # define YYINITDEPTH 200
1054 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1055 if the built-in stack extension method is used).
1057 Do not make this value too large; the results are undefined if
1058 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1059 evaluated with infinite-precision integer arithmetic. */
1061 #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
1066 # define YYMAXDEPTH 10000
1074 # if defined (__GLIBC__) && defined (_STRING_H)
1075 # define yystrlen strlen
1077 /* Return the length of YYSTR. */
1079 # if defined (__STDC__) || defined (__cplusplus)
1080 yystrlen (const char *yystr)
1086 register const char *yys = yystr;
1088 while (*yys++ != '\0')
1091 return yys - yystr - 1;
1097 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1098 # define yystpcpy stpcpy
1100 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1103 # if defined (__STDC__) || defined (__cplusplus)
1104 yystpcpy (char *yydest, const char *yysrc)
1106 yystpcpy (yydest, yysrc)
1111 register char *yyd = yydest;
1112 register const char *yys = yysrc;
1114 while ((*yyd++ = *yys++) != '\0')
1122 #endif /* !YYERROR_VERBOSE */
1127 /*--------------------------------.
1128 | Print this symbol on YYOUTPUT. |
1129 `--------------------------------*/
1131 #if defined (__STDC__) || defined (__cplusplus)
1133 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
1136 yysymprint (yyoutput, yytype, yyvaluep)
1142 /* Pacify ``unused variable'' warnings. */
1145 if (yytype < YYNTOKENS)
1147 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1149 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1153 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1160 YYFPRINTF (yyoutput, ")");
1163 #endif /* ! YYDEBUG */
1164 /*-----------------------------------------------.
1165 | Release the memory associated to this symbol. |
1166 `-----------------------------------------------*/
1168 #if defined (__STDC__) || defined (__cplusplus)
1170 yydestruct (int yytype, YYSTYPE *yyvaluep)
1173 yydestruct (yytype, yyvaluep)
1178 /* Pacify ``unused variable'' warnings. */
1190 /* Prevent warnings from -Wmissing-prototypes. */
1192 #ifdef YYPARSE_PARAM
1193 # if defined (__STDC__) || defined (__cplusplus)
1194 int yyparse (void *YYPARSE_PARAM);
1198 #else /* ! YYPARSE_PARAM */
1199 #if defined (__STDC__) || defined (__cplusplus)
1204 #endif /* ! YYPARSE_PARAM */
1208 /* The lookahead symbol. */
1211 /* The semantic value of the lookahead symbol. */
1214 /* Number of syntax errors so far. */
1223 #ifdef YYPARSE_PARAM
1224 # if defined (__STDC__) || defined (__cplusplus)
1225 int yyparse (void *YYPARSE_PARAM)
1227 int yyparse (YYPARSE_PARAM)
1228 void *YYPARSE_PARAM;
1230 #else /* ! YYPARSE_PARAM */
1231 #if defined (__STDC__) || defined (__cplusplus)
1242 register int yystate;
1245 /* Number of tokens to shift before error messages enabled. */
1247 /* Lookahead token as an internal (translated) token number. */
1250 /* Three stacks and their tools:
1251 `yyss': related to states,
1252 `yyvs': related to semantic values,
1253 `yyls': related to locations.
1255 Refer to the stacks thru separate pointers, to allow yyoverflow
1256 to reallocate them elsewhere. */
1258 /* The state stack. */
1259 short int yyssa[YYINITDEPTH];
1260 short int *yyss = yyssa;
1261 register short int *yyssp;
1263 /* The semantic value stack. */
1264 YYSTYPE yyvsa[YYINITDEPTH];
1265 YYSTYPE *yyvs = yyvsa;
1266 register YYSTYPE *yyvsp;
1270 #define YYPOPSTACK (yyvsp--, yyssp--)
1272 YYSIZE_T yystacksize = YYINITDEPTH;
1274 /* The variables used to return semantic value and location from the
1279 /* When reducing, the number of symbols on the RHS of the reduced
1283 YYDPRINTF ((stderr, "Starting parse\n"));
1288 yychar = YYEMPTY; /* Cause a token to be read. */
1290 /* Initialize stack pointers.
1291 Waste one element of value and location stack
1292 so that they stay on the same level as the state stack.
1293 The wasted elements are never initialized. */
1301 /*------------------------------------------------------------.
1302 | yynewstate -- Push a new state, which is found in yystate. |
1303 `------------------------------------------------------------*/
1305 /* In all cases, when you get here, the value and location stacks
1306 have just been pushed. so pushing a state here evens the stacks.
1313 if (yyss + yystacksize - 1 <= yyssp)
1315 /* Get the current used size of the three stacks, in elements. */
1316 YYSIZE_T yysize = yyssp - yyss + 1;
1320 /* Give user a chance to reallocate the stack. Use copies of
1321 these so that the &'s don't force the real ones into
1323 YYSTYPE *yyvs1 = yyvs;
1324 short int *yyss1 = yyss;
1327 /* Each stack pointer address is followed by the size of the
1328 data in use in that stack, in bytes. This used to be a
1329 conditional around just the two extra args, but that might
1330 be undefined if yyoverflow is a macro. */
1331 yyoverflow ("parser stack overflow",
1332 &yyss1, yysize * sizeof (*yyssp),
1333 &yyvs1, yysize * sizeof (*yyvsp),
1340 #else /* no yyoverflow */
1341 # ifndef YYSTACK_RELOCATE
1344 /* Extend the stack our own way. */
1345 if (YYMAXDEPTH <= yystacksize)
1348 if (YYMAXDEPTH < yystacksize)
1349 yystacksize = YYMAXDEPTH;
1352 short int *yyss1 = yyss;
1353 union yyalloc *yyptr =
1354 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1357 YYSTACK_RELOCATE (yyss);
1358 YYSTACK_RELOCATE (yyvs);
1360 # undef YYSTACK_RELOCATE
1362 YYSTACK_FREE (yyss1);
1365 #endif /* no yyoverflow */
1367 yyssp = yyss + yysize - 1;
1368 yyvsp = yyvs + yysize - 1;
1371 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1372 (unsigned long int) yystacksize));
1374 if (yyss + yystacksize - 1 <= yyssp)
1378 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1387 /* Do appropriate processing given the current state. */
1388 /* Read a lookahead token if we need one and don't already have one. */
1391 /* First try to decide what to do without reference to lookahead token. */
1393 yyn = yypact[yystate];
1394 if (yyn == YYPACT_NINF)
1397 /* Not known => get a lookahead token if don't already have one. */
1399 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1400 if (yychar == YYEMPTY)
1402 YYDPRINTF ((stderr, "Reading a token: "));
1406 if (yychar <= YYEOF)
1408 yychar = yytoken = YYEOF;
1409 YYDPRINTF ((stderr, "Now at end of input.\n"));
1413 yytoken = YYTRANSLATE (yychar);
1414 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1417 /* If the proper action on seeing token YYTOKEN is to reduce or to
1418 detect an error, take that action. */
1420 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1425 if (yyn == 0 || yyn == YYTABLE_NINF)
1434 /* Shift the lookahead token. */
1435 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1437 /* Discard the token being shifted unless it is eof. */
1438 if (yychar != YYEOF)
1444 /* Count tokens shifted since error; after three, turn off error
1453 /*-----------------------------------------------------------.
1454 | yydefault -- do the default action for the current state. |
1455 `-----------------------------------------------------------*/
1457 yyn = yydefact[yystate];
1463 /*-----------------------------.
1464 | yyreduce -- Do a reduction. |
1465 `-----------------------------*/
1467 /* yyn is the number of a rule to reduce with. */
1470 /* If YYLEN is nonzero, implement the default value of the action:
1473 Otherwise, the following line sets YYVAL to garbage.
1474 This behavior is undocumented and Bison
1475 users should not rely upon it. Assigning to YYVAL
1476 unconditionally makes the parser a bit smaller, and it avoids a
1477 GCC warning that YYVAL may be used uninitialized. */
1478 yyval = yyvsp[1-yylen];
1481 YY_REDUCE_PRINT (yyn);
1485 #line 127 "parser.y"
1491 #line 136 "parser.y"
1493 if (abort_asap) {YYABORT;}
1495 yyvsp[-2].sym->type = LABEL;
1496 yyvsp[-2].sym->value = lc;
1498 inclc(yyvsp[0].value);
1504 #line 145 "parser.y"
1505 { inclc(yyvsp[0].value); bytecount = 0; }
1509 #line 148 "parser.y"
1511 yyval.value = yyvsp[-1].value;
1512 if( dashl && pass2 )
1513 dumplist(yyvsp[0].str,1);
1518 #line 153 "parser.y"
1520 yyval.value = yyvsp[-1].value;
1521 if( dashl && pass2 )
1522 dumplist(yyvsp[0].str,1);
1528 #line 159 "parser.y"
1531 if( dashl && pass2 )
1532 dumplist(yyvsp[0].str,0);
1537 #line 164 "parser.y"
1544 #line 167 "parser.y"
1547 if( dashl && pass2 )
1548 dumplist(yyvsp[-2].str,0);
1553 #line 184 "parser.y"
1555 lc = yyvsp[0].val.v;
1556 if( pass2 ) emitaddr(lc);
1563 #line 190 "parser.y"
1564 { yyval.value = yyvsp[0].value; }
1568 #line 191 "parser.y"
1569 { yyval.value = yyvsp[0].value; }
1573 #line 192 "parser.y"
1574 { yyval.value = yyvsp[0].val.v;
1576 emitaddr(lc+yyval.value); }
1580 #line 196 "parser.y"
1582 if( yyvsp[0].val.d == 0 )
1583 warn("Expression is undefined in pass 1");
1584 yyvsp[-2].sym->type = LABEL;
1585 yyvsp[-2].sym->value = yyvsp[0].val.v;
1591 #line 205 "parser.y"
1593 yyvsp[-2].sym->type = LABEL;
1594 yyvsp[-2].sym->value = yyvsp[0].value;
1600 #line 210 "parser.y"
1601 { yyval.value = 0; }
1605 #line 214 "parser.y"
1607 if( yyvsp[0].val.d == 0 )
1608 warn("Expression is undefined in pass 1");
1609 if( !(isbit16(yyvsp[0].val.v)) )
1610 warn("Value greater than 16-bits");
1611 yyval.value = yyvsp[0].val.v;
1616 #line 224 "parser.y"
1618 if( !isbit8(yyvsp[-1].value) )
1619 warn("Bit address exceeds 8-bits");
1620 if( isbmram(yyvsp[-1].value) )
1621 yyval.value = (yyvsp[-1].value-0x20)*8+ yyvsp[0].value;
1622 else if( isbmsfr(yyvsp[-1].value) )
1623 yyval.value = yyvsp[-1].value + yyvsp[0].value;
1625 warn("Invalid bit addressable RAM location");
1630 #line 237 "parser.y"
1632 if( yyvsp[0].sym->type == UNDEF )
1633 warn("Symbol %s must be defined in pass 1",yyvsp[0].sym->name);
1634 yyval.value = yyvsp[0].sym->value;
1639 #line 242 "parser.y"
1640 { yyval.value = yyvsp[0].value; }
1644 #line 247 "parser.y"
1646 if( yyvsp[0].sym->type != UNDEF && pass1)
1647 warn("Attempt to redefine symbol: %s",yyvsp[0].sym->name);
1648 yyval.sym = yyvsp[0].sym;
1653 #line 255 "parser.y"
1655 if( pass2 ) genbyte(yyvsp[0].value);
1656 yyval.value = yyvsp[-2].value + 1;
1661 #line 260 "parser.y"
1664 yyval.value = yyvsp[-2].value + yyvsp[0].value;
1666 yyval.value = yyvsp[-2].value + strlen(yyvsp[0].str);
1667 genstr(yyvsp[0].str);
1675 #line 271 "parser.y"
1677 if( pass2 ) genbyte(yyvsp[0].value);
1683 #line 276 "parser.y"
1686 yyval.value = yyvsp[0].value;
1688 yyval.value = strlen(yyvsp[0].str);
1689 genstr(yyvsp[0].str);
1696 #line 288 "parser.y"
1698 if( pass2 ) genword(yyvsp[0].value);
1699 yyval.value = yyvsp[-2].value + 2;
1704 #line 293 "parser.y"
1706 if( pass2 ) genword(yyvsp[0].value);
1712 #line 306 "parser.y"
1718 #line 309 "parser.y"
1719 { yyval.val.v = yyvsp[-1].val.v;
1720 yyval.val.d = yyvsp[-1].val.d; }
1724 #line 312 "parser.y"
1725 { yyval.val.v = -yyvsp[0].val.v;
1726 yyval.val.d = yyvsp[0].val.d; }
1730 #line 315 "parser.y"
1731 { yyval.val.v = yyvsp[-2].val.v | yyvsp[0].val.v;
1732 yyval.val.d = yyvsp[-2].val.d && yyvsp[0].val.d; }
1736 #line 318 "parser.y"
1737 { yyval.val.v = yyvsp[-2].val.v & yyvsp[0].val.v;
1738 yyval.val.d = yyvsp[-2].val.d && yyvsp[0].val.d; }
1742 #line 321 "parser.y"
1743 { yyval.val.v = yyvsp[-2].val.v * yyvsp[0].val.v;
1744 yyval.val.d = yyvsp[-2].val.d && yyvsp[0].val.d; }
1748 #line 324 "parser.y"
1749 { yyval.val.v = yyvsp[-2].val.v / yyvsp[0].val.v;
1750 yyval.val.d = yyvsp[-2].val.d && yyvsp[0].val.d; }
1754 #line 327 "parser.y"
1755 { yyval.val.v = yyvsp[-2].val.v % yyvsp[0].val.v;
1756 yyval.val.d = yyvsp[-2].val.d && yyvsp[0].val.d; }
1760 #line 330 "parser.y"
1761 { yyval.val.v = yyvsp[-2].val.v - yyvsp[0].val.v;
1762 yyval.val.d = yyvsp[-2].val.d && yyvsp[0].val.d; }
1766 #line 333 "parser.y"
1767 { yyval.val.v = yyvsp[-2].val.v + yyvsp[0].val.v;
1768 yyval.val.d = yyvsp[-2].val.d && yyvsp[0].val.d; }
1772 #line 336 "parser.y"
1773 { yyval.val.v = yyvsp[-3].val.v >> yyvsp[0].val.v;
1774 yyval.val.d = yyvsp[-3].val.d && yyvsp[0].val.d; }
1778 #line 339 "parser.y"
1779 { yyval.val.v = yyvsp[-3].val.v << yyvsp[0].val.v;
1780 yyval.val.d = yyvsp[-3].val.d && yyvsp[0].val.d; }
1784 #line 342 "parser.y"
1787 yyval.val.v = yyvsp[0].sym->value;
1788 yyval.val.d = (yyvsp[0].sym->type != UNDEF);
1791 if( yyvsp[0].sym->type == UNDEF )
1792 warn("Undefined symbol %s",yyvsp[0].sym->name);
1793 yyval.val.v = yyvsp[0].sym->value;
1800 #line 354 "parser.y"
1801 { yyval.val.v = yyvsp[0].val.v; yyval.val.d=1; }
1805 #line 367 "parser.y"
1806 { yyval.value = makeop(yyvsp[0].op,NULL,0); }
1810 #line 369 "parser.y"
1811 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
1815 #line 371 "parser.y"
1816 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
1820 #line 373 "parser.y"
1821 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
1825 #line 375 "parser.y"
1826 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
1830 #line 377 "parser.y"
1831 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
1835 #line 379 "parser.y"
1836 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
1840 #line 381 "parser.y"
1841 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,4); }
1845 #line 383 "parser.y"
1846 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
1850 #line 385 "parser.y"
1851 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,4); }
1855 #line 387 "parser.y"
1856 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,6); }
1860 #line 389 "parser.y"
1861 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
1865 #line 391 "parser.y"
1866 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,4); }
1870 #line 393 "parser.y"
1871 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,6); }
1875 #line 395 "parser.y"
1876 { if( get_md(yyvsp[0].mode) == 3 )
1877 warn("Immediate mode is illegal");
1878 yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0);
1883 #line 400 "parser.y"
1884 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
1888 #line 402 "parser.y"
1889 { yyval.value = makeop(yyvsp[-1].op,NULL,4); }
1893 #line 404 "parser.y"
1894 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
1898 #line 406 "parser.y"
1899 { yyval.value = makeop(yyvsp[-1].op,NULL,0); }
1903 #line 408 "parser.y"
1904 { yyval.value = makeop(yyvsp[-1].op,NULL,0); }
1908 #line 410 "parser.y"
1909 { yyval.value = makeop(yyvsp[-4].op,NULL,0); }
1913 #line 412 "parser.y"
1914 { yyval.value = makeop(yyvsp[-4].op,NULL,0); }
1918 #line 414 "parser.y"
1919 { yyval.value = makeop(yyvsp[-1].op,NULL,0); }
1923 #line 416 "parser.y"
1924 { yyval.value = makeop(yyvsp[0].op,NULL,0); }
1928 #line 418 "parser.y"
1929 { yyval.value = makeop(yyvsp[0].op,NULL,0); }
1933 #line 420 "parser.y"
1934 { yyval.value = makeop(yyvsp[-1].op,NULL,0); }
1938 #line 422 "parser.y"
1939 { yyval.value = makeop(yyvsp[-1].op,NULL,0); }
1943 #line 424 "parser.y"
1944 { yyval.value = makeop(yyvsp[-1].op,NULL,0); }
1948 #line 426 "parser.y"
1949 { yyval.value = makeop(yyvsp[-1].op,NULL,0); }
1953 #line 428 "parser.y"
1954 { yyval.value = makeop(yyvsp[-1].op,NULL,0); }
1958 #line 430 "parser.y"
1959 { if( get_md(yyvsp[0].mode) != 2 )
1960 warn("Invalid addressing mode");
1961 yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,-2); }
1965 #line 434 "parser.y"
1966 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
1970 #line 436 "parser.y"
1971 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
1975 #line 438 "parser.y"
1976 { if( get_md(yyvsp[0].mode) == 0 )
1977 warn("Invalid addressing mode");
1978 yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,-1); }
1982 #line 442 "parser.y"
1988 set_b1(tmp,yyvsp[0].value);
1989 yyval.value = makeop(yyvsp[-1].op,&tmp,0);
1994 #line 451 "parser.y"
2000 set_b1(tmp,yyvsp[0].value);
2001 yyval.value = makeop(yyvsp[-1].op,&tmp,0);
2006 #line 460 "parser.y"
2007 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
2011 #line 462 "parser.y"
2012 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
2016 #line 464 "parser.y"
2017 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
2021 #line 466 "parser.y"
2022 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
2026 #line 468 "parser.y"
2027 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
2031 #line 470 "parser.y"
2032 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
2036 #line 472 "parser.y"
2037 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
2041 #line 474 "parser.y"
2042 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
2046 #line 476 "parser.y"
2047 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
2051 #line 478 "parser.y"
2052 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
2056 #line 480 "parser.y"
2057 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
2061 #line 482 "parser.y"
2062 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
2066 #line 484 "parser.y"
2067 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,0); }
2071 #line 486 "parser.y"
2072 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,4); }
2076 #line 488 "parser.y"
2077 { yyval.value = makeop(yyvsp[-1].op,&yyvsp[0].mode,6); }
2081 #line 492 "parser.y"
2082 { yyval.value = makeop(yyvsp[-6].op,NULL,0); }
2086 #line 494 "parser.y"
2087 { yyval.value = makeop(yyvsp[-6].op,NULL,0); }
2091 #line 496 "parser.y"
2092 { yyval.value = makeop(yyvsp[-6].op,NULL,1); }
2096 #line 498 "parser.y"
2097 { yyval.value = makeop(yyvsp[-6].op,NULL,1); }
2101 #line 501 "parser.y"
2102 { yyval.value = makeop(yyvsp[-4].op,NULL,yyvsp[0].value); }
2106 #line 503 "parser.y"
2107 { yyval.value = makeop(yyvsp[-4].op,NULL,2); }
2111 #line 505 "parser.y"
2112 { yyval.value = makeop(yyvsp[-4].op,NULL,yyvsp[-2].value+3); }
2116 #line 507 "parser.y"
2117 { yyval.value = makeop(yyvsp[-4].op,NULL,5); }
2121 #line 519 "parser.y"
2123 set_md(yyval.mode,0);
2124 set_ov(yyval.mode, yyvsp[0].value);
2125 set_sz(yyval.mode, 0);
2130 #line 525 "parser.y"
2132 set_md(yyval.mode,1);
2133 set_ov(yyval.mode,0);
2134 set_sz(yyval.mode,1);
2135 set_b1(yyval.mode,yyvsp[0].value);
2140 #line 532 "parser.y"
2142 set_md(yyval.mode,2);
2143 set_ov(yyval.mode,yyvsp[0].value);
2144 set_sz(yyval.mode,0);
2149 #line 538 "parser.y"
2151 set_md(yyval.mode,3);
2152 set_ov(yyval.mode,0);
2153 set_sz(yyval.mode,1);
2154 set_b1(yyval.mode,yyvsp[0].value);
2159 #line 547 "parser.y"
2161 set_md(yyval.mode,0);
2162 set_ov(yyval.mode,0);
2163 set_sz(yyval.mode,1);
2164 set_b1(yyval.mode,yyvsp[-2].value);
2169 #line 554 "parser.y"
2171 set_md(yyval.mode,1);
2172 set_ov(yyval.mode,0);
2173 set_sz(yyval.mode,2);
2174 set_b1(yyval.mode,yyvsp[-3].value);
2175 set_b2(yyval.mode,yyvsp[0].value);
2180 #line 564 "parser.y"
2182 set_md(yyval.mode,0);
2183 set_ov(yyval.mode,0);
2184 set_sz(yyval.mode,1);
2185 set_b1(yyval.mode,yyvsp[0].value);
2190 #line 571 "parser.y"
2192 set_md(yyval.mode,1);
2193 set_ov(yyval.mode,0);
2194 set_sz(yyval.mode,1);
2195 set_b1(yyval.mode,yyvsp[0].value);
2200 #line 578 "parser.y"
2202 set_md(yyval.mode,1);
2203 set_ov(yyval.mode,0);
2204 set_sz(yyval.mode,1);
2205 set_b1(yyval.mode,yyvsp[0].value);
2210 #line 587 "parser.y"
2212 set_md(yyval.mode,0);
2213 set_ov(yyval.mode,0);
2214 set_sz(yyval.mode,2);
2215 set_b1(yyval.mode,yyvsp[-2].value);
2216 set_b2(yyval.mode,yyvsp[0].value);
2221 #line 597 "parser.y"
2223 set_md(yyval.mode,0);
2224 set_ov(yyval.mode,yyvsp[-2].value);
2225 set_sz(yyval.mode,1);
2226 set_b1(yyval.mode,yyvsp[0].value);
2231 #line 604 "parser.y"
2233 set_md(yyval.mode,1);
2234 set_ov(yyval.mode,0);
2235 set_sz(yyval.mode,2);
2236 set_b1(yyval.mode,yyvsp[-2].value);
2237 set_b2(yyval.mode,yyvsp[0].value);
2242 #line 614 "parser.y"
2244 set_md(yyval.mode,0);
2245 set_ov(yyval.mode,yyvsp[-2].value);
2246 set_sz(yyval.mode,0);
2251 #line 620 "parser.y"
2253 set_md(yyval.mode,1);
2254 set_ov(yyval.mode,yyvsp[-2].value);
2255 set_sz(yyval.mode,1);
2256 set_b1(yyval.mode,yyvsp[0].value);
2261 #line 627 "parser.y"
2263 set_md(yyval.mode,2);
2264 set_ov(yyval.mode,yyvsp[-3].value);
2265 set_sz(yyval.mode,1);
2266 set_b1(yyval.mode,yyvsp[0].value);
2271 #line 634 "parser.y"
2273 set_md(yyval.mode,3);
2274 set_ov(yyval.mode,yyvsp[0].value);
2275 set_sz(yyval.mode,1);
2276 set_b1(yyval.mode,yyvsp[-2].value);
2281 #line 641 "parser.y"
2283 set_md(yyval.mode,4);
2284 set_ov(yyval.mode,0);
2285 set_sz(yyval.mode,2);
2286 set_b1(yyval.mode,yyvsp[0].value);
2287 set_b2(yyval.mode,yyvsp[-2].value);
2292 #line 649 "parser.y"
2294 set_md(yyval.mode,5);
2295 set_ov(yyval.mode,yyvsp[0].value);
2296 set_sz(yyval.mode,1);
2297 set_b1(yyval.mode,yyvsp[-3].value);
2302 #line 656 "parser.y"
2304 set_md(yyval.mode,6);
2305 set_ov(yyval.mode,yyvsp[-2].value);
2306 set_sz(yyval.mode,0);
2311 #line 662 "parser.y"
2313 set_md(yyval.mode,7);
2314 set_ov(yyval.mode,yyvsp[-2].value);
2315 set_sz(yyval.mode,1);
2316 set_b1(yyval.mode,yyvsp[0].value);
2321 #line 669 "parser.y"
2323 set_md(yyval.mode,8);
2324 set_ov(yyval.mode,yyvsp[-3].value);
2325 set_sz(yyval.mode,1);
2326 set_b1(yyval.mode,yyvsp[0].value);
2331 #line 676 "parser.y"
2333 set_md(yyval.mode,9);
2334 set_ov(yyval.mode,0);
2335 set_sz(yyval.mode,2);
2336 set_b1(yyval.mode, (yyvsp[0].value & 0xff00) >> 8 );
2337 set_b2(yyval.mode, (yyvsp[0].value & 0x00ff) );
2342 #line 684 "parser.y"
2344 set_md(yyval.mode,10);
2345 set_ov(yyval.mode,0);
2346 set_sz(yyval.mode,1);
2347 set_b1(yyval.mode,yyvsp[0].value);
2352 #line 700 "parser.y"
2354 set_md(yyval.mode,11);
2355 set_ov(yyval.mode,0);
2356 set_sz(yyval.mode,1);
2357 set_b1(yyval.mode,yyvsp[-2].value);
2362 #line 707 "parser.y"
2365 if( !isbit8(yyvsp[-3].value) )
2366 warn("Bit address exceeds 8-bits");
2367 if( isbmram(yyvsp[-3].value) )
2368 set_b1(yyval.mode, (yyvsp[-3].value-0x20)*8+ yyvsp[-2].value );
2369 else if( isbmsfr(yyvsp[-3].value) )
2370 set_b1(yyval.mode, yyvsp[-3].value + yyvsp[-2].value );
2372 warn("Invalid bit addressable RAM location");
2374 set_md(yyval.mode,11);
2375 set_ov(yyval.mode,0);
2376 set_sz(yyval.mode,1);
2381 #line 726 "parser.y"
2383 set_md(yyval.mode,0);
2384 set_ov(yyval.mode,0);
2385 set_sz(yyval.mode,0);
2390 #line 733 "parser.y"
2392 set_md(yyval.mode,1);
2393 set_ov(yyval.mode,yyvsp[0].value);
2394 set_sz(yyval.mode,0);
2399 #line 739 "parser.y"
2401 set_md(yyval.mode,2);
2402 set_ov(yyval.mode,0);
2403 set_sz(yyval.mode,1);
2404 set_b1(yyval.mode,yyvsp[0].value);
2409 #line 746 "parser.y"
2411 set_md(yyval.mode,3);
2412 set_ov(yyval.mode,yyvsp[0].value);
2413 set_sz(yyval.mode,0);
2418 #line 754 "parser.y"
2420 set_md(yyval.mode,0);
2421 set_ov(yyval.mode,0);
2422 set_sz(yyval.mode,0);
2427 #line 760 "parser.y"
2429 set_md(yyval.mode,1);
2430 set_ov(yyval.mode,0);
2431 set_sz(yyval.mode,0);
2436 #line 766 "parser.y"
2438 set_md(yyval.mode,2);
2439 set_ov(yyval.mode,0);
2440 set_sz(yyval.mode,1);
2441 set_b1(yyval.mode,yyvsp[0].value);
2446 #line 775 "parser.y"
2448 set_md(yyval.mode,0);
2449 set_ov(yyval.mode,0);
2450 set_sz(yyval.mode,2);
2451 set_b1(yyval.mode,yyvsp[-2].value);
2452 set_b2(yyval.mode,yyvsp[0].value);
2457 #line 783 "parser.y"
2459 set_md(yyval.mode,1);
2460 set_ov(yyval.mode,0);
2461 set_sz(yyval.mode,2);
2462 set_b1(yyval.mode,yyvsp[-2].value);
2463 set_b2(yyval.mode,yyvsp[0].value);
2468 #line 791 "parser.y"
2470 set_md(yyval.mode,2);
2471 set_ov(yyval.mode,yyvsp[-5].value);
2472 set_sz(yyval.mode,2);
2473 set_b1(yyval.mode,yyvsp[-2].value);
2474 set_b2(yyval.mode,yyvsp[0].value);
2479 #line 799 "parser.y"
2481 set_md(yyval.mode,3);
2482 set_ov(yyval.mode,yyvsp[-5].value);
2483 set_sz(yyval.mode,2);
2484 set_b1(yyval.mode,yyvsp[-2].value);
2485 set_b2(yyval.mode,yyvsp[0].value);
2490 #line 809 "parser.y"
2494 offset = yyvsp[0].val.v - (lc+3);
2495 if( offset > 127 || offset < -128 )
2496 warn("Relative offset exceeds -128 / +127");
2497 yyval.value = offset;
2503 #line 826 "parser.y"
2507 offset = yyvsp[0].val.v - (lc+2); /* different! */
2508 if( offset > 127 || offset < -128 )
2509 warn("Relative offset exceeds -128 / +127");
2510 yyval.value = offset;
2516 #line 839 "parser.y"
2519 if( !isbit8(yyvsp[-1].value) )
2520 warn("Bit address exceeds 8-bits");
2521 if( isbmram(yyvsp[-1].value) )
2522 yyval.value = (yyvsp[-1].value-0x20)*8+yyvsp[0].value;
2523 else if( isbmsfr(yyvsp[-1].value) )
2524 yyval.value = yyvsp[-1].value + yyvsp[0].value;
2526 warn("Invalid bit addressable RAM location");
2532 #line 852 "parser.y"
2535 if( !isbit8(yyvsp[0].value) )
2536 warn("Bit address exceeds 8-bits");
2537 yyval.value = yyvsp[0].value;
2543 #line 862 "parser.y"
2545 if( yyvsp[0].sym->type == UNDEF && pass2 )
2546 warn("Symbol %s undefined",yyvsp[0].sym->name);
2547 yyval.value = yyvsp[0].sym->value;
2552 #line 867 "parser.y"
2553 { yyval.value = yyvsp[0].value; }
2557 #line 870 "parser.y"
2558 { yyval.value = 0; }
2562 #line 871 "parser.y"
2563 { yyval.value = 1; }
2567 #line 872 "parser.y"
2568 { yyval.value = 2; }
2572 #line 873 "parser.y"
2573 { yyval.value = 3; }
2577 #line 874 "parser.y"
2578 { yyval.value = 4; }
2582 #line 875 "parser.y"
2583 { yyval.value = 5; }
2587 #line 876 "parser.y"
2588 { yyval.value = 6; }
2592 #line 877 "parser.y"
2593 { yyval.value = 7; }
2597 #line 880 "parser.y"
2598 { yyval.value = 0; }
2602 #line 881 "parser.y"
2603 { yyval.value = 1; }
2607 #line 883 "parser.y"
2609 warn("Illegal indirect register: @r2"); }
2613 #line 886 "parser.y"
2615 warn("Illegal indirect register: @r3"); }
2619 #line 889 "parser.y"
2621 warn("Illegal indirect register: @r4"); }
2625 #line 892 "parser.y"
2627 warn("Illegal indirect register: @r5"); }
2631 #line 895 "parser.y"
2633 warn("Illegal indirect register: @r6"); }
2637 #line 898 "parser.y"
2639 warn("Illegal indirect register: @r7"); }
2643 #line 903 "parser.y"
2646 if( !isbit8(yyvsp[0].val.v) )
2647 warn("Expression greater than 8-bits");
2649 yyval.value = yyvsp[0].val.v;
2654 #line 913 "parser.y"
2657 if( !isbit16(yyvsp[0].val.v) )
2658 warn("Expression greater than 16-bits");
2660 yyval.value = yyvsp[0].val.v;
2665 #line 923 "parser.y"
2668 if( !isbit16(yyvsp[0].val.v) )
2669 warn("Address greater than 16-bits");
2670 if( (yyvsp[0].val.v & size11) != ((lc+2) & size11) )
2671 warn("Address outside current 2K page");
2673 set_md(yyval.mode,0);
2674 set_ov(yyval.mode, (yyvsp[0].val.v&0x0700)>>3 );
2675 set_sz(yyval.mode,1);
2676 set_b1(yyval.mode,yyvsp[0].val.v&0x00ff);
2681 #line 938 "parser.y"
2684 if( !isbit16(yyvsp[0].val.v) )
2685 warn("Address greater than 16-bits");
2687 set_md(yyval.mode,0);
2688 set_ov(yyval.mode, 0 );
2689 set_sz(yyval.mode,2);
2690 set_b1(yyval.mode, (yyvsp[0].val.v & 0xff00 ) >> 8 );
2691 set_b2(yyval.mode, (yyvsp[0].val.v & 0x00ff ) );
2696 #line 952 "parser.y"
2700 offset = yyvsp[0].val.v - (lc+2);
2701 if( offset>127 || offset<-128 )
2702 warn("Relative offset exceeds -128 / +127");
2704 set_md(yyval.mode,0);
2705 set_ov(yyval.mode,0);
2706 set_sz(yyval.mode,1);
2707 set_b1(yyval.mode,offset);
2715 /* Line 1010 of yacc.c. */
2716 #line 2717 "y.tab.c"
2722 YY_STACK_PRINT (yyss, yyssp);
2727 /* Now `shift' the result of the reduction. Determine what state
2728 that goes to, based on the state we popped back to and the rule
2729 number reduced by. */
2733 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2734 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2735 yystate = yytable[yystate];
2737 yystate = yydefgoto[yyn - YYNTOKENS];
2742 /*------------------------------------.
2743 | yyerrlab -- here on detecting error |
2744 `------------------------------------*/
2746 /* If not already recovering from an error, report this error. */
2751 yyn = yypact[yystate];
2753 if (YYPACT_NINF < yyn && yyn < YYLAST)
2755 YYSIZE_T yysize = 0;
2756 int yytype = YYTRANSLATE (yychar);
2757 const char* yyprefix;
2761 /* Start YYX at -YYN if negative to avoid negative indexes in
2763 int yyxbegin = yyn < 0 ? -yyn : 0;
2765 /* Stay within bounds of both yycheck and yytname. */
2766 int yychecklim = YYLAST - yyn;
2767 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
2770 yyprefix = ", expecting ";
2771 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2772 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2774 yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
2782 yysize += (sizeof ("syntax error, unexpected ")
2783 + yystrlen (yytname[yytype]));
2784 yymsg = (char *) YYSTACK_ALLOC (yysize);
2787 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
2788 yyp = yystpcpy (yyp, yytname[yytype]);
2792 yyprefix = ", expecting ";
2793 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2794 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2796 yyp = yystpcpy (yyp, yyprefix);
2797 yyp = yystpcpy (yyp, yytname[yyx]);
2802 YYSTACK_FREE (yymsg);
2805 yyerror ("syntax error; also virtual memory exhausted");
2808 #endif /* YYERROR_VERBOSE */
2809 yyerror ("syntax error");
2814 if (yyerrstatus == 3)
2816 /* If just tried and failed to reuse lookahead token after an
2817 error, discard it. */
2819 if (yychar <= YYEOF)
2821 /* If at end of input, pop the error token,
2822 then the rest of the stack, then return failure. */
2823 if (yychar == YYEOF)
2829 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
2830 yydestruct (yystos[*yyssp], yyvsp);
2835 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
2836 yydestruct (yytoken, &yylval);
2842 /* Else will try to reuse lookahead token after shifting the error
2847 /*---------------------------------------------------.
2848 | yyerrorlab -- error raised explicitly by YYERROR. |
2849 `---------------------------------------------------*/
2853 /* Pacify GCC when the user code never invokes YYERROR and the label
2854 yyerrorlab therefore never appears in user code. */
2865 /*-------------------------------------------------------------.
2866 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2867 `-------------------------------------------------------------*/
2869 yyerrstatus = 3; /* Each real token shifted decrements this. */
2873 yyn = yypact[yystate];
2874 if (yyn != YYPACT_NINF)
2877 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2885 /* Pop the current state because it cannot handle the error token. */
2889 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
2890 yydestruct (yystos[yystate], yyvsp);
2893 YY_STACK_PRINT (yyss, yyssp);
2899 YYDPRINTF ((stderr, "Shifting error token, "));
2908 /*-------------------------------------.
2909 | yyacceptlab -- YYACCEPT comes here. |
2910 `-------------------------------------*/
2915 /*-----------------------------------.
2916 | yyabortlab -- YYABORT comes here. |
2917 `-----------------------------------*/
2923 /*----------------------------------------------.
2924 | yyoverflowlab -- parser overflow comes here. |
2925 `----------------------------------------------*/
2927 yyerror ("parser stack overflow");
2935 YYSTACK_FREE (yyss);
2941 #line 967 "parser.y"
2944 /* ---------------------------------------------------------------------- */
2946 void yyerror(const char *s)
2948 warn("%s near \"%s\"", s, get_last_token());
2952 /* ----------------------------------------------------------------------
2954 * This function makes an opcode based on the instruction symbol table
2955 * entry, and an addressing mode structure.
2956 * This function is called from both passes, but
2957 * only generates code in pass 2.
2959 * Resultant opcode bytes are passed to genbyte().
2961 * Returns the nuumber of bytes that the instruction
2966 int makeop(struct opcode * op, struct mode *m, int add)
2968 register unsigned int newop;
2971 if(pass2) genbyte(op->bytes[0+add]);
2976 newop = op->bytes[ get_md(*m)+add ] | get_ov(*m);
2978 if( get_sz(*m) > 0 ) genbyte( get_b1(*m) );
2979 if( get_sz(*m) > 1 ) genbyte( get_b2(*m) );
2981 return( get_sz(*m)+1 );
2985 /* ----------------------------------------------------------------------
2987 * Increments the Location Counter by 'i' amount.
2988 * Check to see if 'i' overflows 64K.
2989 * Checks to see if assembler is overlapping previous sections
2990 * of code. (using a large bit field).
2994 #define indx(a) ( (a)/(sizeof(long)*8) )
2995 #define bit(a) ( 1 << ((a)%(sizeof(long)*8)) )
2997 #define getloc(a) (regions[indx(a)] & bit(a))
2998 #define setloc(a) (regions[indx(a)] |= bit(a))
3000 static unsigned long regions[ 0x10000/(sizeof(long)*8) ];
3006 if( pass2 && getloc(lc) )
3007 error("Location counter overlaps");
3008 if( pass2 ) setloc(lc);
3013 error("Location counter has exceeded 16-bits");
3016 void clear_location_counter(void)
3018 memset(regions, 0, sizeof(regions));
3022 /* ----------------------------------------------------------------------
3024 * This routine returns a new string, which is equivilant to
3025 * 'line' except that all tabs have been expanded to spaces, and
3026 * the total length has been truncated to 60 chars.
3029 char *padline(char *line)
3031 static char newline[61];
3035 for(p1=line; pos<sizeof(newline)-1 && *p1; p1++ ) {
3037 nxtpos = pos+8-pos%8;
3038 while(pos<sizeof(newline)-1 && pos <= nxtpos)
3039 newline[pos++] = ' ';
3040 } else if( *p1 != '\n' )
3041 newline[pos++]= *p1;
3043 newline[pos] = '\0';
3048 /* ----------------------------------------------------------------------
3050 * Outputs the current location counter, bytebuf[] array, and
3051 * the string 'txt' to the listing file.
3052 * This routine is called for every source line encountered in the
3053 * source file. (Only in pass 2, and if listing is turned on).
3057 void dumplist(char *txt, int show)
3061 fprintf(listing,show?"%04lX: ":" ",lc);
3064 for(i=0; i<bytecount; i++ ) {
3065 fprintf(listing,"%02X ",bytebuf[i]);
3068 fprintf(listing,"\n ");
3072 fprintf(listing," ");
3074 fprintf(listing," %s\n",padline(txt));
3077 /* ----------------------------------------------------------------------
3079 * Place information into the bytebuf[] array, and also
3080 * call emitbyte with the byte.
3086 if( bytecount < sizeof(bytebuf) )
3087 bytebuf[bytecount++] = b;
3091 void genstr(const char *s)
3097 void genword(unsigned long w)
3099 genbyte( (w & 0xff00) >> 8 );
3100 genbyte( (w & 0x00ff) );