xref: /netbsd-src/external/gpl3/binutils.old/dist/binutils/sysinfo.c (revision e992f068c547fd6e84b3f104dc2340adcc955732)
1*e992f068Schristos /* A Bison parser, made by GNU Bison 3.8.2.  */
275fd0b74Schristos 
3ede78133Schristos /* Bison implementation for Yacc-like parsers in C
475fd0b74Schristos 
5*e992f068Schristos    Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
6*e992f068Schristos    Inc.
775fd0b74Schristos 
8ede78133Schristos    This program is free software: you can redistribute it and/or modify
975fd0b74Schristos    it under the terms of the GNU General Public License as published by
10ede78133Schristos    the Free Software Foundation, either version 3 of the License, or
11ede78133Schristos    (at your option) any later version.
1275fd0b74Schristos 
1375fd0b74Schristos    This program is distributed in the hope that it will be useful,
1475fd0b74Schristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
1575fd0b74Schristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1675fd0b74Schristos    GNU General Public License for more details.
1775fd0b74Schristos 
1875fd0b74Schristos    You should have received a copy of the GNU General Public License
19*e992f068Schristos    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
2075fd0b74Schristos 
2175fd0b74Schristos /* As a special exception, you may create a larger work that contains
2275fd0b74Schristos    part or all of the Bison parser skeleton and distribute that work
2375fd0b74Schristos    under terms of your choice, so long as that work isn't itself a
2475fd0b74Schristos    parser generator using the skeleton or a modified version thereof
2575fd0b74Schristos    as a parser skeleton.  Alternatively, if you modify or redistribute
2675fd0b74Schristos    the parser skeleton itself, you may (at your option) remove this
2775fd0b74Schristos    special exception, which will cause the skeleton and the resulting
2875fd0b74Schristos    Bison output files to be licensed under the GNU General Public
2975fd0b74Schristos    License without this special exception.
3075fd0b74Schristos 
3175fd0b74Schristos    This special exception was added by the Free Software Foundation in
3275fd0b74Schristos    version 2.2 of Bison.  */
3375fd0b74Schristos 
3475fd0b74Schristos /* C LALR(1) parser skeleton written by Richard Stallman, by
3575fd0b74Schristos    simplifying the original so-called "semantic" parser.  */
3675fd0b74Schristos 
37*e992f068Schristos /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38*e992f068Schristos    especially those whose name start with YY_ or yy_.  They are
39*e992f068Schristos    private implementation details that can be changed or removed.  */
40*e992f068Schristos 
4175fd0b74Schristos /* All symbols defined below should begin with yy or YY, to avoid
4275fd0b74Schristos    infringing on user name space.  This should be done even for local
4375fd0b74Schristos    variables, as they might otherwise be expanded by user macros.
4475fd0b74Schristos    There are some unavoidable exceptions within include files to
4575fd0b74Schristos    define necessary library symbols; they are noted "INFRINGES ON
4675fd0b74Schristos    USER NAME SPACE" below.  */
4775fd0b74Schristos 
48*e992f068Schristos /* Identify Bison output, and Bison version.  */
49*e992f068Schristos #define YYBISON 30802
5075fd0b74Schristos 
51*e992f068Schristos /* Bison version string.  */
52*e992f068Schristos #define YYBISON_VERSION "3.8.2"
5375fd0b74Schristos 
5475fd0b74Schristos /* Skeleton name.  */
5575fd0b74Schristos #define YYSKELETON_NAME "yacc.c"
5675fd0b74Schristos 
5775fd0b74Schristos /* Pure parsers.  */
5875fd0b74Schristos #define YYPURE 0
5975fd0b74Schristos 
60ede78133Schristos /* Push parsers.  */
61ede78133Schristos #define YYPUSH 0
62ede78133Schristos 
63ede78133Schristos /* Pull parsers.  */
64ede78133Schristos #define YYPULL 1
6575fd0b74Schristos 
6675fd0b74Schristos 
6775fd0b74Schristos 
68ede78133Schristos 
69*e992f068Schristos /* First part of user prologue.  */
70*e992f068Schristos #line 21 "sysinfo.y"
71ede78133Schristos 
72ede78133Schristos #include <stdio.h>
73ede78133Schristos #include <stdlib.h>
74ede78133Schristos #include <string.h>
75ede78133Schristos 
76ede78133Schristos static char writecode;
77ede78133Schristos static char *it;
78ede78133Schristos static int code;
79ede78133Schristos static char * repeat;
80ede78133Schristos static char *oldrepeat;
81ede78133Schristos static char *name;
82ede78133Schristos static int rdepth;
83ede78133Schristos static char *names[] = {" ","[n]","[n][m]"};
84ede78133Schristos static char *pnames[]= {"","*","**"};
85ede78133Schristos 
86*e992f068Schristos static void yyerror (const char *s);
87ede78133Schristos extern int yylex (void);
88ede78133Schristos 
89*e992f068Schristos #line 90 "sysinfo.c"
90ede78133Schristos 
91*e992f068Schristos # ifndef YY_CAST
92*e992f068Schristos #  ifdef __cplusplus
93*e992f068Schristos #   define YY_CAST(Type, Val) static_cast<Type> (Val)
94*e992f068Schristos #   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
95*e992f068Schristos #  else
96*e992f068Schristos #   define YY_CAST(Type, Val) ((Type) (Val))
97*e992f068Schristos #   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
98*e992f068Schristos #  endif
99*e992f068Schristos # endif
100ede78133Schristos # ifndef YY_NULLPTR
101*e992f068Schristos #  if defined __cplusplus
102*e992f068Schristos #   if 201103L <= __cplusplus
103ede78133Schristos #    define YY_NULLPTR nullptr
104ede78133Schristos #   else
105ede78133Schristos #    define YY_NULLPTR 0
106ede78133Schristos #   endif
107ede78133Schristos #  else
108*e992f068Schristos #   define YY_NULLPTR ((void*)0)
109*e992f068Schristos #  endif
110ede78133Schristos # endif
111ede78133Schristos 
112*e992f068Schristos /* Use api.header.include to #include this header
113*e992f068Schristos    instead of duplicating it here.  */
114ede78133Schristos #ifndef YY_YY_SYSINFO_H_INCLUDED
115ede78133Schristos # define YY_YY_SYSINFO_H_INCLUDED
116ede78133Schristos /* Debug traces.  */
117ede78133Schristos #ifndef YYDEBUG
118ede78133Schristos # define YYDEBUG 0
119ede78133Schristos #endif
120ede78133Schristos #if YYDEBUG
121ede78133Schristos extern int yydebug;
122ede78133Schristos #endif
123ede78133Schristos 
124*e992f068Schristos /* Token kinds.  */
12575fd0b74Schristos #ifndef YYTOKENTYPE
12675fd0b74Schristos # define YYTOKENTYPE
127ede78133Schristos   enum yytokentype
128ede78133Schristos   {
129*e992f068Schristos     YYEMPTY = -2,
130*e992f068Schristos     YYEOF = 0,                     /* "end of file"  */
131*e992f068Schristos     YYerror = 256,                 /* error  */
132*e992f068Schristos     YYUNDEF = 257,                 /* "invalid token"  */
133*e992f068Schristos     COND = 258,                    /* COND  */
134*e992f068Schristos     REPEAT = 259,                  /* REPEAT  */
135*e992f068Schristos     TYPE = 260,                    /* TYPE  */
136*e992f068Schristos     NAME = 261,                    /* NAME  */
137*e992f068Schristos     NUMBER = 262,                  /* NUMBER  */
138*e992f068Schristos     UNIT = 263                     /* UNIT  */
13975fd0b74Schristos   };
140*e992f068Schristos   typedef enum yytokentype yytoken_kind_t;
14175fd0b74Schristos #endif
142*e992f068Schristos /* Token kinds.  */
143*e992f068Schristos #define YYEMPTY -2
144*e992f068Schristos #define YYEOF 0
145*e992f068Schristos #define YYerror 256
146*e992f068Schristos #define YYUNDEF 257
14775fd0b74Schristos #define COND 258
14875fd0b74Schristos #define REPEAT 259
14975fd0b74Schristos #define TYPE 260
15075fd0b74Schristos #define NAME 261
15175fd0b74Schristos #define NUMBER 262
15275fd0b74Schristos #define UNIT 263
15375fd0b74Schristos 
154ede78133Schristos /* Value type.  */
15575fd0b74Schristos #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
156ede78133Schristos union YYSTYPE
15775fd0b74Schristos {
158*e992f068Schristos #line 41 "sysinfo.y"
159ede78133Schristos 
16075fd0b74Schristos  int i;
16175fd0b74Schristos  char *s;
162ede78133Schristos 
163*e992f068Schristos #line 164 "sysinfo.c"
164ede78133Schristos 
165*e992f068Schristos };
166ede78133Schristos typedef union YYSTYPE YYSTYPE;
16775fd0b74Schristos # define YYSTYPE_IS_TRIVIAL 1
168ede78133Schristos # define YYSTYPE_IS_DECLARED 1
16975fd0b74Schristos #endif
17075fd0b74Schristos 
17175fd0b74Schristos 
172ede78133Schristos extern YYSTYPE yylval;
173ede78133Schristos 
174*e992f068Schristos 
175ede78133Schristos int yyparse (void);
176ede78133Schristos 
177*e992f068Schristos 
178ede78133Schristos #endif /* !YY_YY_SYSINFO_H_INCLUDED  */
179*e992f068Schristos /* Symbol kind.  */
180*e992f068Schristos enum yysymbol_kind_t
181*e992f068Schristos {
182*e992f068Schristos   YYSYMBOL_YYEMPTY = -2,
183*e992f068Schristos   YYSYMBOL_YYEOF = 0,                      /* "end of file"  */
184*e992f068Schristos   YYSYMBOL_YYerror = 1,                    /* error  */
185*e992f068Schristos   YYSYMBOL_YYUNDEF = 2,                    /* "invalid token"  */
186*e992f068Schristos   YYSYMBOL_COND = 3,                       /* COND  */
187*e992f068Schristos   YYSYMBOL_REPEAT = 4,                     /* REPEAT  */
188*e992f068Schristos   YYSYMBOL_5_ = 5,                         /* '('  */
189*e992f068Schristos   YYSYMBOL_6_ = 6,                         /* ')'  */
190*e992f068Schristos   YYSYMBOL_TYPE = 7,                       /* TYPE  */
191*e992f068Schristos   YYSYMBOL_NAME = 8,                       /* NAME  */
192*e992f068Schristos   YYSYMBOL_NUMBER = 9,                     /* NUMBER  */
193*e992f068Schristos   YYSYMBOL_UNIT = 10,                      /* UNIT  */
194*e992f068Schristos   YYSYMBOL_YYACCEPT = 11,                  /* $accept  */
195*e992f068Schristos   YYSYMBOL_top = 12,                       /* top  */
196*e992f068Schristos   YYSYMBOL_13_1 = 13,                      /* $@1  */
197*e992f068Schristos   YYSYMBOL_it_list = 14,                   /* it_list  */
198*e992f068Schristos   YYSYMBOL_it = 15,                        /* it  */
199*e992f068Schristos   YYSYMBOL_16_2 = 16,                      /* $@2  */
200*e992f068Schristos   YYSYMBOL_it_field_list = 17,             /* it_field_list  */
201*e992f068Schristos   YYSYMBOL_repeat_it_field = 18,           /* repeat_it_field  */
202*e992f068Schristos   YYSYMBOL_19_3 = 19,                      /* $@3  */
203*e992f068Schristos   YYSYMBOL_cond_it_field = 20,             /* cond_it_field  */
204*e992f068Schristos   YYSYMBOL_21_4 = 21,                      /* $@4  */
205*e992f068Schristos   YYSYMBOL_it_field = 22,                  /* it_field  */
206*e992f068Schristos   YYSYMBOL_23_5 = 23,                      /* $@5  */
207*e992f068Schristos   YYSYMBOL_attr_type = 24,                 /* attr_type  */
208*e992f068Schristos   YYSYMBOL_attr_desc = 25,                 /* attr_desc  */
209*e992f068Schristos   YYSYMBOL_attr_size = 26,                 /* attr_size  */
210*e992f068Schristos   YYSYMBOL_attr_id = 27,                   /* attr_id  */
211*e992f068Schristos   YYSYMBOL_enums = 28,                     /* enums  */
212*e992f068Schristos   YYSYMBOL_enum_list = 29                  /* enum_list  */
213*e992f068Schristos };
214*e992f068Schristos typedef enum yysymbol_kind_t yysymbol_kind_t;
21575fd0b74Schristos 
21675fd0b74Schristos 
217*e992f068Schristos 
21875fd0b74Schristos 
21975fd0b74Schristos #ifdef short
22075fd0b74Schristos # undef short
22175fd0b74Schristos #endif
22275fd0b74Schristos 
223*e992f068Schristos /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
224*e992f068Schristos    <limits.h> and (if available) <stdint.h> are included
225*e992f068Schristos    so that the code can choose integer types of a good width.  */
226*e992f068Schristos 
227*e992f068Schristos #ifndef __PTRDIFF_MAX__
228*e992f068Schristos # include <limits.h> /* INFRINGES ON USER NAME SPACE */
229*e992f068Schristos # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
230*e992f068Schristos #  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
231*e992f068Schristos #  define YY_STDINT_H
232*e992f068Schristos # endif
23375fd0b74Schristos #endif
23475fd0b74Schristos 
235*e992f068Schristos /* Narrow types that promote to a signed type and that can represent a
236*e992f068Schristos    signed or unsigned integer of at least N bits.  In tables they can
237*e992f068Schristos    save space and decrease cache pressure.  Promoting to a signed type
238*e992f068Schristos    helps avoid bugs in integer arithmetic.  */
239*e992f068Schristos 
240*e992f068Schristos #ifdef __INT_LEAST8_MAX__
241*e992f068Schristos typedef __INT_LEAST8_TYPE__ yytype_int8;
242*e992f068Schristos #elif defined YY_STDINT_H
243*e992f068Schristos typedef int_least8_t yytype_int8;
24475fd0b74Schristos #else
245ede78133Schristos typedef signed char yytype_int8;
24675fd0b74Schristos #endif
24775fd0b74Schristos 
248*e992f068Schristos #ifdef __INT_LEAST16_MAX__
249*e992f068Schristos typedef __INT_LEAST16_TYPE__ yytype_int16;
250*e992f068Schristos #elif defined YY_STDINT_H
251*e992f068Schristos typedef int_least16_t yytype_int16;
25275fd0b74Schristos #else
253*e992f068Schristos typedef short yytype_int16;
25475fd0b74Schristos #endif
25575fd0b74Schristos 
256*e992f068Schristos /* Work around bug in HP-UX 11.23, which defines these macros
257*e992f068Schristos    incorrectly for preprocessor constants.  This workaround can likely
258*e992f068Schristos    be removed in 2023, as HPE has promised support for HP-UX 11.23
259*e992f068Schristos    (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
260*e992f068Schristos    <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>.  */
261*e992f068Schristos #ifdef __hpux
262*e992f068Schristos # undef UINT_LEAST8_MAX
263*e992f068Schristos # undef UINT_LEAST16_MAX
264*e992f068Schristos # define UINT_LEAST8_MAX 255
265*e992f068Schristos # define UINT_LEAST16_MAX 65535
266*e992f068Schristos #endif
267*e992f068Schristos 
268*e992f068Schristos #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
269*e992f068Schristos typedef __UINT_LEAST8_TYPE__ yytype_uint8;
270*e992f068Schristos #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
271*e992f068Schristos        && UINT_LEAST8_MAX <= INT_MAX)
272*e992f068Schristos typedef uint_least8_t yytype_uint8;
273*e992f068Schristos #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
274*e992f068Schristos typedef unsigned char yytype_uint8;
27575fd0b74Schristos #else
276*e992f068Schristos typedef short yytype_uint8;
277*e992f068Schristos #endif
278*e992f068Schristos 
279*e992f068Schristos #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
280*e992f068Schristos typedef __UINT_LEAST16_TYPE__ yytype_uint16;
281*e992f068Schristos #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
282*e992f068Schristos        && UINT_LEAST16_MAX <= INT_MAX)
283*e992f068Schristos typedef uint_least16_t yytype_uint16;
284*e992f068Schristos #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
285*e992f068Schristos typedef unsigned short yytype_uint16;
286*e992f068Schristos #else
287*e992f068Schristos typedef int yytype_uint16;
288*e992f068Schristos #endif
289*e992f068Schristos 
290*e992f068Schristos #ifndef YYPTRDIFF_T
291*e992f068Schristos # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
292*e992f068Schristos #  define YYPTRDIFF_T __PTRDIFF_TYPE__
293*e992f068Schristos #  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
294*e992f068Schristos # elif defined PTRDIFF_MAX
295*e992f068Schristos #  ifndef ptrdiff_t
296*e992f068Schristos #   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
297*e992f068Schristos #  endif
298*e992f068Schristos #  define YYPTRDIFF_T ptrdiff_t
299*e992f068Schristos #  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
300*e992f068Schristos # else
301*e992f068Schristos #  define YYPTRDIFF_T long
302*e992f068Schristos #  define YYPTRDIFF_MAXIMUM LONG_MAX
303*e992f068Schristos # endif
30475fd0b74Schristos #endif
30575fd0b74Schristos 
30675fd0b74Schristos #ifndef YYSIZE_T
30775fd0b74Schristos # ifdef __SIZE_TYPE__
30875fd0b74Schristos #  define YYSIZE_T __SIZE_TYPE__
30975fd0b74Schristos # elif defined size_t
31075fd0b74Schristos #  define YYSIZE_T size_t
311*e992f068Schristos # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
31275fd0b74Schristos #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
31375fd0b74Schristos #  define YYSIZE_T size_t
31475fd0b74Schristos # else
315*e992f068Schristos #  define YYSIZE_T unsigned
31675fd0b74Schristos # endif
31775fd0b74Schristos #endif
31875fd0b74Schristos 
319*e992f068Schristos #define YYSIZE_MAXIMUM                                  \
320*e992f068Schristos   YY_CAST (YYPTRDIFF_T,                                 \
321*e992f068Schristos            (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
322*e992f068Schristos             ? YYPTRDIFF_MAXIMUM                         \
323*e992f068Schristos             : YY_CAST (YYSIZE_T, -1)))
324*e992f068Schristos 
325*e992f068Schristos #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
326*e992f068Schristos 
327*e992f068Schristos 
328*e992f068Schristos /* Stored state numbers (used for stacks). */
329*e992f068Schristos typedef yytype_int8 yy_state_t;
330*e992f068Schristos 
331*e992f068Schristos /* State numbers in computations.  */
332*e992f068Schristos typedef int yy_state_fast_t;
33375fd0b74Schristos 
33475fd0b74Schristos #ifndef YY_
33575fd0b74Schristos # if defined YYENABLE_NLS && YYENABLE_NLS
33675fd0b74Schristos #  if ENABLE_NLS
33775fd0b74Schristos #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
338ede78133Schristos #   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
33975fd0b74Schristos #  endif
34075fd0b74Schristos # endif
34175fd0b74Schristos # ifndef YY_
342ede78133Schristos #  define YY_(Msgid) Msgid
343ede78133Schristos # endif
344ede78133Schristos #endif
345ede78133Schristos 
346ede78133Schristos 
347ede78133Schristos #ifndef YY_ATTRIBUTE_PURE
348*e992f068Schristos # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
349*e992f068Schristos #  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
350*e992f068Schristos # else
351*e992f068Schristos #  define YY_ATTRIBUTE_PURE
352*e992f068Schristos # endif
353ede78133Schristos #endif
354ede78133Schristos 
355ede78133Schristos #ifndef YY_ATTRIBUTE_UNUSED
356*e992f068Schristos # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
357*e992f068Schristos #  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
358ede78133Schristos # else
359*e992f068Schristos #  define YY_ATTRIBUTE_UNUSED
36075fd0b74Schristos # endif
36175fd0b74Schristos #endif
36275fd0b74Schristos 
36375fd0b74Schristos /* Suppress unused-variable warnings by "using" E.  */
36475fd0b74Schristos #if ! defined lint || defined __GNUC__
365*e992f068Schristos # define YY_USE(E) ((void) (E))
36675fd0b74Schristos #else
367*e992f068Schristos # define YY_USE(E) /* empty */
36875fd0b74Schristos #endif
36975fd0b74Schristos 
370ede78133Schristos /* Suppress an incorrect diagnostic about yylval being uninitialized.  */
371*e992f068Schristos #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
372*e992f068Schristos # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
373*e992f068Schristos #  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
374*e992f068Schristos     _Pragma ("GCC diagnostic push")                                     \
375*e992f068Schristos     _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
376*e992f068Schristos # else
377ede78133Schristos #  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
378ede78133Schristos     _Pragma ("GCC diagnostic push")                                     \
379ede78133Schristos     _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
380ede78133Schristos     _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
381*e992f068Schristos # endif
382ede78133Schristos # define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
383ede78133Schristos     _Pragma ("GCC diagnostic pop")
38475fd0b74Schristos #else
385ede78133Schristos # define YY_INITIAL_VALUE(Value) Value
38675fd0b74Schristos #endif
387ede78133Schristos #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
388ede78133Schristos # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
389ede78133Schristos # define YY_IGNORE_MAYBE_UNINITIALIZED_END
39075fd0b74Schristos #endif
391ede78133Schristos #ifndef YY_INITIAL_VALUE
392ede78133Schristos # define YY_INITIAL_VALUE(Value) /* Nothing. */
393ede78133Schristos #endif
394ede78133Schristos 
395*e992f068Schristos #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
396*e992f068Schristos # define YY_IGNORE_USELESS_CAST_BEGIN                          \
397*e992f068Schristos     _Pragma ("GCC diagnostic push")                            \
398*e992f068Schristos     _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
399*e992f068Schristos # define YY_IGNORE_USELESS_CAST_END            \
400*e992f068Schristos     _Pragma ("GCC diagnostic pop")
401*e992f068Schristos #endif
402*e992f068Schristos #ifndef YY_IGNORE_USELESS_CAST_BEGIN
403*e992f068Schristos # define YY_IGNORE_USELESS_CAST_BEGIN
404*e992f068Schristos # define YY_IGNORE_USELESS_CAST_END
405*e992f068Schristos #endif
40675fd0b74Schristos 
407*e992f068Schristos 
408*e992f068Schristos #define YY_ASSERT(E) ((void) (0 && (E)))
409*e992f068Schristos 
410*e992f068Schristos #if !defined yyoverflow
41175fd0b74Schristos 
41275fd0b74Schristos /* The parser invokes alloca or malloc; define the necessary symbols.  */
41375fd0b74Schristos 
41475fd0b74Schristos # ifdef YYSTACK_USE_ALLOCA
41575fd0b74Schristos #  if YYSTACK_USE_ALLOCA
41675fd0b74Schristos #   ifdef __GNUC__
41775fd0b74Schristos #    define YYSTACK_ALLOC __builtin_alloca
41875fd0b74Schristos #   elif defined __BUILTIN_VA_ARG_INCR
41975fd0b74Schristos #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
42075fd0b74Schristos #   elif defined _AIX
42175fd0b74Schristos #    define YYSTACK_ALLOC __alloca
42275fd0b74Schristos #   elif defined _MSC_VER
42375fd0b74Schristos #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
42475fd0b74Schristos #    define alloca _alloca
42575fd0b74Schristos #   else
42675fd0b74Schristos #    define YYSTACK_ALLOC alloca
427ede78133Schristos #    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
42875fd0b74Schristos #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
429ede78133Schristos       /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
430ede78133Schristos #     ifndef EXIT_SUCCESS
431ede78133Schristos #      define EXIT_SUCCESS 0
43275fd0b74Schristos #     endif
43375fd0b74Schristos #    endif
43475fd0b74Schristos #   endif
43575fd0b74Schristos #  endif
43675fd0b74Schristos # endif
43775fd0b74Schristos 
43875fd0b74Schristos # ifdef YYSTACK_ALLOC
439ede78133Schristos    /* Pacify GCC's 'empty if-body' warning.  */
440ede78133Schristos #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
44175fd0b74Schristos #  ifndef YYSTACK_ALLOC_MAXIMUM
44275fd0b74Schristos     /* The OS might guarantee only one guard page at the bottom of the stack,
44375fd0b74Schristos        and a page size can be as small as 4096 bytes.  So we cannot safely
44475fd0b74Schristos        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
44575fd0b74Schristos        to allow for a few compiler-allocated temporary stack slots.  */
44675fd0b74Schristos #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
44775fd0b74Schristos #  endif
44875fd0b74Schristos # else
44975fd0b74Schristos #  define YYSTACK_ALLOC YYMALLOC
45075fd0b74Schristos #  define YYSTACK_FREE YYFREE
45175fd0b74Schristos #  ifndef YYSTACK_ALLOC_MAXIMUM
45275fd0b74Schristos #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
45375fd0b74Schristos #  endif
454ede78133Schristos #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
45575fd0b74Schristos        && ! ((defined YYMALLOC || defined malloc) \
45675fd0b74Schristos              && (defined YYFREE || defined free)))
45775fd0b74Schristos #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
458ede78133Schristos #   ifndef EXIT_SUCCESS
459ede78133Schristos #    define EXIT_SUCCESS 0
46075fd0b74Schristos #   endif
46175fd0b74Schristos #  endif
46275fd0b74Schristos #  ifndef YYMALLOC
46375fd0b74Schristos #   define YYMALLOC malloc
464ede78133Schristos #   if ! defined malloc && ! defined EXIT_SUCCESS
46575fd0b74Schristos void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
46675fd0b74Schristos #   endif
46775fd0b74Schristos #  endif
46875fd0b74Schristos #  ifndef YYFREE
46975fd0b74Schristos #   define YYFREE free
470ede78133Schristos #   if ! defined free && ! defined EXIT_SUCCESS
47175fd0b74Schristos void free (void *); /* INFRINGES ON USER NAME SPACE */
47275fd0b74Schristos #   endif
47375fd0b74Schristos #  endif
47475fd0b74Schristos # endif
475*e992f068Schristos #endif /* !defined yyoverflow */
47675fd0b74Schristos 
47775fd0b74Schristos #if (! defined yyoverflow \
47875fd0b74Schristos      && (! defined __cplusplus \
47975fd0b74Schristos          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
48075fd0b74Schristos 
48175fd0b74Schristos /* A type that is properly aligned for any stack member.  */
48275fd0b74Schristos union yyalloc
48375fd0b74Schristos {
484*e992f068Schristos   yy_state_t yyss_alloc;
485ede78133Schristos   YYSTYPE yyvs_alloc;
48675fd0b74Schristos };
48775fd0b74Schristos 
48875fd0b74Schristos /* The size of the maximum gap between one aligned stack and the next.  */
489*e992f068Schristos # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
49075fd0b74Schristos 
49175fd0b74Schristos /* The size of an array large to enough to hold all stacks, each with
49275fd0b74Schristos    N elements.  */
49375fd0b74Schristos # define YYSTACK_BYTES(N) \
494*e992f068Schristos      ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
49575fd0b74Schristos       + YYSTACK_GAP_MAXIMUM)
49675fd0b74Schristos 
497ede78133Schristos # define YYCOPY_NEEDED 1
49875fd0b74Schristos 
49975fd0b74Schristos /* Relocate STACK from its old location to the new one.  The
50075fd0b74Schristos    local variables YYSIZE and YYSTACKSIZE give the old and new number of
50175fd0b74Schristos    elements in the stack, and YYPTR gives the new location of the
50275fd0b74Schristos    stack.  Advance YYPTR to a properly aligned location for the next
50375fd0b74Schristos    stack.  */
504ede78133Schristos # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
50575fd0b74Schristos     do                                                                  \
50675fd0b74Schristos       {                                                                 \
507*e992f068Schristos         YYPTRDIFF_T yynewbytes;                                         \
508ede78133Schristos         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
509ede78133Schristos         Stack = &yyptr->Stack_alloc;                                    \
510*e992f068Schristos         yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
511*e992f068Schristos         yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
51275fd0b74Schristos       }                                                                 \
513ede78133Schristos     while (0)
51475fd0b74Schristos 
51575fd0b74Schristos #endif
51675fd0b74Schristos 
517ede78133Schristos #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
518ede78133Schristos /* Copy COUNT objects from SRC to DST.  The source and destination do
519ede78133Schristos    not overlap.  */
520ede78133Schristos # ifndef YYCOPY
521ede78133Schristos #  if defined __GNUC__ && 1 < __GNUC__
522ede78133Schristos #   define YYCOPY(Dst, Src, Count) \
523*e992f068Schristos       __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
524ede78133Schristos #  else
525ede78133Schristos #   define YYCOPY(Dst, Src, Count)              \
526ede78133Schristos       do                                        \
527ede78133Schristos         {                                       \
528*e992f068Schristos           YYPTRDIFF_T yyi;                      \
529ede78133Schristos           for (yyi = 0; yyi < (Count); yyi++)   \
530ede78133Schristos             (Dst)[yyi] = (Src)[yyi];            \
531ede78133Schristos         }                                       \
532ede78133Schristos       while (0)
533ede78133Schristos #  endif
534ede78133Schristos # endif
535ede78133Schristos #endif /* !YYCOPY_NEEDED */
536ede78133Schristos 
53775fd0b74Schristos /* YYFINAL -- State number of the termination state.  */
53875fd0b74Schristos #define YYFINAL  3
53975fd0b74Schristos /* YYLAST -- Last index in YYTABLE.  */
54075fd0b74Schristos #define YYLAST   38
54175fd0b74Schristos 
54275fd0b74Schristos /* YYNTOKENS -- Number of terminals.  */
54375fd0b74Schristos #define YYNTOKENS  11
54475fd0b74Schristos /* YYNNTS -- Number of nonterminals.  */
54575fd0b74Schristos #define YYNNTS  19
54675fd0b74Schristos /* YYNRULES -- Number of rules.  */
54775fd0b74Schristos #define YYNRULES  27
548ede78133Schristos /* YYNSTATES -- Number of states.  */
54975fd0b74Schristos #define YYNSTATES  55
55075fd0b74Schristos 
551*e992f068Schristos /* YYMAXUTOK -- Last valid token kind.  */
55275fd0b74Schristos #define YYMAXUTOK   263
55375fd0b74Schristos 
554*e992f068Schristos 
555*e992f068Schristos /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
556*e992f068Schristos    as returned by yylex, with out-of-bounds checking.  */
55775fd0b74Schristos #define YYTRANSLATE(YYX)                                \
558*e992f068Schristos   (0 <= (YYX) && (YYX) <= YYMAXUTOK                     \
559*e992f068Schristos    ? YY_CAST (yysymbol_kind_t, yytranslate[YYX])        \
560*e992f068Schristos    : YYSYMBOL_YYUNDEF)
56175fd0b74Schristos 
562ede78133Schristos /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
563*e992f068Schristos    as returned by yylex.  */
564*e992f068Schristos static const yytype_int8 yytranslate[] =
56575fd0b74Schristos {
56675fd0b74Schristos        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
56775fd0b74Schristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
56875fd0b74Schristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
56975fd0b74Schristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
57075fd0b74Schristos        5,     6,     2,     2,     2,     2,     2,     2,     2,     2,
57175fd0b74Schristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
57275fd0b74Schristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
57375fd0b74Schristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
57475fd0b74Schristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
57575fd0b74Schristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
57675fd0b74Schristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
57775fd0b74Schristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
57875fd0b74Schristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
57975fd0b74Schristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
58075fd0b74Schristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
58175fd0b74Schristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
58275fd0b74Schristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
58375fd0b74Schristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
58475fd0b74Schristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
58575fd0b74Schristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
58675fd0b74Schristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
58775fd0b74Schristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
58875fd0b74Schristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
58975fd0b74Schristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
59075fd0b74Schristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
59175fd0b74Schristos        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
59275fd0b74Schristos        7,     8,     9,    10
59375fd0b74Schristos };
59475fd0b74Schristos 
59575fd0b74Schristos #if YYDEBUG
596ede78133Schristos /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
597*e992f068Schristos static const yytype_int16 yyrline[] =
59875fd0b74Schristos {
599ede78133Schristos        0,    55,    55,    55,    93,    94,    99,    98,   171,   172,
600ede78133Schristos      173,   174,   178,   177,   228,   227,   257,   256,   367,   368,
601ede78133Schristos      372,   377,   383,   384,   387,   388,   390,   392
60275fd0b74Schristos };
60375fd0b74Schristos #endif
60475fd0b74Schristos 
605*e992f068Schristos /** Accessing symbol of state STATE.  */
606*e992f068Schristos #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
607*e992f068Schristos 
608*e992f068Schristos #if YYDEBUG || 0
609*e992f068Schristos /* The user-facing name of the symbol whose (internal) number is
610*e992f068Schristos    YYSYMBOL.  No bounds checking.  */
611*e992f068Schristos static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
612*e992f068Schristos 
61375fd0b74Schristos /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
61475fd0b74Schristos    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
61575fd0b74Schristos static const char *const yytname[] =
61675fd0b74Schristos {
617*e992f068Schristos   "\"end of file\"", "error", "\"invalid token\"", "COND", "REPEAT",
618*e992f068Schristos   "'('", "')'", "TYPE", "NAME", "NUMBER", "UNIT", "$accept", "top", "$@1",
619*e992f068Schristos   "it_list", "it", "$@2", "it_field_list", "repeat_it_field", "$@3",
620*e992f068Schristos   "cond_it_field", "$@4", "it_field", "$@5", "attr_type", "attr_desc",
621*e992f068Schristos   "attr_size", "attr_id", "enums", "enum_list", YY_NULLPTR
62275fd0b74Schristos };
62375fd0b74Schristos 
624*e992f068Schristos static const char *
yysymbol_name(yysymbol_kind_t yysymbol)625*e992f068Schristos yysymbol_name (yysymbol_kind_t yysymbol)
62675fd0b74Schristos {
627*e992f068Schristos   return yytname[yysymbol];
628*e992f068Schristos }
62975fd0b74Schristos #endif
63075fd0b74Schristos 
631*e992f068Schristos #define YYPACT_NINF (-14)
632ede78133Schristos 
633*e992f068Schristos #define yypact_value_is_default(Yyn) \
634*e992f068Schristos   ((Yyn) == YYPACT_NINF)
635ede78133Schristos 
636*e992f068Schristos #define YYTABLE_NINF (-1)
637ede78133Schristos 
638*e992f068Schristos #define yytable_value_is_error(Yyn) \
639ede78133Schristos   0
640ede78133Schristos 
641ede78133Schristos /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
642ede78133Schristos    STATE-NUM.  */
643ede78133Schristos static const yytype_int8 yypact[] =
64475fd0b74Schristos {
645ede78133Schristos      -14,     8,     4,   -14,     2,   -14,     4,     3,   -14,   -14,
646ede78133Schristos        6,     0,     7,     6,     6,     6,     9,    10,    11,    15,
647ede78133Schristos      -14,   -14,   -14,   -14,   -14,   -14,    16,    14,     6,     6,
648ede78133Schristos      -14,   -14,     5,    17,    18,    19,    20,   -14,   -14,   -14,
649ede78133Schristos       22,    23,   -14,    24,    27,   -14,   -14,    28,     1,   -14,
650ede78133Schristos       25,   -14,    29,    30,   -14
65175fd0b74Schristos };
65275fd0b74Schristos 
653ede78133Schristos /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
654ede78133Schristos    Performed when YYTABLE does not specify something else to do.  Zero
65575fd0b74Schristos    means the default is an error.  */
656*e992f068Schristos static const yytype_int8 yydefact[] =
65775fd0b74Schristos {
65875fd0b74Schristos        2,     0,     5,     1,     0,     3,     5,     0,     4,     6,
65975fd0b74Schristos       11,     0,     0,    11,    11,    11,     0,     0,     0,     0,
66075fd0b74Schristos        7,    10,     9,     8,    14,    12,     0,    19,    11,    11,
66175fd0b74Schristos       20,    18,     0,     0,     0,     0,     0,    15,    13,    21,
66275fd0b74Schristos       23,     0,    16,     0,    24,    22,    26,     0,     0,    17,
66375fd0b74Schristos        0,    25,     0,     0,    27
66475fd0b74Schristos };
66575fd0b74Schristos 
66675fd0b74Schristos /* YYPGOTO[NTERM-NUM].  */
66775fd0b74Schristos static const yytype_int8 yypgoto[] =
66875fd0b74Schristos {
66975fd0b74Schristos      -14,   -14,   -14,    32,   -14,   -14,   -13,   -14,   -14,   -14,
67075fd0b74Schristos      -14,   -14,   -14,   -14,   -14,   -14,   -14,   -14,   -14
67175fd0b74Schristos };
67275fd0b74Schristos 
673ede78133Schristos /* YYDEFGOTO[NTERM-NUM].  */
674ede78133Schristos static const yytype_int8 yydefgoto[] =
675ede78133Schristos {
676*e992f068Schristos        0,     1,     2,     5,     6,    10,    12,    13,    29,    14,
677ede78133Schristos       28,    15,    44,    32,    19,    36,    42,    47,    48
678ede78133Schristos };
679ede78133Schristos 
680ede78133Schristos /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
681ede78133Schristos    positive, shift that token.  If negative, reduce the rule whose
682ede78133Schristos    number is the opposite.  If YYTABLE_NINF, syntax error.  */
683*e992f068Schristos static const yytype_int8 yytable[] =
68475fd0b74Schristos {
68575fd0b74Schristos       21,    22,    23,    16,    17,    18,    50,    51,     3,     4,
68675fd0b74Schristos        7,    11,     9,    20,    35,    33,    34,    24,    25,    26,
68775fd0b74Schristos       27,    31,    30,    37,    38,     0,    40,    41,     0,    39,
68875fd0b74Schristos       45,    43,    46,    52,    49,     0,    54,    53,     8
68975fd0b74Schristos };
69075fd0b74Schristos 
69175fd0b74Schristos static const yytype_int8 yycheck[] =
69275fd0b74Schristos {
69375fd0b74Schristos       13,    14,    15,     3,     4,     5,     5,     6,     0,     5,
69475fd0b74Schristos        8,     5,     9,     6,     9,    28,    29,     8,     8,     8,
69575fd0b74Schristos        5,     7,     6,     6,     6,    -1,     6,     5,    -1,    10,
69675fd0b74Schristos        6,     8,     5,     8,     6,    -1,     6,     8,     6
69775fd0b74Schristos };
69875fd0b74Schristos 
699*e992f068Schristos /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
700*e992f068Schristos    state STATE-NUM.  */
701*e992f068Schristos static const yytype_int8 yystos[] =
70275fd0b74Schristos {
70375fd0b74Schristos        0,    12,    13,     0,     5,    14,    15,     8,    14,     9,
70475fd0b74Schristos       16,     5,    17,    18,    20,    22,     3,     4,     5,    25,
70575fd0b74Schristos        6,    17,    17,    17,     8,     8,     8,     5,    21,    19,
70675fd0b74Schristos        6,     7,    24,    17,    17,     9,    26,     6,     6,    10,
70775fd0b74Schristos        6,     5,    27,     8,    23,     6,     5,    28,    29,     6,
70875fd0b74Schristos        5,     6,     8,     8,     6
70975fd0b74Schristos };
71075fd0b74Schristos 
711*e992f068Schristos /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.  */
712*e992f068Schristos static const yytype_int8 yyr1[] =
713ede78133Schristos {
714ede78133Schristos        0,    11,    13,    12,    14,    14,    16,    15,    17,    17,
715ede78133Schristos       17,    17,    19,    18,    21,    20,    23,    22,    24,    24,
716ede78133Schristos       25,    26,    27,    27,    28,    28,    29,    29
717ede78133Schristos };
718ede78133Schristos 
719*e992f068Schristos /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.  */
720*e992f068Schristos static const yytype_int8 yyr2[] =
721ede78133Schristos {
722ede78133Schristos        0,     2,     0,     2,     2,     0,     0,     6,     2,     2,
723ede78133Schristos        2,     0,     0,     6,     0,     6,     0,    10,     1,     0,
724ede78133Schristos        3,     2,     3,     0,     0,     3,     0,     5
725ede78133Schristos };
726ede78133Schristos 
727ede78133Schristos 
728*e992f068Schristos enum { YYENOMEM = -2 };
729*e992f068Schristos 
73075fd0b74Schristos #define yyerrok         (yyerrstatus = 0)
73175fd0b74Schristos #define yyclearin       (yychar = YYEMPTY)
73275fd0b74Schristos 
73375fd0b74Schristos #define YYACCEPT        goto yyacceptlab
73475fd0b74Schristos #define YYABORT         goto yyabortlab
73575fd0b74Schristos #define YYERROR         goto yyerrorlab
736*e992f068Schristos #define YYNOMEM         goto yyexhaustedlab
73775fd0b74Schristos 
73875fd0b74Schristos 
73975fd0b74Schristos #define YYRECOVERING()  (!!yyerrstatus)
74075fd0b74Schristos 
74175fd0b74Schristos #define YYBACKUP(Token, Value)                                    \
74275fd0b74Schristos   do                                                              \
743ede78133Schristos     if (yychar == YYEMPTY)                                        \
74475fd0b74Schristos       {                                                           \
74575fd0b74Schristos         yychar = (Token);                                         \
74675fd0b74Schristos         yylval = (Value);                                         \
747ede78133Schristos         YYPOPSTACK (yylen);                                       \
748ede78133Schristos         yystate = *yyssp;                                         \
74975fd0b74Schristos         goto yybackup;                                            \
75075fd0b74Schristos       }                                                           \
75175fd0b74Schristos     else                                                          \
75275fd0b74Schristos       {                                                           \
75375fd0b74Schristos         yyerror (YY_("syntax error: cannot back up")); \
75475fd0b74Schristos         YYERROR;                                                  \
75575fd0b74Schristos       }                                                           \
756ede78133Schristos   while (0)
75775fd0b74Schristos 
758*e992f068Schristos /* Backward compatibility with an undocumented macro.
759*e992f068Schristos    Use YYerror or YYUNDEF. */
760*e992f068Schristos #define YYERRCODE YYUNDEF
76175fd0b74Schristos 
76275fd0b74Schristos 
76375fd0b74Schristos /* Enable debugging if requested.  */
76475fd0b74Schristos #if YYDEBUG
76575fd0b74Schristos 
76675fd0b74Schristos # ifndef YYFPRINTF
76775fd0b74Schristos #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
76875fd0b74Schristos #  define YYFPRINTF fprintf
76975fd0b74Schristos # endif
77075fd0b74Schristos 
77175fd0b74Schristos # define YYDPRINTF(Args)                        \
77275fd0b74Schristos do {                                            \
77375fd0b74Schristos   if (yydebug)                                  \
77475fd0b74Schristos     YYFPRINTF Args;                             \
775ede78133Schristos } while (0)
776ede78133Schristos 
777ede78133Schristos 
77875fd0b74Schristos 
779*e992f068Schristos 
780*e992f068Schristos # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)                    \
78175fd0b74Schristos do {                                                                      \
78275fd0b74Schristos   if (yydebug)                                                            \
78375fd0b74Schristos     {                                                                     \
78475fd0b74Schristos       YYFPRINTF (stderr, "%s ", Title);                                   \
78575fd0b74Schristos       yy_symbol_print (stderr,                                            \
786*e992f068Schristos                   Kind, Value); \
78775fd0b74Schristos       YYFPRINTF (stderr, "\n");                                           \
78875fd0b74Schristos     }                                                                     \
789ede78133Schristos } while (0)
79075fd0b74Schristos 
79175fd0b74Schristos 
792*e992f068Schristos /*-----------------------------------.
793*e992f068Schristos | Print this symbol's value on YYO.  |
794*e992f068Schristos `-----------------------------------*/
79575fd0b74Schristos 
79675fd0b74Schristos static void
yy_symbol_value_print(FILE * yyo,yysymbol_kind_t yykind,YYSTYPE const * const yyvaluep)797*e992f068Schristos yy_symbol_value_print (FILE *yyo,
798*e992f068Schristos                        yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
79975fd0b74Schristos {
800*e992f068Schristos   FILE *yyoutput = yyo;
801*e992f068Schristos   YY_USE (yyoutput);
80275fd0b74Schristos   if (!yyvaluep)
80375fd0b74Schristos     return;
804*e992f068Schristos   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
805*e992f068Schristos   YY_USE (yykind);
806*e992f068Schristos   YY_IGNORE_MAYBE_UNINITIALIZED_END
80775fd0b74Schristos }
80875fd0b74Schristos 
80975fd0b74Schristos 
810*e992f068Schristos /*---------------------------.
811*e992f068Schristos | Print this symbol on YYO.  |
812*e992f068Schristos `---------------------------*/
81375fd0b74Schristos 
81475fd0b74Schristos static void
yy_symbol_print(FILE * yyo,yysymbol_kind_t yykind,YYSTYPE const * const yyvaluep)815*e992f068Schristos yy_symbol_print (FILE *yyo,
816*e992f068Schristos                  yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
81775fd0b74Schristos {
818*e992f068Schristos   YYFPRINTF (yyo, "%s %s (",
819*e992f068Schristos              yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
82075fd0b74Schristos 
821*e992f068Schristos   yy_symbol_value_print (yyo, yykind, yyvaluep);
822*e992f068Schristos   YYFPRINTF (yyo, ")");
82375fd0b74Schristos }
82475fd0b74Schristos 
82575fd0b74Schristos /*------------------------------------------------------------------.
82675fd0b74Schristos | yy_stack_print -- Print the state stack from its BOTTOM up to its |
82775fd0b74Schristos | TOP (included).                                                   |
82875fd0b74Schristos `------------------------------------------------------------------*/
82975fd0b74Schristos 
83075fd0b74Schristos static void
yy_stack_print(yy_state_t * yybottom,yy_state_t * yytop)831*e992f068Schristos yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
83275fd0b74Schristos {
83375fd0b74Schristos   YYFPRINTF (stderr, "Stack now");
834ede78133Schristos   for (; yybottom <= yytop; yybottom++)
835ede78133Schristos     {
836ede78133Schristos       int yybot = *yybottom;
837ede78133Schristos       YYFPRINTF (stderr, " %d", yybot);
838ede78133Schristos     }
83975fd0b74Schristos   YYFPRINTF (stderr, "\n");
84075fd0b74Schristos }
84175fd0b74Schristos 
84275fd0b74Schristos # define YY_STACK_PRINT(Bottom, Top)                            \
84375fd0b74Schristos do {                                                            \
84475fd0b74Schristos   if (yydebug)                                                  \
84575fd0b74Schristos     yy_stack_print ((Bottom), (Top));                           \
846ede78133Schristos } while (0)
84775fd0b74Schristos 
84875fd0b74Schristos 
84975fd0b74Schristos /*------------------------------------------------.
85075fd0b74Schristos | Report that the YYRULE is going to be reduced.  |
85175fd0b74Schristos `------------------------------------------------*/
85275fd0b74Schristos 
85375fd0b74Schristos static void
yy_reduce_print(yy_state_t * yyssp,YYSTYPE * yyvsp,int yyrule)854*e992f068Schristos yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
855*e992f068Schristos                  int yyrule)
85675fd0b74Schristos {
857*e992f068Schristos   int yylno = yyrline[yyrule];
85875fd0b74Schristos   int yynrhs = yyr2[yyrule];
85975fd0b74Schristos   int yyi;
860*e992f068Schristos   YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
86175fd0b74Schristos              yyrule - 1, yylno);
86275fd0b74Schristos   /* The symbols being reduced.  */
86375fd0b74Schristos   for (yyi = 0; yyi < yynrhs; yyi++)
86475fd0b74Schristos     {
865ede78133Schristos       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
866ede78133Schristos       yy_symbol_print (stderr,
867*e992f068Schristos                        YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
868*e992f068Schristos                        &yyvsp[(yyi + 1) - (yynrhs)]);
869ede78133Schristos       YYFPRINTF (stderr, "\n");
87075fd0b74Schristos     }
87175fd0b74Schristos }
87275fd0b74Schristos 
87375fd0b74Schristos # define YY_REDUCE_PRINT(Rule)          \
87475fd0b74Schristos do {                                    \
87575fd0b74Schristos   if (yydebug)                          \
876ede78133Schristos     yy_reduce_print (yyssp, yyvsp, Rule); \
877ede78133Schristos } while (0)
87875fd0b74Schristos 
87975fd0b74Schristos /* Nonzero means print parse trace.  It is left uninitialized so that
88075fd0b74Schristos    multiple parsers can coexist.  */
88175fd0b74Schristos int yydebug;
88275fd0b74Schristos #else /* !YYDEBUG */
883*e992f068Schristos # define YYDPRINTF(Args) ((void) 0)
884*e992f068Schristos # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
88575fd0b74Schristos # define YY_STACK_PRINT(Bottom, Top)
88675fd0b74Schristos # define YY_REDUCE_PRINT(Rule)
88775fd0b74Schristos #endif /* !YYDEBUG */
88875fd0b74Schristos 
88975fd0b74Schristos 
89075fd0b74Schristos /* YYINITDEPTH -- initial size of the parser's stacks.  */
89175fd0b74Schristos #ifndef YYINITDEPTH
89275fd0b74Schristos # define YYINITDEPTH 200
89375fd0b74Schristos #endif
89475fd0b74Schristos 
89575fd0b74Schristos /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
89675fd0b74Schristos    if the built-in stack extension method is used).
89775fd0b74Schristos 
89875fd0b74Schristos    Do not make this value too large; the results are undefined if
89975fd0b74Schristos    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
90075fd0b74Schristos    evaluated with infinite-precision integer arithmetic.  */
90175fd0b74Schristos 
90275fd0b74Schristos #ifndef YYMAXDEPTH
90375fd0b74Schristos # define YYMAXDEPTH 10000
90475fd0b74Schristos #endif
90575fd0b74Schristos 
90675fd0b74Schristos 
90775fd0b74Schristos 
90875fd0b74Schristos 
90975fd0b74Schristos 
91075fd0b74Schristos 
91175fd0b74Schristos /*-----------------------------------------------.
91275fd0b74Schristos | Release the memory associated to this symbol.  |
91375fd0b74Schristos `-----------------------------------------------*/
91475fd0b74Schristos 
91575fd0b74Schristos static void
yydestruct(const char * yymsg,yysymbol_kind_t yykind,YYSTYPE * yyvaluep)916*e992f068Schristos yydestruct (const char *yymsg,
917*e992f068Schristos             yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
91875fd0b74Schristos {
919*e992f068Schristos   YY_USE (yyvaluep);
92075fd0b74Schristos   if (!yymsg)
92175fd0b74Schristos     yymsg = "Deleting";
922*e992f068Schristos   YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
92375fd0b74Schristos 
924ede78133Schristos   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
925*e992f068Schristos   YY_USE (yykind);
926ede78133Schristos   YY_IGNORE_MAYBE_UNINITIALIZED_END
92775fd0b74Schristos }
92875fd0b74Schristos 
92975fd0b74Schristos 
930*e992f068Schristos /* Lookahead token kind.  */
93175fd0b74Schristos int yychar;
93275fd0b74Schristos 
933ede78133Schristos /* The semantic value of the lookahead symbol.  */
93475fd0b74Schristos YYSTYPE yylval;
93575fd0b74Schristos /* Number of syntax errors so far.  */
93675fd0b74Schristos int yynerrs;
93775fd0b74Schristos 
93875fd0b74Schristos 
939*e992f068Schristos 
940*e992f068Schristos 
94175fd0b74Schristos /*----------.
94275fd0b74Schristos | yyparse.  |
94375fd0b74Schristos `----------*/
94475fd0b74Schristos 
94575fd0b74Schristos int
yyparse(void)94675fd0b74Schristos yyparse (void)
94775fd0b74Schristos {
948*e992f068Schristos     yy_state_fast_t yystate = 0;
94975fd0b74Schristos     /* Number of tokens to shift before error messages enabled.  */
950*e992f068Schristos     int yyerrstatus = 0;
951ede78133Schristos 
952*e992f068Schristos     /* Refer to the stacks through separate pointers, to allow yyoverflow
953ede78133Schristos        to reallocate them elsewhere.  */
954ede78133Schristos 
955*e992f068Schristos     /* Their size.  */
956*e992f068Schristos     YYPTRDIFF_T yystacksize = YYINITDEPTH;
957ede78133Schristos 
958*e992f068Schristos     /* The state stack: array, bottom, top.  */
959*e992f068Schristos     yy_state_t yyssa[YYINITDEPTH];
960*e992f068Schristos     yy_state_t *yyss = yyssa;
961*e992f068Schristos     yy_state_t *yyssp = yyss;
962*e992f068Schristos 
963*e992f068Schristos     /* The semantic value stack: array, bottom, top.  */
964ede78133Schristos     YYSTYPE yyvsa[YYINITDEPTH];
965*e992f068Schristos     YYSTYPE *yyvs = yyvsa;
966*e992f068Schristos     YYSTYPE *yyvsp = yyvs;
967ede78133Schristos 
968ede78133Schristos   int yyn;
969*e992f068Schristos   /* The return value of yyparse.  */
970ede78133Schristos   int yyresult;
971*e992f068Schristos   /* Lookahead symbol kind.  */
972*e992f068Schristos   yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
973ede78133Schristos   /* The variables used to return semantic value and location from the
974ede78133Schristos      action routines.  */
975ede78133Schristos   YYSTYPE yyval;
976ede78133Schristos 
977*e992f068Schristos 
97875fd0b74Schristos 
97975fd0b74Schristos #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
98075fd0b74Schristos 
98175fd0b74Schristos   /* The number of symbols on the RHS of the reduced rule.
98275fd0b74Schristos      Keep to zero when no symbol should be popped.  */
98375fd0b74Schristos   int yylen = 0;
98475fd0b74Schristos 
98575fd0b74Schristos   YYDPRINTF ((stderr, "Starting parse\n"));
98675fd0b74Schristos 
98775fd0b74Schristos   yychar = YYEMPTY; /* Cause a token to be read.  */
988*e992f068Schristos 
98975fd0b74Schristos   goto yysetstate;
99075fd0b74Schristos 
991*e992f068Schristos 
99275fd0b74Schristos /*------------------------------------------------------------.
993*e992f068Schristos | yynewstate -- push a new state, which is found in yystate.  |
99475fd0b74Schristos `------------------------------------------------------------*/
99575fd0b74Schristos yynewstate:
99675fd0b74Schristos   /* In all cases, when you get here, the value and location stacks
99775fd0b74Schristos      have just been pushed.  So pushing a state here evens the stacks.  */
99875fd0b74Schristos   yyssp++;
99975fd0b74Schristos 
1000*e992f068Schristos 
1001*e992f068Schristos /*--------------------------------------------------------------------.
1002*e992f068Schristos | yysetstate -- set current state (the top of the stack) to yystate.  |
1003*e992f068Schristos `--------------------------------------------------------------------*/
100475fd0b74Schristos yysetstate:
1005*e992f068Schristos   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1006*e992f068Schristos   YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1007*e992f068Schristos   YY_IGNORE_USELESS_CAST_BEGIN
1008*e992f068Schristos   *yyssp = YY_CAST (yy_state_t, yystate);
1009*e992f068Schristos   YY_IGNORE_USELESS_CAST_END
1010*e992f068Schristos   YY_STACK_PRINT (yyss, yyssp);
101175fd0b74Schristos 
101275fd0b74Schristos   if (yyss + yystacksize - 1 <= yyssp)
1013*e992f068Schristos #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1014*e992f068Schristos     YYNOMEM;
1015*e992f068Schristos #else
101675fd0b74Schristos     {
101775fd0b74Schristos       /* Get the current used size of the three stacks, in elements.  */
1018*e992f068Schristos       YYPTRDIFF_T yysize = yyssp - yyss + 1;
101975fd0b74Schristos 
1020*e992f068Schristos # if defined yyoverflow
102175fd0b74Schristos       {
102275fd0b74Schristos         /* Give user a chance to reallocate the stack.  Use copies of
102375fd0b74Schristos            these so that the &'s don't force the real ones into
102475fd0b74Schristos            memory.  */
1025*e992f068Schristos         yy_state_t *yyss1 = yyss;
102675fd0b74Schristos         YYSTYPE *yyvs1 = yyvs;
102775fd0b74Schristos 
102875fd0b74Schristos         /* Each stack pointer address is followed by the size of the
102975fd0b74Schristos            data in use in that stack, in bytes.  This used to be a
103075fd0b74Schristos            conditional around just the two extra args, but that might
103175fd0b74Schristos            be undefined if yyoverflow is a macro.  */
103275fd0b74Schristos         yyoverflow (YY_("memory exhausted"),
1033*e992f068Schristos                     &yyss1, yysize * YYSIZEOF (*yyssp),
1034*e992f068Schristos                     &yyvs1, yysize * YYSIZEOF (*yyvsp),
103575fd0b74Schristos                     &yystacksize);
103675fd0b74Schristos         yyss = yyss1;
103775fd0b74Schristos         yyvs = yyvs1;
103875fd0b74Schristos       }
1039*e992f068Schristos # else /* defined YYSTACK_RELOCATE */
104075fd0b74Schristos       /* Extend the stack our own way.  */
104175fd0b74Schristos       if (YYMAXDEPTH <= yystacksize)
1042*e992f068Schristos         YYNOMEM;
104375fd0b74Schristos       yystacksize *= 2;
104475fd0b74Schristos       if (YYMAXDEPTH < yystacksize)
104575fd0b74Schristos         yystacksize = YYMAXDEPTH;
104675fd0b74Schristos 
104775fd0b74Schristos       {
1048*e992f068Schristos         yy_state_t *yyss1 = yyss;
104975fd0b74Schristos         union yyalloc *yyptr =
1050*e992f068Schristos           YY_CAST (union yyalloc *,
1051*e992f068Schristos                    YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
105275fd0b74Schristos         if (! yyptr)
1053*e992f068Schristos           YYNOMEM;
1054ede78133Schristos         YYSTACK_RELOCATE (yyss_alloc, yyss);
1055ede78133Schristos         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
105675fd0b74Schristos #  undef YYSTACK_RELOCATE
105775fd0b74Schristos         if (yyss1 != yyssa)
105875fd0b74Schristos           YYSTACK_FREE (yyss1);
105975fd0b74Schristos       }
106075fd0b74Schristos # endif
106175fd0b74Schristos 
106275fd0b74Schristos       yyssp = yyss + yysize - 1;
106375fd0b74Schristos       yyvsp = yyvs + yysize - 1;
106475fd0b74Schristos 
1065*e992f068Schristos       YY_IGNORE_USELESS_CAST_BEGIN
1066*e992f068Schristos       YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1067*e992f068Schristos                   YY_CAST (long, yystacksize)));
1068*e992f068Schristos       YY_IGNORE_USELESS_CAST_END
106975fd0b74Schristos 
107075fd0b74Schristos       if (yyss + yystacksize - 1 <= yyssp)
107175fd0b74Schristos         YYABORT;
107275fd0b74Schristos     }
1073*e992f068Schristos #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
107475fd0b74Schristos 
107575fd0b74Schristos 
1076ede78133Schristos   if (yystate == YYFINAL)
1077ede78133Schristos     YYACCEPT;
1078ede78133Schristos 
107975fd0b74Schristos   goto yybackup;
108075fd0b74Schristos 
1081*e992f068Schristos 
108275fd0b74Schristos /*-----------.
108375fd0b74Schristos | yybackup.  |
108475fd0b74Schristos `-----------*/
108575fd0b74Schristos yybackup:
108675fd0b74Schristos   /* Do appropriate processing given the current state.  Read a
1087ede78133Schristos      lookahead token if we need one and don't already have one.  */
108875fd0b74Schristos 
1089ede78133Schristos   /* First try to decide what to do without reference to lookahead token.  */
109075fd0b74Schristos   yyn = yypact[yystate];
1091ede78133Schristos   if (yypact_value_is_default (yyn))
109275fd0b74Schristos     goto yydefault;
109375fd0b74Schristos 
1094ede78133Schristos   /* Not known => get a lookahead token if don't already have one.  */
109575fd0b74Schristos 
1096*e992f068Schristos   /* YYCHAR is either empty, or end-of-input, or a valid lookahead.  */
109775fd0b74Schristos   if (yychar == YYEMPTY)
109875fd0b74Schristos     {
1099*e992f068Schristos       YYDPRINTF ((stderr, "Reading a token\n"));
1100ede78133Schristos       yychar = yylex ();
110175fd0b74Schristos     }
110275fd0b74Schristos 
110375fd0b74Schristos   if (yychar <= YYEOF)
110475fd0b74Schristos     {
1105*e992f068Schristos       yychar = YYEOF;
1106*e992f068Schristos       yytoken = YYSYMBOL_YYEOF;
110775fd0b74Schristos       YYDPRINTF ((stderr, "Now at end of input.\n"));
110875fd0b74Schristos     }
1109*e992f068Schristos   else if (yychar == YYerror)
1110*e992f068Schristos     {
1111*e992f068Schristos       /* The scanner already issued an error message, process directly
1112*e992f068Schristos          to error recovery.  But do not keep the error token as
1113*e992f068Schristos          lookahead, it is too special and may lead us to an endless
1114*e992f068Schristos          loop in error recovery. */
1115*e992f068Schristos       yychar = YYUNDEF;
1116*e992f068Schristos       yytoken = YYSYMBOL_YYerror;
1117*e992f068Schristos       goto yyerrlab1;
1118*e992f068Schristos     }
111975fd0b74Schristos   else
112075fd0b74Schristos     {
112175fd0b74Schristos       yytoken = YYTRANSLATE (yychar);
112275fd0b74Schristos       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
112375fd0b74Schristos     }
112475fd0b74Schristos 
112575fd0b74Schristos   /* If the proper action on seeing token YYTOKEN is to reduce or to
112675fd0b74Schristos      detect an error, take that action.  */
112775fd0b74Schristos   yyn += yytoken;
112875fd0b74Schristos   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
112975fd0b74Schristos     goto yydefault;
113075fd0b74Schristos   yyn = yytable[yyn];
113175fd0b74Schristos   if (yyn <= 0)
113275fd0b74Schristos     {
1133ede78133Schristos       if (yytable_value_is_error (yyn))
113475fd0b74Schristos         goto yyerrlab;
113575fd0b74Schristos       yyn = -yyn;
113675fd0b74Schristos       goto yyreduce;
113775fd0b74Schristos     }
113875fd0b74Schristos 
113975fd0b74Schristos   /* Count tokens shifted since error; after three, turn off error
114075fd0b74Schristos      status.  */
114175fd0b74Schristos   if (yyerrstatus)
114275fd0b74Schristos     yyerrstatus--;
114375fd0b74Schristos 
1144ede78133Schristos   /* Shift the lookahead token.  */
114575fd0b74Schristos   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
114675fd0b74Schristos   yystate = yyn;
1147ede78133Schristos   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
114875fd0b74Schristos   *++yyvsp = yylval;
1149ede78133Schristos   YY_IGNORE_MAYBE_UNINITIALIZED_END
115075fd0b74Schristos 
1151*e992f068Schristos   /* Discard the shifted token.  */
1152*e992f068Schristos   yychar = YYEMPTY;
115375fd0b74Schristos   goto yynewstate;
115475fd0b74Schristos 
115575fd0b74Schristos 
115675fd0b74Schristos /*-----------------------------------------------------------.
115775fd0b74Schristos | yydefault -- do the default action for the current state.  |
115875fd0b74Schristos `-----------------------------------------------------------*/
115975fd0b74Schristos yydefault:
116075fd0b74Schristos   yyn = yydefact[yystate];
116175fd0b74Schristos   if (yyn == 0)
116275fd0b74Schristos     goto yyerrlab;
116375fd0b74Schristos   goto yyreduce;
116475fd0b74Schristos 
116575fd0b74Schristos 
116675fd0b74Schristos /*-----------------------------.
1167*e992f068Schristos | yyreduce -- do a reduction.  |
116875fd0b74Schristos `-----------------------------*/
116975fd0b74Schristos yyreduce:
117075fd0b74Schristos   /* yyn is the number of a rule to reduce with.  */
117175fd0b74Schristos   yylen = yyr2[yyn];
117275fd0b74Schristos 
117375fd0b74Schristos   /* If YYLEN is nonzero, implement the default value of the action:
1174ede78133Schristos      '$$ = $1'.
117575fd0b74Schristos 
117675fd0b74Schristos      Otherwise, the following line sets YYVAL to garbage.
117775fd0b74Schristos      This behavior is undocumented and Bison
117875fd0b74Schristos      users should not rely upon it.  Assigning to YYVAL
117975fd0b74Schristos      unconditionally makes the parser a bit smaller, and it avoids a
118075fd0b74Schristos      GCC warning that YYVAL may be used uninitialized.  */
118175fd0b74Schristos   yyval = yyvsp[1-yylen];
118275fd0b74Schristos 
118375fd0b74Schristos 
118475fd0b74Schristos   YY_REDUCE_PRINT (yyn);
118575fd0b74Schristos   switch (yyn)
118675fd0b74Schristos     {
1187*e992f068Schristos   case 2: /* $@1: %empty  */
1188*e992f068Schristos #line 55 "sysinfo.y"
118975fd0b74Schristos       {
119075fd0b74Schristos   switch (writecode)
119175fd0b74Schristos     {
119275fd0b74Schristos     case 'i':
119375fd0b74Schristos       printf("#ifdef SYSROFF_SWAP_IN\n");
119475fd0b74Schristos       break;
119575fd0b74Schristos     case 'p':
119675fd0b74Schristos       printf("#ifdef SYSROFF_p\n");
119775fd0b74Schristos       break;
119875fd0b74Schristos     case 'd':
119975fd0b74Schristos       break;
120075fd0b74Schristos     case 'g':
120175fd0b74Schristos       printf("#ifdef SYSROFF_SWAP_OUT\n");
120275fd0b74Schristos       break;
120375fd0b74Schristos     case 'c':
120475fd0b74Schristos       printf("#ifdef SYSROFF_PRINT\n");
120575fd0b74Schristos       printf("#include <stdio.h>\n");
120675fd0b74Schristos       printf("#include <stdlib.h>\n");
120775fd0b74Schristos       printf("#include <ansidecl.h>\n");
120875fd0b74Schristos       break;
120975fd0b74Schristos     }
121075fd0b74Schristos  }
1211*e992f068Schristos #line 1212 "sysinfo.c"
121275fd0b74Schristos     break;
121375fd0b74Schristos 
1214*e992f068Schristos   case 3: /* top: $@1 it_list  */
1215*e992f068Schristos #line 77 "sysinfo.y"
121675fd0b74Schristos         {
121775fd0b74Schristos   switch (writecode) {
121875fd0b74Schristos   case 'i':
121975fd0b74Schristos   case 'p':
122075fd0b74Schristos   case 'g':
122175fd0b74Schristos   case 'c':
122275fd0b74Schristos     printf("#endif\n");
122375fd0b74Schristos     break;
122475fd0b74Schristos   case 'd':
122575fd0b74Schristos     break;
122675fd0b74Schristos   }
122775fd0b74Schristos }
1228*e992f068Schristos #line 1229 "sysinfo.c"
122975fd0b74Schristos     break;
123075fd0b74Schristos 
1231*e992f068Schristos   case 6: /* $@2: %empty  */
1232*e992f068Schristos #line 99 "sysinfo.y"
123375fd0b74Schristos       {
1234ede78133Schristos 	it = (yyvsp[-1].s); code = (yyvsp[0].i);
123575fd0b74Schristos 	switch (writecode)
123675fd0b74Schristos 	  {
123775fd0b74Schristos 	  case 'd':
123875fd0b74Schristos 	    printf("\n\n\n#define IT_%s_CODE 0x%x\n", it,code);
123975fd0b74Schristos 	    printf("struct IT_%s;\n", it);
124075fd0b74Schristos 	    printf("extern void sysroff_swap_%s_in (struct IT_%s *);\n",
1241ede78133Schristos 		   (yyvsp[-1].s), it);
124275fd0b74Schristos 	    printf("extern void sysroff_swap_%s_out (FILE *, struct IT_%s *);\n",
1243ede78133Schristos 		   (yyvsp[-1].s), it);
124475fd0b74Schristos 	    printf("extern void sysroff_print_%s_out (struct IT_%s *);\n",
1245ede78133Schristos 		   (yyvsp[-1].s), it);
124675fd0b74Schristos 	    printf("struct IT_%s { \n", it);
124775fd0b74Schristos 	    break;
124875fd0b74Schristos 	  case 'i':
1249ede78133Schristos 	    printf("void sysroff_swap_%s_in (struct IT_%s * ptr)\n",(yyvsp[-1].s),it);
125075fd0b74Schristos 	    printf("{\n");
125175fd0b74Schristos 	    printf("\tunsigned char raw[255];\n");
125275fd0b74Schristos 	    printf("\tint idx = 0;\n");
125375fd0b74Schristos 	    printf("\tint size;\n");
125475fd0b74Schristos 	    printf("\tmemset(raw,0,255);\n");
125575fd0b74Schristos 	    printf("\tmemset(ptr,0,sizeof(*ptr));\n");
125675fd0b74Schristos 	    printf("\tsize = fillup(raw);\n");
125775fd0b74Schristos 	    break;
125875fd0b74Schristos 	  case 'g':
1259ede78133Schristos 	    printf("void sysroff_swap_%s_out (FILE * ffile, struct IT_%s * ptr)\n",(yyvsp[-1].s),it);
126075fd0b74Schristos 	    printf("{\n");
126175fd0b74Schristos 	    printf("\tunsigned char raw[255];\n");
126275fd0b74Schristos 	    printf("\tint idx = 16;\n");
126375fd0b74Schristos 	    printf("\tmemset (raw, 0, 255);\n");
126475fd0b74Schristos 	    printf("\tcode = IT_%s_CODE;\n", it);
126575fd0b74Schristos 	    break;
126675fd0b74Schristos 	  case 'o':
1267ede78133Schristos 	    printf("void sysroff_swap_%s_out (bfd * abfd, struct IT_%s * ptr)\n",(yyvsp[-1].s), it);
126875fd0b74Schristos 	    printf("{\n");
126975fd0b74Schristos 	    printf("\tint idx = 0;\n");
127075fd0b74Schristos 	    break;
127175fd0b74Schristos 	  case 'c':
1272ede78133Schristos 	    printf("void sysroff_print_%s_out (struct IT_%s *ptr)\n",(yyvsp[-1].s),it);
127375fd0b74Schristos 	    printf("{\n");
1274ede78133Schristos 	    printf("itheader(\"%s\", IT_%s_CODE);\n",(yyvsp[-1].s),(yyvsp[-1].s));
127575fd0b74Schristos 	    break;
127675fd0b74Schristos 
127775fd0b74Schristos 	  case 't':
127875fd0b74Schristos 	    break;
127975fd0b74Schristos 	  }
128075fd0b74Schristos 
128175fd0b74Schristos       }
1282*e992f068Schristos #line 1283 "sysinfo.c"
128375fd0b74Schristos     break;
128475fd0b74Schristos 
1285*e992f068Schristos   case 7: /* it: '(' NAME NUMBER $@2 it_field_list ')'  */
1286*e992f068Schristos #line 150 "sysinfo.y"
128775fd0b74Schristos {
128875fd0b74Schristos   switch (writecode) {
128975fd0b74Schristos   case 'd':
129075fd0b74Schristos     printf("};\n");
129175fd0b74Schristos     break;
129275fd0b74Schristos   case 'g':
129375fd0b74Schristos     printf("\tchecksum(ffile,raw, idx, IT_%s_CODE);\n", it);
1294ede78133Schristos     /* Fall through.  */
129575fd0b74Schristos   case 'i':
129675fd0b74Schristos   case 'o':
129775fd0b74Schristos   case 'c':
129875fd0b74Schristos     printf("}\n");
129975fd0b74Schristos   }
1300ede78133Schristos 
1301ede78133Schristos   free (it);
130275fd0b74Schristos }
1303*e992f068Schristos #line 1304 "sysinfo.c"
130475fd0b74Schristos     break;
130575fd0b74Schristos 
1306*e992f068Schristos   case 12: /* $@3: %empty  */
1307*e992f068Schristos #line 178 "sysinfo.y"
130875fd0b74Schristos         {
130975fd0b74Schristos 	  rdepth++;
131075fd0b74Schristos 	  switch (writecode)
131175fd0b74Schristos 	    {
131275fd0b74Schristos 	    case 'c':
131375fd0b74Schristos 	      if (rdepth==1)
1314ede78133Schristos 	      printf("\tprintf(\"repeat %%d\\n\", %s);\n",(yyvsp[0].s));
131575fd0b74Schristos 	      if (rdepth==2)
1316ede78133Schristos 	      printf("\tprintf(\"repeat %%d\\n\", %s[n]);\n",(yyvsp[0].s));
1317ede78133Schristos 	      /* Fall through.  */
131875fd0b74Schristos 	    case 'i':
131975fd0b74Schristos 	    case 'g':
132075fd0b74Schristos 	    case 'o':
132175fd0b74Schristos 
132275fd0b74Schristos 	      if (rdepth==1)
132375fd0b74Schristos 		{
1324ede78133Schristos 	      printf("\t{ int n; for (n = 0; n < %s; n++) {\n",    (yyvsp[0].s));
132575fd0b74Schristos 	    }
132675fd0b74Schristos 	      if (rdepth == 2) {
1327ede78133Schristos 	      printf("\t{ int m; for (m = 0; m < %s[n]; m++) {\n",    (yyvsp[0].s));
132875fd0b74Schristos 	    }
132975fd0b74Schristos 
133075fd0b74Schristos 	      break;
133175fd0b74Schristos 	    }
133275fd0b74Schristos 
133375fd0b74Schristos 	  oldrepeat = repeat;
1334ede78133Schristos          repeat = (yyvsp[0].s);
133575fd0b74Schristos 	}
1336*e992f068Schristos #line 1337 "sysinfo.c"
133775fd0b74Schristos     break;
133875fd0b74Schristos 
1339*e992f068Schristos   case 13: /* repeat_it_field: '(' REPEAT NAME $@3 it_field_list ')'  */
1340*e992f068Schristos #line 209 "sysinfo.y"
134175fd0b74Schristos         {
1342ede78133Schristos 	  free (repeat);
1343ede78133Schristos 
134475fd0b74Schristos 	  repeat = oldrepeat;
134575fd0b74Schristos 	  oldrepeat =0;
134675fd0b74Schristos 	  rdepth--;
134775fd0b74Schristos 	  switch (writecode)
134875fd0b74Schristos 	    {
134975fd0b74Schristos 	    case 'i':
135075fd0b74Schristos 	    case 'g':
135175fd0b74Schristos 	    case 'o':
135275fd0b74Schristos 	    case 'c':
135375fd0b74Schristos 	  printf("\t}}\n");
135475fd0b74Schristos 	}
135575fd0b74Schristos 	}
1356*e992f068Schristos #line 1357 "sysinfo.c"
135775fd0b74Schristos     break;
135875fd0b74Schristos 
1359*e992f068Schristos   case 14: /* $@4: %empty  */
1360*e992f068Schristos #line 228 "sysinfo.y"
136175fd0b74Schristos         {
136275fd0b74Schristos 	  switch (writecode)
136375fd0b74Schristos 	    {
136475fd0b74Schristos 	    case 'i':
136575fd0b74Schristos 	    case 'g':
136675fd0b74Schristos 	    case 'o':
136775fd0b74Schristos 	    case 'c':
1368ede78133Schristos 	      printf("\tif (%s) {\n", (yyvsp[0].s));
136975fd0b74Schristos 	      break;
137075fd0b74Schristos 	    }
1371ede78133Schristos 
1372ede78133Schristos 	  free ((yyvsp[0].s));
137375fd0b74Schristos 	}
1374*e992f068Schristos #line 1375 "sysinfo.c"
137575fd0b74Schristos     break;
137675fd0b74Schristos 
1377*e992f068Schristos   case 15: /* cond_it_field: '(' COND NAME $@4 it_field_list ')'  */
1378*e992f068Schristos #line 243 "sysinfo.y"
137975fd0b74Schristos         {
138075fd0b74Schristos 	  switch (writecode)
138175fd0b74Schristos 	    {
138275fd0b74Schristos 	    case 'i':
138375fd0b74Schristos 	    case 'g':
138475fd0b74Schristos 	    case 'o':
138575fd0b74Schristos 	    case 'c':
138675fd0b74Schristos 	  printf("\t}\n");
138775fd0b74Schristos 	}
138875fd0b74Schristos 	}
1389*e992f068Schristos #line 1390 "sysinfo.c"
139075fd0b74Schristos     break;
139175fd0b74Schristos 
1392*e992f068Schristos   case 16: /* $@5: %empty  */
1393*e992f068Schristos #line 257 "sysinfo.y"
1394ede78133Schristos         {name = (yyvsp[0].s); }
1395*e992f068Schristos #line 1396 "sysinfo.c"
139675fd0b74Schristos     break;
139775fd0b74Schristos 
1398*e992f068Schristos   case 17: /* it_field: '(' attr_desc '(' attr_type attr_size ')' attr_id $@5 enums ')'  */
1399*e992f068Schristos #line 259 "sysinfo.y"
140075fd0b74Schristos         {
1401ede78133Schristos 	  char *desc = (yyvsp[-8].s);
1402ede78133Schristos 	  char *type = (yyvsp[-6].s);
1403ede78133Schristos 	  int size = (yyvsp[-5].i);
1404ede78133Schristos 	  char *id = (yyvsp[-3].s);
140575fd0b74Schristos char *p = names[rdepth];
140675fd0b74Schristos char *ptr = pnames[rdepth];
140775fd0b74Schristos 	  switch (writecode)
140875fd0b74Schristos 	    {
140975fd0b74Schristos 	    case 'g':
141075fd0b74Schristos 	      if (size % 8)
141175fd0b74Schristos 		{
141275fd0b74Schristos 
141375fd0b74Schristos 		  printf("\twriteBITS(ptr->%s%s,raw,&idx,%d);\n",
141475fd0b74Schristos 			 id,
141575fd0b74Schristos 			 names[rdepth], size);
141675fd0b74Schristos 
141775fd0b74Schristos 		}
141875fd0b74Schristos 	      else {
141975fd0b74Schristos 		printf("\twrite%s(ptr->%s%s,raw,&idx,%d,ffile);\n",
142075fd0b74Schristos 		       type,
142175fd0b74Schristos 		       id,
142275fd0b74Schristos 		       names[rdepth],size/8);
142375fd0b74Schristos 		}
142475fd0b74Schristos 	      break;
142575fd0b74Schristos 	    case 'i':
142675fd0b74Schristos 	      {
142775fd0b74Schristos 
142875fd0b74Schristos 		if (rdepth >= 1)
142975fd0b74Schristos 
143075fd0b74Schristos 		  {
143175fd0b74Schristos 		    printf("if (!ptr->%s) ptr->%s = (%s*)xcalloc(%s, sizeof(ptr->%s[0]));\n",
143275fd0b74Schristos 			   id,
143375fd0b74Schristos 			   id,
143475fd0b74Schristos 			   type,
143575fd0b74Schristos 			   repeat,
143675fd0b74Schristos 			   id);
143775fd0b74Schristos 		  }
143875fd0b74Schristos 
143975fd0b74Schristos 		if (rdepth == 2)
144075fd0b74Schristos 		  {
144175fd0b74Schristos 		    printf("if (!ptr->%s[n]) ptr->%s[n] = (%s**)xcalloc(%s[n], sizeof(ptr->%s[n][0]));\n",
144275fd0b74Schristos 			   id,
144375fd0b74Schristos 			   id,
144475fd0b74Schristos 			   type,
144575fd0b74Schristos 			   repeat,
144675fd0b74Schristos 			   id);
144775fd0b74Schristos 		  }
144875fd0b74Schristos 
144975fd0b74Schristos 	      }
145075fd0b74Schristos 
145175fd0b74Schristos 	      if (size % 8)
145275fd0b74Schristos 		{
145375fd0b74Schristos 		  printf("\tptr->%s%s = getBITS(raw,&idx, %d,size);\n",
145475fd0b74Schristos 			 id,
145575fd0b74Schristos 			 names[rdepth],
145675fd0b74Schristos 			 size);
145775fd0b74Schristos 		}
145875fd0b74Schristos 	      else {
145975fd0b74Schristos 		printf("\tptr->%s%s = get%s(raw,&idx, %d,size);\n",
146075fd0b74Schristos 		       id,
146175fd0b74Schristos 		       names[rdepth],
146275fd0b74Schristos 		       type,
146375fd0b74Schristos 		       size/8);
146475fd0b74Schristos 		}
146575fd0b74Schristos 	      break;
146675fd0b74Schristos 	    case 'o':
146775fd0b74Schristos 	      printf("\tput%s(raw,%d,%d,&idx,ptr->%s%s);\n", type,size/8,size%8,id,names[rdepth]);
146875fd0b74Schristos 	      break;
146975fd0b74Schristos 	    case 'd':
147075fd0b74Schristos 	      if (repeat)
147175fd0b74Schristos 		printf("\t/* repeat %s */\n", repeat);
147275fd0b74Schristos 
147375fd0b74Schristos 		  if (type[0] == 'I') {
147475fd0b74Schristos 		  printf("\tint %s%s; \t/* %s */\n",ptr,id, desc);
147575fd0b74Schristos 		}
147675fd0b74Schristos 		  else if (type[0] =='C') {
147775fd0b74Schristos 		  printf("\tchar %s*%s;\t /* %s */\n",ptr,id, desc);
147875fd0b74Schristos 		}
147975fd0b74Schristos 	      else {
148075fd0b74Schristos 		printf("\tbarray %s%s;\t /* %s */\n",ptr,id, desc);
148175fd0b74Schristos 	      }
148275fd0b74Schristos 		  break;
148375fd0b74Schristos 		case 'c':
148475fd0b74Schristos 	      printf("tabout();\n");
148575fd0b74Schristos 		  printf("\tprintf(\"/*%-30s*/ ptr->%s = \");\n", desc, id);
148675fd0b74Schristos 
148775fd0b74Schristos 		  if (type[0] == 'I')
148875fd0b74Schristos 		  printf("\tprintf(\"%%d\\n\",ptr->%s%s);\n", id,p);
148975fd0b74Schristos 		  else   if (type[0] == 'C')
149075fd0b74Schristos 		  printf("\tprintf(\"%%s\\n\",ptr->%s%s);\n", id,p);
149175fd0b74Schristos 
149275fd0b74Schristos 		  else   if (type[0] == 'B')
149375fd0b74Schristos 		    {
149475fd0b74Schristos 		  printf("\tpbarray(&ptr->%s%s);\n", id,p);
149575fd0b74Schristos 		}
149675fd0b74Schristos 	      else abort();
149775fd0b74Schristos 		  break;
149875fd0b74Schristos 		}
1499ede78133Schristos 
1500ede78133Schristos 	  free (desc);
1501ede78133Schristos 	  free (id);
150275fd0b74Schristos 	}
1503*e992f068Schristos #line 1504 "sysinfo.c"
150475fd0b74Schristos     break;
150575fd0b74Schristos 
1506*e992f068Schristos   case 18: /* attr_type: TYPE  */
1507*e992f068Schristos #line 367 "sysinfo.y"
1508ede78133Schristos               { (yyval.s) = (yyvsp[0].s); }
1509*e992f068Schristos #line 1510 "sysinfo.c"
151075fd0b74Schristos     break;
151175fd0b74Schristos 
1512*e992f068Schristos   case 19: /* attr_type: %empty  */
1513*e992f068Schristos #line 368 "sysinfo.y"
151475fd0b74Schristos            { (yyval.s) = "INT";}
1515*e992f068Schristos #line 1516 "sysinfo.c"
151675fd0b74Schristos     break;
151775fd0b74Schristos 
1518*e992f068Schristos   case 20: /* attr_desc: '(' NAME ')'  */
1519*e992f068Schristos #line 373 "sysinfo.y"
1520ede78133Schristos         { (yyval.s) = (yyvsp[-1].s); }
1521*e992f068Schristos #line 1522 "sysinfo.c"
152275fd0b74Schristos     break;
152375fd0b74Schristos 
1524*e992f068Schristos   case 21: /* attr_size: NUMBER UNIT  */
1525*e992f068Schristos #line 378 "sysinfo.y"
1526ede78133Schristos         { (yyval.i) = (yyvsp[-1].i) * (yyvsp[0].i); }
1527*e992f068Schristos #line 1528 "sysinfo.c"
152875fd0b74Schristos     break;
152975fd0b74Schristos 
1530*e992f068Schristos   case 22: /* attr_id: '(' NAME ')'  */
1531*e992f068Schristos #line 383 "sysinfo.y"
1532ede78133Schristos                                 { (yyval.s) = (yyvsp[-1].s); }
1533*e992f068Schristos #line 1534 "sysinfo.c"
153475fd0b74Schristos     break;
153575fd0b74Schristos 
1536*e992f068Schristos   case 23: /* attr_id: %empty  */
1537*e992f068Schristos #line 384 "sysinfo.y"
1538ede78133Schristos                 { (yyval.s) = strdup ("dummy");}
1539*e992f068Schristos #line 1540 "sysinfo.c"
154075fd0b74Schristos     break;
154175fd0b74Schristos 
1542*e992f068Schristos   case 27: /* enum_list: enum_list '(' NAME NAME ')'  */
1543*e992f068Schristos #line 392 "sysinfo.y"
154475fd0b74Schristos                                     {
154575fd0b74Schristos 	  switch (writecode)
154675fd0b74Schristos 	    {
154775fd0b74Schristos 	    case 'd':
1548ede78133Schristos 	      printf("#define %s %s\n", (yyvsp[-2].s),(yyvsp[-1].s));
154975fd0b74Schristos 	      break;
155075fd0b74Schristos 	    case 'c':
1551ede78133Schristos 		printf("if (ptr->%s%s == %s) { tabout(); printf(\"%s\\n\");}\n", name, names[rdepth],(yyvsp[-1].s),(yyvsp[-2].s));
155275fd0b74Schristos 	    }
1553ede78133Schristos 
1554ede78133Schristos 	  free ((yyvsp[-2].s));
1555ede78133Schristos 	  free ((yyvsp[-1].s));
155675fd0b74Schristos 	}
1557*e992f068Schristos #line 1558 "sysinfo.c"
155875fd0b74Schristos     break;
155975fd0b74Schristos 
156075fd0b74Schristos 
1561*e992f068Schristos #line 1562 "sysinfo.c"
1562*e992f068Schristos 
156375fd0b74Schristos       default: break;
156475fd0b74Schristos     }
1565ede78133Schristos   /* User semantic actions sometimes alter yychar, and that requires
1566ede78133Schristos      that yytoken be updated with the new translation.  We take the
1567ede78133Schristos      approach of translating immediately before every use of yytoken.
1568ede78133Schristos      One alternative is translating here after every semantic action,
1569ede78133Schristos      but that translation would be missed if the semantic action invokes
1570ede78133Schristos      YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1571ede78133Schristos      if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
1572ede78133Schristos      incorrect destructor might then be invoked immediately.  In the
1573ede78133Schristos      case of YYERROR or YYBACKUP, subsequent parser actions might lead
1574ede78133Schristos      to an incorrect destructor call or verbose syntax error message
1575ede78133Schristos      before the lookahead is translated.  */
1576*e992f068Schristos   YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
157775fd0b74Schristos 
157875fd0b74Schristos   YYPOPSTACK (yylen);
157975fd0b74Schristos   yylen = 0;
158075fd0b74Schristos 
158175fd0b74Schristos   *++yyvsp = yyval;
158275fd0b74Schristos 
1583ede78133Schristos   /* Now 'shift' the result of the reduction.  Determine what state
158475fd0b74Schristos      that goes to, based on the state we popped back to and the rule
158575fd0b74Schristos      number reduced by.  */
1586*e992f068Schristos   {
1587*e992f068Schristos     const int yylhs = yyr1[yyn] - YYNTOKENS;
1588*e992f068Schristos     const int yyi = yypgoto[yylhs] + *yyssp;
1589*e992f068Schristos     yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1590*e992f068Schristos                ? yytable[yyi]
1591*e992f068Schristos                : yydefgoto[yylhs]);
1592*e992f068Schristos   }
159375fd0b74Schristos 
159475fd0b74Schristos   goto yynewstate;
159575fd0b74Schristos 
159675fd0b74Schristos 
1597ede78133Schristos /*--------------------------------------.
1598ede78133Schristos | yyerrlab -- here on detecting error.  |
1599ede78133Schristos `--------------------------------------*/
160075fd0b74Schristos yyerrlab:
1601ede78133Schristos   /* Make sure we have latest lookahead translation.  See comments at
1602ede78133Schristos      user semantic actions for why this is necessary.  */
1603*e992f068Schristos   yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
160475fd0b74Schristos   /* If not already recovering from an error, report this error.  */
160575fd0b74Schristos   if (!yyerrstatus)
160675fd0b74Schristos     {
160775fd0b74Schristos       ++yynerrs;
160875fd0b74Schristos       yyerror (YY_("syntax error"));
160975fd0b74Schristos     }
161075fd0b74Schristos 
161175fd0b74Schristos   if (yyerrstatus == 3)
161275fd0b74Schristos     {
1613ede78133Schristos       /* If just tried and failed to reuse lookahead token after an
161475fd0b74Schristos          error, discard it.  */
161575fd0b74Schristos 
161675fd0b74Schristos       if (yychar <= YYEOF)
161775fd0b74Schristos         {
161875fd0b74Schristos           /* Return failure if at end of input.  */
161975fd0b74Schristos           if (yychar == YYEOF)
162075fd0b74Schristos             YYABORT;
162175fd0b74Schristos         }
162275fd0b74Schristos       else
162375fd0b74Schristos         {
162475fd0b74Schristos           yydestruct ("Error: discarding",
162575fd0b74Schristos                       yytoken, &yylval);
162675fd0b74Schristos           yychar = YYEMPTY;
162775fd0b74Schristos         }
162875fd0b74Schristos     }
162975fd0b74Schristos 
1630ede78133Schristos   /* Else will try to reuse lookahead token after shifting the error
163175fd0b74Schristos      token.  */
163275fd0b74Schristos   goto yyerrlab1;
163375fd0b74Schristos 
163475fd0b74Schristos 
163575fd0b74Schristos /*---------------------------------------------------.
163675fd0b74Schristos | yyerrorlab -- error raised explicitly by YYERROR.  |
163775fd0b74Schristos `---------------------------------------------------*/
163875fd0b74Schristos yyerrorlab:
1639*e992f068Schristos   /* Pacify compilers when the user code never invokes YYERROR and the
1640*e992f068Schristos      label yyerrorlab therefore never appears in user code.  */
1641*e992f068Schristos   if (0)
1642*e992f068Schristos     YYERROR;
1643*e992f068Schristos   ++yynerrs;
164475fd0b74Schristos 
1645ede78133Schristos   /* Do not reclaim the symbols of the rule whose action triggered
164675fd0b74Schristos      this YYERROR.  */
164775fd0b74Schristos   YYPOPSTACK (yylen);
164875fd0b74Schristos   yylen = 0;
164975fd0b74Schristos   YY_STACK_PRINT (yyss, yyssp);
165075fd0b74Schristos   yystate = *yyssp;
165175fd0b74Schristos   goto yyerrlab1;
165275fd0b74Schristos 
165375fd0b74Schristos 
165475fd0b74Schristos /*-------------------------------------------------------------.
165575fd0b74Schristos | yyerrlab1 -- common code for both syntax error and YYERROR.  |
165675fd0b74Schristos `-------------------------------------------------------------*/
165775fd0b74Schristos yyerrlab1:
165875fd0b74Schristos   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
165975fd0b74Schristos 
1660*e992f068Schristos   /* Pop stack until we find a state that shifts the error token.  */
166175fd0b74Schristos   for (;;)
166275fd0b74Schristos     {
166375fd0b74Schristos       yyn = yypact[yystate];
1664ede78133Schristos       if (!yypact_value_is_default (yyn))
166575fd0b74Schristos         {
1666*e992f068Schristos           yyn += YYSYMBOL_YYerror;
1667*e992f068Schristos           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
166875fd0b74Schristos             {
166975fd0b74Schristos               yyn = yytable[yyn];
167075fd0b74Schristos               if (0 < yyn)
167175fd0b74Schristos                 break;
167275fd0b74Schristos             }
167375fd0b74Schristos         }
167475fd0b74Schristos 
167575fd0b74Schristos       /* Pop the current state because it cannot handle the error token.  */
167675fd0b74Schristos       if (yyssp == yyss)
167775fd0b74Schristos         YYABORT;
167875fd0b74Schristos 
167975fd0b74Schristos 
168075fd0b74Schristos       yydestruct ("Error: popping",
1681*e992f068Schristos                   YY_ACCESSING_SYMBOL (yystate), yyvsp);
168275fd0b74Schristos       YYPOPSTACK (1);
168375fd0b74Schristos       yystate = *yyssp;
168475fd0b74Schristos       YY_STACK_PRINT (yyss, yyssp);
168575fd0b74Schristos     }
168675fd0b74Schristos 
1687ede78133Schristos   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
168875fd0b74Schristos   *++yyvsp = yylval;
1689ede78133Schristos   YY_IGNORE_MAYBE_UNINITIALIZED_END
169075fd0b74Schristos 
169175fd0b74Schristos 
169275fd0b74Schristos   /* Shift the error token.  */
1693*e992f068Schristos   YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
169475fd0b74Schristos 
169575fd0b74Schristos   yystate = yyn;
169675fd0b74Schristos   goto yynewstate;
169775fd0b74Schristos 
169875fd0b74Schristos 
169975fd0b74Schristos /*-------------------------------------.
170075fd0b74Schristos | yyacceptlab -- YYACCEPT comes here.  |
170175fd0b74Schristos `-------------------------------------*/
170275fd0b74Schristos yyacceptlab:
170375fd0b74Schristos   yyresult = 0;
1704*e992f068Schristos   goto yyreturnlab;
1705*e992f068Schristos 
170675fd0b74Schristos 
170775fd0b74Schristos /*-----------------------------------.
170875fd0b74Schristos | yyabortlab -- YYABORT comes here.  |
170975fd0b74Schristos `-----------------------------------*/
171075fd0b74Schristos yyabortlab:
171175fd0b74Schristos   yyresult = 1;
1712*e992f068Schristos   goto yyreturnlab;
171375fd0b74Schristos 
1714*e992f068Schristos 
1715*e992f068Schristos /*-----------------------------------------------------------.
1716*e992f068Schristos | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here.  |
1717*e992f068Schristos `-----------------------------------------------------------*/
171875fd0b74Schristos yyexhaustedlab:
171975fd0b74Schristos   yyerror (YY_("memory exhausted"));
172075fd0b74Schristos   yyresult = 2;
1721*e992f068Schristos   goto yyreturnlab;
172275fd0b74Schristos 
1723*e992f068Schristos 
1724*e992f068Schristos /*----------------------------------------------------------.
1725*e992f068Schristos | yyreturnlab -- parsing is finished, clean up and return.  |
1726*e992f068Schristos `----------------------------------------------------------*/
1727*e992f068Schristos yyreturnlab:
1728ede78133Schristos   if (yychar != YYEMPTY)
1729ede78133Schristos     {
1730ede78133Schristos       /* Make sure we have latest lookahead translation.  See comments at
1731ede78133Schristos          user semantic actions for why this is necessary.  */
1732ede78133Schristos       yytoken = YYTRANSLATE (yychar);
173375fd0b74Schristos       yydestruct ("Cleanup: discarding lookahead",
173475fd0b74Schristos                   yytoken, &yylval);
1735ede78133Schristos     }
1736ede78133Schristos   /* Do not reclaim the symbols of the rule whose action triggered
173775fd0b74Schristos      this YYABORT or YYACCEPT.  */
173875fd0b74Schristos   YYPOPSTACK (yylen);
173975fd0b74Schristos   YY_STACK_PRINT (yyss, yyssp);
174075fd0b74Schristos   while (yyssp != yyss)
174175fd0b74Schristos     {
174275fd0b74Schristos       yydestruct ("Cleanup: popping",
1743*e992f068Schristos                   YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
174475fd0b74Schristos       YYPOPSTACK (1);
174575fd0b74Schristos     }
174675fd0b74Schristos #ifndef yyoverflow
174775fd0b74Schristos   if (yyss != yyssa)
174875fd0b74Schristos     YYSTACK_FREE (yyss);
174975fd0b74Schristos #endif
1750*e992f068Schristos 
1751ede78133Schristos   return yyresult;
175275fd0b74Schristos }
1753*e992f068Schristos 
1754*e992f068Schristos #line 410 "sysinfo.y"
175575fd0b74Schristos 
175675fd0b74Schristos /* four modes
175775fd0b74Schristos 
175875fd0b74Schristos    -d write structure definitions for sysroff in host format
175975fd0b74Schristos    -i write functions to swap into sysroff format in
176075fd0b74Schristos    -o write functions to swap into sysroff format out
176175fd0b74Schristos    -c write code to print info in human form */
176275fd0b74Schristos 
176375fd0b74Schristos int yydebug;
176475fd0b74Schristos 
176575fd0b74Schristos int
main(int ac,char ** av)176675fd0b74Schristos main (int ac, char **av)
176775fd0b74Schristos {
176875fd0b74Schristos   yydebug=0;
176975fd0b74Schristos   if (ac > 1)
177075fd0b74Schristos     writecode = av[1][1];
177175fd0b74Schristos if (writecode == 'd')
177275fd0b74Schristos   {
177375fd0b74Schristos     printf("typedef struct { unsigned char *data; int len; } barray; \n");
177475fd0b74Schristos     printf("typedef  int INT;\n");
177575fd0b74Schristos     printf("typedef  char * CHARS;\n");
177675fd0b74Schristos 
177775fd0b74Schristos   }
177875fd0b74Schristos   yyparse();
177975fd0b74Schristos return 0;
178075fd0b74Schristos }
178175fd0b74Schristos 
1782*e992f068Schristos static void
yyerror(const char * s)1783*e992f068Schristos yyerror (const char *s)
178475fd0b74Schristos {
178575fd0b74Schristos   fprintf(stderr, "%s\n" , s);
178675fd0b74Schristos }
1787