2005-05-01 Paul Brook <paul@codesourcery.com>
[binutils.git] / gas / itbl-parse.c
blob1d4d5d6c66e6361b033d5df210ccebd48fb37794
1 /* A Bison parser, made from itbl-parse.y
2 by GNU bison 1.35. */
4 #define YYBISON 1 /* Identify Bison output. */
6 # define DREG 257
7 # define CREG 258
8 # define GREG 259
9 # define IMMED 260
10 # define ADDR 261
11 # define INSN 262
12 # define NUM 263
13 # define ID 264
14 # define NL 265
15 # define PNUM 266
17 #line 21 "itbl-parse.y"
20 /*
22 Yacc grammar for instruction table entries.
24 =======================================================================
25 Original Instruction table specification document:
27 MIPS Coprocessor Table Specification
28 ====================================
30 This document describes the format of the MIPS coprocessor table. The
31 table specifies a list of valid functions, data registers and control
32 registers that can be used in coprocessor instructions. This list,
33 together with the coprocessor instruction classes listed below,
34 specifies the complete list of coprocessor instructions that will
35 be recognized and assembled by the GNU assembler. In effect,
36 this makes the GNU assembler table-driven, where the table is
37 specified by the programmer.
39 The table is an ordinary text file that the GNU assembler reads when
40 it starts. Using the information in the table, the assembler
41 generates an internal list of valid coprocessor registers and
42 functions. The assembler uses this internal list in addition to the
43 standard MIPS registers and instructions which are built-in to the
44 assembler during code generation.
46 To specify the coprocessor table when invoking the GNU assembler, use
47 the command line option "--itbl file", where file is the
48 complete name of the table, including path and extension.
50 Examples:
52 gas -t cop.tbl test.s -o test.o
53 gas -t /usr/local/lib/cop.tbl test.s -o test.o
54 gas --itbl d:\gnu\data\cop.tbl test.s -o test.o
56 Only one table may be supplied during a single invocation of
57 the assembler.
60 Instruction classes
61 ===================
63 Below is a list of the valid coprocessor instruction classes for
64 any given coprocessor "z". These instructions are already recognized
65 by the assembler, and are listed here only for reference.
67 Class format instructions
68 -------------------------------------------------
69 Class1:
70 op base rt offset
71 LWCz rt,offset (base)
72 SWCz rt,offset (base)
73 Class2:
74 COPz sub rt rd 0
75 MTCz rt,rd
76 MFCz rt,rd
77 CTCz rt,rd
78 CFCz rt,rd
79 Class3:
80 COPz CO cofun
81 COPz cofun
82 Class4:
83 COPz BC br offset
84 BCzT offset
85 BCzF offset
86 Class5:
87 COPz sub rt rd 0
88 DMFCz rt,rd
89 DMTCz rt,rd
90 Class6:
91 op base rt offset
92 LDCz rt,offset (base)
93 SDCz rt,offset (base)
94 Class7:
95 COPz BC br offset
96 BCzTL offset
97 BCzFL offset
99 The coprocessor table defines coprocessor-specific registers that can
100 be used with all of the above classes of instructions, where
101 appropriate. It also defines additional coprocessor-specific
102 functions for Class3 (COPz cofun) instructions, Thus, the table allows
103 the programmer to use convenient mnemonics and operands for these
104 functions, instead of the COPz mmenmonic and cofun operand.
106 The names of the MIPS general registers and their aliases are defined
107 by the assembler and will be recognized as valid register names by the
108 assembler when used (where allowed) in coprocessor instructions.
109 However, the names and values of all coprocessor data and control
110 register mnemonics must be specified in the coprocessor table.
113 Table Grammar
114 =============
116 Here is the grammar for the coprocessor table:
118 table -> entry*
120 entry -> [z entrydef] [comment] '\n'
122 entrydef -> type name val
123 entrydef -> 'insn' name val funcdef ; type of entry (instruction)
125 z -> 'p'['0'..'3'] ; processor number
126 type -> ['dreg' | 'creg' | 'greg' ] ; type of entry (register)
127 ; 'dreg', 'creg' or 'greg' specifies a data, control, or general
128 ; register mnemonic, respectively
129 name -> [ltr|dec]* ; mnemonic of register/function
130 val -> [dec|hex] ; register/function number (integer constant)
132 funcdef -> frange flags fields
133 ; bitfield range for opcode
134 ; list of fields' formats
135 fields -> field*
136 field -> [','] ftype frange flags
137 flags -> ['*' flagexpr]
138 flagexpr -> '[' flagexpr ']'
139 flagexpr -> val '|' flagexpr
140 ftype -> [ type | 'immed' | 'addr' ]
141 ; 'immed' specifies an immediate value; see grammar for "val" above
142 ; 'addr' specifies a C identifier; name of symbol to be resolved at
143 ; link time
144 frange -> ':' val '-' val ; starting to ending bit positions, where
145 ; where 0 is least significant bit
146 frange -> (null) ; default range of 31-0 will be assumed
148 comment -> [';'|'#'] [char]*
149 char -> any printable character
150 ltr -> ['a'..'z'|'A'..'Z']
151 dec -> ['0'..'9']* ; value in decimal
152 hex -> '0x'['0'..'9' | 'a'..'f' | 'A'..'F']* ; value in hexadecimal
155 Examples
156 ========
158 Example 1:
160 The table:
162 p1 dreg d1 1 ; data register "d1" for COP1 has value 1
163 p1 creg c3 3 ; ctrl register "c3" for COP1 has value 3
164 p3 func fill 0x1f:24-20 ; function "fill" for COP3 has value 31 and
165 ; no fields
167 will allow the assembler to accept the following coprocessor instructions:
169 LWC1 d1,0x100 ($2)
170 fill
172 Here, the general purpose register "$2", and instruction "LWC1", are standard
173 mnemonics built-in to the MIPS assembler.
176 Example 2:
178 The table:
180 p3 dreg d3 3 ; data register "d3" for COP3 has value 3
181 p3 creg c2 22 ; control register "c2" for COP3 has value 22
182 p3 func fee 0x1f:24-20 dreg:17-13 creg:12-8 immed:7-0
183 ; function "fee" for COP3 has value 31, and 3 fields
184 ; consisting of a data register, a control register,
185 ; and an immediate value.
187 will allow the assembler to accept the following coprocessor instruction:
189 fee d3,c2,0x1
191 and will emit the object code:
193 31-26 25 24-20 19-18 17-13 12-8 7-0
194 COPz CO fun dreg creg immed
195 010011 1 11111 00 00011 10110 00000001
197 0x4ff07601
200 Example 3:
202 The table:
204 p3 dreg d3 3 ; data register "d3" for COP3 has value 3
205 p3 creg c2 22 ; control register "c2" for COP3 has value 22
206 p3 func fuu 0x01f00001 dreg:17-13 creg:12-8
208 will allow the assembler to accept the following coprocessor
209 instruction:
211 fuu d3,c2
213 and will emit the object code:
215 31-26 25 24-20 19-18 17-13 12-8 7-0
216 COPz CO fun dreg creg
217 010011 1 11111 00 00011 10110 00000001
219 0x4ff07601
221 In this way, the programmer can force arbitrary bits of an instruction
222 to have predefined values.
224 =======================================================================
225 Additional notes:
227 Encoding of ranges:
228 To handle more than one bit position range within an instruction,
229 use 0s to mask out the ranges which don't apply.
230 May decide to modify the syntax to allow commas separate multiple
231 ranges within an instruction (range','range).
233 Changes in grammar:
234 The number of parms argument to the function entry
235 was deleted from the original format such that we now count the fields.
237 ----
238 FIXME! should really change lexical analyzer
239 to recognize 'dreg' etc. in context sensitive way.
240 Currently function names or mnemonics may be incorrectly parsed as keywords
242 FIXME! hex is ambiguous with any digit
246 #include <stdio.h>
247 #include "itbl-lex.h"
248 #include "itbl-ops.h"
250 /* #define DEBUG */
252 #ifdef DEBUG
253 #ifndef DBG_LVL
254 #define DBG_LVL 1
255 #endif
256 #else
257 #define DBG_LVL 0
258 #endif
260 #if DBG_LVL >= 1
261 #define DBG(x) printf x
262 #else
263 #define DBG(x)
264 #endif
266 #if DBG_LVL >= 2
267 #define DBGL2(x) printf x
268 #else
269 #define DBGL2(x)
270 #endif
272 static int sbit, ebit;
273 static struct itbl_entry *insn=0;
274 static int yyerror PARAMS ((const char *));
277 #line 281 "itbl-parse.y"
278 #ifndef YYSTYPE
279 typedef union
281 char *str;
282 int num;
283 int processor;
284 unsigned long val;
285 } yystype;
286 # define YYSTYPE yystype
287 # define YYSTYPE_IS_TRIVIAL 1
288 #endif
289 #ifndef YYDEBUG
290 # define YYDEBUG 0
291 #endif
295 #define YYFINAL 51
296 #define YYFLAG -32768
297 #define YYNTBASE 20
299 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
300 #define YYTRANSLATE(x) ((unsigned)(x) <= 266 ? yytranslate[x] : 34)
302 /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
303 static const char yytranslate[] =
305 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
306 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
307 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
308 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
309 2, 2, 17, 2, 13, 19, 2, 2, 2, 2,
310 2, 2, 2, 2, 2, 2, 2, 2, 18, 2,
311 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
312 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
313 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
314 2, 15, 2, 16, 2, 2, 2, 2, 2, 2,
315 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
316 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
317 2, 2, 2, 2, 14, 2, 2, 2, 2, 2,
318 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
319 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
320 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
321 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
322 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
323 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
324 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
325 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
326 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
327 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
328 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
329 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
330 2, 2, 2, 2, 2, 2, 1, 3, 4, 5,
331 6, 7, 8, 9, 10, 11, 12
334 #if YYDEBUG
335 static const short yyprhs[] =
337 0, 0, 2, 5, 6, 12, 13, 23, 25, 28,
338 32, 35, 36, 38, 40, 42, 46, 50, 54, 56,
339 59, 60, 65, 66, 68, 70, 72, 74, 76, 78
341 static const short yyrhs[] =
343 21, 0, 22, 21, 0, 0, 30, 31, 32, 33,
344 11, 0, 0, 30, 8, 32, 33, 29, 28, 23,
345 24, 11, 0, 11, 0, 1, 11, 0, 13, 26,
346 24, 0, 26, 24, 0, 0, 31, 0, 7, 0,
347 6, 0, 25, 29, 28, 0, 9, 14, 27, 0,
348 15, 27, 16, 0, 9, 0, 17, 27, 0, 0,
349 18, 9, 19, 9, 0, 0, 12, 0, 3, 0,
350 4, 0, 5, 0, 10, 0, 9, 0, 9, 0
353 #endif
355 #if YYDEBUG
356 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
357 static const short yyrline[] =
359 0, 298, 302, 304, 307, 314, 314, 323, 324, 327,
360 329, 330, 333, 339, 344, 351, 360, 365, 369, 375,
361 381, 387, 394, 401, 409, 415, 420, 427, 435, 443
363 #endif
366 #if (YYDEBUG) || defined YYERROR_VERBOSE
368 /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
369 static const char *const yytname[] =
371 "$", "error", "$undefined.", "DREG", "CREG", "GREG", "IMMED", "ADDR",
372 "INSN", "NUM", "ID", "NL", "PNUM", "','", "'|'", "'['", "']'", "'*'",
373 "':'", "'-'", "insntbl", "entrys", "entry", "@1", "fieldspecs", "ftype",
374 "fieldspec", "flagexpr", "flags", "range", "pnum", "regtype", "name",
375 "value", 0
377 #endif
379 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
380 static const short yyr1[] =
382 0, 20, 21, 21, 22, 23, 22, 22, 22, 24,
383 24, 24, 25, 25, 25, 26, 27, 27, 27, 28,
384 28, 29, 29, 30, 31, 31, 31, 32, 34, 33
387 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
388 static const short yyr2[] =
390 0, 1, 2, 0, 5, 0, 9, 1, 2, 3,
391 2, 0, 1, 1, 1, 3, 3, 3, 1, 2,
392 0, 4, 0, 1, 1, 1, 1, 1, 1, 1
395 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
396 doesn't specify something else to do. Zero means the default is an
397 error. */
398 static const short yydefact[] =
400 0, 0, 7, 23, 1, 0, 0, 8, 2, 24,
401 25, 26, 0, 0, 27, 0, 0, 29, 22, 0,
402 0, 20, 4, 0, 0, 5, 0, 18, 0, 19,
403 11, 21, 0, 0, 14, 13, 0, 0, 22, 11,
404 12, 16, 17, 11, 6, 20, 10, 9, 15, 0,
405 0, 0
408 static const short yydefgoto[] =
410 49, 4, 5, 30, 37, 38, 39, 29, 25, 21,
411 6, 40, 15, 18
414 static const short yypact[] =
416 0, -9,-32768,-32768,-32768, 0, 12,-32768,-32768,-32768,
417 -32768,-32768, 3, 3,-32768, 9, 9,-32768, -8, 8,
418 19, 15,-32768, 10, -6,-32768, 24, 20, -6,-32768,
419 1,-32768, -6, 21,-32768,-32768, 18, 25, -8, 1,
420 -32768,-32768,-32768, 1,-32768, 15,-32768,-32768,-32768, 35,
421 38,-32768
424 static const short yypgoto[] =
426 -32768, 34,-32768,-32768, -13,-32768, 4, -1, -4, 5,
427 -32768, 36, 31, 29
431 #define YYLAST 45
434 static const short yytable[] =
436 -3, 1, 7, 27, 9, 10, 11, 34, 35, 28,
437 20, 2, 3, 14, 36, 9, 10, 11, 17, 22,
438 12, 9, 10, 11, 34, 35, 46, 33, 23, 26,
439 47, 41, 24, 31, 32, 50, 44, 42, 51, 8,
440 43, 48, 13, 45, 16, 19
443 static const short yycheck[] =
445 0, 1, 11, 9, 3, 4, 5, 6, 7, 15,
446 18, 11, 12, 10, 13, 3, 4, 5, 9, 11,
447 8, 3, 4, 5, 6, 7, 39, 28, 9, 19,
448 43, 32, 17, 9, 14, 0, 11, 16, 0, 5,
449 36, 45, 6, 38, 13, 16
451 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
452 #line 3 "/usr/share/bison/bison.simple"
454 /* Skeleton output parser for bison,
456 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
457 Foundation, Inc.
459 This program is free software; you can redistribute it and/or modify
460 it under the terms of the GNU General Public License as published by
461 the Free Software Foundation; either version 2, or (at your option)
462 any later version.
464 This program is distributed in the hope that it will be useful,
465 but WITHOUT ANY WARRANTY; without even the implied warranty of
466 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
467 GNU General Public License for more details.
469 You should have received a copy of the GNU General Public License
470 along with this program; if not, write to the Free Software
471 Foundation, Inc., 59 Temple Place - Suite 330,
472 Boston, MA 02111-1307, USA. */
474 /* As a special exception, when this file is copied by Bison into a
475 Bison output file, you may use that output file without restriction.
476 This special exception was added by the Free Software Foundation
477 in version 1.24 of Bison. */
479 /* This is the parser code that is written into each bison parser when
480 the %semantic_parser declaration is not specified in the grammar.
481 It was written by Richard Stallman by simplifying the hairy parser
482 used when %semantic_parser is specified. */
484 /* All symbols defined below should begin with yy or YY, to avoid
485 infringing on user name space. This should be done even for local
486 variables, as they might otherwise be expanded by user macros.
487 There are some unavoidable exceptions within include files to
488 define necessary library symbols; they are noted "INFRINGES ON
489 USER NAME SPACE" below. */
491 #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
493 /* The parser invokes alloca or malloc; define the necessary symbols. */
495 # if YYSTACK_USE_ALLOCA
496 # define YYSTACK_ALLOC alloca
497 # else
498 # ifndef YYSTACK_USE_ALLOCA
499 # if defined (alloca) || defined (_ALLOCA_H)
500 # define YYSTACK_ALLOC alloca
501 # else
502 # ifdef __GNUC__
503 # define YYSTACK_ALLOC __builtin_alloca
504 # endif
505 # endif
506 # endif
507 # endif
509 # ifdef YYSTACK_ALLOC
510 /* Pacify GCC's `empty if-body' warning. */
511 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
512 # else
513 # if defined (__STDC__) || defined (__cplusplus)
514 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
515 # define YYSIZE_T size_t
516 # endif
517 # define YYSTACK_ALLOC malloc
518 # define YYSTACK_FREE free
519 # endif
520 #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
523 #if (! defined (yyoverflow) \
524 && (! defined (__cplusplus) \
525 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
527 /* A type that is properly aligned for any stack member. */
528 union yyalloc
530 short yyss;
531 YYSTYPE yyvs;
532 # if YYLSP_NEEDED
533 YYLTYPE yyls;
534 # endif
537 /* The size of the maximum gap between one aligned stack and the next. */
538 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
540 /* The size of an array large to enough to hold all stacks, each with
541 N elements. */
542 # if YYLSP_NEEDED
543 # define YYSTACK_BYTES(N) \
544 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
545 + 2 * YYSTACK_GAP_MAX)
546 # else
547 # define YYSTACK_BYTES(N) \
548 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
549 + YYSTACK_GAP_MAX)
550 # endif
552 /* Copy COUNT objects from FROM to TO. The source and destination do
553 not overlap. */
554 # ifndef YYCOPY
555 # if 1 < __GNUC__
556 # define YYCOPY(To, From, Count) \
557 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
558 # else
559 # define YYCOPY(To, From, Count) \
560 do \
562 register YYSIZE_T yyi; \
563 for (yyi = 0; yyi < (Count); yyi++) \
564 (To)[yyi] = (From)[yyi]; \
566 while (0)
567 # endif
568 # endif
570 /* Relocate STACK from its old location to the new one. The
571 local variables YYSIZE and YYSTACKSIZE give the old and new number of
572 elements in the stack, and YYPTR gives the new location of the
573 stack. Advance YYPTR to a properly aligned location for the next
574 stack. */
575 # define YYSTACK_RELOCATE(Stack) \
576 do \
578 YYSIZE_T yynewbytes; \
579 YYCOPY (&yyptr->Stack, Stack, yysize); \
580 Stack = &yyptr->Stack; \
581 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
582 yyptr += yynewbytes / sizeof (*yyptr); \
584 while (0)
586 #endif
589 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
590 # define YYSIZE_T __SIZE_TYPE__
591 #endif
592 #if ! defined (YYSIZE_T) && defined (size_t)
593 # define YYSIZE_T size_t
594 #endif
595 #if ! defined (YYSIZE_T)
596 # if defined (__STDC__) || defined (__cplusplus)
597 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
598 # define YYSIZE_T size_t
599 # endif
600 #endif
601 #if ! defined (YYSIZE_T)
602 # define YYSIZE_T unsigned int
603 #endif
605 #define yyerrok (yyerrstatus = 0)
606 #define yyclearin (yychar = YYEMPTY)
607 #define YYEMPTY -2
608 #define YYEOF 0
609 #define YYACCEPT goto yyacceptlab
610 #define YYABORT goto yyabortlab
611 #define YYERROR goto yyerrlab1
612 /* Like YYERROR except do call yyerror. This remains here temporarily
613 to ease the transition to the new meaning of YYERROR, for GCC.
614 Once GCC version 2 has supplanted version 1, this can go. */
615 #define YYFAIL goto yyerrlab
616 #define YYRECOVERING() (!!yyerrstatus)
617 #define YYBACKUP(Token, Value) \
618 do \
619 if (yychar == YYEMPTY && yylen == 1) \
621 yychar = (Token); \
622 yylval = (Value); \
623 yychar1 = YYTRANSLATE (yychar); \
624 YYPOPSTACK; \
625 goto yybackup; \
627 else \
629 yyerror ("syntax error: cannot back up"); \
630 YYERROR; \
632 while (0)
634 #define YYTERROR 1
635 #define YYERRCODE 256
638 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
639 are run).
641 When YYLLOC_DEFAULT is run, CURRENT is set the location of the
642 first token. By default, to implement support for ranges, extend
643 its range to the last symbol. */
645 #ifndef YYLLOC_DEFAULT
646 # define YYLLOC_DEFAULT(Current, Rhs, N) \
647 Current.last_line = Rhs[N].last_line; \
648 Current.last_column = Rhs[N].last_column;
649 #endif
652 /* YYLEX -- calling `yylex' with the right arguments. */
654 #if YYPURE
655 # if YYLSP_NEEDED
656 # ifdef YYLEX_PARAM
657 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
658 # else
659 # define YYLEX yylex (&yylval, &yylloc)
660 # endif
661 # else /* !YYLSP_NEEDED */
662 # ifdef YYLEX_PARAM
663 # define YYLEX yylex (&yylval, YYLEX_PARAM)
664 # else
665 # define YYLEX yylex (&yylval)
666 # endif
667 # endif /* !YYLSP_NEEDED */
668 #else /* !YYPURE */
669 # define YYLEX yylex ()
670 #endif /* !YYPURE */
673 /* Enable debugging if requested. */
674 #if YYDEBUG
676 # ifndef YYFPRINTF
677 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
678 # define YYFPRINTF fprintf
679 # endif
681 # define YYDPRINTF(Args) \
682 do { \
683 if (yydebug) \
684 YYFPRINTF Args; \
685 } while (0)
686 /* Nonzero means print parse trace. It is left uninitialized so that
687 multiple parsers can coexist. */
688 int yydebug;
689 #else /* !YYDEBUG */
690 # define YYDPRINTF(Args)
691 #endif /* !YYDEBUG */
693 /* YYINITDEPTH -- initial size of the parser's stacks. */
694 #ifndef YYINITDEPTH
695 # define YYINITDEPTH 200
696 #endif
698 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
699 if the built-in stack extension method is used).
701 Do not make this value too large; the results are undefined if
702 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
703 evaluated with infinite-precision integer arithmetic. */
705 #if YYMAXDEPTH == 0
706 # undef YYMAXDEPTH
707 #endif
709 #ifndef YYMAXDEPTH
710 # define YYMAXDEPTH 10000
711 #endif
713 #ifdef YYERROR_VERBOSE
715 # ifndef yystrlen
716 # if defined (__GLIBC__) && defined (_STRING_H)
717 # define yystrlen strlen
718 # else
719 /* Return the length of YYSTR. */
720 static YYSIZE_T
721 # if defined (__STDC__) || defined (__cplusplus)
722 yystrlen (const char *yystr)
723 # else
724 yystrlen (yystr)
725 const char *yystr;
726 # endif
728 register const char *yys = yystr;
730 while (*yys++ != '\0')
731 continue;
733 return yys - yystr - 1;
735 # endif
736 # endif
738 # ifndef yystpcpy
739 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
740 # include <string.h>
741 # define yystpcpy stpcpy
742 # else
743 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
744 YYDEST. */
745 static char *
746 # if defined (__STDC__) || defined (__cplusplus)
747 yystpcpy (char *yydest, const char *yysrc)
748 # else
749 yystpcpy (yydest, yysrc)
750 char *yydest;
751 const char *yysrc;
752 # endif
754 register char *yyd = yydest;
755 register const char *yys = yysrc;
757 while ((*yyd++ = *yys++) != '\0')
758 continue;
760 return yyd - 1;
762 # endif
763 # endif
764 #endif
766 #line 316 "/usr/share/bison/bison.simple"
769 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
770 into yyparse. The argument should have type void *.
771 It should actually point to an object.
772 Grammar actions can access the variable by casting it
773 to the proper pointer type. */
775 #ifdef YYPARSE_PARAM
776 # if defined (__STDC__) || defined (__cplusplus)
777 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
778 # define YYPARSE_PARAM_DECL
779 # else
780 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
781 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
782 # endif
783 #else /* !YYPARSE_PARAM */
784 # define YYPARSE_PARAM_ARG
785 # define YYPARSE_PARAM_DECL
786 #endif /* !YYPARSE_PARAM */
788 /* Prevent warning if -Wstrict-prototypes. */
789 #ifdef __GNUC__
790 # ifdef YYPARSE_PARAM
791 int yyparse (void *);
792 # else
793 int yyparse (void);
794 # endif
795 #endif
797 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
798 variables are global, or local to YYPARSE. */
800 #define YY_DECL_NON_LSP_VARIABLES \
801 /* The lookahead symbol. */ \
802 int yychar; \
804 /* The semantic value of the lookahead symbol. */ \
805 YYSTYPE yylval; \
807 /* Number of parse errors so far. */ \
808 int yynerrs;
810 #if YYLSP_NEEDED
811 # define YY_DECL_VARIABLES \
812 YY_DECL_NON_LSP_VARIABLES \
814 /* Location data for the lookahead symbol. */ \
815 YYLTYPE yylloc;
816 #else
817 # define YY_DECL_VARIABLES \
818 YY_DECL_NON_LSP_VARIABLES
819 #endif
822 /* If nonreentrant, generate the variables here. */
824 #if !YYPURE
825 YY_DECL_VARIABLES
826 #endif /* !YYPURE */
829 yyparse (YYPARSE_PARAM_ARG)
830 YYPARSE_PARAM_DECL
832 /* If reentrant, generate the variables here. */
833 #if YYPURE
834 YY_DECL_VARIABLES
835 #endif /* !YYPURE */
837 register int yystate;
838 register int yyn;
839 int yyresult;
840 /* Number of tokens to shift before error messages enabled. */
841 int yyerrstatus;
842 /* Lookahead token as an internal (translated) token number. */
843 int yychar1 = 0;
845 /* Three stacks and their tools:
846 `yyss': related to states,
847 `yyvs': related to semantic values,
848 `yyls': related to locations.
850 Refer to the stacks thru separate pointers, to allow yyoverflow
851 to reallocate them elsewhere. */
853 /* The state stack. */
854 short yyssa[YYINITDEPTH];
855 short *yyss = yyssa;
856 register short *yyssp;
858 /* The semantic value stack. */
859 YYSTYPE yyvsa[YYINITDEPTH];
860 YYSTYPE *yyvs = yyvsa;
861 register YYSTYPE *yyvsp;
863 #if YYLSP_NEEDED
864 /* The location stack. */
865 YYLTYPE yylsa[YYINITDEPTH];
866 YYLTYPE *yyls = yylsa;
867 YYLTYPE *yylsp;
868 #endif
870 #if YYLSP_NEEDED
871 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
872 #else
873 # define YYPOPSTACK (yyvsp--, yyssp--)
874 #endif
876 YYSIZE_T yystacksize = YYINITDEPTH;
879 /* The variables used to return semantic value and location from the
880 action routines. */
881 YYSTYPE yyval;
882 #if YYLSP_NEEDED
883 YYLTYPE yyloc;
884 #endif
886 /* When reducing, the number of symbols on the RHS of the reduced
887 rule. */
888 int yylen;
890 YYDPRINTF ((stderr, "Starting parse\n"));
892 yystate = 0;
893 yyerrstatus = 0;
894 yynerrs = 0;
895 yychar = YYEMPTY; /* Cause a token to be read. */
897 /* Initialize stack pointers.
898 Waste one element of value and location stack
899 so that they stay on the same level as the state stack.
900 The wasted elements are never initialized. */
902 yyssp = yyss;
903 yyvsp = yyvs;
904 #if YYLSP_NEEDED
905 yylsp = yyls;
906 #endif
907 goto yysetstate;
909 /*------------------------------------------------------------.
910 | yynewstate -- Push a new state, which is found in yystate. |
911 `------------------------------------------------------------*/
912 yynewstate:
913 /* In all cases, when you get here, the value and location stacks
914 have just been pushed. so pushing a state here evens the stacks.
916 yyssp++;
918 yysetstate:
919 *yyssp = yystate;
921 if (yyssp >= yyss + yystacksize - 1)
923 /* Get the current used size of the three stacks, in elements. */
924 YYSIZE_T yysize = yyssp - yyss + 1;
926 #ifdef yyoverflow
928 /* Give user a chance to reallocate the stack. Use copies of
929 these so that the &'s don't force the real ones into
930 memory. */
931 YYSTYPE *yyvs1 = yyvs;
932 short *yyss1 = yyss;
934 /* Each stack pointer address is followed by the size of the
935 data in use in that stack, in bytes. */
936 # if YYLSP_NEEDED
937 YYLTYPE *yyls1 = yyls;
938 /* This used to be a conditional around just the two extra args,
939 but that might be undefined if yyoverflow is a macro. */
940 yyoverflow ("parser stack overflow",
941 &yyss1, yysize * sizeof (*yyssp),
942 &yyvs1, yysize * sizeof (*yyvsp),
943 &yyls1, yysize * sizeof (*yylsp),
944 &yystacksize);
945 yyls = yyls1;
946 # else
947 yyoverflow ("parser stack overflow",
948 &yyss1, yysize * sizeof (*yyssp),
949 &yyvs1, yysize * sizeof (*yyvsp),
950 &yystacksize);
951 # endif
952 yyss = yyss1;
953 yyvs = yyvs1;
955 #else /* no yyoverflow */
956 # ifndef YYSTACK_RELOCATE
957 goto yyoverflowlab;
958 # else
959 /* Extend the stack our own way. */
960 if (yystacksize >= YYMAXDEPTH)
961 goto yyoverflowlab;
962 yystacksize *= 2;
963 if (yystacksize > YYMAXDEPTH)
964 yystacksize = YYMAXDEPTH;
967 short *yyss1 = yyss;
968 union yyalloc *yyptr =
969 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
970 if (! yyptr)
971 goto yyoverflowlab;
972 YYSTACK_RELOCATE (yyss);
973 YYSTACK_RELOCATE (yyvs);
974 # if YYLSP_NEEDED
975 YYSTACK_RELOCATE (yyls);
976 # endif
977 # undef YYSTACK_RELOCATE
978 if (yyss1 != yyssa)
979 YYSTACK_FREE (yyss1);
981 # endif
982 #endif /* no yyoverflow */
984 yyssp = yyss + yysize - 1;
985 yyvsp = yyvs + yysize - 1;
986 #if YYLSP_NEEDED
987 yylsp = yyls + yysize - 1;
988 #endif
990 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
991 (unsigned long int) yystacksize));
993 if (yyssp >= yyss + yystacksize - 1)
994 YYABORT;
997 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
999 goto yybackup;
1002 /*-----------.
1003 | yybackup. |
1004 `-----------*/
1005 yybackup:
1007 /* Do appropriate processing given the current state. */
1008 /* Read a lookahead token if we need one and don't already have one. */
1009 /* yyresume: */
1011 /* First try to decide what to do without reference to lookahead token. */
1013 yyn = yypact[yystate];
1014 if (yyn == YYFLAG)
1015 goto yydefault;
1017 /* Not known => get a lookahead token if don't already have one. */
1019 /* yychar is either YYEMPTY or YYEOF
1020 or a valid token in external form. */
1022 if (yychar == YYEMPTY)
1024 YYDPRINTF ((stderr, "Reading a token: "));
1025 yychar = YYLEX;
1028 /* Convert token to internal form (in yychar1) for indexing tables with */
1030 if (yychar <= 0) /* This means end of input. */
1032 yychar1 = 0;
1033 yychar = YYEOF; /* Don't call YYLEX any more */
1035 YYDPRINTF ((stderr, "Now at end of input.\n"));
1037 else
1039 yychar1 = YYTRANSLATE (yychar);
1041 #if YYDEBUG
1042 /* We have to keep this `#if YYDEBUG', since we use variables
1043 which are defined only if `YYDEBUG' is set. */
1044 if (yydebug)
1046 YYFPRINTF (stderr, "Next token is %d (%s",
1047 yychar, yytname[yychar1]);
1048 /* Give the individual parser a way to print the precise
1049 meaning of a token, for further debugging info. */
1050 # ifdef YYPRINT
1051 YYPRINT (stderr, yychar, yylval);
1052 # endif
1053 YYFPRINTF (stderr, ")\n");
1055 #endif
1058 yyn += yychar1;
1059 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1060 goto yydefault;
1062 yyn = yytable[yyn];
1064 /* yyn is what to do for this token type in this state.
1065 Negative => reduce, -yyn is rule number.
1066 Positive => shift, yyn is new state.
1067 New state is final state => don't bother to shift,
1068 just return success.
1069 0, or most negative number => error. */
1071 if (yyn < 0)
1073 if (yyn == YYFLAG)
1074 goto yyerrlab;
1075 yyn = -yyn;
1076 goto yyreduce;
1078 else if (yyn == 0)
1079 goto yyerrlab;
1081 if (yyn == YYFINAL)
1082 YYACCEPT;
1084 /* Shift the lookahead token. */
1085 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
1086 yychar, yytname[yychar1]));
1088 /* Discard the token being shifted unless it is eof. */
1089 if (yychar != YYEOF)
1090 yychar = YYEMPTY;
1092 *++yyvsp = yylval;
1093 #if YYLSP_NEEDED
1094 *++yylsp = yylloc;
1095 #endif
1097 /* Count tokens shifted since error; after three, turn off error
1098 status. */
1099 if (yyerrstatus)
1100 yyerrstatus--;
1102 yystate = yyn;
1103 goto yynewstate;
1106 /*-----------------------------------------------------------.
1107 | yydefault -- do the default action for the current state. |
1108 `-----------------------------------------------------------*/
1109 yydefault:
1110 yyn = yydefact[yystate];
1111 if (yyn == 0)
1112 goto yyerrlab;
1113 goto yyreduce;
1116 /*-----------------------------.
1117 | yyreduce -- Do a reduction. |
1118 `-----------------------------*/
1119 yyreduce:
1120 /* yyn is the number of a rule to reduce with. */
1121 yylen = yyr2[yyn];
1123 /* If YYLEN is nonzero, implement the default value of the action:
1124 `$$ = $1'.
1126 Otherwise, the following line sets YYVAL to the semantic value of
1127 the lookahead token. This behavior is undocumented and Bison
1128 users should not rely upon it. Assigning to YYVAL
1129 unconditionally makes the parser a bit smaller, and it avoids a
1130 GCC warning that YYVAL may be used uninitialized. */
1131 yyval = yyvsp[1-yylen];
1133 #if YYLSP_NEEDED
1134 /* Similarly for the default location. Let the user run additional
1135 commands if for instance locations are ranges. */
1136 yyloc = yylsp[1-yylen];
1137 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1138 #endif
1140 #if YYDEBUG
1141 /* We have to keep this `#if YYDEBUG', since we use variables which
1142 are defined only if `YYDEBUG' is set. */
1143 if (yydebug)
1145 int yyi;
1147 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
1148 yyn, yyrline[yyn]);
1150 /* Print the symbols being reduced, and their result. */
1151 for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
1152 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1153 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1155 #endif
1157 switch (yyn) {
1159 case 4:
1160 #line 309 "itbl-parse.y"
1162 DBG (("line %d: entry pnum=%d type=%d name=%s value=x%x\n",
1163 insntbl_line, yyvsp[-4].num, yyvsp[-3].num, yyvsp[-2].str, yyvsp[-1].val));
1164 itbl_add_reg (yyvsp[-4].num, yyvsp[-3].num, yyvsp[-2].str, yyvsp[-1].val);
1166 break;
1167 case 5:
1168 #line 315 "itbl-parse.y"
1170 DBG (("line %d: entry pnum=%d type=INSN name=%s value=x%x",
1171 insntbl_line, yyvsp[-5].num, yyvsp[-3].str, yyvsp[-2].val));
1172 DBG ((" sbit=%d ebit=%d flags=0x%x\n", sbit, ebit, yyvsp[0].val));
1173 insn=itbl_add_insn (yyvsp[-5].num, yyvsp[-3].str, yyvsp[-2].val, sbit, ebit, yyvsp[0].val);
1175 break;
1176 case 6:
1177 #line 322 "itbl-parse.y"
1179 break;
1180 case 12:
1181 #line 335 "itbl-parse.y"
1183 DBGL2 (("ftype\n"));
1184 yyval.num = yyvsp[0].num;
1186 break;
1187 case 13:
1188 #line 340 "itbl-parse.y"
1190 DBGL2 (("addr\n"));
1191 yyval.num = ADDR;
1193 break;
1194 case 14:
1195 #line 345 "itbl-parse.y"
1197 DBGL2 (("immed\n"));
1198 yyval.num = IMMED;
1200 break;
1201 case 15:
1202 #line 353 "itbl-parse.y"
1204 DBG (("line %d: field type=%d sbit=%d ebit=%d, flags=0x%x\n",
1205 insntbl_line, yyvsp[-2].num, sbit, ebit, yyvsp[0].val));
1206 itbl_add_operand (insn, yyvsp[-2].num, sbit, ebit, yyvsp[0].val);
1208 break;
1209 case 16:
1210 #line 362 "itbl-parse.y"
1212 yyval.val = yyvsp[-2].num | yyvsp[0].val;
1214 break;
1215 case 17:
1216 #line 366 "itbl-parse.y"
1218 yyval.val = yyvsp[-1].val;
1220 break;
1221 case 18:
1222 #line 370 "itbl-parse.y"
1224 yyval.val = yyvsp[0].num;
1226 break;
1227 case 19:
1228 #line 377 "itbl-parse.y"
1230 DBGL2 (("flags=%d\n", yyvsp[0].val));
1231 yyval.val = yyvsp[0].val;
1233 break;
1234 case 20:
1235 #line 382 "itbl-parse.y"
1237 yyval.val = 0;
1239 break;
1240 case 21:
1241 #line 389 "itbl-parse.y"
1243 DBGL2 (("range %d %d\n", yyvsp[-2].num, yyvsp[0].num));
1244 sbit = yyvsp[-2].num;
1245 ebit = yyvsp[0].num;
1247 break;
1248 case 22:
1249 #line 395 "itbl-parse.y"
1251 sbit = 31;
1252 ebit = 0;
1254 break;
1255 case 23:
1256 #line 403 "itbl-parse.y"
1258 DBGL2 (("pnum=%d\n",yyvsp[0].num));
1259 yyval.num = yyvsp[0].num;
1261 break;
1262 case 24:
1263 #line 411 "itbl-parse.y"
1265 DBGL2 (("dreg\n"));
1266 yyval.num = DREG;
1268 break;
1269 case 25:
1270 #line 416 "itbl-parse.y"
1272 DBGL2 (("creg\n"));
1273 yyval.num = CREG;
1275 break;
1276 case 26:
1277 #line 421 "itbl-parse.y"
1279 DBGL2 (("greg\n"));
1280 yyval.num = GREG;
1282 break;
1283 case 27:
1284 #line 429 "itbl-parse.y"
1286 DBGL2 (("name=%s\n",yyvsp[0].str));
1287 yyval.str = yyvsp[0].str;
1289 break;
1290 case 28:
1291 #line 437 "itbl-parse.y"
1293 DBGL2 (("num=%d\n",yyvsp[0].num));
1294 yyval.num = yyvsp[0].num;
1296 break;
1297 case 29:
1298 #line 445 "itbl-parse.y"
1300 DBGL2 (("val=x%x\n",yyvsp[0].num));
1301 yyval.val = yyvsp[0].num;
1303 break;
1306 #line 706 "/usr/share/bison/bison.simple"
1309 yyvsp -= yylen;
1310 yyssp -= yylen;
1311 #if YYLSP_NEEDED
1312 yylsp -= yylen;
1313 #endif
1315 #if YYDEBUG
1316 if (yydebug)
1318 short *yyssp1 = yyss - 1;
1319 YYFPRINTF (stderr, "state stack now");
1320 while (yyssp1 != yyssp)
1321 YYFPRINTF (stderr, " %d", *++yyssp1);
1322 YYFPRINTF (stderr, "\n");
1324 #endif
1326 *++yyvsp = yyval;
1327 #if YYLSP_NEEDED
1328 *++yylsp = yyloc;
1329 #endif
1331 /* Now `shift' the result of the reduction. Determine what state
1332 that goes to, based on the state we popped back to and the rule
1333 number reduced by. */
1335 yyn = yyr1[yyn];
1337 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1338 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1339 yystate = yytable[yystate];
1340 else
1341 yystate = yydefgoto[yyn - YYNTBASE];
1343 goto yynewstate;
1346 /*------------------------------------.
1347 | yyerrlab -- here on detecting error |
1348 `------------------------------------*/
1349 yyerrlab:
1350 /* If not already recovering from an error, report this error. */
1351 if (!yyerrstatus)
1353 ++yynerrs;
1355 #ifdef YYERROR_VERBOSE
1356 yyn = yypact[yystate];
1358 if (yyn > YYFLAG && yyn < YYLAST)
1360 YYSIZE_T yysize = 0;
1361 char *yymsg;
1362 int yyx, yycount;
1364 yycount = 0;
1365 /* Start YYX at -YYN if negative to avoid negative indexes in
1366 YYCHECK. */
1367 for (yyx = yyn < 0 ? -yyn : 0;
1368 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1369 if (yycheck[yyx + yyn] == yyx)
1370 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1371 yysize += yystrlen ("parse error, unexpected ") + 1;
1372 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
1373 yymsg = (char *) YYSTACK_ALLOC (yysize);
1374 if (yymsg != 0)
1376 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1377 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
1379 if (yycount < 5)
1381 yycount = 0;
1382 for (yyx = yyn < 0 ? -yyn : 0;
1383 yyx < (int) (sizeof (yytname) / sizeof (char *));
1384 yyx++)
1385 if (yycheck[yyx + yyn] == yyx)
1387 const char *yyq = ! yycount ? ", expecting " : " or ";
1388 yyp = yystpcpy (yyp, yyq);
1389 yyp = yystpcpy (yyp, yytname[yyx]);
1390 yycount++;
1393 yyerror (yymsg);
1394 YYSTACK_FREE (yymsg);
1396 else
1397 yyerror ("parse error; also virtual memory exhausted");
1399 else
1400 #endif /* defined (YYERROR_VERBOSE) */
1401 yyerror ("parse error");
1403 goto yyerrlab1;
1406 /*--------------------------------------------------.
1407 | yyerrlab1 -- error raised explicitly by an action |
1408 `--------------------------------------------------*/
1409 yyerrlab1:
1410 if (yyerrstatus == 3)
1412 /* If just tried and failed to reuse lookahead token after an
1413 error, discard it. */
1415 /* return failure if at end of input */
1416 if (yychar == YYEOF)
1417 YYABORT;
1418 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1419 yychar, yytname[yychar1]));
1420 yychar = YYEMPTY;
1423 /* Else will try to reuse lookahead token after shifting the error
1424 token. */
1426 yyerrstatus = 3; /* Each real token shifted decrements this */
1428 goto yyerrhandle;
1431 /*-------------------------------------------------------------------.
1432 | yyerrdefault -- current state does not do anything special for the |
1433 | error token. |
1434 `-------------------------------------------------------------------*/
1435 yyerrdefault:
1436 #if 0
1437 /* This is wrong; only states that explicitly want error tokens
1438 should shift them. */
1440 /* If its default is to accept any token, ok. Otherwise pop it. */
1441 yyn = yydefact[yystate];
1442 if (yyn)
1443 goto yydefault;
1444 #endif
1447 /*---------------------------------------------------------------.
1448 | yyerrpop -- pop the current state because it cannot handle the |
1449 | error token |
1450 `---------------------------------------------------------------*/
1451 yyerrpop:
1452 if (yyssp == yyss)
1453 YYABORT;
1454 yyvsp--;
1455 yystate = *--yyssp;
1456 #if YYLSP_NEEDED
1457 yylsp--;
1458 #endif
1460 #if YYDEBUG
1461 if (yydebug)
1463 short *yyssp1 = yyss - 1;
1464 YYFPRINTF (stderr, "Error: state stack now");
1465 while (yyssp1 != yyssp)
1466 YYFPRINTF (stderr, " %d", *++yyssp1);
1467 YYFPRINTF (stderr, "\n");
1469 #endif
1471 /*--------------.
1472 | yyerrhandle. |
1473 `--------------*/
1474 yyerrhandle:
1475 yyn = yypact[yystate];
1476 if (yyn == YYFLAG)
1477 goto yyerrdefault;
1479 yyn += YYTERROR;
1480 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1481 goto yyerrdefault;
1483 yyn = yytable[yyn];
1484 if (yyn < 0)
1486 if (yyn == YYFLAG)
1487 goto yyerrpop;
1488 yyn = -yyn;
1489 goto yyreduce;
1491 else if (yyn == 0)
1492 goto yyerrpop;
1494 if (yyn == YYFINAL)
1495 YYACCEPT;
1497 YYDPRINTF ((stderr, "Shifting error token, "));
1499 *++yyvsp = yylval;
1500 #if YYLSP_NEEDED
1501 *++yylsp = yylloc;
1502 #endif
1504 yystate = yyn;
1505 goto yynewstate;
1508 /*-------------------------------------.
1509 | yyacceptlab -- YYACCEPT comes here. |
1510 `-------------------------------------*/
1511 yyacceptlab:
1512 yyresult = 0;
1513 goto yyreturn;
1515 /*-----------------------------------.
1516 | yyabortlab -- YYABORT comes here. |
1517 `-----------------------------------*/
1518 yyabortlab:
1519 yyresult = 1;
1520 goto yyreturn;
1522 /*---------------------------------------------.
1523 | yyoverflowab -- parser overflow comes here. |
1524 `---------------------------------------------*/
1525 yyoverflowlab:
1526 yyerror ("parser stack overflow");
1527 yyresult = 2;
1528 /* Fall through. */
1530 yyreturn:
1531 #ifndef yyoverflow
1532 if (yyss != yyssa)
1533 YYSTACK_FREE (yyss);
1534 #endif
1535 return yyresult;
1537 #line 450 "itbl-parse.y"
1540 static int
1541 yyerror (msg)
1542 const char *msg;
1544 printf ("line %d: %s\n", insntbl_line, msg);
1545 return 0;