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
88 /* Copy the first part of user declarations. */
94 static char writecode
;
98 static char *oldrepeat
;
101 static char *names
[] = {" ","[n]","[n][m]"};
102 static char *pnames
[]= {"","*","**"};
104 static int yyerror (char *s
);
105 extern int yylex (void);
108 /* Enabling traces. */
113 /* Enabling verbose error messages. */
114 #ifdef YYERROR_VERBOSE
115 # undef YYERROR_VERBOSE
116 # define YYERROR_VERBOSE 1
118 # define YYERROR_VERBOSE 0
121 /* Enabling the token table. */
122 #ifndef YYTOKEN_TABLE
123 # define YYTOKEN_TABLE 0
126 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
127 typedef union YYSTYPE
133 /* Line 187 of yacc.c. */
134 #line 135 "sysinfo.c"
136 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
137 # define YYSTYPE_IS_DECLARED 1
138 # define YYSTYPE_IS_TRIVIAL 1
143 /* Copy the second part of user declarations. */
146 /* Line 216 of yacc.c. */
147 #line 148 "sysinfo.c"
154 typedef YYTYPE_UINT8 yytype_uint8
;
156 typedef unsigned char yytype_uint8
;
160 typedef YYTYPE_INT8 yytype_int8
;
161 #elif (defined __STDC__ || defined __C99__FUNC__ \
162 || defined __cplusplus || defined _MSC_VER)
163 typedef signed char yytype_int8
;
165 typedef short int yytype_int8
;
169 typedef YYTYPE_UINT16 yytype_uint16
;
171 typedef unsigned short int yytype_uint16
;
175 typedef YYTYPE_INT16 yytype_int16
;
177 typedef short int yytype_int16
;
181 # ifdef __SIZE_TYPE__
182 # define YYSIZE_T __SIZE_TYPE__
183 # elif defined size_t
184 # define YYSIZE_T size_t
185 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
186 || defined __cplusplus || defined _MSC_VER)
187 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
188 # define YYSIZE_T size_t
190 # define YYSIZE_T unsigned int
194 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
199 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
200 # define YY_(msgid) dgettext ("bison-runtime", msgid)
204 # define YY_(msgid) msgid
208 /* Suppress unused-variable warnings by "using" E. */
209 #if ! defined lint || defined __GNUC__
210 # define YYUSE(e) ((void) (e))
212 # define YYUSE(e) /* empty */
215 /* Identity function, used to suppress warnings about constant conditions. */
219 #if (defined __STDC__ || defined __C99__FUNC__ \
220 || defined __cplusplus || defined _MSC_VER)
233 #if ! defined yyoverflow || YYERROR_VERBOSE
235 /* The parser invokes alloca or malloc; define the necessary symbols. */
237 # ifdef YYSTACK_USE_ALLOCA
238 # if YYSTACK_USE_ALLOCA
240 # define YYSTACK_ALLOC __builtin_alloca
241 # elif defined __BUILTIN_VA_ARG_INCR
242 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
244 # define YYSTACK_ALLOC __alloca
245 # elif defined _MSC_VER
246 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
247 # define alloca _alloca
249 # define YYSTACK_ALLOC alloca
250 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
251 || defined __cplusplus || defined _MSC_VER)
252 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
261 # ifdef YYSTACK_ALLOC
262 /* Pacify GCC's `empty if-body' warning. */
263 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
264 # ifndef YYSTACK_ALLOC_MAXIMUM
265 /* The OS might guarantee only one guard page at the bottom of the stack,
266 and a page size can be as small as 4096 bytes. So we cannot safely
267 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
268 to allow for a few compiler-allocated temporary stack slots. */
269 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
272 # define YYSTACK_ALLOC YYMALLOC
273 # define YYSTACK_FREE YYFREE
274 # ifndef YYSTACK_ALLOC_MAXIMUM
275 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
277 # if (defined __cplusplus && ! defined _STDLIB_H \
278 && ! ((defined YYMALLOC || defined malloc) \
279 && (defined YYFREE || defined free)))
280 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
286 # define YYMALLOC malloc
287 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
288 || defined __cplusplus || defined _MSC_VER)
289 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
294 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
295 || defined __cplusplus || defined _MSC_VER)
296 void free (void *); /* INFRINGES ON USER NAME SPACE */
300 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
303 #if (! defined yyoverflow \
304 && (! defined __cplusplus \
305 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
307 /* A type that is properly aligned for any stack member. */
314 /* The size of the maximum gap between one aligned stack and the next. */
315 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
317 /* The size of an array large to enough to hold all stacks, each with
319 # define YYSTACK_BYTES(N) \
320 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
321 + YYSTACK_GAP_MAXIMUM)
323 /* Copy COUNT objects from FROM to TO. The source and destination do
326 # if defined __GNUC__ && 1 < __GNUC__
327 # define YYCOPY(To, From, Count) \
328 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
330 # define YYCOPY(To, From, Count) \
334 for (yyi = 0; yyi < (Count); yyi++) \
335 (To)[yyi] = (From)[yyi]; \
341 /* Relocate STACK from its old location to the new one. The
342 local variables YYSIZE and YYSTACKSIZE give the old and new number of
343 elements in the stack, and YYPTR gives the new location of the
344 stack. Advance YYPTR to a properly aligned location for the next
346 # define YYSTACK_RELOCATE(Stack) \
349 YYSIZE_T yynewbytes; \
350 YYCOPY (&yyptr->Stack, Stack, yysize); \
351 Stack = &yyptr->Stack; \
352 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
353 yyptr += yynewbytes / sizeof (*yyptr); \
359 /* YYFINAL -- State number of the termination state. */
361 /* YYLAST -- Last index in YYTABLE. */
364 /* YYNTOKENS -- Number of terminals. */
366 /* YYNNTS -- Number of nonterminals. */
368 /* YYNRULES -- Number of rules. */
370 /* YYNRULES -- Number of states. */
373 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
375 #define YYMAXUTOK 263
377 #define YYTRANSLATE(YYX) \
378 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
380 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
381 static const yytype_uint8 yytranslate
[] =
383 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
384 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
385 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
386 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
387 5, 6, 2, 2, 2, 2, 2, 2, 2, 2,
388 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
389 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
390 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
391 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
392 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
393 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
394 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
395 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
396 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
397 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
398 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
399 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
400 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
401 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
402 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
403 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
404 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
405 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
406 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
407 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
408 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
413 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
415 static const yytype_uint8 yyprhs
[] =
417 0, 0, 3, 4, 7, 10, 11, 12, 19, 22,
418 25, 28, 29, 30, 37, 38, 45, 46, 57, 59,
419 60, 64, 67, 71, 72, 73, 77, 78
422 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
423 static const yytype_int8 yyrhs
[] =
425 12, 0, -1, -1, 13, 14, -1, 15, 14, -1,
426 -1, -1, 5, 8, 9, 16, 17, 6, -1, 22,
427 17, -1, 20, 17, -1, 18, 17, -1, -1, -1,
428 5, 4, 8, 19, 17, 6, -1, -1, 5, 3,
429 8, 21, 17, 6, -1, -1, 5, 25, 5, 24,
430 26, 6, 27, 23, 28, 6, -1, 7, -1, -1,
431 5, 8, 6, -1, 9, 10, -1, 5, 8, 6,
432 -1, -1, -1, 5, 29, 6, -1, -1, 29, 5,
436 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
437 static const yytype_uint16 yyrline
[] =
439 0, 54, 54, 54, 92, 93, 98, 97, 175, 176,
440 177, 178, 182, 181, 229, 228, 256, 255, 363, 364,
441 368, 373, 379, 380, 383, 384, 386, 388
445 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
446 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
447 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
448 static const char *const yytname
[] =
450 "$end", "error", "$undefined", "COND", "REPEAT", "'('", "')'", "TYPE",
451 "NAME", "NUMBER", "UNIT", "$accept", "top", "@1", "it_list", "it", "@2",
452 "it_field_list", "repeat_it_field", "@3", "cond_it_field", "@4",
453 "it_field", "@5", "attr_type", "attr_desc", "attr_size", "attr_id",
454 "enums", "enum_list", 0
459 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
461 static const yytype_uint16 yytoknum
[] =
463 0, 256, 257, 258, 259, 40, 41, 260, 261, 262,
468 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
469 static const yytype_uint8 yyr1
[] =
471 0, 11, 13, 12, 14, 14, 16, 15, 17, 17,
472 17, 17, 19, 18, 21, 20, 23, 22, 24, 24,
473 25, 26, 27, 27, 28, 28, 29, 29
476 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
477 static const yytype_uint8 yyr2
[] =
479 0, 2, 0, 2, 2, 0, 0, 6, 2, 2,
480 2, 0, 0, 6, 0, 6, 0, 10, 1, 0,
481 3, 2, 3, 0, 0, 3, 0, 5
484 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
485 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
486 means the default is an error. */
487 static const yytype_uint8 yydefact
[] =
489 2, 0, 5, 1, 0, 3, 5, 0, 4, 6,
490 11, 0, 0, 11, 11, 11, 0, 0, 0, 0,
491 7, 10, 9, 8, 14, 12, 0, 19, 11, 11,
492 20, 18, 0, 0, 0, 0, 0, 15, 13, 21,
493 23, 0, 16, 0, 24, 22, 26, 0, 0, 17,
497 /* YYDEFGOTO[NTERM-NUM]. */
498 static const yytype_int8 yydefgoto
[] =
500 -1, 1, 2, 5, 6, 10, 12, 13, 29, 14,
501 28, 15, 44, 32, 19, 36, 42, 47, 48
504 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
506 #define YYPACT_NINF -14
507 static const yytype_int8 yypact
[] =
509 -14, 8, 4, -14, 2, -14, 4, 3, -14, -14,
510 6, 0, 7, 6, 6, 6, 9, 10, 11, 15,
511 -14, -14, -14, -14, -14, -14, 16, 14, 6, 6,
512 -14, -14, 5, 17, 18, 19, 20, -14, -14, -14,
513 22, 23, -14, 24, 27, -14, -14, 28, 1, -14,
517 /* YYPGOTO[NTERM-NUM]. */
518 static const yytype_int8 yypgoto
[] =
520 -14, -14, -14, 32, -14, -14, -13, -14, -14, -14,
521 -14, -14, -14, -14, -14, -14, -14, -14, -14
524 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
525 positive, shift that token. If negative, reduce the rule which
526 number is the opposite. If zero, do what YYDEFACT says.
527 If YYTABLE_NINF, syntax error. */
528 #define YYTABLE_NINF -1
529 static const yytype_uint8 yytable
[] =
531 21, 22, 23, 16, 17, 18, 50, 51, 3, 4,
532 7, 11, 9, 20, 35, 33, 34, 24, 25, 26,
533 27, 31, 30, 37, 38, 0, 40, 41, 0, 39,
534 45, 43, 46, 52, 49, 0, 54, 53, 8
537 static const yytype_int8 yycheck
[] =
539 13, 14, 15, 3, 4, 5, 5, 6, 0, 5,
540 8, 5, 9, 6, 9, 28, 29, 8, 8, 8,
541 5, 7, 6, 6, 6, -1, 6, 5, -1, 10,
542 6, 8, 5, 8, 6, -1, 6, 8, 6
545 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
546 symbol of state STATE-NUM. */
547 static const yytype_uint8 yystos
[] =
549 0, 12, 13, 0, 5, 14, 15, 8, 14, 9,
550 16, 5, 17, 18, 20, 22, 3, 4, 5, 25,
551 6, 17, 17, 17, 8, 8, 8, 5, 21, 19,
552 6, 7, 24, 17, 17, 9, 26, 6, 6, 10,
553 6, 5, 27, 8, 23, 6, 5, 28, 29, 6,
557 #define yyerrok (yyerrstatus = 0)
558 #define yyclearin (yychar = YYEMPTY)
562 #define YYACCEPT goto yyacceptlab
563 #define YYABORT goto yyabortlab
564 #define YYERROR goto yyerrorlab
567 /* Like YYERROR except do call yyerror. This remains here temporarily
568 to ease the transition to the new meaning of YYERROR, for GCC.
569 Once GCC version 2 has supplanted version 1, this can go. */
571 #define YYFAIL goto yyerrlab
573 #define YYRECOVERING() (!!yyerrstatus)
575 #define YYBACKUP(Token, Value) \
577 if (yychar == YYEMPTY && yylen == 1) \
581 yytoken = YYTRANSLATE (yychar); \
587 yyerror (YY_("syntax error: cannot back up")); \
594 #define YYERRCODE 256
597 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
598 If N is 0, then set CURRENT to the empty location which ends
599 the previous symbol: RHS[0] (always defined). */
601 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
602 #ifndef YYLLOC_DEFAULT
603 # define YYLLOC_DEFAULT(Current, Rhs, N) \
607 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
608 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
609 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
610 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
614 (Current).first_line = (Current).last_line = \
615 YYRHSLOC (Rhs, 0).last_line; \
616 (Current).first_column = (Current).last_column = \
617 YYRHSLOC (Rhs, 0).last_column; \
623 /* YY_LOCATION_PRINT -- Print the location on the stream.
624 This macro was not mandated originally: define only if we know
625 we won't break user code: when these are the locations we know. */
627 #ifndef YY_LOCATION_PRINT
628 # if YYLTYPE_IS_TRIVIAL
629 # define YY_LOCATION_PRINT(File, Loc) \
630 fprintf (File, "%d.%d-%d.%d", \
631 (Loc).first_line, (Loc).first_column, \
632 (Loc).last_line, (Loc).last_column)
634 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
639 /* YYLEX -- calling `yylex' with the right arguments. */
642 # define YYLEX yylex (YYLEX_PARAM)
644 # define YYLEX yylex ()
647 /* Enable debugging if requested. */
651 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
652 # define YYFPRINTF fprintf
655 # define YYDPRINTF(Args) \
661 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
665 YYFPRINTF (stderr, "%s ", Title); \
666 yy_symbol_print (stderr, \
668 YYFPRINTF (stderr, "\n"); \
673 /*--------------------------------.
674 | Print this symbol on YYOUTPUT. |
675 `--------------------------------*/
678 #if (defined __STDC__ || defined __C99__FUNC__ \
679 || defined __cplusplus || defined _MSC_VER)
681 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
684 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
)
687 YYSTYPE
const * const yyvaluep
;
693 if (yytype
< YYNTOKENS
)
694 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
706 /*--------------------------------.
707 | Print this symbol on YYOUTPUT. |
708 `--------------------------------*/
710 #if (defined __STDC__ || defined __C99__FUNC__ \
711 || defined __cplusplus || defined _MSC_VER)
713 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
716 yy_symbol_print (yyoutput
, yytype
, yyvaluep
)
719 YYSTYPE
const * const yyvaluep
;
722 if (yytype
< YYNTOKENS
)
723 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
725 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
727 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
);
728 YYFPRINTF (yyoutput
, ")");
731 /*------------------------------------------------------------------.
732 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
734 `------------------------------------------------------------------*/
736 #if (defined __STDC__ || defined __C99__FUNC__ \
737 || defined __cplusplus || defined _MSC_VER)
739 yy_stack_print (yytype_int16
*bottom
, yytype_int16
*top
)
742 yy_stack_print (bottom
, top
)
743 yytype_int16
*bottom
;
747 YYFPRINTF (stderr
, "Stack now");
748 for (; bottom
<= top
; ++bottom
)
749 YYFPRINTF (stderr
, " %d", *bottom
);
750 YYFPRINTF (stderr
, "\n");
753 # define YY_STACK_PRINT(Bottom, Top) \
756 yy_stack_print ((Bottom), (Top)); \
760 /*------------------------------------------------.
761 | Report that the YYRULE is going to be reduced. |
762 `------------------------------------------------*/
764 #if (defined __STDC__ || defined __C99__FUNC__ \
765 || defined __cplusplus || defined _MSC_VER)
767 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
)
770 yy_reduce_print (yyvsp
, yyrule
)
775 int yynrhs
= yyr2
[yyrule
];
777 unsigned long int yylno
= yyrline
[yyrule
];
778 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
780 /* The symbols being reduced. */
781 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
783 fprintf (stderr
, " $%d = ", yyi
+ 1);
784 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
785 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
787 fprintf (stderr
, "\n");
791 # define YY_REDUCE_PRINT(Rule) \
794 yy_reduce_print (yyvsp, Rule); \
797 /* Nonzero means print parse trace. It is left uninitialized so that
798 multiple parsers can coexist. */
801 # define YYDPRINTF(Args)
802 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
803 # define YY_STACK_PRINT(Bottom, Top)
804 # define YY_REDUCE_PRINT(Rule)
805 #endif /* !YYDEBUG */
808 /* YYINITDEPTH -- initial size of the parser's stacks. */
810 # define YYINITDEPTH 200
813 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
814 if the built-in stack extension method is used).
816 Do not make this value too large; the results are undefined if
817 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
818 evaluated with infinite-precision integer arithmetic. */
821 # define YYMAXDEPTH 10000
829 # if defined __GLIBC__ && defined _STRING_H
830 # define yystrlen strlen
832 /* Return the length of YYSTR. */
833 #if (defined __STDC__ || defined __C99__FUNC__ \
834 || defined __cplusplus || defined _MSC_VER)
836 yystrlen (const char *yystr
)
844 for (yylen
= 0; yystr
[yylen
]; yylen
++)
852 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
853 # define yystpcpy stpcpy
855 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
857 #if (defined __STDC__ || defined __C99__FUNC__ \
858 || defined __cplusplus || defined _MSC_VER)
860 yystpcpy (char *yydest
, const char *yysrc
)
863 yystpcpy (yydest
, yysrc
)
869 const char *yys
= yysrc
;
871 while ((*yyd
++ = *yys
++) != '\0')
880 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
881 quotes and backslashes, so that it's suitable for yyerror. The
882 heuristic is that double-quoting is unnecessary unless the string
883 contains an apostrophe, a comma, or backslash (other than
884 backslash-backslash). YYSTR is taken from yytname. If YYRES is
885 null, do not copy; instead, return the length of what the result
888 yytnamerr (char *yyres
, const char *yystr
)
893 char const *yyp
= yystr
;
900 goto do_not_strip_quotes
;
904 goto do_not_strip_quotes
;
917 do_not_strip_quotes
: ;
921 return yystrlen (yystr
);
923 return yystpcpy (yyres
, yystr
) - yyres
;
927 /* Copy into YYRESULT an error message about the unexpected token
928 YYCHAR while in state YYSTATE. Return the number of bytes copied,
929 including the terminating null byte. If YYRESULT is null, do not
930 copy anything; just return the number of bytes that would be
931 copied. As a special case, return 0 if an ordinary "syntax error"
932 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
935 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
937 int yyn
= yypact
[yystate
];
939 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
943 int yytype
= YYTRANSLATE (yychar
);
944 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
945 YYSIZE_T yysize
= yysize0
;
947 int yysize_overflow
= 0;
948 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
949 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
953 /* This is so xgettext sees the translatable formats that are
954 constructed on the fly. */
955 YY_("syntax error, unexpected %s");
956 YY_("syntax error, unexpected %s, expecting %s");
957 YY_("syntax error, unexpected %s, expecting %s or %s");
958 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
959 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
963 static char const yyunexpected
[] = "syntax error, unexpected %s";
964 static char const yyexpecting
[] = ", expecting %s";
965 static char const yyor
[] = " or %s";
966 char yyformat
[sizeof yyunexpected
967 + sizeof yyexpecting
- 1
968 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
969 * (sizeof yyor
- 1))];
970 char const *yyprefix
= yyexpecting
;
972 /* Start YYX at -YYN if negative to avoid negative indexes in
974 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
976 /* Stay within bounds of both yycheck and yytname. */
977 int yychecklim
= YYLAST
- yyn
+ 1;
978 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
981 yyarg
[0] = yytname
[yytype
];
982 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
984 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
985 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
987 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
991 yyformat
[sizeof yyunexpected
- 1] = '\0';
994 yyarg
[yycount
++] = yytname
[yyx
];
995 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
996 yysize_overflow
|= (yysize1
< yysize
);
998 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1002 yyf
= YY_(yyformat
);
1003 yysize1
= yysize
+ yystrlen (yyf
);
1004 yysize_overflow
|= (yysize1
< yysize
);
1007 if (yysize_overflow
)
1008 return YYSIZE_MAXIMUM
;
1012 /* Avoid sprintf, as that infringes on the user's name space.
1013 Don't have undefined behavior even if the translation
1014 produced a string with the wrong number of "%s"s. */
1015 char *yyp
= yyresult
;
1017 while ((*yyp
= *yyf
) != '\0')
1019 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1021 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1034 #endif /* YYERROR_VERBOSE */
1037 /*-----------------------------------------------.
1038 | Release the memory associated to this symbol. |
1039 `-----------------------------------------------*/
1042 #if (defined __STDC__ || defined __C99__FUNC__ \
1043 || defined __cplusplus || defined _MSC_VER)
1045 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
)
1048 yydestruct (yymsg
, yytype
, yyvaluep
)
1058 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1069 /* Prevent warnings from -Wmissing-prototypes. */
1071 #ifdef YYPARSE_PARAM
1072 #if defined __STDC__ || defined __cplusplus
1073 int yyparse (void *YYPARSE_PARAM
);
1077 #else /* ! YYPARSE_PARAM */
1078 #if defined __STDC__ || defined __cplusplus
1083 #endif /* ! YYPARSE_PARAM */
1087 /* The look-ahead symbol. */
1090 /* The semantic value of the look-ahead symbol. */
1093 /* Number of syntax errors so far. */
1102 #ifdef YYPARSE_PARAM
1103 #if (defined __STDC__ || defined __C99__FUNC__ \
1104 || defined __cplusplus || defined _MSC_VER)
1106 yyparse (void *YYPARSE_PARAM
)
1109 yyparse (YYPARSE_PARAM
)
1110 void *YYPARSE_PARAM
;
1112 #else /* ! YYPARSE_PARAM */
1113 #if (defined __STDC__ || defined __C99__FUNC__ \
1114 || defined __cplusplus || defined _MSC_VER)
1128 /* Number of tokens to shift before error messages enabled. */
1130 /* Look-ahead token as an internal (translated) token number. */
1133 /* Buffer for error messages, and its allocated size. */
1135 char *yymsg
= yymsgbuf
;
1136 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1139 /* Three stacks and their tools:
1140 `yyss': related to states,
1141 `yyvs': related to semantic values,
1142 `yyls': related to locations.
1144 Refer to the stacks thru separate pointers, to allow yyoverflow
1145 to reallocate them elsewhere. */
1147 /* The state stack. */
1148 yytype_int16 yyssa
[YYINITDEPTH
];
1149 yytype_int16
*yyss
= yyssa
;
1150 yytype_int16
*yyssp
;
1152 /* The semantic value stack. */
1153 YYSTYPE yyvsa
[YYINITDEPTH
];
1154 YYSTYPE
*yyvs
= yyvsa
;
1159 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1161 YYSIZE_T yystacksize
= YYINITDEPTH
;
1163 /* The variables used to return semantic value and location from the
1168 /* The number of symbols on the RHS of the reduced rule.
1169 Keep to zero when no symbol should be popped. */
1172 YYDPRINTF ((stderr
, "Starting parse\n"));
1177 yychar
= YYEMPTY
; /* Cause a token to be read. */
1179 /* Initialize stack pointers.
1180 Waste one element of value and location stack
1181 so that they stay on the same level as the state stack.
1182 The wasted elements are never initialized. */
1189 /*------------------------------------------------------------.
1190 | yynewstate -- Push a new state, which is found in yystate. |
1191 `------------------------------------------------------------*/
1193 /* In all cases, when you get here, the value and location stacks
1194 have just been pushed. So pushing a state here evens the stacks. */
1200 if (yyss
+ yystacksize
- 1 <= yyssp
)
1202 /* Get the current used size of the three stacks, in elements. */
1203 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1207 /* Give user a chance to reallocate the stack. Use copies of
1208 these so that the &'s don't force the real ones into
1210 YYSTYPE
*yyvs1
= yyvs
;
1211 yytype_int16
*yyss1
= yyss
;
1214 /* Each stack pointer address is followed by the size of the
1215 data in use in that stack, in bytes. This used to be a
1216 conditional around just the two extra args, but that might
1217 be undefined if yyoverflow is a macro. */
1218 yyoverflow (YY_("memory exhausted"),
1219 &yyss1
, yysize
* sizeof (*yyssp
),
1220 &yyvs1
, yysize
* sizeof (*yyvsp
),
1227 #else /* no yyoverflow */
1228 # ifndef YYSTACK_RELOCATE
1229 goto yyexhaustedlab
;
1231 /* Extend the stack our own way. */
1232 if (YYMAXDEPTH
<= yystacksize
)
1233 goto yyexhaustedlab
;
1235 if (YYMAXDEPTH
< yystacksize
)
1236 yystacksize
= YYMAXDEPTH
;
1239 yytype_int16
*yyss1
= yyss
;
1240 union yyalloc
*yyptr
=
1241 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1243 goto yyexhaustedlab
;
1244 YYSTACK_RELOCATE (yyss
);
1245 YYSTACK_RELOCATE (yyvs
);
1247 # undef YYSTACK_RELOCATE
1249 YYSTACK_FREE (yyss1
);
1252 #endif /* no yyoverflow */
1254 yyssp
= yyss
+ yysize
- 1;
1255 yyvsp
= yyvs
+ yysize
- 1;
1258 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1259 (unsigned long int) yystacksize
));
1261 if (yyss
+ yystacksize
- 1 <= yyssp
)
1265 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1274 /* Do appropriate processing given the current state. Read a
1275 look-ahead token if we need one and don't already have one. */
1277 /* First try to decide what to do without reference to look-ahead token. */
1278 yyn
= yypact
[yystate
];
1279 if (yyn
== YYPACT_NINF
)
1282 /* Not known => get a look-ahead token if don't already have one. */
1284 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1285 if (yychar
== YYEMPTY
)
1287 YYDPRINTF ((stderr
, "Reading a token: "));
1291 if (yychar
<= YYEOF
)
1293 yychar
= yytoken
= YYEOF
;
1294 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1298 yytoken
= YYTRANSLATE (yychar
);
1299 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1302 /* If the proper action on seeing token YYTOKEN is to reduce or to
1303 detect an error, take that action. */
1305 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1310 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1319 /* Count tokens shifted since error; after three, turn off error
1324 /* Shift the look-ahead token. */
1325 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1327 /* Discard the shifted token unless it is eof. */
1328 if (yychar
!= YYEOF
)
1337 /*-----------------------------------------------------------.
1338 | yydefault -- do the default action for the current state. |
1339 `-----------------------------------------------------------*/
1341 yyn
= yydefact
[yystate
];
1347 /*-----------------------------.
1348 | yyreduce -- Do a reduction. |
1349 `-----------------------------*/
1351 /* yyn is the number of a rule to reduce with. */
1354 /* If YYLEN is nonzero, implement the default value of the action:
1357 Otherwise, the following line sets YYVAL to garbage.
1358 This behavior is undocumented and Bison
1359 users should not rely upon it. Assigning to YYVAL
1360 unconditionally makes the parser a bit smaller, and it avoids a
1361 GCC warning that YYVAL may be used uninitialized. */
1362 yyval
= yyvsp
[1-yylen
];
1365 YY_REDUCE_PRINT (yyn
);
1369 #line 54 "sysinfo.y"
1374 printf("#ifdef SYSROFF_SWAP_IN\n");
1377 printf("#ifdef SYSROFF_p\n");
1382 printf("#ifdef SYSROFF_SWAP_OUT\n");
1385 printf("#ifdef SYSROFF_PRINT\n");
1386 printf("#include <stdio.h>\n");
1387 printf("#include <stdlib.h>\n");
1388 printf("#include <ansidecl.h>\n");
1395 #line 76 "sysinfo.y"
1397 switch (writecode
) {
1411 #line 98 "sysinfo.y"
1413 it
= (yyvsp
[(2) - (3)].s
); code
= (yyvsp
[(3) - (3)].i
);
1417 printf("\n\n\n#define IT_%s_CODE 0x%x\n", it
,code
);
1418 printf("struct IT_%s;\n", it
);
1419 printf("extern void sysroff_swap_%s_in PARAMS ((struct IT_%s *));\n",
1420 (yyvsp
[(2) - (3)].s
), it
);
1421 printf("extern void sysroff_swap_%s_out PARAMS ((FILE *, struct IT_%s *));\n",
1422 (yyvsp
[(2) - (3)].s
), it
);
1423 printf("extern void sysroff_print_%s_out PARAMS ((struct IT_%s *));\n",
1424 (yyvsp
[(2) - (3)].s
), it
);
1425 printf("struct IT_%s { \n", it
);
1428 printf("void sysroff_swap_%s_in(ptr)\n",(yyvsp
[(2) - (3)].s
));
1429 printf("struct IT_%s *ptr;\n", it
);
1431 printf("unsigned char raw[255];\n");
1432 printf("\tint idx = 0 ;\n");
1433 printf("\tint size;\n");
1434 printf("memset(raw,0,255);\n");
1435 printf("memset(ptr,0,sizeof(*ptr));\n");
1436 printf("size = fillup(raw);\n");
1439 printf("void sysroff_swap_%s_out(file,ptr)\n",(yyvsp
[(2) - (3)].s
));
1440 printf("FILE * file;\n");
1441 printf("struct IT_%s *ptr;\n", it
);
1443 printf("\tunsigned char raw[255];\n");
1444 printf("\tint idx = 16 ;\n");
1445 printf("\tmemset (raw, 0, 255);\n");
1446 printf("\tcode = IT_%s_CODE;\n", it
);
1449 printf("void sysroff_swap_%s_out(abfd,ptr)\n",(yyvsp
[(2) - (3)].s
));
1450 printf("bfd * abfd;\n");
1451 printf("struct IT_%s *ptr;\n",it
);
1453 printf("int idx = 0 ;\n");
1456 printf("void sysroff_print_%s_out(ptr)\n",(yyvsp
[(2) - (3)].s
));
1457 printf("struct IT_%s *ptr;\n", it
);
1459 printf("itheader(\"%s\", IT_%s_CODE);\n",(yyvsp
[(2) - (3)].s
),(yyvsp
[(2) - (3)].s
));
1470 #line 155 "sysinfo.y"
1472 switch (writecode
) {
1477 printf("\tchecksum(file,raw, idx, IT_%s_CODE);\n", it
);
1489 #line 182 "sysinfo.y"
1496 printf("\tprintf(\"repeat %%d\\n\", %s);\n",(yyvsp
[(3) - (3)].s
));
1498 printf("\tprintf(\"repeat %%d\\n\", %s[n]);\n",(yyvsp
[(3) - (3)].s
));
1505 printf("\t{ int n; for (n = 0; n < %s; n++) {\n", (yyvsp
[(3) - (3)].s
));
1508 printf("\t{ int m; for (m = 0; m < %s[n]; m++) {\n", (yyvsp
[(3) - (3)].s
));
1515 repeat
= (yyvsp
[(3) - (3)].s
);
1520 #line 212 "sysinfo.y"
1537 #line 229 "sysinfo.y"
1545 printf("\tif (%s) {\n", (yyvsp
[(3) - (3)].s
));
1552 #line 242 "sysinfo.y"
1566 #line 256 "sysinfo.y"
1567 {name
= (yyvsp
[(7) - (7)].s
); }
1571 #line 258 "sysinfo.y"
1573 char *desc
= (yyvsp
[(2) - (10)].s
);
1574 char *type
= (yyvsp
[(4) - (10)].s
);
1575 int size
= (yyvsp
[(5) - (10)].i
);
1576 char *id
= (yyvsp
[(7) - (10)].s
);
1577 char *p
= names
[rdepth
];
1578 char *ptr
= pnames
[rdepth
];
1585 printf("\twriteBITS(ptr->%s%s,raw,&idx,%d);\n",
1587 names
[rdepth
], size
);
1591 printf("\twrite%s(ptr->%s%s,raw,&idx,%d,file);\n",
1594 names
[rdepth
],size
/8);
1603 printf("if (!ptr->%s) ptr->%s = (%s*)xcalloc(%s, sizeof(ptr->%s[0]));\n",
1613 printf("if (!ptr->%s[n]) ptr->%s[n] = (%s**)xcalloc(%s[n], sizeof(ptr->%s[n][0]));\n",
1625 printf("\tptr->%s%s = getBITS(raw,&idx, %d,size);\n",
1631 printf("\tptr->%s%s = get%s(raw,&idx, %d,size);\n",
1639 printf("\tput%s(raw,%d,%d,&idx,ptr->%s%s);\n", type
,size
/8,size
%8,id
,names
[rdepth
]);
1643 printf("\t/* repeat %s */\n", repeat
);
1645 if (type
[0] == 'I') {
1646 printf("\tint %s%s; \t/* %s */\n",ptr
,id
, desc
);
1648 else if (type
[0] =='C') {
1649 printf("\tchar %s*%s;\t /* %s */\n",ptr
,id
, desc
);
1652 printf("\tbarray %s%s;\t /* %s */\n",ptr
,id
, desc
);
1656 printf("tabout();\n");
1657 printf("\tprintf(\"/*%-30s*/ ptr->%s = \");\n", desc
, id
);
1660 printf("\tprintf(\"%%d\\n\",ptr->%s%s);\n", id
,p
);
1661 else if (type
[0] == 'C')
1662 printf("\tprintf(\"%%s\\n\",ptr->%s%s);\n", id
,p
);
1664 else if (type
[0] == 'B')
1666 printf("\tpbarray(&ptr->%s%s);\n", id
,p
);
1675 #line 363 "sysinfo.y"
1676 { (yyval
.s
) = (yyvsp
[(1) - (1)].s
); }
1680 #line 364 "sysinfo.y"
1681 { (yyval
.s
) = "INT";}
1685 #line 369 "sysinfo.y"
1686 { (yyval
.s
) = (yyvsp
[(2) - (3)].s
); }
1690 #line 374 "sysinfo.y"
1691 { (yyval
.i
) = (yyvsp
[(1) - (2)].i
) * (yyvsp
[(2) - (2)].i
); }
1695 #line 379 "sysinfo.y"
1696 { (yyval
.s
) = (yyvsp
[(2) - (3)].s
); }
1700 #line 380 "sysinfo.y"
1701 { (yyval
.s
) = "dummy";}
1705 #line 388 "sysinfo.y"
1710 printf("#define %s %s\n", (yyvsp
[(3) - (5)].s
),(yyvsp
[(4) - (5)].s
));
1713 printf("if (ptr->%s%s == %s) { tabout(); printf(\"%s\\n\");}\n", name
, names
[rdepth
],(yyvsp
[(4) - (5)].s
),(yyvsp
[(3) - (5)].s
));
1719 /* Line 1267 of yacc.c. */
1720 #line 1721 "sysinfo.c"
1723 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
1727 YY_STACK_PRINT (yyss
, yyssp
);
1732 /* Now `shift' the result of the reduction. Determine what state
1733 that goes to, based on the state we popped back to and the rule
1734 number reduced by. */
1738 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
1739 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1740 yystate
= yytable
[yystate
];
1742 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
1747 /*------------------------------------.
1748 | yyerrlab -- here on detecting error |
1749 `------------------------------------*/
1751 /* If not already recovering from an error, report this error. */
1755 #if ! YYERROR_VERBOSE
1756 yyerror (YY_("syntax error"));
1759 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
1760 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
1762 YYSIZE_T yyalloc
= 2 * yysize
;
1763 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
1764 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
1765 if (yymsg
!= yymsgbuf
)
1766 YYSTACK_FREE (yymsg
);
1767 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
1769 yymsg_alloc
= yyalloc
;
1773 yymsg_alloc
= sizeof yymsgbuf
;
1777 if (0 < yysize
&& yysize
<= yymsg_alloc
)
1779 (void) yysyntax_error (yymsg
, yystate
, yychar
);
1784 yyerror (YY_("syntax error"));
1786 goto yyexhaustedlab
;
1794 if (yyerrstatus
== 3)
1796 /* If just tried and failed to reuse look-ahead token after an
1797 error, discard it. */
1799 if (yychar
<= YYEOF
)
1801 /* Return failure if at end of input. */
1802 if (yychar
== YYEOF
)
1807 yydestruct ("Error: discarding",
1813 /* Else will try to reuse look-ahead token after shifting the error
1818 /*---------------------------------------------------.
1819 | yyerrorlab -- error raised explicitly by YYERROR. |
1820 `---------------------------------------------------*/
1823 /* Pacify compilers like GCC when the user code never invokes
1824 YYERROR and the label yyerrorlab therefore never appears in user
1826 if (/*CONSTCOND*/ 0)
1829 /* Do not reclaim the symbols of the rule which action triggered
1833 YY_STACK_PRINT (yyss
, yyssp
);
1838 /*-------------------------------------------------------------.
1839 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1840 `-------------------------------------------------------------*/
1842 yyerrstatus
= 3; /* Each real token shifted decrements this. */
1846 yyn
= yypact
[yystate
];
1847 if (yyn
!= YYPACT_NINF
)
1850 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
1858 /* Pop the current state because it cannot handle the error token. */
1863 yydestruct ("Error: popping",
1864 yystos
[yystate
], yyvsp
);
1867 YY_STACK_PRINT (yyss
, yyssp
);
1876 /* Shift the error token. */
1877 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
1883 /*-------------------------------------.
1884 | yyacceptlab -- YYACCEPT comes here. |
1885 `-------------------------------------*/
1890 /*-----------------------------------.
1891 | yyabortlab -- YYABORT comes here. |
1892 `-----------------------------------*/
1898 /*-------------------------------------------------.
1899 | yyexhaustedlab -- memory exhaustion comes here. |
1900 `-------------------------------------------------*/
1902 yyerror (YY_("memory exhausted"));
1908 if (yychar
!= YYEOF
&& yychar
!= YYEMPTY
)
1909 yydestruct ("Cleanup: discarding lookahead",
1911 /* Do not reclaim the symbols of the rule which action triggered
1912 this YYABORT or YYACCEPT. */
1914 YY_STACK_PRINT (yyss
, yyssp
);
1915 while (yyssp
!= yyss
)
1917 yydestruct ("Cleanup: popping",
1918 yystos
[*yyssp
], yyvsp
);
1923 YYSTACK_FREE (yyss
);
1926 if (yymsg
!= yymsgbuf
)
1927 YYSTACK_FREE (yymsg
);
1929 /* Make sure YYID is used. */
1930 return YYID (yyresult
);
1934 #line 403 "sysinfo.y"
1938 -d write structure definitions for sysroff in host format
1939 -i write functions to swap into sysroff format in
1940 -o write functions to swap into sysroff format out
1941 -c write code to print info in human form */
1946 main (int ac
, char **av
)
1950 writecode
= av
[1][1];
1951 if (writecode
== 'd')
1953 printf("typedef struct { unsigned char *data; int len; } barray; \n");
1954 printf("typedef int INT;\n");
1955 printf("typedef char * CHARS;\n");
1965 fprintf(stderr
, "%s\n" , s
);