1 /* A Bison parser, made by GNU Bison 2.3. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
23 /* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work
25 under terms of your choice, so long as that work isn't itself a
26 parser generator using the skeleton or a modified version thereof
27 as a parser skeleton. Alternatively, if you modify or redistribute
28 the parser skeleton itself, you may (at your option) remove this
29 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public
31 License without this special exception.
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
39 /* All symbols defined below should begin with yy or YY, to avoid
40 infringing on user name space. This should be done even for local
41 variables, as they might otherwise be expanded by user macros.
42 There are some unavoidable exceptions within include files to
43 define necessary library symbols; they are noted "INFRINGES ON
44 USER NAME SPACE" below. */
46 /* Identify Bison output. */
50 #define YYBISON_VERSION "2.3"
53 #define YYSKELETON_NAME "yacc.c"
58 /* Using locations. */
59 #define YYLSP_NEEDED 0
66 /* Put the tokens into the symbol table, so that GDB and other debuggers
96 /* Copy the first part of user declarations. */
97 #line 21 "itbl-parse.y"
102 Yacc grammar for instruction table entries.
104 =======================================================================
105 Original Instruction table specification document:
107 MIPS Coprocessor Table Specification
108 ====================================
110 This document describes the format of the MIPS coprocessor table. The
111 table specifies a list of valid functions, data registers and control
112 registers that can be used in coprocessor instructions. This list,
113 together with the coprocessor instruction classes listed below,
114 specifies the complete list of coprocessor instructions that will
115 be recognized and assembled by the GNU assembler. In effect,
116 this makes the GNU assembler table-driven, where the table is
117 specified by the programmer.
119 The table is an ordinary text file that the GNU assembler reads when
120 it starts. Using the information in the table, the assembler
121 generates an internal list of valid coprocessor registers and
122 functions. The assembler uses this internal list in addition to the
123 standard MIPS registers and instructions which are built-in to the
124 assembler during code generation.
126 To specify the coprocessor table when invoking the GNU assembler, use
127 the command line option "--itbl file", where file is the
128 complete name of the table, including path and extension.
132 gas -t cop.tbl test.s -o test.o
133 gas -t /usr/local/lib/cop.tbl test.s -o test.o
134 gas --itbl d:\gnu\data\cop.tbl test.s -o test.o
136 Only one table may be supplied during a single invocation of
143 Below is a list of the valid coprocessor instruction classes for
144 any given coprocessor "z". These instructions are already recognized
145 by the assembler, and are listed here only for reference.
147 Class format instructions
148 -------------------------------------------------
151 LWCz rt,offset (base)
152 SWCz rt,offset (base)
172 LDCz rt,offset (base)
173 SDCz rt,offset (base)
179 The coprocessor table defines coprocessor-specific registers that can
180 be used with all of the above classes of instructions, where
181 appropriate. It also defines additional coprocessor-specific
182 functions for Class3 (COPz cofun) instructions, Thus, the table allows
183 the programmer to use convenient mnemonics and operands for these
184 functions, instead of the COPz mmenmonic and cofun operand.
186 The names of the MIPS general registers and their aliases are defined
187 by the assembler and will be recognized as valid register names by the
188 assembler when used (where allowed) in coprocessor instructions.
189 However, the names and values of all coprocessor data and control
190 register mnemonics must be specified in the coprocessor table.
196 Here is the grammar for the coprocessor table:
200 entry -> [z entrydef] [comment] '\n'
202 entrydef -> type name val
203 entrydef -> 'insn' name val funcdef ; type of entry (instruction)
205 z -> 'p'['0'..'3'] ; processor number
206 type -> ['dreg' | 'creg' | 'greg' ] ; type of entry (register)
207 ; 'dreg', 'creg' or 'greg' specifies a data, control, or general
208 ; register mnemonic, respectively
209 name -> [ltr|dec]* ; mnemonic of register/function
210 val -> [dec|hex] ; register/function number (integer constant)
212 funcdef -> frange flags fields
213 ; bitfield range for opcode
214 ; list of fields' formats
216 field -> [','] ftype frange flags
217 flags -> ['*' flagexpr]
218 flagexpr -> '[' flagexpr ']'
219 flagexpr -> val '|' flagexpr
220 ftype -> [ type | 'immed' | 'addr' ]
221 ; 'immed' specifies an immediate value; see grammar for "val" above
222 ; 'addr' specifies a C identifier; name of symbol to be resolved at
224 frange -> ':' val '-' val ; starting to ending bit positions, where
225 ; where 0 is least significant bit
226 frange -> (null) ; default range of 31-0 will be assumed
228 comment -> [';'|'#'] [char]*
229 char -> any printable character
230 ltr -> ['a'..'z'|'A'..'Z']
231 dec -> ['0'..'9']* ; value in decimal
232 hex -> '0x'['0'..'9' | 'a'..'f' | 'A'..'F']* ; value in hexadecimal
242 p1 dreg d1 1 ; data register "d1" for COP1 has value 1
243 p1 creg c3 3 ; ctrl register "c3" for COP1 has value 3
244 p3 func fill 0x1f:24-20 ; function "fill" for COP3 has value 31 and
247 will allow the assembler to accept the following coprocessor instructions:
252 Here, the general purpose register "$2", and instruction "LWC1", are standard
253 mnemonics built-in to the MIPS assembler.
260 p3 dreg d3 3 ; data register "d3" for COP3 has value 3
261 p3 creg c2 22 ; control register "c2" for COP3 has value 22
262 p3 func fee 0x1f:24-20 dreg:17-13 creg:12-8 immed:7-0
263 ; function "fee" for COP3 has value 31, and 3 fields
264 ; consisting of a data register, a control register,
265 ; and an immediate value.
267 will allow the assembler to accept the following coprocessor instruction:
271 and will emit the object code:
273 31-26 25 24-20 19-18 17-13 12-8 7-0
274 COPz CO fun dreg creg immed
275 010011 1 11111 00 00011 10110 00000001
284 p3 dreg d3 3 ; data register "d3" for COP3 has value 3
285 p3 creg c2 22 ; control register "c2" for COP3 has value 22
286 p3 func fuu 0x01f00001 dreg:17-13 creg:12-8
288 will allow the assembler to accept the following coprocessor
293 and will emit the object code:
295 31-26 25 24-20 19-18 17-13 12-8 7-0
296 COPz CO fun dreg creg
297 010011 1 11111 00 00011 10110 00000001
301 In this way, the programmer can force arbitrary bits of an instruction
302 to have predefined values.
304 =======================================================================
308 To handle more than one bit position range within an instruction,
309 use 0s to mask out the ranges which don't apply.
310 May decide to modify the syntax to allow commas separate multiple
311 ranges within an instruction (range','range).
314 The number of parms argument to the function entry
315 was deleted from the original format such that we now count the fields.
318 FIXME! should really change lexical analyzer
319 to recognize 'dreg' etc. in context sensitive way.
320 Currently function names or mnemonics may be incorrectly parsed as keywords
322 FIXME! hex is ambiguous with any digit
327 #include "itbl-lex.h"
328 #include "itbl-ops.h"
341 #define DBG(x) printf x
347 #define DBGL2(x) printf x
352 static int sbit
, ebit
;
353 static struct itbl_entry
*insn
=0;
354 static int yyerror (const char *);
358 /* Enabling traces. */
363 /* Enabling verbose error messages. */
364 #ifdef YYERROR_VERBOSE
365 # undef YYERROR_VERBOSE
366 # define YYERROR_VERBOSE 1
368 # define YYERROR_VERBOSE 0
371 /* Enabling the token table. */
372 #ifndef YYTOKEN_TABLE
373 # define YYTOKEN_TABLE 0
376 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
377 typedef union YYSTYPE
378 #line 282 "itbl-parse.y"
385 /* Line 187 of yacc.c. */
386 #line 387 "itbl-parse.c"
388 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
389 # define YYSTYPE_IS_DECLARED 1
390 # define YYSTYPE_IS_TRIVIAL 1
395 /* Copy the second part of user declarations. */
398 /* Line 216 of yacc.c. */
399 #line 400 "itbl-parse.c"
406 typedef YYTYPE_UINT8 yytype_uint8
;
408 typedef unsigned char yytype_uint8
;
412 typedef YYTYPE_INT8 yytype_int8
;
413 #elif (defined __STDC__ || defined __C99__FUNC__ \
414 || defined __cplusplus || defined _MSC_VER)
415 typedef signed char yytype_int8
;
417 typedef short int yytype_int8
;
421 typedef YYTYPE_UINT16 yytype_uint16
;
423 typedef unsigned short int yytype_uint16
;
427 typedef YYTYPE_INT16 yytype_int16
;
429 typedef short int yytype_int16
;
433 # ifdef __SIZE_TYPE__
434 # define YYSIZE_T __SIZE_TYPE__
435 # elif defined size_t
436 # define YYSIZE_T size_t
437 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
438 || defined __cplusplus || defined _MSC_VER)
439 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
440 # define YYSIZE_T size_t
442 # define YYSIZE_T unsigned int
446 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
451 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
452 # define YY_(msgid) dgettext ("bison-runtime", msgid)
456 # define YY_(msgid) msgid
460 /* Suppress unused-variable warnings by "using" E. */
461 #if ! defined lint || defined __GNUC__
462 # define YYUSE(e) ((void) (e))
464 # define YYUSE(e) /* empty */
467 /* Identity function, used to suppress warnings about constant conditions. */
471 #if (defined __STDC__ || defined __C99__FUNC__ \
472 || defined __cplusplus || defined _MSC_VER)
485 #if ! defined yyoverflow || YYERROR_VERBOSE
487 /* The parser invokes alloca or malloc; define the necessary symbols. */
489 # ifdef YYSTACK_USE_ALLOCA
490 # if YYSTACK_USE_ALLOCA
492 # define YYSTACK_ALLOC __builtin_alloca
493 # elif defined __BUILTIN_VA_ARG_INCR
494 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
496 # define YYSTACK_ALLOC __alloca
497 # elif defined _MSC_VER
498 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
499 # define alloca _alloca
501 # define YYSTACK_ALLOC alloca
502 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
503 || defined __cplusplus || defined _MSC_VER)
504 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
513 # ifdef YYSTACK_ALLOC
514 /* Pacify GCC's `empty if-body' warning. */
515 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
516 # ifndef YYSTACK_ALLOC_MAXIMUM
517 /* The OS might guarantee only one guard page at the bottom of the stack,
518 and a page size can be as small as 4096 bytes. So we cannot safely
519 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
520 to allow for a few compiler-allocated temporary stack slots. */
521 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
524 # define YYSTACK_ALLOC YYMALLOC
525 # define YYSTACK_FREE YYFREE
526 # ifndef YYSTACK_ALLOC_MAXIMUM
527 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
529 # if (defined __cplusplus && ! defined _STDLIB_H \
530 && ! ((defined YYMALLOC || defined malloc) \
531 && (defined YYFREE || defined free)))
532 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
538 # define YYMALLOC malloc
539 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
540 || defined __cplusplus || defined _MSC_VER)
541 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
546 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
547 || defined __cplusplus || defined _MSC_VER)
548 void free (void *); /* INFRINGES ON USER NAME SPACE */
552 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
555 #if (! defined yyoverflow \
556 && (! defined __cplusplus \
557 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
559 /* A type that is properly aligned for any stack member. */
566 /* The size of the maximum gap between one aligned stack and the next. */
567 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
569 /* The size of an array large to enough to hold all stacks, each with
571 # define YYSTACK_BYTES(N) \
572 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
573 + YYSTACK_GAP_MAXIMUM)
575 /* Copy COUNT objects from FROM to TO. The source and destination do
578 # if defined __GNUC__ && 1 < __GNUC__
579 # define YYCOPY(To, From, Count) \
580 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
582 # define YYCOPY(To, From, Count) \
586 for (yyi = 0; yyi < (Count); yyi++) \
587 (To)[yyi] = (From)[yyi]; \
593 /* Relocate STACK from its old location to the new one. The
594 local variables YYSIZE and YYSTACKSIZE give the old and new number of
595 elements in the stack, and YYPTR gives the new location of the
596 stack. Advance YYPTR to a properly aligned location for the next
598 # define YYSTACK_RELOCATE(Stack) \
601 YYSIZE_T yynewbytes; \
602 YYCOPY (&yyptr->Stack, Stack, yysize); \
603 Stack = &yyptr->Stack; \
604 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
605 yyptr += yynewbytes / sizeof (*yyptr); \
611 /* YYFINAL -- State number of the termination state. */
613 /* YYLAST -- Last index in YYTABLE. */
616 /* YYNTOKENS -- Number of terminals. */
618 /* YYNNTS -- Number of nonterminals. */
620 /* YYNRULES -- Number of rules. */
622 /* YYNRULES -- Number of states. */
625 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
627 #define YYMAXUTOK 267
629 #define YYTRANSLATE(YYX) \
630 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
632 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
633 static const yytype_uint8 yytranslate
[] =
635 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
636 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
637 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
638 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
639 2, 2, 17, 2, 13, 19, 2, 2, 2, 2,
640 2, 2, 2, 2, 2, 2, 2, 2, 18, 2,
641 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
642 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
643 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
644 2, 15, 2, 16, 2, 2, 2, 2, 2, 2,
645 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
646 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
647 2, 2, 2, 2, 14, 2, 2, 2, 2, 2,
648 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
649 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
650 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
651 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
652 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
653 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
654 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
655 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
656 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
657 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
658 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
659 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
660 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
661 5, 6, 7, 8, 9, 10, 11, 12
665 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
667 static const yytype_uint8 yyprhs
[] =
669 0, 0, 3, 5, 8, 9, 15, 16, 26, 28,
670 31, 35, 38, 39, 41, 43, 45, 49, 53, 57,
671 59, 62, 63, 68, 69, 71, 73, 75, 77, 79
674 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
675 static const yytype_int8 yyrhs
[] =
677 21, 0, -1, 22, -1, 23, 22, -1, -1, 31,
678 32, 33, 34, 11, -1, -1, 31, 8, 33, 34,
679 30, 29, 24, 25, 11, -1, 11, -1, 1, 11,
680 -1, 13, 27, 25, -1, 27, 25, -1, -1, 32,
681 -1, 7, -1, 6, -1, 26, 30, 29, -1, 9,
682 14, 28, -1, 15, 28, 16, -1, 9, -1, 17,
683 28, -1, -1, 18, 9, 19, 9, -1, -1, 12,
684 -1, 3, -1, 4, -1, 5, -1, 10, -1, 9,
688 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
689 static const yytype_uint16 yyrline
[] =
691 0, 299, 299, 303, 304, 308, 315, 314, 323, 324,
692 328, 329, 330, 334, 339, 344, 352, 361, 365, 369,
693 376, 382, 388, 395, 402, 410, 415, 420, 428, 444
697 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
698 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
699 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
700 static const char *const yytname
[] =
702 "$end", "error", "$undefined", "DREG", "CREG", "GREG", "IMMED", "ADDR",
703 "INSN", "NUM", "ID", "NL", "PNUM", "','", "'|'", "'['", "']'", "'*'",
704 "':'", "'-'", "$accept", "insntbl", "entrys", "entry", "@1",
705 "fieldspecs", "ftype", "fieldspec", "flagexpr", "flags", "range", "pnum",
706 "regtype", "name", "value", 0
711 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
713 static const yytype_uint16 yytoknum
[] =
715 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
716 265, 266, 267, 44, 124, 91, 93, 42, 58, 45
720 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
721 static const yytype_uint8 yyr1
[] =
723 0, 20, 21, 22, 22, 23, 24, 23, 23, 23,
724 25, 25, 25, 26, 26, 26, 27, 28, 28, 28,
725 29, 29, 30, 30, 31, 32, 32, 32, 33, 34
728 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
729 static const yytype_uint8 yyr2
[] =
731 0, 2, 1, 2, 0, 5, 0, 9, 1, 2,
732 3, 2, 0, 1, 1, 1, 3, 3, 3, 1,
733 2, 0, 4, 0, 1, 1, 1, 1, 1, 1
736 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
737 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
738 means the default is an error. */
739 static const yytype_uint8 yydefact
[] =
741 0, 0, 8, 24, 0, 2, 0, 0, 9, 1,
742 3, 25, 26, 27, 0, 0, 28, 0, 0, 29,
743 23, 0, 0, 21, 5, 0, 0, 6, 0, 19,
744 0, 20, 12, 22, 0, 0, 15, 14, 0, 0,
745 23, 12, 13, 17, 18, 12, 7, 21, 11, 10,
749 /* YYDEFGOTO[NTERM-NUM]. */
750 static const yytype_int8 yydefgoto
[] =
752 -1, 4, 5, 6, 32, 39, 40, 41, 31, 27,
756 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
758 #define YYPACT_NINF -16
759 static const yytype_int8 yypact
[] =
761 0, -9, -16, -16, 10, -16, 0, 12, -16, -16,
762 -16, -16, -16, -16, 3, 3, -16, 9, 9, -16,
763 11, 8, 19, 15, -16, 14, -6, -16, 25, 21,
764 -6, -16, 1, -16, -6, 20, -16, -16, 18, 26,
765 11, 1, -16, -16, -16, 1, -16, 15, -16, -16,
769 /* YYPGOTO[NTERM-NUM]. */
770 static const yytype_int8 yypgoto
[] =
772 -16, -16, 32, -16, -16, -15, -16, 2, -3, -8,
776 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
777 positive, shift that token. If negative, reduce the rule which
778 number is the opposite. If zero, do what YYDEFACT says.
779 If YYTABLE_NINF, syntax error. */
780 #define YYTABLE_NINF -5
781 static const yytype_int8 yytable
[] =
783 -4, 1, 8, 29, 11, 12, 13, 36, 37, 30,
784 9, 2, 3, 16, 38, 11, 12, 13, 19, 24,
785 14, 11, 12, 13, 36, 37, 48, 35, 25, 22,
786 49, 43, 26, 28, 33, 34, 44, 46, 10, 50,
787 45, 15, 18, 0, 47, 0, 21
790 static const yytype_int8 yycheck
[] =
792 0, 1, 11, 9, 3, 4, 5, 6, 7, 15,
793 0, 11, 12, 10, 13, 3, 4, 5, 9, 11,
794 8, 3, 4, 5, 6, 7, 41, 30, 9, 18,
795 45, 34, 17, 19, 9, 14, 16, 11, 6, 47,
796 38, 7, 15, -1, 40, -1, 18
799 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
800 symbol of state STATE-NUM. */
801 static const yytype_uint8 yystos
[] =
803 0, 1, 11, 12, 21, 22, 23, 31, 11, 0,
804 22, 3, 4, 5, 8, 32, 10, 33, 33, 9,
805 34, 34, 18, 30, 11, 9, 17, 29, 19, 9,
806 15, 28, 24, 9, 14, 28, 6, 7, 13, 25,
807 26, 27, 32, 28, 16, 27, 11, 30, 25, 25,
811 #define yyerrok (yyerrstatus = 0)
812 #define yyclearin (yychar = YYEMPTY)
816 #define YYACCEPT goto yyacceptlab
817 #define YYABORT goto yyabortlab
818 #define YYERROR goto yyerrorlab
821 /* Like YYERROR except do call yyerror. This remains here temporarily
822 to ease the transition to the new meaning of YYERROR, for GCC.
823 Once GCC version 2 has supplanted version 1, this can go. */
825 #define YYFAIL goto yyerrlab
827 #define YYRECOVERING() (!!yyerrstatus)
829 #define YYBACKUP(Token, Value) \
831 if (yychar == YYEMPTY && yylen == 1) \
835 yytoken = YYTRANSLATE (yychar); \
841 yyerror (YY_("syntax error: cannot back up")); \
848 #define YYERRCODE 256
851 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
852 If N is 0, then set CURRENT to the empty location which ends
853 the previous symbol: RHS[0] (always defined). */
855 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
856 #ifndef YYLLOC_DEFAULT
857 # define YYLLOC_DEFAULT(Current, Rhs, N) \
861 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
862 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
863 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
864 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
868 (Current).first_line = (Current).last_line = \
869 YYRHSLOC (Rhs, 0).last_line; \
870 (Current).first_column = (Current).last_column = \
871 YYRHSLOC (Rhs, 0).last_column; \
877 /* YY_LOCATION_PRINT -- Print the location on the stream.
878 This macro was not mandated originally: define only if we know
879 we won't break user code: when these are the locations we know. */
881 #ifndef YY_LOCATION_PRINT
882 # if YYLTYPE_IS_TRIVIAL
883 # define YY_LOCATION_PRINT(File, Loc) \
884 fprintf (File, "%d.%d-%d.%d", \
885 (Loc).first_line, (Loc).first_column, \
886 (Loc).last_line, (Loc).last_column)
888 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
893 /* YYLEX -- calling `yylex' with the right arguments. */
896 # define YYLEX yylex (YYLEX_PARAM)
898 # define YYLEX yylex ()
901 /* Enable debugging if requested. */
905 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
906 # define YYFPRINTF fprintf
909 # define YYDPRINTF(Args) \
915 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
919 YYFPRINTF (stderr, "%s ", Title); \
920 yy_symbol_print (stderr, \
922 YYFPRINTF (stderr, "\n"); \
927 /*--------------------------------.
928 | Print this symbol on YYOUTPUT. |
929 `--------------------------------*/
932 #if (defined __STDC__ || defined __C99__FUNC__ \
933 || defined __cplusplus || defined _MSC_VER)
935 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
938 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
)
941 YYSTYPE
const * const yyvaluep
;
947 if (yytype
< YYNTOKENS
)
948 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
960 /*--------------------------------.
961 | Print this symbol on YYOUTPUT. |
962 `--------------------------------*/
964 #if (defined __STDC__ || defined __C99__FUNC__ \
965 || defined __cplusplus || defined _MSC_VER)
967 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
970 yy_symbol_print (yyoutput
, yytype
, yyvaluep
)
973 YYSTYPE
const * const yyvaluep
;
976 if (yytype
< YYNTOKENS
)
977 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
979 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
981 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
);
982 YYFPRINTF (yyoutput
, ")");
985 /*------------------------------------------------------------------.
986 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
988 `------------------------------------------------------------------*/
990 #if (defined __STDC__ || defined __C99__FUNC__ \
991 || defined __cplusplus || defined _MSC_VER)
993 yy_stack_print (yytype_int16
*bottom
, yytype_int16
*top
)
996 yy_stack_print (bottom
, top
)
997 yytype_int16
*bottom
;
1001 YYFPRINTF (stderr
, "Stack now");
1002 for (; bottom
<= top
; ++bottom
)
1003 YYFPRINTF (stderr
, " %d", *bottom
);
1004 YYFPRINTF (stderr
, "\n");
1007 # define YY_STACK_PRINT(Bottom, Top) \
1010 yy_stack_print ((Bottom), (Top)); \
1014 /*------------------------------------------------.
1015 | Report that the YYRULE is going to be reduced. |
1016 `------------------------------------------------*/
1018 #if (defined __STDC__ || defined __C99__FUNC__ \
1019 || defined __cplusplus || defined _MSC_VER)
1021 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
)
1024 yy_reduce_print (yyvsp
, yyrule
)
1029 int yynrhs
= yyr2
[yyrule
];
1031 unsigned long int yylno
= yyrline
[yyrule
];
1032 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1034 /* The symbols being reduced. */
1035 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1037 fprintf (stderr
, " $%d = ", yyi
+ 1);
1038 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1039 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1041 fprintf (stderr
, "\n");
1045 # define YY_REDUCE_PRINT(Rule) \
1048 yy_reduce_print (yyvsp, Rule); \
1051 /* Nonzero means print parse trace. It is left uninitialized so that
1052 multiple parsers can coexist. */
1054 #else /* !YYDEBUG */
1055 # define YYDPRINTF(Args)
1056 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1057 # define YY_STACK_PRINT(Bottom, Top)
1058 # define YY_REDUCE_PRINT(Rule)
1059 #endif /* !YYDEBUG */
1062 /* YYINITDEPTH -- initial size of the parser's stacks. */
1064 # define YYINITDEPTH 200
1067 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1068 if the built-in stack extension method is used).
1070 Do not make this value too large; the results are undefined if
1071 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1072 evaluated with infinite-precision integer arithmetic. */
1075 # define YYMAXDEPTH 10000
1083 # if defined __GLIBC__ && defined _STRING_H
1084 # define yystrlen strlen
1086 /* Return the length of YYSTR. */
1087 #if (defined __STDC__ || defined __C99__FUNC__ \
1088 || defined __cplusplus || defined _MSC_VER)
1090 yystrlen (const char *yystr
)
1098 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1106 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1107 # define yystpcpy stpcpy
1109 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1111 #if (defined __STDC__ || defined __C99__FUNC__ \
1112 || defined __cplusplus || defined _MSC_VER)
1114 yystpcpy (char *yydest
, const char *yysrc
)
1117 yystpcpy (yydest
, yysrc
)
1123 const char *yys
= yysrc
;
1125 while ((*yyd
++ = *yys
++) != '\0')
1134 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1135 quotes and backslashes, so that it's suitable for yyerror. The
1136 heuristic is that double-quoting is unnecessary unless the string
1137 contains an apostrophe, a comma, or backslash (other than
1138 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1139 null, do not copy; instead, return the length of what the result
1142 yytnamerr (char *yyres
, const char *yystr
)
1147 char const *yyp
= yystr
;
1154 goto do_not_strip_quotes
;
1158 goto do_not_strip_quotes
;
1171 do_not_strip_quotes
: ;
1175 return yystrlen (yystr
);
1177 return yystpcpy (yyres
, yystr
) - yyres
;
1181 /* Copy into YYRESULT an error message about the unexpected token
1182 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1183 including the terminating null byte. If YYRESULT is null, do not
1184 copy anything; just return the number of bytes that would be
1185 copied. As a special case, return 0 if an ordinary "syntax error"
1186 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1187 size calculation. */
1189 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1191 int yyn
= yypact
[yystate
];
1193 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1197 int yytype
= YYTRANSLATE (yychar
);
1198 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1199 YYSIZE_T yysize
= yysize0
;
1201 int yysize_overflow
= 0;
1202 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1203 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1207 /* This is so xgettext sees the translatable formats that are
1208 constructed on the fly. */
1209 YY_("syntax error, unexpected %s");
1210 YY_("syntax error, unexpected %s, expecting %s");
1211 YY_("syntax error, unexpected %s, expecting %s or %s");
1212 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1213 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1217 static char const yyunexpected
[] = "syntax error, unexpected %s";
1218 static char const yyexpecting
[] = ", expecting %s";
1219 static char const yyor
[] = " or %s";
1220 char yyformat
[sizeof yyunexpected
1221 + sizeof yyexpecting
- 1
1222 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1223 * (sizeof yyor
- 1))];
1224 char const *yyprefix
= yyexpecting
;
1226 /* Start YYX at -YYN if negative to avoid negative indexes in
1228 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1230 /* Stay within bounds of both yycheck and yytname. */
1231 int yychecklim
= YYLAST
- yyn
+ 1;
1232 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1235 yyarg
[0] = yytname
[yytype
];
1236 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1238 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1239 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1241 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1245 yyformat
[sizeof yyunexpected
- 1] = '\0';
1248 yyarg
[yycount
++] = yytname
[yyx
];
1249 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1250 yysize_overflow
|= (yysize1
< yysize
);
1252 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1256 yyf
= YY_(yyformat
);
1257 yysize1
= yysize
+ yystrlen (yyf
);
1258 yysize_overflow
|= (yysize1
< yysize
);
1261 if (yysize_overflow
)
1262 return YYSIZE_MAXIMUM
;
1266 /* Avoid sprintf, as that infringes on the user's name space.
1267 Don't have undefined behavior even if the translation
1268 produced a string with the wrong number of "%s"s. */
1269 char *yyp
= yyresult
;
1271 while ((*yyp
= *yyf
) != '\0')
1273 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1275 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1288 #endif /* YYERROR_VERBOSE */
1291 /*-----------------------------------------------.
1292 | Release the memory associated to this symbol. |
1293 `-----------------------------------------------*/
1296 #if (defined __STDC__ || defined __C99__FUNC__ \
1297 || defined __cplusplus || defined _MSC_VER)
1299 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
)
1302 yydestruct (yymsg
, yytype
, yyvaluep
)
1312 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1323 /* Prevent warnings from -Wmissing-prototypes. */
1325 #ifdef YYPARSE_PARAM
1326 #if defined __STDC__ || defined __cplusplus
1327 int yyparse (void *YYPARSE_PARAM
);
1331 #else /* ! YYPARSE_PARAM */
1332 #if defined __STDC__ || defined __cplusplus
1337 #endif /* ! YYPARSE_PARAM */
1341 /* The look-ahead symbol. */
1344 /* The semantic value of the look-ahead symbol. */
1347 /* Number of syntax errors so far. */
1356 #ifdef YYPARSE_PARAM
1357 #if (defined __STDC__ || defined __C99__FUNC__ \
1358 || defined __cplusplus || defined _MSC_VER)
1360 yyparse (void *YYPARSE_PARAM
)
1363 yyparse (YYPARSE_PARAM
)
1364 void *YYPARSE_PARAM
;
1366 #else /* ! YYPARSE_PARAM */
1367 #if (defined __STDC__ || defined __C99__FUNC__ \
1368 || defined __cplusplus || defined _MSC_VER)
1382 /* Number of tokens to shift before error messages enabled. */
1384 /* Look-ahead token as an internal (translated) token number. */
1387 /* Buffer for error messages, and its allocated size. */
1389 char *yymsg
= yymsgbuf
;
1390 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1393 /* Three stacks and their tools:
1394 `yyss': related to states,
1395 `yyvs': related to semantic values,
1396 `yyls': related to locations.
1398 Refer to the stacks thru separate pointers, to allow yyoverflow
1399 to reallocate them elsewhere. */
1401 /* The state stack. */
1402 yytype_int16 yyssa
[YYINITDEPTH
];
1403 yytype_int16
*yyss
= yyssa
;
1404 yytype_int16
*yyssp
;
1406 /* The semantic value stack. */
1407 YYSTYPE yyvsa
[YYINITDEPTH
];
1408 YYSTYPE
*yyvs
= yyvsa
;
1413 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1415 YYSIZE_T yystacksize
= YYINITDEPTH
;
1417 /* The variables used to return semantic value and location from the
1422 /* The number of symbols on the RHS of the reduced rule.
1423 Keep to zero when no symbol should be popped. */
1426 YYDPRINTF ((stderr
, "Starting parse\n"));
1431 yychar
= YYEMPTY
; /* Cause a token to be read. */
1433 /* Initialize stack pointers.
1434 Waste one element of value and location stack
1435 so that they stay on the same level as the state stack.
1436 The wasted elements are never initialized. */
1443 /*------------------------------------------------------------.
1444 | yynewstate -- Push a new state, which is found in yystate. |
1445 `------------------------------------------------------------*/
1447 /* In all cases, when you get here, the value and location stacks
1448 have just been pushed. So pushing a state here evens the stacks. */
1454 if (yyss
+ yystacksize
- 1 <= yyssp
)
1456 /* Get the current used size of the three stacks, in elements. */
1457 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1461 /* Give user a chance to reallocate the stack. Use copies of
1462 these so that the &'s don't force the real ones into
1464 YYSTYPE
*yyvs1
= yyvs
;
1465 yytype_int16
*yyss1
= yyss
;
1468 /* Each stack pointer address is followed by the size of the
1469 data in use in that stack, in bytes. This used to be a
1470 conditional around just the two extra args, but that might
1471 be undefined if yyoverflow is a macro. */
1472 yyoverflow (YY_("memory exhausted"),
1473 &yyss1
, yysize
* sizeof (*yyssp
),
1474 &yyvs1
, yysize
* sizeof (*yyvsp
),
1481 #else /* no yyoverflow */
1482 # ifndef YYSTACK_RELOCATE
1483 goto yyexhaustedlab
;
1485 /* Extend the stack our own way. */
1486 if (YYMAXDEPTH
<= yystacksize
)
1487 goto yyexhaustedlab
;
1489 if (YYMAXDEPTH
< yystacksize
)
1490 yystacksize
= YYMAXDEPTH
;
1493 yytype_int16
*yyss1
= yyss
;
1494 union yyalloc
*yyptr
=
1495 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1497 goto yyexhaustedlab
;
1498 YYSTACK_RELOCATE (yyss
);
1499 YYSTACK_RELOCATE (yyvs
);
1501 # undef YYSTACK_RELOCATE
1503 YYSTACK_FREE (yyss1
);
1506 #endif /* no yyoverflow */
1508 yyssp
= yyss
+ yysize
- 1;
1509 yyvsp
= yyvs
+ yysize
- 1;
1512 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1513 (unsigned long int) yystacksize
));
1515 if (yyss
+ yystacksize
- 1 <= yyssp
)
1519 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1528 /* Do appropriate processing given the current state. Read a
1529 look-ahead token if we need one and don't already have one. */
1531 /* First try to decide what to do without reference to look-ahead token. */
1532 yyn
= yypact
[yystate
];
1533 if (yyn
== YYPACT_NINF
)
1536 /* Not known => get a look-ahead token if don't already have one. */
1538 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1539 if (yychar
== YYEMPTY
)
1541 YYDPRINTF ((stderr
, "Reading a token: "));
1545 if (yychar
<= YYEOF
)
1547 yychar
= yytoken
= YYEOF
;
1548 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1552 yytoken
= YYTRANSLATE (yychar
);
1553 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1556 /* If the proper action on seeing token YYTOKEN is to reduce or to
1557 detect an error, take that action. */
1559 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1564 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1573 /* Count tokens shifted since error; after three, turn off error
1578 /* Shift the look-ahead token. */
1579 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1581 /* Discard the shifted token unless it is eof. */
1582 if (yychar
!= YYEOF
)
1591 /*-----------------------------------------------------------.
1592 | yydefault -- do the default action for the current state. |
1593 `-----------------------------------------------------------*/
1595 yyn
= yydefact
[yystate
];
1601 /*-----------------------------.
1602 | yyreduce -- Do a reduction. |
1603 `-----------------------------*/
1605 /* yyn is the number of a rule to reduce with. */
1608 /* If YYLEN is nonzero, implement the default value of the action:
1611 Otherwise, the following line sets YYVAL to garbage.
1612 This behavior is undocumented and Bison
1613 users should not rely upon it. Assigning to YYVAL
1614 unconditionally makes the parser a bit smaller, and it avoids a
1615 GCC warning that YYVAL may be used uninitialized. */
1616 yyval
= yyvsp
[1-yylen
];
1619 YY_REDUCE_PRINT (yyn
);
1623 #line 309 "itbl-parse.y"
1625 DBG (("line %d: entry pnum=%d type=%d name=%s value=x%x\n",
1626 insntbl_line
, (yyvsp
[(1) - (5)].num
), (yyvsp
[(2) - (5)].num
), (yyvsp
[(3) - (5)].str
), (yyvsp
[(4) - (5)].val
)));
1627 itbl_add_reg ((yyvsp
[(1) - (5)].num
), (yyvsp
[(2) - (5)].num
), (yyvsp
[(3) - (5)].str
), (yyvsp
[(4) - (5)].val
));
1632 #line 315 "itbl-parse.y"
1634 DBG (("line %d: entry pnum=%d type=INSN name=%s value=x%x",
1635 insntbl_line
, (yyvsp
[(1) - (6)].num
), (yyvsp
[(3) - (6)].str
), (yyvsp
[(4) - (6)].val
)));
1636 DBG ((" sbit=%d ebit=%d flags=0x%x\n", sbit
, ebit
, (yyvsp
[(6) - (6)].val
)));
1637 insn
=itbl_add_insn ((yyvsp
[(1) - (6)].num
), (yyvsp
[(3) - (6)].str
), (yyvsp
[(4) - (6)].val
), sbit
, ebit
, (yyvsp
[(6) - (6)].val
));
1642 #line 322 "itbl-parse.y"
1647 #line 335 "itbl-parse.y"
1649 DBGL2 (("ftype\n"));
1650 (yyval
.num
) = (yyvsp
[(1) - (1)].num
);
1655 #line 340 "itbl-parse.y"
1663 #line 345 "itbl-parse.y"
1665 DBGL2 (("immed\n"));
1666 (yyval
.num
) = IMMED
;
1671 #line 353 "itbl-parse.y"
1673 DBG (("line %d: field type=%d sbit=%d ebit=%d, flags=0x%x\n",
1674 insntbl_line
, (yyvsp
[(1) - (3)].num
), sbit
, ebit
, (yyvsp
[(3) - (3)].val
)));
1675 itbl_add_operand (insn
, (yyvsp
[(1) - (3)].num
), sbit
, ebit
, (yyvsp
[(3) - (3)].val
));
1680 #line 362 "itbl-parse.y"
1682 (yyval
.val
) = (yyvsp
[(1) - (3)].num
) | (yyvsp
[(3) - (3)].val
);
1687 #line 366 "itbl-parse.y"
1689 (yyval
.val
) = (yyvsp
[(2) - (3)].val
);
1694 #line 370 "itbl-parse.y"
1696 (yyval
.val
) = (yyvsp
[(1) - (1)].num
);
1701 #line 377 "itbl-parse.y"
1703 DBGL2 (("flags=%d\n", (yyvsp
[(2) - (2)].val
)));
1704 (yyval
.val
) = (yyvsp
[(2) - (2)].val
);
1709 #line 382 "itbl-parse.y"
1716 #line 389 "itbl-parse.y"
1718 DBGL2 (("range %d %d\n", (yyvsp
[(2) - (4)].num
), (yyvsp
[(4) - (4)].num
)));
1719 sbit
= (yyvsp
[(2) - (4)].num
);
1720 ebit
= (yyvsp
[(4) - (4)].num
);
1725 #line 395 "itbl-parse.y"
1733 #line 403 "itbl-parse.y"
1735 DBGL2 (("pnum=%d\n",(yyvsp
[(1) - (1)].num
)));
1736 (yyval
.num
) = (yyvsp
[(1) - (1)].num
);
1741 #line 411 "itbl-parse.y"
1749 #line 416 "itbl-parse.y"
1757 #line 421 "itbl-parse.y"
1765 #line 429 "itbl-parse.y"
1767 DBGL2 (("name=%s\n",(yyvsp
[(1) - (1)].str
)));
1768 (yyval
.str
) = (yyvsp
[(1) - (1)].str
);
1773 #line 445 "itbl-parse.y"
1775 DBGL2 (("val=x%x\n",(yyvsp
[(1) - (1)].num
)));
1776 (yyval
.val
) = (yyvsp
[(1) - (1)].num
);
1781 /* Line 1267 of yacc.c. */
1782 #line 1783 "itbl-parse.c"
1785 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
1789 YY_STACK_PRINT (yyss
, yyssp
);
1794 /* Now `shift' the result of the reduction. Determine what state
1795 that goes to, based on the state we popped back to and the rule
1796 number reduced by. */
1800 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
1801 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1802 yystate
= yytable
[yystate
];
1804 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
1809 /*------------------------------------.
1810 | yyerrlab -- here on detecting error |
1811 `------------------------------------*/
1813 /* If not already recovering from an error, report this error. */
1817 #if ! YYERROR_VERBOSE
1818 yyerror (YY_("syntax error"));
1821 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
1822 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
1824 YYSIZE_T yyalloc
= 2 * yysize
;
1825 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
1826 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
1827 if (yymsg
!= yymsgbuf
)
1828 YYSTACK_FREE (yymsg
);
1829 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
1831 yymsg_alloc
= yyalloc
;
1835 yymsg_alloc
= sizeof yymsgbuf
;
1839 if (0 < yysize
&& yysize
<= yymsg_alloc
)
1841 (void) yysyntax_error (yymsg
, yystate
, yychar
);
1846 yyerror (YY_("syntax error"));
1848 goto yyexhaustedlab
;
1856 if (yyerrstatus
== 3)
1858 /* If just tried and failed to reuse look-ahead token after an
1859 error, discard it. */
1861 if (yychar
<= YYEOF
)
1863 /* Return failure if at end of input. */
1864 if (yychar
== YYEOF
)
1869 yydestruct ("Error: discarding",
1875 /* Else will try to reuse look-ahead token after shifting the error
1880 /*---------------------------------------------------.
1881 | yyerrorlab -- error raised explicitly by YYERROR. |
1882 `---------------------------------------------------*/
1885 /* Pacify compilers like GCC when the user code never invokes
1886 YYERROR and the label yyerrorlab therefore never appears in user
1888 if (/*CONSTCOND*/ 0)
1891 /* Do not reclaim the symbols of the rule which action triggered
1895 YY_STACK_PRINT (yyss
, yyssp
);
1900 /*-------------------------------------------------------------.
1901 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1902 `-------------------------------------------------------------*/
1904 yyerrstatus
= 3; /* Each real token shifted decrements this. */
1908 yyn
= yypact
[yystate
];
1909 if (yyn
!= YYPACT_NINF
)
1912 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
1920 /* Pop the current state because it cannot handle the error token. */
1925 yydestruct ("Error: popping",
1926 yystos
[yystate
], yyvsp
);
1929 YY_STACK_PRINT (yyss
, yyssp
);
1938 /* Shift the error token. */
1939 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
1945 /*-------------------------------------.
1946 | yyacceptlab -- YYACCEPT comes here. |
1947 `-------------------------------------*/
1952 /*-----------------------------------.
1953 | yyabortlab -- YYABORT comes here. |
1954 `-----------------------------------*/
1960 /*-------------------------------------------------.
1961 | yyexhaustedlab -- memory exhaustion comes here. |
1962 `-------------------------------------------------*/
1964 yyerror (YY_("memory exhausted"));
1970 if (yychar
!= YYEOF
&& yychar
!= YYEMPTY
)
1971 yydestruct ("Cleanup: discarding lookahead",
1973 /* Do not reclaim the symbols of the rule which action triggered
1974 this YYABORT or YYACCEPT. */
1976 YY_STACK_PRINT (yyss
, yyssp
);
1977 while (yyssp
!= yyss
)
1979 yydestruct ("Cleanup: popping",
1980 yystos
[*yyssp
], yyvsp
);
1985 YYSTACK_FREE (yyss
);
1988 if (yymsg
!= yymsgbuf
)
1989 YYSTACK_FREE (yymsg
);
1991 /* Make sure YYID is used. */
1992 return YYID (yyresult
);
1996 #line 450 "itbl-parse.y"
2003 printf ("line %d: %s\n", insntbl_line
, msg
);