Commit generated files for 2.12.1.
[binutils.git] / gas / itbl-parse.c
blob15b2a92f257d2ef9ae558735c66e51f228110b65
1 /* A Bison parser, made from itbl-parse.y
2 by GNU bison 1.33. */
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 hexidecimal
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 sensative 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-ops.h"
249 /* #define DEBUG */
251 #ifdef DEBUG
252 #ifndef DBG_LVL
253 #define DBG_LVL 1
254 #endif
255 #else
256 #define DBG_LVL 0
257 #endif
259 #if DBG_LVL >= 1
260 #define DBG(x) printf x
261 #else
262 #define DBG(x)
263 #endif
265 #if DBG_LVL >= 2
266 #define DBGL2(x) printf x
267 #else
268 #define DBGL2(x)
269 #endif
271 static int sbit, ebit;
272 static struct itbl_entry *insn=0;
273 extern int insntbl_line;
274 int yyparse PARAMS ((void));
275 int yylex PARAMS ((void));
276 static int yyerror PARAMS ((const char *));
279 #line 283 "itbl-parse.y"
280 #ifndef YYSTYPE
281 typedef union
283 char *str;
284 int num;
285 int processor;
286 unsigned long val;
287 } yystype;
288 # define YYSTYPE yystype
289 #endif
290 #ifndef YYDEBUG
291 # define YYDEBUG 0
292 #endif
296 #define YYFINAL 51
297 #define YYFLAG -32768
298 #define YYNTBASE 20
300 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
301 #define YYTRANSLATE(x) ((unsigned)(x) <= 266 ? yytranslate[x] : 34)
303 /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
304 static const char yytranslate[] =
306 0, 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, 2, 2, 2, 2, 2, 2, 2, 2,
310 2, 2, 17, 2, 13, 19, 2, 2, 2, 2,
311 2, 2, 2, 2, 2, 2, 2, 2, 18, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2,
315 2, 15, 2, 16, 2, 2, 2, 2, 2, 2,
316 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
317 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
318 2, 2, 2, 2, 14, 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, 2, 2, 2, 2,
331 2, 2, 2, 2, 2, 2, 1, 3, 4, 5,
332 6, 7, 8, 9, 10, 11, 12
335 #if YYDEBUG
336 static const short yyprhs[] =
338 0, 0, 2, 5, 6, 12, 13, 23, 25, 28,
339 32, 35, 36, 38, 40, 42, 46, 50, 54, 56,
340 59, 60, 65, 66, 68, 70, 72, 74, 76, 78
342 static const short yyrhs[] =
344 21, 0, 22, 21, 0, 0, 30, 31, 32, 33,
345 11, 0, 0, 30, 8, 32, 33, 29, 28, 23,
346 24, 11, 0, 11, 0, 1, 11, 0, 13, 26,
347 24, 0, 26, 24, 0, 0, 31, 0, 7, 0,
348 6, 0, 25, 29, 28, 0, 9, 14, 27, 0,
349 15, 27, 16, 0, 9, 0, 17, 27, 0, 0,
350 18, 9, 19, 9, 0, 0, 12, 0, 3, 0,
351 4, 0, 5, 0, 10, 0, 9, 0, 9, 0
354 #endif
356 #if YYDEBUG
357 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
358 static const short yyrline[] =
360 0, 300, 304, 306, 309, 316, 316, 324, 325, 328,
361 330, 331, 334, 340, 345, 352, 361, 366, 370, 376,
362 382, 388, 395, 402, 410, 416, 421, 428, 436, 444
364 #endif
367 #if (YYDEBUG) || defined YYERROR_VERBOSE
369 /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
370 static const char *const yytname[] =
372 "$", "error", "$undefined.", "DREG", "CREG", "GREG", "IMMED", "ADDR",
373 "INSN", "NUM", "ID", "NL", "PNUM", "','", "'|'", "'['", "']'", "'*'",
374 "':'", "'-'", "insntbl", "entrys", "entry", "@1", "fieldspecs", "ftype",
375 "fieldspec", "flagexpr", "flags", "range", "pnum", "regtype", "name",
376 "value", NULL
378 #endif
380 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
381 static const short yyr1[] =
383 0, 20, 21, 21, 22, 23, 22, 22, 22, 24,
384 24, 24, 25, 25, 25, 26, 27, 27, 27, 28,
385 28, 29, 29, 30, 31, 31, 31, 32, 34, 33
388 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
389 static const short yyr2[] =
391 0, 1, 2, 0, 5, 0, 9, 1, 2, 3,
392 2, 0, 1, 1, 1, 3, 3, 3, 1, 2,
393 0, 4, 0, 1, 1, 1, 1, 1, 1, 1
396 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
397 doesn't specify something else to do. Zero means the default is an
398 error. */
399 static const short yydefact[] =
401 0, 0, 7, 23, 1, 0, 0, 8, 2, 24,
402 25, 26, 0, 0, 27, 0, 0, 29, 22, 0,
403 0, 20, 4, 0, 0, 5, 0, 18, 0, 19,
404 11, 21, 0, 0, 14, 13, 0, 0, 22, 11,
405 12, 16, 17, 11, 6, 20, 10, 9, 15, 0,
406 0, 0
409 static const short yydefgoto[] =
411 49, 4, 5, 30, 37, 38, 39, 29, 25, 21,
412 6, 40, 15, 18
415 static const short yypact[] =
417 0, -9,-32768,-32768,-32768, 0, 12,-32768,-32768,-32768,
418 -32768,-32768, 3, 3,-32768, 9, 9,-32768, -8, 8,
419 19, 15,-32768, 10, -6,-32768, 24, 20, -6,-32768,
420 1,-32768, -6, 21,-32768,-32768, 18, 25, -8, 1,
421 -32768,-32768,-32768, 1,-32768, 15,-32768,-32768,-32768, 35,
422 38,-32768
425 static const short yypgoto[] =
427 -32768, 34,-32768,-32768, -13,-32768, 4, -1, -4, 5,
428 -32768, 36, 31, 29
432 #define YYLAST 45
435 static const short yytable[] =
437 -3, 1, 7, 27, 9, 10, 11, 34, 35, 28,
438 20, 2, 3, 14, 36, 9, 10, 11, 17, 22,
439 12, 9, 10, 11, 34, 35, 46, 33, 23, 26,
440 47, 41, 24, 31, 32, 50, 44, 42, 51, 8,
441 43, 48, 13, 45, 16, 19
444 static const short yycheck[] =
446 0, 1, 11, 9, 3, 4, 5, 6, 7, 15,
447 18, 11, 12, 10, 13, 3, 4, 5, 9, 11,
448 8, 3, 4, 5, 6, 7, 39, 28, 9, 19,
449 43, 32, 17, 9, 14, 0, 11, 16, 0, 5,
450 36, 45, 6, 38, 13, 16
452 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
453 #line 3 "/usr/share/bison/bison.simple"
455 /* Skeleton output parser for bison,
457 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
458 Foundation, Inc.
460 This program is free software; you can redistribute it and/or modify
461 it under the terms of the GNU General Public License as published by
462 the Free Software Foundation; either version 2, or (at your option)
463 any later version.
465 This program is distributed in the hope that it will be useful,
466 but WITHOUT ANY WARRANTY; without even the implied warranty of
467 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
468 GNU General Public License for more details.
470 You should have received a copy of the GNU General Public License
471 along with this program; if not, write to the Free Software
472 Foundation, Inc., 59 Temple Place - Suite 330,
473 Boston, MA 02111-1307, USA. */
475 /* As a special exception, when this file is copied by Bison into a
476 Bison output file, you may use that output file without restriction.
477 This special exception was added by the Free Software Foundation
478 in version 1.24 of Bison. */
480 /* This is the parser code that is written into each bison parser when
481 the %semantic_parser declaration is not specified in the grammar.
482 It was written by Richard Stallman by simplifying the hairy parser
483 used when %semantic_parser is specified. */
485 /* All symbols defined below should begin with yy or YY, to avoid
486 infringing on user name space. This should be done even for local
487 variables, as they might otherwise be expanded by user macros.
488 There are some unavoidable exceptions within include files to
489 define necessary library symbols; they are noted "INFRINGES ON
490 USER NAME SPACE" below. */
492 #ifdef __cplusplus
493 # define YYSTD(x) std::x
494 #else
495 # define YYSTD(x) x
496 #endif
498 #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
500 /* The parser invokes alloca or malloc; define the necessary symbols. */
502 # if YYSTACK_USE_ALLOCA
503 # define YYSTACK_ALLOC alloca
504 # else
505 # ifndef YYSTACK_USE_ALLOCA
506 # if defined (alloca) || defined (_ALLOCA_H)
507 # define YYSTACK_ALLOC alloca
508 # else
509 # ifdef __GNUC__
510 # define YYSTACK_ALLOC __builtin_alloca
511 # endif
512 # endif
513 # endif
514 # endif
516 # ifdef YYSTACK_ALLOC
517 /* Pacify GCC's `empty if-body' warning. */
518 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
519 # else
520 # ifdef __cplusplus
521 # include <cstdlib> /* INFRINGES ON USER NAME SPACE */
522 # define YYSIZE_T std::size_t
523 # else
524 # ifdef __STDC__
525 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
526 # define YYSIZE_T size_t
527 # endif
528 # endif
529 # define YYSTACK_ALLOC YYSTD (malloc)
530 # define YYSTACK_FREE YYSTD (free)
531 # endif
533 /* A type that is properly aligned for any stack member. */
534 union yyalloc
536 short yyss;
537 YYSTYPE yyvs;
538 # if YYLSP_NEEDED
539 YYLTYPE yyls;
540 # endif
543 /* The size of the maximum gap between one aligned stack and the next. */
544 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
546 /* The size of an array large to enough to hold all stacks, each with
547 N elements. */
548 # if YYLSP_NEEDED
549 # define YYSTACK_BYTES(N) \
550 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
551 + 2 * YYSTACK_GAP_MAX)
552 # else
553 # define YYSTACK_BYTES(N) \
554 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
555 + YYSTACK_GAP_MAX)
556 # endif
558 /* Relocate the TYPE STACK from its old location to the new one. The
559 local variables YYSIZE and YYSTACKSIZE give the old and new number of
560 elements in the stack, and YYPTR gives the new location of the
561 stack. Advance YYPTR to a properly aligned location for the next
562 stack. */
563 # define YYSTACK_RELOCATE(Type, Stack) \
564 do \
566 YYSIZE_T yynewbytes; \
567 yymemcpy ((char *) yyptr, (char *) (Stack), \
568 yysize * (YYSIZE_T) sizeof (Type)); \
569 Stack = &yyptr->Stack; \
570 yynewbytes = yystacksize * sizeof (Type) + YYSTACK_GAP_MAX; \
571 yyptr += yynewbytes / sizeof (*yyptr); \
573 while (0)
575 #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
578 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
579 # define YYSIZE_T __SIZE_TYPE__
580 #endif
581 #if ! defined (YYSIZE_T) && defined (size_t)
582 # define YYSIZE_T size_t
583 #endif
584 #if ! defined (YYSIZE_T)
585 # ifdef __cplusplus
586 # include <cstddef> /* INFRINGES ON USER NAME SPACE */
587 # define YYSIZE_T std::size_t
588 # else
589 # ifdef __STDC__
590 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
591 # define YYSIZE_T size_t
592 # endif
593 # endif
594 #endif
595 #if ! defined (YYSIZE_T)
596 # define YYSIZE_T unsigned int
597 #endif
599 #define yyerrok (yyerrstatus = 0)
600 #define yyclearin (yychar = YYEMPTY)
601 #define YYEMPTY -2
602 #define YYEOF 0
603 #define YYACCEPT goto yyacceptlab
604 #define YYABORT goto yyabortlab
605 #define YYERROR goto yyerrlab1
606 /* Like YYERROR except do call yyerror. This remains here temporarily
607 to ease the transition to the new meaning of YYERROR, for GCC.
608 Once GCC version 2 has supplanted version 1, this can go. */
609 #define YYFAIL goto yyerrlab
610 #define YYRECOVERING() (!!yyerrstatus)
611 #define YYBACKUP(Token, Value) \
612 do \
613 if (yychar == YYEMPTY && yylen == 1) \
615 yychar = (Token); \
616 yylval = (Value); \
617 yychar1 = YYTRANSLATE (yychar); \
618 YYPOPSTACK; \
619 goto yybackup; \
621 else \
623 yyerror ("syntax error: cannot back up"); \
624 YYERROR; \
626 while (0)
628 #define YYTERROR 1
629 #define YYERRCODE 256
632 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
633 are run).
635 When YYLLOC_DEFAULT is run, CURRENT is set the location of the
636 first token. By default, to implement support for ranges, extend
637 its range to the last symbol. */
639 #ifndef YYLLOC_DEFAULT
640 # define YYLLOC_DEFAULT(Current, Rhs, N) \
641 Current.last_line = Rhs[N].last_line; \
642 Current.last_column = Rhs[N].last_column;
643 #endif
646 /* YYLEX -- calling `yylex' with the right arguments. */
648 #if YYPURE
649 # if YYLSP_NEEDED
650 # ifdef YYLEX_PARAM
651 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
652 # else
653 # define YYLEX yylex (&yylval, &yylloc)
654 # endif
655 # else /* !YYLSP_NEEDED */
656 # ifdef YYLEX_PARAM
657 # define YYLEX yylex (&yylval, YYLEX_PARAM)
658 # else
659 # define YYLEX yylex (&yylval)
660 # endif
661 # endif /* !YYLSP_NEEDED */
662 #else /* !YYPURE */
663 # define YYLEX yylex ()
664 #endif /* !YYPURE */
667 /* Enable debugging if requested. */
668 #if YYDEBUG
670 # ifndef YYFPRINTF
671 # ifdef __cplusplus
672 # include <cstdio> /* INFRINGES ON USER NAME SPACE */
673 # else
674 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
675 # endif
676 # define YYFPRINTF YYSTD (fprintf)
677 # endif
679 # define YYDPRINTF(Args) \
680 do { \
681 if (yydebug) \
682 YYFPRINTF Args; \
683 } while (0)
684 /* Nonzero means print parse trace. [The following comment makes no
685 sense to me. Could someone clarify it? --akim] Since this is
686 uninitialized, it does not stop multiple parsers from coexisting.
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 #if ! defined (yyoverflow) && ! defined (yymemcpy)
714 # if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
715 # define yymemcpy __builtin_memcpy
716 # else /* not GNU C or C++ */
718 /* This is the most reliable way to avoid incompatibilities
719 in available built-in functions on various systems. */
720 static void
721 # if defined (__STDC__) || defined (__cplusplus)
722 yymemcpy (char *yyto, const char *yyfrom, YYSIZE_T yycount)
723 # else
724 yymemcpy (yyto, yyfrom, yycount)
725 char *yyto;
726 const char *yyfrom;
727 YYSIZE_T yycount;
728 # endif
730 register const char *yyf = yyfrom;
731 register char *yyt = yyto;
732 register YYSIZE_T yyi = yycount;
734 while (yyi-- != 0)
735 *yyt++ = *yyf++;
737 # endif
738 #endif
740 #ifdef YYERROR_VERBOSE
742 # ifndef yystrlen
743 # if defined (__GLIBC__) && defined (_STRING_H)
744 # define yystrlen strlen
745 # else
746 /* Return the length of YYSTR. */
747 static YYSIZE_T
748 # if defined (__STDC__) || defined (__cplusplus)
749 yystrlen (const char *yystr)
750 # else
751 yystrlen (yystr)
752 const char *yystr;
753 # endif
755 register const char *yys = yystr;
757 while (*yys++ != '\0')
758 continue;
760 return yys - yystr - 1;
762 # endif
763 # endif
765 # ifndef yystpcpy
766 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
767 # define yystpcpy stpcpy
768 # else
769 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
770 YYDEST. */
771 static char *
772 # if defined (__STDC__) || defined (__cplusplus)
773 yystpcpy (char *yydest, const char *yysrc)
774 # else
775 yystpcpy (yydest, yysrc)
776 char *yydest;
777 const char *yysrc;
778 # endif
780 register char *yyd = yydest;
781 register const char *yys = yysrc;
783 while ((*yyd++ = *yys++) != '\0')
784 continue;
786 return yyd - 1;
788 # endif
789 # endif
790 #endif
792 #line 341 "/usr/share/bison/bison.simple"
795 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
796 into yyparse. The argument should have type void *.
797 It should actually point to an object.
798 Grammar actions can access the variable by casting it
799 to the proper pointer type. */
801 #ifdef YYPARSE_PARAM
802 # ifdef __cplusplus
803 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
804 # define YYPARSE_PARAM_DECL
805 # else /* !__cplusplus */
806 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
807 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
808 # endif /* !__cplusplus */
809 #else /* !YYPARSE_PARAM */
810 # define YYPARSE_PARAM_ARG
811 # define YYPARSE_PARAM_DECL
812 #endif /* !YYPARSE_PARAM */
814 /* Prevent warning if -Wstrict-prototypes. */
815 #ifdef __GNUC__
816 # ifdef YYPARSE_PARAM
817 int yyparse (void *);
818 # else
819 int yyparse (void);
820 # endif
821 #endif
823 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
824 variables are global, or local to YYPARSE. */
826 #define YY_DECL_NON_LSP_VARIABLES \
827 /* The lookahead symbol. */ \
828 int yychar; \
830 /* The semantic value of the lookahead symbol. */ \
831 YYSTYPE yylval; \
833 /* Number of parse errors so far. */ \
834 int yynerrs;
836 #if YYLSP_NEEDED
837 # define YY_DECL_VARIABLES \
838 YY_DECL_NON_LSP_VARIABLES \
840 /* Location data for the lookahead symbol. */ \
841 YYLTYPE yylloc;
842 #else
843 # define YY_DECL_VARIABLES \
844 YY_DECL_NON_LSP_VARIABLES
845 #endif
848 /* If nonreentrant, generate the variables here. */
850 #if !YYPURE
851 YY_DECL_VARIABLES
852 #endif /* !YYPURE */
855 yyparse (YYPARSE_PARAM_ARG)
856 YYPARSE_PARAM_DECL
858 /* If reentrant, generate the variables here. */
859 #if YYPURE
860 YY_DECL_VARIABLES
861 #endif /* !YYPURE */
863 register int yystate;
864 register int yyn;
865 int yyresult;
866 /* Number of tokens to shift before error messages enabled. */
867 int yyerrstatus;
868 /* Lookahead token as an internal (translated) token number. */
869 int yychar1 = 0;
871 /* Three stacks and their tools:
872 `yyss': related to states,
873 `yyvs': related to semantic values,
874 `yyls': related to locations.
876 Refer to the stacks thru separate pointers, to allow yyoverflow
877 to reallocate them elsewhere. */
879 /* The state stack. */
880 short yyssa[YYINITDEPTH];
881 short *yyss = yyssa;
882 register short *yyssp;
884 /* The semantic value stack. */
885 YYSTYPE yyvsa[YYINITDEPTH];
886 YYSTYPE *yyvs = yyvsa;
887 register YYSTYPE *yyvsp;
889 #if YYLSP_NEEDED
890 /* The location stack. */
891 YYLTYPE yylsa[YYINITDEPTH];
892 YYLTYPE *yyls = yylsa;
893 YYLTYPE *yylsp;
894 #endif
896 #if YYLSP_NEEDED
897 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
898 #else
899 # define YYPOPSTACK (yyvsp--, yyssp--)
900 #endif
902 YYSIZE_T yystacksize = YYINITDEPTH;
905 /* The variables used to return semantic value and location from the
906 action routines. */
907 YYSTYPE yyval;
908 #if YYLSP_NEEDED
909 YYLTYPE yyloc;
910 #endif
912 /* When reducing, the number of symbols on the RHS of the reduced
913 rule. */
914 int yylen;
916 YYDPRINTF ((stderr, "Starting parse\n"));
918 yystate = 0;
919 yyerrstatus = 0;
920 yynerrs = 0;
921 yychar = YYEMPTY; /* Cause a token to be read. */
923 /* Initialize stack pointers.
924 Waste one element of value and location stack
925 so that they stay on the same level as the state stack.
926 The wasted elements are never initialized. */
928 yyssp = yyss;
929 yyvsp = yyvs;
930 #if YYLSP_NEEDED
931 yylsp = yyls;
932 #endif
933 goto yysetstate;
935 /*------------------------------------------------------------.
936 | yynewstate -- Push a new state, which is found in yystate. |
937 `------------------------------------------------------------*/
938 yynewstate:
939 /* In all cases, when you get here, the value and location stacks
940 have just been pushed. so pushing a state here evens the stacks.
942 yyssp++;
944 yysetstate:
945 *yyssp = yystate;
947 if (yyssp >= yyss + yystacksize - 1)
949 /* Get the current used size of the three stacks, in elements. */
950 YYSIZE_T yysize = yyssp - yyss + 1;
952 #ifdef yyoverflow
954 /* Give user a chance to reallocate the stack. Use copies of
955 these so that the &'s don't force the real ones into
956 memory. */
957 YYSTYPE *yyvs1 = yyvs;
958 short *yyss1 = yyss;
960 /* Each stack pointer address is followed by the size of the
961 data in use in that stack, in bytes. */
962 # if YYLSP_NEEDED
963 YYLTYPE *yyls1 = yyls;
964 /* This used to be a conditional around just the two extra args,
965 but that might be undefined if yyoverflow is a macro. */
966 yyoverflow ("parser stack overflow",
967 &yyss1, yysize * sizeof (*yyssp),
968 &yyvs1, yysize * sizeof (*yyvsp),
969 &yyls1, yysize * sizeof (*yylsp),
970 &yystacksize);
971 yyls = yyls1;
972 # else
973 yyoverflow ("parser stack overflow",
974 &yyss1, yysize * sizeof (*yyssp),
975 &yyvs1, yysize * sizeof (*yyvsp),
976 &yystacksize);
977 # endif
978 yyss = yyss1;
979 yyvs = yyvs1;
981 #else /* no yyoverflow */
982 /* Extend the stack our own way. */
983 if (yystacksize >= YYMAXDEPTH)
984 goto yyoverflowlab;
985 yystacksize *= 2;
986 if (yystacksize > YYMAXDEPTH)
987 yystacksize = YYMAXDEPTH;
990 short *yyss1 = yyss;
991 union yyalloc *yyptr =
992 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
993 if (! yyptr)
994 goto yyoverflowlab;
995 YYSTACK_RELOCATE (short, yyss);
996 YYSTACK_RELOCATE (YYSTYPE, yyvs);
997 # if YYLSP_NEEDED
998 YYSTACK_RELOCATE (YYLTYPE, yyls);
999 # endif
1000 # undef YYSTACK_RELOCATE
1001 if (yyss1 != yyssa)
1002 YYSTACK_FREE (yyss1);
1004 #endif /* no yyoverflow */
1006 yyssp = yyss + yysize - 1;
1007 yyvsp = yyvs + yysize - 1;
1008 #if YYLSP_NEEDED
1009 yylsp = yyls + yysize - 1;
1010 #endif
1012 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1013 (unsigned long int) yystacksize));
1015 if (yyssp >= yyss + yystacksize - 1)
1016 YYABORT;
1019 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1021 goto yybackup;
1024 /*-----------.
1025 | yybackup. |
1026 `-----------*/
1027 yybackup:
1029 /* Do appropriate processing given the current state. */
1030 /* Read a lookahead token if we need one and don't already have one. */
1031 /* yyresume: */
1033 /* First try to decide what to do without reference to lookahead token. */
1035 yyn = yypact[yystate];
1036 if (yyn == YYFLAG)
1037 goto yydefault;
1039 /* Not known => get a lookahead token if don't already have one. */
1041 /* yychar is either YYEMPTY or YYEOF
1042 or a valid token in external form. */
1044 if (yychar == YYEMPTY)
1046 YYDPRINTF ((stderr, "Reading a token: "));
1047 yychar = YYLEX;
1050 /* Convert token to internal form (in yychar1) for indexing tables with */
1052 if (yychar <= 0) /* This means end of input. */
1054 yychar1 = 0;
1055 yychar = YYEOF; /* Don't call YYLEX any more */
1057 YYDPRINTF ((stderr, "Now at end of input.\n"));
1059 else
1061 yychar1 = YYTRANSLATE (yychar);
1063 #if YYDEBUG
1064 /* We have to keep this `#if YYDEBUG', since we use variables
1065 which are defined only if `YYDEBUG' is set. */
1066 if (yydebug)
1068 YYFPRINTF (stderr, "Next token is %d (%s",
1069 yychar, yytname[yychar1]);
1070 /* Give the individual parser a way to print the precise
1071 meaning of a token, for further debugging info. */
1072 # ifdef YYPRINT
1073 YYPRINT (stderr, yychar, yylval);
1074 # endif
1075 YYFPRINTF (stderr, ")\n");
1077 #endif
1080 yyn += yychar1;
1081 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1082 goto yydefault;
1084 yyn = yytable[yyn];
1086 /* yyn is what to do for this token type in this state.
1087 Negative => reduce, -yyn is rule number.
1088 Positive => shift, yyn is new state.
1089 New state is final state => don't bother to shift,
1090 just return success.
1091 0, or most negative number => error. */
1093 if (yyn < 0)
1095 if (yyn == YYFLAG)
1096 goto yyerrlab;
1097 yyn = -yyn;
1098 goto yyreduce;
1100 else if (yyn == 0)
1101 goto yyerrlab;
1103 if (yyn == YYFINAL)
1104 YYACCEPT;
1106 /* Shift the lookahead token. */
1107 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
1108 yychar, yytname[yychar1]));
1110 /* Discard the token being shifted unless it is eof. */
1111 if (yychar != YYEOF)
1112 yychar = YYEMPTY;
1114 *++yyvsp = yylval;
1115 #if YYLSP_NEEDED
1116 *++yylsp = yylloc;
1117 #endif
1119 /* Count tokens shifted since error; after three, turn off error
1120 status. */
1121 if (yyerrstatus)
1122 yyerrstatus--;
1124 yystate = yyn;
1125 goto yynewstate;
1128 /*-----------------------------------------------------------.
1129 | yydefault -- do the default action for the current state. |
1130 `-----------------------------------------------------------*/
1131 yydefault:
1132 yyn = yydefact[yystate];
1133 if (yyn == 0)
1134 goto yyerrlab;
1135 goto yyreduce;
1138 /*-----------------------------.
1139 | yyreduce -- Do a reduction. |
1140 `-----------------------------*/
1141 yyreduce:
1142 /* yyn is the number of a rule to reduce with. */
1143 yylen = yyr2[yyn];
1145 /* If YYLEN is nonzero, implement the default value of the action:
1146 `$$ = $1'.
1148 Otherwise, the following line sets YYVAL to the semantic value of
1149 the lookahead token. This behavior is undocumented and Bison
1150 users should not rely upon it. Assigning to YYVAL
1151 unconditionally makes the parser a bit smaller, and it avoids a
1152 GCC warning that YYVAL may be used uninitialized. */
1153 yyval = yyvsp[1-yylen];
1155 #if YYLSP_NEEDED
1156 /* Similarly for the default location. Let the user run additional
1157 commands if for instance locations are ranges. */
1158 yyloc = yylsp[1-yylen];
1159 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1160 #endif
1162 #if YYDEBUG
1163 /* We have to keep this `#if YYDEBUG', since we use variables which
1164 are defined only if `YYDEBUG' is set. */
1165 if (yydebug)
1167 int yyi;
1169 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
1170 yyn, yyrline[yyn]);
1172 /* Print the symbols being reduced, and their result. */
1173 for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
1174 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1175 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1177 #endif
1179 switch (yyn) {
1181 case 4:
1182 #line 311 "itbl-parse.y"
1184 DBG (("line %d: entry pnum=%d type=%d name=%s value=x%x\n",
1185 insntbl_line, yyvsp[-4].num, yyvsp[-3].num, yyvsp[-2].str, yyvsp[-1].val));
1186 itbl_add_reg (yyvsp[-4].num, yyvsp[-3].num, yyvsp[-2].str, yyvsp[-1].val);
1188 break;
1189 case 5:
1190 #line 317 "itbl-parse.y"
1192 DBG (("line %d: entry pnum=%d type=INSN name=%s value=x%x",
1193 insntbl_line, yyvsp[-5].num, yyvsp[-3].str, yyvsp[-2].val));
1194 DBG ((" sbit=%d ebit=%d flags=0x%x\n", sbit, ebit, yyvsp[0].val));
1195 insn=itbl_add_insn (yyvsp[-5].num, yyvsp[-3].str, yyvsp[-2].val, sbit, ebit, yyvsp[0].val);
1197 break;
1198 case 12:
1199 #line 336 "itbl-parse.y"
1201 DBGL2 (("ftype\n"));
1202 yyval.num = yyvsp[0].num;
1204 break;
1205 case 13:
1206 #line 341 "itbl-parse.y"
1208 DBGL2 (("addr\n"));
1209 yyval.num = ADDR;
1211 break;
1212 case 14:
1213 #line 346 "itbl-parse.y"
1215 DBGL2 (("immed\n"));
1216 yyval.num = IMMED;
1218 break;
1219 case 15:
1220 #line 354 "itbl-parse.y"
1222 DBG (("line %d: field type=%d sbit=%d ebit=%d, flags=0x%x\n",
1223 insntbl_line, yyvsp[-2].num, sbit, ebit, yyvsp[0].val));
1224 itbl_add_operand (insn, yyvsp[-2].num, sbit, ebit, yyvsp[0].val);
1226 break;
1227 case 16:
1228 #line 363 "itbl-parse.y"
1230 yyval.val = yyvsp[-2].num | yyvsp[0].val;
1232 break;
1233 case 17:
1234 #line 367 "itbl-parse.y"
1236 yyval.val = yyvsp[-1].val;
1238 break;
1239 case 18:
1240 #line 371 "itbl-parse.y"
1242 yyval.val = yyvsp[0].num;
1244 break;
1245 case 19:
1246 #line 378 "itbl-parse.y"
1248 DBGL2 (("flags=%d\n", yyvsp[0].val));
1249 yyval.val = yyvsp[0].val;
1251 break;
1252 case 20:
1253 #line 383 "itbl-parse.y"
1255 yyval.val = 0;
1257 break;
1258 case 21:
1259 #line 390 "itbl-parse.y"
1261 DBGL2 (("range %d %d\n", yyvsp[-2].num, yyvsp[0].num));
1262 sbit = yyvsp[-2].num;
1263 ebit = yyvsp[0].num;
1265 break;
1266 case 22:
1267 #line 396 "itbl-parse.y"
1269 sbit = 31;
1270 ebit = 0;
1272 break;
1273 case 23:
1274 #line 404 "itbl-parse.y"
1276 DBGL2 (("pnum=%d\n",yyvsp[0].num));
1277 yyval.num = yyvsp[0].num;
1279 break;
1280 case 24:
1281 #line 412 "itbl-parse.y"
1283 DBGL2 (("dreg\n"));
1284 yyval.num = DREG;
1286 break;
1287 case 25:
1288 #line 417 "itbl-parse.y"
1290 DBGL2 (("creg\n"));
1291 yyval.num = CREG;
1293 break;
1294 case 26:
1295 #line 422 "itbl-parse.y"
1297 DBGL2 (("greg\n"));
1298 yyval.num = GREG;
1300 break;
1301 case 27:
1302 #line 430 "itbl-parse.y"
1304 DBGL2 (("name=%s\n",yyvsp[0].str));
1305 yyval.str = yyvsp[0].str;
1307 break;
1308 case 28:
1309 #line 438 "itbl-parse.y"
1311 DBGL2 (("num=%d\n",yyvsp[0].num));
1312 yyval.num = yyvsp[0].num;
1314 break;
1315 case 29:
1316 #line 446 "itbl-parse.y"
1318 DBGL2 (("val=x%x\n",yyvsp[0].num));
1319 yyval.val = yyvsp[0].num;
1321 break;
1324 #line 727 "/usr/share/bison/bison.simple"
1327 yyvsp -= yylen;
1328 yyssp -= yylen;
1329 #if YYLSP_NEEDED
1330 yylsp -= yylen;
1331 #endif
1333 #if YYDEBUG
1334 if (yydebug)
1336 short *yyssp1 = yyss - 1;
1337 YYFPRINTF (stderr, "state stack now");
1338 while (yyssp1 != yyssp)
1339 YYFPRINTF (stderr, " %d", *++yyssp1);
1340 YYFPRINTF (stderr, "\n");
1342 #endif
1344 *++yyvsp = yyval;
1345 #if YYLSP_NEEDED
1346 *++yylsp = yyloc;
1347 #endif
1349 /* Now `shift' the result of the reduction. Determine what state
1350 that goes to, based on the state we popped back to and the rule
1351 number reduced by. */
1353 yyn = yyr1[yyn];
1355 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1356 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1357 yystate = yytable[yystate];
1358 else
1359 yystate = yydefgoto[yyn - YYNTBASE];
1361 goto yynewstate;
1364 /*------------------------------------.
1365 | yyerrlab -- here on detecting error |
1366 `------------------------------------*/
1367 yyerrlab:
1368 /* If not already recovering from an error, report this error. */
1369 if (!yyerrstatus)
1371 ++yynerrs;
1373 #ifdef YYERROR_VERBOSE
1374 yyn = yypact[yystate];
1376 if (yyn > YYFLAG && yyn < YYLAST)
1378 YYSIZE_T yysize = 0;
1379 char *yymsg;
1380 int yyx, yycount;
1382 yycount = 0;
1383 /* Start YYX at -YYN if negative to avoid negative indexes in
1384 YYCHECK. */
1385 for (yyx = yyn < 0 ? -yyn : 0;
1386 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1387 if (yycheck[yyx + yyn] == yyx)
1388 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1389 yysize += yystrlen ("parse error, unexpected ") + 1;
1390 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
1391 yymsg = (char *) YYSTACK_ALLOC (yysize);
1392 if (yymsg != 0)
1394 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1395 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
1397 if (yycount < 5)
1399 yycount = 0;
1400 for (yyx = yyn < 0 ? -yyn : 0;
1401 yyx < (int) (sizeof (yytname) / sizeof (char *));
1402 yyx++)
1403 if (yycheck[yyx + yyn] == yyx)
1405 const char *yyq = ! yycount ? ", expecting " : " or ";
1406 yyp = yystpcpy (yyp, yyq);
1407 yyp = yystpcpy (yyp, yytname[yyx]);
1408 yycount++;
1411 yyerror (yymsg);
1412 YYSTACK_FREE (yymsg);
1414 else
1415 yyerror ("parse error; also virtual memory exhausted");
1417 else
1418 #endif /* defined (YYERROR_VERBOSE) */
1419 yyerror ("parse error");
1421 goto yyerrlab1;
1424 /*--------------------------------------------------.
1425 | yyerrlab1 -- error raised explicitly by an action |
1426 `--------------------------------------------------*/
1427 yyerrlab1:
1428 if (yyerrstatus == 3)
1430 /* If just tried and failed to reuse lookahead token after an
1431 error, discard it. */
1433 /* return failure if at end of input */
1434 if (yychar == YYEOF)
1435 YYABORT;
1436 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1437 yychar, yytname[yychar1]));
1438 yychar = YYEMPTY;
1441 /* Else will try to reuse lookahead token after shifting the error
1442 token. */
1444 yyerrstatus = 3; /* Each real token shifted decrements this */
1446 goto yyerrhandle;
1449 /*-------------------------------------------------------------------.
1450 | yyerrdefault -- current state does not do anything special for the |
1451 | error token. |
1452 `-------------------------------------------------------------------*/
1453 yyerrdefault:
1454 #if 0
1455 /* This is wrong; only states that explicitly want error tokens
1456 should shift them. */
1458 /* If its default is to accept any token, ok. Otherwise pop it. */
1459 yyn = yydefact[yystate];
1460 if (yyn)
1461 goto yydefault;
1462 #endif
1465 /*---------------------------------------------------------------.
1466 | yyerrpop -- pop the current state because it cannot handle the |
1467 | error token |
1468 `---------------------------------------------------------------*/
1469 yyerrpop:
1470 if (yyssp == yyss)
1471 YYABORT;
1472 yyvsp--;
1473 yystate = *--yyssp;
1474 #if YYLSP_NEEDED
1475 yylsp--;
1476 #endif
1478 #if YYDEBUG
1479 if (yydebug)
1481 short *yyssp1 = yyss - 1;
1482 YYFPRINTF (stderr, "Error: state stack now");
1483 while (yyssp1 != yyssp)
1484 YYFPRINTF (stderr, " %d", *++yyssp1);
1485 YYFPRINTF (stderr, "\n");
1487 #endif
1489 /*--------------.
1490 | yyerrhandle. |
1491 `--------------*/
1492 yyerrhandle:
1493 yyn = yypact[yystate];
1494 if (yyn == YYFLAG)
1495 goto yyerrdefault;
1497 yyn += YYTERROR;
1498 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1499 goto yyerrdefault;
1501 yyn = yytable[yyn];
1502 if (yyn < 0)
1504 if (yyn == YYFLAG)
1505 goto yyerrpop;
1506 yyn = -yyn;
1507 goto yyreduce;
1509 else if (yyn == 0)
1510 goto yyerrpop;
1512 if (yyn == YYFINAL)
1513 YYACCEPT;
1515 YYDPRINTF ((stderr, "Shifting error token, "));
1517 *++yyvsp = yylval;
1518 #if YYLSP_NEEDED
1519 *++yylsp = yylloc;
1520 #endif
1522 yystate = yyn;
1523 goto yynewstate;
1526 /*-------------------------------------.
1527 | yyacceptlab -- YYACCEPT comes here. |
1528 `-------------------------------------*/
1529 yyacceptlab:
1530 yyresult = 0;
1531 goto yyreturn;
1533 /*-----------------------------------.
1534 | yyabortlab -- YYABORT comes here. |
1535 `-----------------------------------*/
1536 yyabortlab:
1537 yyresult = 1;
1538 goto yyreturn;
1540 /*---------------------------------------------.
1541 | yyoverflowab -- parser overflow comes here. |
1542 `---------------------------------------------*/
1543 yyoverflowlab:
1544 yyerror ("parser stack overflow");
1545 yyresult = 2;
1546 /* Fall through. */
1548 yyreturn:
1549 #ifndef yyoverflow
1550 if (yyss != yyssa)
1551 YYSTACK_FREE (yyss);
1552 #endif
1553 return yyresult;
1555 #line 451 "itbl-parse.y"
1558 static int
1559 yyerror (msg)
1560 const char *msg;
1562 printf ("line %d: %s\n", insntbl_line, msg);
1563 return 0;