xref: /netbsd-src/crypto/external/bsd/heimdal/dist/lib/com_err/parse.c (revision afab4e300d3a9fb07dd8c80daf53d0feb3345706)
1*afab4e30Schristos /*	$NetBSD: parse.c,v 1.3 2023/06/19 21:41:42 christos Exp $	*/
2929c70cbSchristos 
3*afab4e30Schristos /* A Bison parser, made by GNU Bison 3.8.2.  */
4929c70cbSchristos 
5*afab4e30Schristos /* Bison implementation for Yacc-like parsers in C
6929c70cbSchristos 
7*afab4e30Schristos    Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
8*afab4e30Schristos    Inc.
9929c70cbSchristos 
10*afab4e30Schristos    This program is free software: you can redistribute it and/or modify
11929c70cbSchristos    it under the terms of the GNU General Public License as published by
12*afab4e30Schristos    the Free Software Foundation, either version 3 of the License, or
13*afab4e30Schristos    (at your option) any later version.
14929c70cbSchristos 
15929c70cbSchristos    This program is distributed in the hope that it will be useful,
16929c70cbSchristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
17929c70cbSchristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18929c70cbSchristos    GNU General Public License for more details.
19929c70cbSchristos 
20929c70cbSchristos    You should have received a copy of the GNU General Public License
21*afab4e30Schristos    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
22929c70cbSchristos 
23929c70cbSchristos /* As a special exception, you may create a larger work that contains
24929c70cbSchristos    part or all of the Bison parser skeleton and distribute that work
25929c70cbSchristos    under terms of your choice, so long as that work isn't itself a
26929c70cbSchristos    parser generator using the skeleton or a modified version thereof
27929c70cbSchristos    as a parser skeleton.  Alternatively, if you modify or redistribute
28929c70cbSchristos    the parser skeleton itself, you may (at your option) remove this
29929c70cbSchristos    special exception, which will cause the skeleton and the resulting
30929c70cbSchristos    Bison output files to be licensed under the GNU General Public
31929c70cbSchristos    License without this special exception.
32929c70cbSchristos 
33929c70cbSchristos    This special exception was added by the Free Software Foundation in
34929c70cbSchristos    version 2.2 of Bison.  */
35929c70cbSchristos 
36929c70cbSchristos /* C LALR(1) parser skeleton written by Richard Stallman, by
37929c70cbSchristos    simplifying the original so-called "semantic" parser.  */
38929c70cbSchristos 
39*afab4e30Schristos /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
40*afab4e30Schristos    especially those whose name start with YY_ or yy_.  They are
41*afab4e30Schristos    private implementation details that can be changed or removed.  */
42*afab4e30Schristos 
43929c70cbSchristos /* All symbols defined below should begin with yy or YY, to avoid
44929c70cbSchristos    infringing on user name space.  This should be done even for local
45929c70cbSchristos    variables, as they might otherwise be expanded by user macros.
46929c70cbSchristos    There are some unavoidable exceptions within include files to
47929c70cbSchristos    define necessary library symbols; they are noted "INFRINGES ON
48929c70cbSchristos    USER NAME SPACE" below.  */
49929c70cbSchristos 
50*afab4e30Schristos /* Identify Bison output, and Bison version.  */
51*afab4e30Schristos #define YYBISON 30802
52929c70cbSchristos 
53*afab4e30Schristos /* Bison version string.  */
54*afab4e30Schristos #define YYBISON_VERSION "3.8.2"
55929c70cbSchristos 
56929c70cbSchristos /* Skeleton name.  */
57929c70cbSchristos #define YYSKELETON_NAME "yacc.c"
58929c70cbSchristos 
59929c70cbSchristos /* Pure parsers.  */
60929c70cbSchristos #define YYPURE 0
61929c70cbSchristos 
62*afab4e30Schristos /* Push parsers.  */
63*afab4e30Schristos #define YYPUSH 0
64929c70cbSchristos 
65*afab4e30Schristos /* Pull parsers.  */
66*afab4e30Schristos #define YYPULL 1
67929c70cbSchristos 
68929c70cbSchristos 
69929c70cbSchristos 
70929c70cbSchristos 
71*afab4e30Schristos /* First part of user prologue.  */
72929c70cbSchristos #line 1 "parse.y"
73929c70cbSchristos 
74929c70cbSchristos /*
75929c70cbSchristos  * Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
76929c70cbSchristos  * (Royal Institute of Technology, Stockholm, Sweden).
77929c70cbSchristos  * All rights reserved.
78929c70cbSchristos  *
79929c70cbSchristos  * Redistribution and use in source and binary forms, with or without
80929c70cbSchristos  * modification, are permitted provided that the following conditions
81929c70cbSchristos  * are met:
82929c70cbSchristos  *
83929c70cbSchristos  * 1. Redistributions of source code must retain the above copyright
84929c70cbSchristos  *    notice, this list of conditions and the following disclaimer.
85929c70cbSchristos  *
86929c70cbSchristos  * 2. Redistributions in binary form must reproduce the above copyright
87929c70cbSchristos  *    notice, this list of conditions and the following disclaimer in the
88929c70cbSchristos  *    documentation and/or other materials provided with the distribution.
89929c70cbSchristos  *
90929c70cbSchristos  * 3. Neither the name of the Institute nor the names of its contributors
91929c70cbSchristos  *    may be used to endorse or promote products derived from this software
92929c70cbSchristos  *    without specific prior written permission.
93929c70cbSchristos  *
94929c70cbSchristos  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
95929c70cbSchristos  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
96929c70cbSchristos  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
97929c70cbSchristos  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
98929c70cbSchristos  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
99929c70cbSchristos  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
100929c70cbSchristos  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
101929c70cbSchristos  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
102929c70cbSchristos  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
103929c70cbSchristos  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
104929c70cbSchristos  * SUCH DAMAGE.
105929c70cbSchristos  */
106929c70cbSchristos 
107929c70cbSchristos #include "compile_et.h"
108929c70cbSchristos #include "lex.h"
109929c70cbSchristos 
110929c70cbSchristos void yyerror (char *s);
111929c70cbSchristos static long name2number(const char *str);
112929c70cbSchristos 
113929c70cbSchristos extern char *yytext;
114929c70cbSchristos 
115929c70cbSchristos /* This is for bison */
116929c70cbSchristos 
117929c70cbSchristos #if !defined(alloca) && !defined(HAVE_ALLOCA)
118929c70cbSchristos #define alloca(x) malloc(x)
119929c70cbSchristos #endif
120929c70cbSchristos 
121929c70cbSchristos #define YYMALLOC malloc
122929c70cbSchristos #define YYFREE free
123929c70cbSchristos 
124929c70cbSchristos 
125*afab4e30Schristos #line 124 "parse.c"
126929c70cbSchristos 
127*afab4e30Schristos # ifndef YY_CAST
128*afab4e30Schristos #  ifdef __cplusplus
129*afab4e30Schristos #   define YY_CAST(Type, Val) static_cast<Type> (Val)
130*afab4e30Schristos #   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
131*afab4e30Schristos #  else
132*afab4e30Schristos #   define YY_CAST(Type, Val) ((Type) (Val))
133*afab4e30Schristos #   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
134*afab4e30Schristos #  endif
135*afab4e30Schristos # endif
136*afab4e30Schristos # ifndef YY_NULLPTR
137*afab4e30Schristos #  if defined __cplusplus
138*afab4e30Schristos #   if 201103L <= __cplusplus
139*afab4e30Schristos #    define YY_NULLPTR nullptr
140*afab4e30Schristos #   else
141*afab4e30Schristos #    define YY_NULLPTR 0
142*afab4e30Schristos #   endif
143*afab4e30Schristos #  else
144*afab4e30Schristos #   define YY_NULLPTR ((void*)0)
145*afab4e30Schristos #  endif
146*afab4e30Schristos # endif
147*afab4e30Schristos 
148*afab4e30Schristos /* Use api.header.include to #include this header
149*afab4e30Schristos    instead of duplicating it here.  */
150*afab4e30Schristos #ifndef YY_YY_PARSE_H_INCLUDED
151*afab4e30Schristos # define YY_YY_PARSE_H_INCLUDED
152*afab4e30Schristos /* Debug traces.  */
153929c70cbSchristos #ifndef YYDEBUG
154929c70cbSchristos # define YYDEBUG 0
155929c70cbSchristos #endif
156*afab4e30Schristos #if YYDEBUG
157*afab4e30Schristos extern int yydebug;
158929c70cbSchristos #endif
159929c70cbSchristos 
160*afab4e30Schristos /* Token kinds.  */
161*afab4e30Schristos #ifndef YYTOKENTYPE
162*afab4e30Schristos # define YYTOKENTYPE
163*afab4e30Schristos   enum yytokentype
164929c70cbSchristos   {
165*afab4e30Schristos     YYEMPTY = -2,
166*afab4e30Schristos     YYEOF = 0,                     /* "end of file"  */
167*afab4e30Schristos     YYerror = 256,                 /* error  */
168*afab4e30Schristos     YYUNDEF = 257,                 /* "invalid token"  */
169*afab4e30Schristos     ET = 258,                      /* ET  */
170*afab4e30Schristos     INDEX = 259,                   /* INDEX  */
171*afab4e30Schristos     PREFIX = 260,                  /* PREFIX  */
172*afab4e30Schristos     EC = 261,                      /* EC  */
173*afab4e30Schristos     ID = 262,                      /* ID  */
174*afab4e30Schristos     END = 263,                     /* END  */
175*afab4e30Schristos     STRING = 264,                  /* STRING  */
176*afab4e30Schristos     NUMBER = 265                   /* NUMBER  */
177*afab4e30Schristos   };
178*afab4e30Schristos   typedef enum yytokentype yytoken_kind_t;
179*afab4e30Schristos #endif
180*afab4e30Schristos /* Token kinds.  */
181*afab4e30Schristos #define YYEMPTY -2
182*afab4e30Schristos #define YYEOF 0
183*afab4e30Schristos #define YYerror 256
184*afab4e30Schristos #define YYUNDEF 257
185*afab4e30Schristos #define ET 258
186*afab4e30Schristos #define INDEX 259
187*afab4e30Schristos #define PREFIX 260
188*afab4e30Schristos #define EC 261
189*afab4e30Schristos #define ID 262
190*afab4e30Schristos #define END 263
191*afab4e30Schristos #define STRING 264
192*afab4e30Schristos #define NUMBER 265
193*afab4e30Schristos 
194*afab4e30Schristos /* Value type.  */
195*afab4e30Schristos #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
196*afab4e30Schristos union YYSTYPE
197*afab4e30Schristos {
198*afab4e30Schristos #line 54 "parse.y"
199*afab4e30Schristos 
200929c70cbSchristos   char *string;
201929c70cbSchristos   int number;
202*afab4e30Schristos 
203*afab4e30Schristos #line 202 "parse.c"
204*afab4e30Schristos 
205*afab4e30Schristos };
206*afab4e30Schristos typedef union YYSTYPE YYSTYPE;
207929c70cbSchristos # define YYSTYPE_IS_TRIVIAL 1
208*afab4e30Schristos # define YYSTYPE_IS_DECLARED 1
209929c70cbSchristos #endif
210929c70cbSchristos 
211929c70cbSchristos 
212*afab4e30Schristos extern YYSTYPE yylval;
213929c70cbSchristos 
214929c70cbSchristos 
215*afab4e30Schristos int yyparse (void);
216*afab4e30Schristos 
217*afab4e30Schristos 
218*afab4e30Schristos #endif /* !YY_YY_PARSE_H_INCLUDED  */
219*afab4e30Schristos /* Symbol kind.  */
220*afab4e30Schristos enum yysymbol_kind_t
221*afab4e30Schristos {
222*afab4e30Schristos   YYSYMBOL_YYEMPTY = -2,
223*afab4e30Schristos   YYSYMBOL_YYEOF = 0,                      /* "end of file"  */
224*afab4e30Schristos   YYSYMBOL_YYerror = 1,                    /* error  */
225*afab4e30Schristos   YYSYMBOL_YYUNDEF = 2,                    /* "invalid token"  */
226*afab4e30Schristos   YYSYMBOL_ET = 3,                         /* ET  */
227*afab4e30Schristos   YYSYMBOL_INDEX = 4,                      /* INDEX  */
228*afab4e30Schristos   YYSYMBOL_PREFIX = 5,                     /* PREFIX  */
229*afab4e30Schristos   YYSYMBOL_EC = 6,                         /* EC  */
230*afab4e30Schristos   YYSYMBOL_ID = 7,                         /* ID  */
231*afab4e30Schristos   YYSYMBOL_END = 8,                        /* END  */
232*afab4e30Schristos   YYSYMBOL_STRING = 9,                     /* STRING  */
233*afab4e30Schristos   YYSYMBOL_NUMBER = 10,                    /* NUMBER  */
234*afab4e30Schristos   YYSYMBOL_11_ = 11,                       /* ','  */
235*afab4e30Schristos   YYSYMBOL_YYACCEPT = 12,                  /* $accept  */
236*afab4e30Schristos   YYSYMBOL_file = 13,                      /* file  */
237*afab4e30Schristos   YYSYMBOL_header = 14,                    /* header  */
238*afab4e30Schristos   YYSYMBOL_id = 15,                        /* id  */
239*afab4e30Schristos   YYSYMBOL_et = 16,                        /* et  */
240*afab4e30Schristos   YYSYMBOL_statements = 17,                /* statements  */
241*afab4e30Schristos   YYSYMBOL_statement = 18                  /* statement  */
242*afab4e30Schristos };
243*afab4e30Schristos typedef enum yysymbol_kind_t yysymbol_kind_t;
244*afab4e30Schristos 
245*afab4e30Schristos 
246*afab4e30Schristos 
247929c70cbSchristos 
248929c70cbSchristos #ifdef short
249929c70cbSchristos # undef short
250929c70cbSchristos #endif
251929c70cbSchristos 
252*afab4e30Schristos /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
253*afab4e30Schristos    <limits.h> and (if available) <stdint.h> are included
254*afab4e30Schristos    so that the code can choose integer types of a good width.  */
255*afab4e30Schristos 
256*afab4e30Schristos #ifndef __PTRDIFF_MAX__
257*afab4e30Schristos # include <limits.h> /* INFRINGES ON USER NAME SPACE */
258*afab4e30Schristos # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
259*afab4e30Schristos #  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
260*afab4e30Schristos #  define YY_STDINT_H
261*afab4e30Schristos # endif
262929c70cbSchristos #endif
263929c70cbSchristos 
264*afab4e30Schristos /* Narrow types that promote to a signed type and that can represent a
265*afab4e30Schristos    signed or unsigned integer of at least N bits.  In tables they can
266*afab4e30Schristos    save space and decrease cache pressure.  Promoting to a signed type
267*afab4e30Schristos    helps avoid bugs in integer arithmetic.  */
268*afab4e30Schristos 
269*afab4e30Schristos #ifdef __INT_LEAST8_MAX__
270*afab4e30Schristos typedef __INT_LEAST8_TYPE__ yytype_int8;
271*afab4e30Schristos #elif defined YY_STDINT_H
272*afab4e30Schristos typedef int_least8_t yytype_int8;
273*afab4e30Schristos #else
274929c70cbSchristos typedef signed char yytype_int8;
275929c70cbSchristos #endif
276929c70cbSchristos 
277*afab4e30Schristos #ifdef __INT_LEAST16_MAX__
278*afab4e30Schristos typedef __INT_LEAST16_TYPE__ yytype_int16;
279*afab4e30Schristos #elif defined YY_STDINT_H
280*afab4e30Schristos typedef int_least16_t yytype_int16;
281929c70cbSchristos #else
282*afab4e30Schristos typedef short yytype_int16;
283929c70cbSchristos #endif
284929c70cbSchristos 
285*afab4e30Schristos /* Work around bug in HP-UX 11.23, which defines these macros
286*afab4e30Schristos    incorrectly for preprocessor constants.  This workaround can likely
287*afab4e30Schristos    be removed in 2023, as HPE has promised support for HP-UX 11.23
288*afab4e30Schristos    (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
289*afab4e30Schristos    <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>.  */
290*afab4e30Schristos #ifdef __hpux
291*afab4e30Schristos # undef UINT_LEAST8_MAX
292*afab4e30Schristos # undef UINT_LEAST16_MAX
293*afab4e30Schristos # define UINT_LEAST8_MAX 255
294*afab4e30Schristos # define UINT_LEAST16_MAX 65535
295*afab4e30Schristos #endif
296*afab4e30Schristos 
297*afab4e30Schristos #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
298*afab4e30Schristos typedef __UINT_LEAST8_TYPE__ yytype_uint8;
299*afab4e30Schristos #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
300*afab4e30Schristos        && UINT_LEAST8_MAX <= INT_MAX)
301*afab4e30Schristos typedef uint_least8_t yytype_uint8;
302*afab4e30Schristos #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
303*afab4e30Schristos typedef unsigned char yytype_uint8;
304929c70cbSchristos #else
305*afab4e30Schristos typedef short yytype_uint8;
306*afab4e30Schristos #endif
307*afab4e30Schristos 
308*afab4e30Schristos #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
309*afab4e30Schristos typedef __UINT_LEAST16_TYPE__ yytype_uint16;
310*afab4e30Schristos #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
311*afab4e30Schristos        && UINT_LEAST16_MAX <= INT_MAX)
312*afab4e30Schristos typedef uint_least16_t yytype_uint16;
313*afab4e30Schristos #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
314*afab4e30Schristos typedef unsigned short yytype_uint16;
315*afab4e30Schristos #else
316*afab4e30Schristos typedef int yytype_uint16;
317*afab4e30Schristos #endif
318*afab4e30Schristos 
319*afab4e30Schristos #ifndef YYPTRDIFF_T
320*afab4e30Schristos # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
321*afab4e30Schristos #  define YYPTRDIFF_T __PTRDIFF_TYPE__
322*afab4e30Schristos #  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
323*afab4e30Schristos # elif defined PTRDIFF_MAX
324*afab4e30Schristos #  ifndef ptrdiff_t
325*afab4e30Schristos #   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
326*afab4e30Schristos #  endif
327*afab4e30Schristos #  define YYPTRDIFF_T ptrdiff_t
328*afab4e30Schristos #  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
329*afab4e30Schristos # else
330*afab4e30Schristos #  define YYPTRDIFF_T long
331*afab4e30Schristos #  define YYPTRDIFF_MAXIMUM LONG_MAX
332*afab4e30Schristos # endif
333929c70cbSchristos #endif
334929c70cbSchristos 
335929c70cbSchristos #ifndef YYSIZE_T
336929c70cbSchristos # ifdef __SIZE_TYPE__
337929c70cbSchristos #  define YYSIZE_T __SIZE_TYPE__
338929c70cbSchristos # elif defined size_t
339929c70cbSchristos #  define YYSIZE_T size_t
340*afab4e30Schristos # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
341929c70cbSchristos #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
342929c70cbSchristos #  define YYSIZE_T size_t
343929c70cbSchristos # else
344*afab4e30Schristos #  define YYSIZE_T unsigned
345929c70cbSchristos # endif
346929c70cbSchristos #endif
347929c70cbSchristos 
348*afab4e30Schristos #define YYSIZE_MAXIMUM                                  \
349*afab4e30Schristos   YY_CAST (YYPTRDIFF_T,                                 \
350*afab4e30Schristos            (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
351*afab4e30Schristos             ? YYPTRDIFF_MAXIMUM                         \
352*afab4e30Schristos             : YY_CAST (YYSIZE_T, -1)))
353*afab4e30Schristos 
354*afab4e30Schristos #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
355*afab4e30Schristos 
356*afab4e30Schristos 
357*afab4e30Schristos /* Stored state numbers (used for stacks). */
358*afab4e30Schristos typedef yytype_int8 yy_state_t;
359*afab4e30Schristos 
360*afab4e30Schristos /* State numbers in computations.  */
361*afab4e30Schristos typedef int yy_state_fast_t;
362929c70cbSchristos 
363929c70cbSchristos #ifndef YY_
364929c70cbSchristos # if defined YYENABLE_NLS && YYENABLE_NLS
365929c70cbSchristos #  if ENABLE_NLS
366929c70cbSchristos #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
367*afab4e30Schristos #   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
368929c70cbSchristos #  endif
369929c70cbSchristos # endif
370929c70cbSchristos # ifndef YY_
371*afab4e30Schristos #  define YY_(Msgid) Msgid
372*afab4e30Schristos # endif
373*afab4e30Schristos #endif
374*afab4e30Schristos 
375*afab4e30Schristos 
376*afab4e30Schristos #ifndef YY_ATTRIBUTE_PURE
377*afab4e30Schristos # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
378*afab4e30Schristos #  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
379*afab4e30Schristos # else
380*afab4e30Schristos #  define YY_ATTRIBUTE_PURE
381*afab4e30Schristos # endif
382*afab4e30Schristos #endif
383*afab4e30Schristos 
384*afab4e30Schristos #ifndef YY_ATTRIBUTE_UNUSED
385*afab4e30Schristos # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
386*afab4e30Schristos #  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
387*afab4e30Schristos # else
388*afab4e30Schristos #  define YY_ATTRIBUTE_UNUSED
389929c70cbSchristos # endif
390929c70cbSchristos #endif
391929c70cbSchristos 
392929c70cbSchristos /* Suppress unused-variable warnings by "using" E.  */
393929c70cbSchristos #if ! defined lint || defined __GNUC__
394*afab4e30Schristos # define YY_USE(E) ((void) (E))
395929c70cbSchristos #else
396*afab4e30Schristos # define YY_USE(E) /* empty */
397929c70cbSchristos #endif
398929c70cbSchristos 
399*afab4e30Schristos /* Suppress an incorrect diagnostic about yylval being uninitialized.  */
400*afab4e30Schristos #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
401*afab4e30Schristos # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
402*afab4e30Schristos #  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
403*afab4e30Schristos     _Pragma ("GCC diagnostic push")                                     \
404*afab4e30Schristos     _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
405929c70cbSchristos # else
406*afab4e30Schristos #  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
407*afab4e30Schristos     _Pragma ("GCC diagnostic push")                                     \
408*afab4e30Schristos     _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
409*afab4e30Schristos     _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
410929c70cbSchristos # endif
411*afab4e30Schristos # define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
412*afab4e30Schristos     _Pragma ("GCC diagnostic pop")
413*afab4e30Schristos #else
414*afab4e30Schristos # define YY_INITIAL_VALUE(Value) Value
415*afab4e30Schristos #endif
416*afab4e30Schristos #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
417*afab4e30Schristos # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
418*afab4e30Schristos # define YY_IGNORE_MAYBE_UNINITIALIZED_END
419*afab4e30Schristos #endif
420*afab4e30Schristos #ifndef YY_INITIAL_VALUE
421*afab4e30Schristos # define YY_INITIAL_VALUE(Value) /* Nothing. */
422929c70cbSchristos #endif
423929c70cbSchristos 
424*afab4e30Schristos #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
425*afab4e30Schristos # define YY_IGNORE_USELESS_CAST_BEGIN                          \
426*afab4e30Schristos     _Pragma ("GCC diagnostic push")                            \
427*afab4e30Schristos     _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
428*afab4e30Schristos # define YY_IGNORE_USELESS_CAST_END            \
429*afab4e30Schristos     _Pragma ("GCC diagnostic pop")
430*afab4e30Schristos #endif
431*afab4e30Schristos #ifndef YY_IGNORE_USELESS_CAST_BEGIN
432*afab4e30Schristos # define YY_IGNORE_USELESS_CAST_BEGIN
433*afab4e30Schristos # define YY_IGNORE_USELESS_CAST_END
434*afab4e30Schristos #endif
435*afab4e30Schristos 
436*afab4e30Schristos 
437*afab4e30Schristos #define YY_ASSERT(E) ((void) (0 && (E)))
438*afab4e30Schristos 
439*afab4e30Schristos #if !defined yyoverflow
440929c70cbSchristos 
441929c70cbSchristos /* The parser invokes alloca or malloc; define the necessary symbols.  */
442929c70cbSchristos 
443929c70cbSchristos # ifdef YYSTACK_USE_ALLOCA
444929c70cbSchristos #  if YYSTACK_USE_ALLOCA
445929c70cbSchristos #   ifdef __GNUC__
446929c70cbSchristos #    define YYSTACK_ALLOC __builtin_alloca
447929c70cbSchristos #   elif defined __BUILTIN_VA_ARG_INCR
448929c70cbSchristos #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
449929c70cbSchristos #   elif defined _AIX
450929c70cbSchristos #    define YYSTACK_ALLOC __alloca
451929c70cbSchristos #   elif defined _MSC_VER
452929c70cbSchristos #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
453929c70cbSchristos #    define alloca _alloca
454929c70cbSchristos #   else
455929c70cbSchristos #    define YYSTACK_ALLOC alloca
456*afab4e30Schristos #    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
457929c70cbSchristos #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
458*afab4e30Schristos       /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
459*afab4e30Schristos #     ifndef EXIT_SUCCESS
460*afab4e30Schristos #      define EXIT_SUCCESS 0
461929c70cbSchristos #     endif
462929c70cbSchristos #    endif
463929c70cbSchristos #   endif
464929c70cbSchristos #  endif
465929c70cbSchristos # endif
466929c70cbSchristos 
467929c70cbSchristos # ifdef YYSTACK_ALLOC
468*afab4e30Schristos    /* Pacify GCC's 'empty if-body' warning.  */
469*afab4e30Schristos #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
470929c70cbSchristos #  ifndef YYSTACK_ALLOC_MAXIMUM
471929c70cbSchristos     /* The OS might guarantee only one guard page at the bottom of the stack,
472929c70cbSchristos        and a page size can be as small as 4096 bytes.  So we cannot safely
473929c70cbSchristos        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
474929c70cbSchristos        to allow for a few compiler-allocated temporary stack slots.  */
475929c70cbSchristos #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
476929c70cbSchristos #  endif
477929c70cbSchristos # else
478929c70cbSchristos #  define YYSTACK_ALLOC YYMALLOC
479929c70cbSchristos #  define YYSTACK_FREE YYFREE
480929c70cbSchristos #  ifndef YYSTACK_ALLOC_MAXIMUM
481929c70cbSchristos #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
482929c70cbSchristos #  endif
483*afab4e30Schristos #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
484929c70cbSchristos        && ! ((defined YYMALLOC || defined malloc) \
485929c70cbSchristos              && (defined YYFREE || defined free)))
486929c70cbSchristos #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
487*afab4e30Schristos #   ifndef EXIT_SUCCESS
488*afab4e30Schristos #    define EXIT_SUCCESS 0
489929c70cbSchristos #   endif
490929c70cbSchristos #  endif
491929c70cbSchristos #  ifndef YYMALLOC
492929c70cbSchristos #   define YYMALLOC malloc
493*afab4e30Schristos #   if ! defined malloc && ! defined EXIT_SUCCESS
494929c70cbSchristos void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
495929c70cbSchristos #   endif
496929c70cbSchristos #  endif
497929c70cbSchristos #  ifndef YYFREE
498929c70cbSchristos #   define YYFREE free
499*afab4e30Schristos #   if ! defined free && ! defined EXIT_SUCCESS
500929c70cbSchristos void free (void *); /* INFRINGES ON USER NAME SPACE */
501929c70cbSchristos #   endif
502929c70cbSchristos #  endif
503929c70cbSchristos # endif
504*afab4e30Schristos #endif /* !defined yyoverflow */
505929c70cbSchristos 
506929c70cbSchristos #if (! defined yyoverflow \
507929c70cbSchristos      && (! defined __cplusplus \
508929c70cbSchristos          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
509929c70cbSchristos 
510929c70cbSchristos /* A type that is properly aligned for any stack member.  */
511929c70cbSchristos union yyalloc
512929c70cbSchristos {
513*afab4e30Schristos   yy_state_t yyss_alloc;
514*afab4e30Schristos   YYSTYPE yyvs_alloc;
515929c70cbSchristos };
516929c70cbSchristos 
517929c70cbSchristos /* The size of the maximum gap between one aligned stack and the next.  */
518*afab4e30Schristos # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
519929c70cbSchristos 
520929c70cbSchristos /* The size of an array large to enough to hold all stacks, each with
521929c70cbSchristos    N elements.  */
522929c70cbSchristos # define YYSTACK_BYTES(N) \
523*afab4e30Schristos      ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
524929c70cbSchristos       + YYSTACK_GAP_MAXIMUM)
525929c70cbSchristos 
526*afab4e30Schristos # define YYCOPY_NEEDED 1
527929c70cbSchristos 
528929c70cbSchristos /* Relocate STACK from its old location to the new one.  The
529929c70cbSchristos    local variables YYSIZE and YYSTACKSIZE give the old and new number of
530929c70cbSchristos    elements in the stack, and YYPTR gives the new location of the
531929c70cbSchristos    stack.  Advance YYPTR to a properly aligned location for the next
532929c70cbSchristos    stack.  */
533*afab4e30Schristos # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
534929c70cbSchristos     do                                                                  \
535929c70cbSchristos       {                                                                 \
536*afab4e30Schristos         YYPTRDIFF_T yynewbytes;                                         \
537*afab4e30Schristos         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
538*afab4e30Schristos         Stack = &yyptr->Stack_alloc;                                    \
539*afab4e30Schristos         yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
540*afab4e30Schristos         yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
541929c70cbSchristos       }                                                                 \
542*afab4e30Schristos     while (0)
543929c70cbSchristos 
544929c70cbSchristos #endif
545929c70cbSchristos 
546*afab4e30Schristos #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
547*afab4e30Schristos /* Copy COUNT objects from SRC to DST.  The source and destination do
548*afab4e30Schristos    not overlap.  */
549*afab4e30Schristos # ifndef YYCOPY
550*afab4e30Schristos #  if defined __GNUC__ && 1 < __GNUC__
551*afab4e30Schristos #   define YYCOPY(Dst, Src, Count) \
552*afab4e30Schristos       __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
553*afab4e30Schristos #  else
554*afab4e30Schristos #   define YYCOPY(Dst, Src, Count)              \
555*afab4e30Schristos       do                                        \
556*afab4e30Schristos         {                                       \
557*afab4e30Schristos           YYPTRDIFF_T yyi;                      \
558*afab4e30Schristos           for (yyi = 0; yyi < (Count); yyi++)   \
559*afab4e30Schristos             (Dst)[yyi] = (Src)[yyi];            \
560*afab4e30Schristos         }                                       \
561*afab4e30Schristos       while (0)
562*afab4e30Schristos #  endif
563*afab4e30Schristos # endif
564*afab4e30Schristos #endif /* !YYCOPY_NEEDED */
565*afab4e30Schristos 
566929c70cbSchristos /* YYFINAL -- State number of the termination state.  */
567929c70cbSchristos #define YYFINAL  9
568929c70cbSchristos /* YYLAST -- Last index in YYTABLE.  */
569929c70cbSchristos #define YYLAST   23
570929c70cbSchristos 
571929c70cbSchristos /* YYNTOKENS -- Number of terminals.  */
572929c70cbSchristos #define YYNTOKENS  12
573929c70cbSchristos /* YYNNTS -- Number of nonterminals.  */
574929c70cbSchristos #define YYNNTS  7
575929c70cbSchristos /* YYNRULES -- Number of rules.  */
576929c70cbSchristos #define YYNRULES  15
577*afab4e30Schristos /* YYNSTATES -- Number of states.  */
578929c70cbSchristos #define YYNSTATES  24
579929c70cbSchristos 
580*afab4e30Schristos /* YYMAXUTOK -- Last valid token kind.  */
581929c70cbSchristos #define YYMAXUTOK   265
582929c70cbSchristos 
583929c70cbSchristos 
584*afab4e30Schristos /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
585*afab4e30Schristos    as returned by yylex, with out-of-bounds checking.  */
586*afab4e30Schristos #define YYTRANSLATE(YYX)                                \
587*afab4e30Schristos   (0 <= (YYX) && (YYX) <= YYMAXUTOK                     \
588*afab4e30Schristos    ? YY_CAST (yysymbol_kind_t, yytranslate[YYX])        \
589*afab4e30Schristos    : YYSYMBOL_YYUNDEF)
590*afab4e30Schristos 
591*afab4e30Schristos /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
592*afab4e30Schristos    as returned by yylex.  */
593*afab4e30Schristos static const yytype_int8 yytranslate[] =
594929c70cbSchristos {
595929c70cbSchristos        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
596929c70cbSchristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
597929c70cbSchristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
598929c70cbSchristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
599929c70cbSchristos        2,     2,     2,     2,    11,     2,     2,     2,     2,     2,
600929c70cbSchristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
601929c70cbSchristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
602929c70cbSchristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
603929c70cbSchristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
604929c70cbSchristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
605929c70cbSchristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
606929c70cbSchristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
607929c70cbSchristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
608929c70cbSchristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
609929c70cbSchristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
610929c70cbSchristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
611929c70cbSchristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
612929c70cbSchristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
613929c70cbSchristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
614929c70cbSchristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
615929c70cbSchristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
616929c70cbSchristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
617929c70cbSchristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
618929c70cbSchristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
619929c70cbSchristos        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
620929c70cbSchristos        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
621929c70cbSchristos        5,     6,     7,     8,     9,    10
622929c70cbSchristos };
623929c70cbSchristos 
624929c70cbSchristos #if YYDEBUG
625*afab4e30Schristos /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
626929c70cbSchristos static const yytype_uint8 yyrline[] =
627929c70cbSchristos {
628929c70cbSchristos        0,    65,    65,    66,    69,    70,    73,    79,    85,    94,
629929c70cbSchristos       95,    98,   102,   110,   117,   137
630929c70cbSchristos };
631929c70cbSchristos #endif
632929c70cbSchristos 
633*afab4e30Schristos /** Accessing symbol of state STATE.  */
634*afab4e30Schristos #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
635*afab4e30Schristos 
636*afab4e30Schristos #if YYDEBUG || 0
637*afab4e30Schristos /* The user-facing name of the symbol whose (internal) number is
638*afab4e30Schristos    YYSYMBOL.  No bounds checking.  */
639*afab4e30Schristos static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
640*afab4e30Schristos 
641929c70cbSchristos /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
642929c70cbSchristos    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
643929c70cbSchristos static const char *const yytname[] =
644929c70cbSchristos {
645*afab4e30Schristos   "\"end of file\"", "error", "\"invalid token\"", "ET", "INDEX",
646*afab4e30Schristos   "PREFIX", "EC", "ID", "END", "STRING", "NUMBER", "','", "$accept",
647*afab4e30Schristos   "file", "header", "id", "et", "statements", "statement", YY_NULLPTR
648929c70cbSchristos };
649*afab4e30Schristos 
650*afab4e30Schristos static const char *
yysymbol_name(yysymbol_kind_t yysymbol)651*afab4e30Schristos yysymbol_name (yysymbol_kind_t yysymbol)
652*afab4e30Schristos {
653*afab4e30Schristos   return yytname[yysymbol];
654*afab4e30Schristos }
655929c70cbSchristos #endif
656929c70cbSchristos 
657*afab4e30Schristos #define YYPACT_NINF (-5)
658929c70cbSchristos 
659*afab4e30Schristos #define yypact_value_is_default(Yyn) \
660*afab4e30Schristos   ((Yyn) == YYPACT_NINF)
661929c70cbSchristos 
662*afab4e30Schristos #define YYTABLE_NINF (-1)
663929c70cbSchristos 
664*afab4e30Schristos #define yytable_value_is_error(Yyn) \
665*afab4e30Schristos   0
666929c70cbSchristos 
667929c70cbSchristos /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
668929c70cbSchristos    STATE-NUM.  */
669929c70cbSchristos static const yytype_int8 yypact[] =
670929c70cbSchristos {
671929c70cbSchristos        0,    -3,    -1,     5,    -4,     6,    -5,     1,    -5,    -5,
672929c70cbSchristos        2,     4,     7,    -5,    -4,    -5,    -5,    -5,    -5,    -5,
673929c70cbSchristos        3,    -5,     8,    -5
674929c70cbSchristos };
675929c70cbSchristos 
676*afab4e30Schristos /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
677*afab4e30Schristos    Performed when YYTABLE does not specify something else to do.  Zero
678*afab4e30Schristos    means the default is an error.  */
679*afab4e30Schristos static const yytype_int8 yydefact[] =
680*afab4e30Schristos {
681*afab4e30Schristos        2,     0,     0,     0,     0,     0,     5,     7,     6,     1,
682*afab4e30Schristos        0,    13,     0,    15,     3,     9,     4,     8,    11,    12,
683*afab4e30Schristos        0,    10,     0,    14
684*afab4e30Schristos };
685*afab4e30Schristos 
686929c70cbSchristos /* YYPGOTO[NTERM-NUM].  */
687929c70cbSchristos static const yytype_int8 yypgoto[] =
688929c70cbSchristos {
689929c70cbSchristos       -5,    -5,    -5,    -5,    10,    -5,     9
690929c70cbSchristos };
691929c70cbSchristos 
692*afab4e30Schristos /* YYDEFGOTO[NTERM-NUM].  */
693*afab4e30Schristos static const yytype_int8 yydefgoto[] =
694*afab4e30Schristos {
695*afab4e30Schristos        0,     3,     4,     5,     6,    14,    15
696*afab4e30Schristos };
697*afab4e30Schristos 
698*afab4e30Schristos /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
699*afab4e30Schristos    positive, shift that token.  If negative, reduce the rule whose
700*afab4e30Schristos    number is the opposite.  If YYTABLE_NINF, syntax error.  */
701*afab4e30Schristos static const yytype_int8 yytable[] =
702929c70cbSchristos {
703929c70cbSchristos       10,    11,    12,     1,    13,     9,     7,     2,     8,     1,
704929c70cbSchristos       17,     0,    18,    19,    22,    16,    20,    23,     0,     0,
705929c70cbSchristos        0,     0,     0,    21
706929c70cbSchristos };
707929c70cbSchristos 
708929c70cbSchristos static const yytype_int8 yycheck[] =
709929c70cbSchristos {
710929c70cbSchristos        4,     5,     6,     3,     8,     0,     9,     7,     9,     3,
711929c70cbSchristos        9,    -1,    10,     9,    11,     5,     9,     9,    -1,    -1,
712929c70cbSchristos       -1,    -1,    -1,    14
713929c70cbSchristos };
714929c70cbSchristos 
715*afab4e30Schristos /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
716*afab4e30Schristos    state STATE-NUM.  */
717*afab4e30Schristos static const yytype_int8 yystos[] =
718929c70cbSchristos {
719929c70cbSchristos        0,     3,     7,    13,    14,    15,    16,     9,     9,     0,
720929c70cbSchristos        4,     5,     6,     8,    17,    18,    16,     9,    10,     9,
721929c70cbSchristos        9,    18,    11,     9
722929c70cbSchristos };
723929c70cbSchristos 
724*afab4e30Schristos /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.  */
725*afab4e30Schristos static const yytype_int8 yyr1[] =
726*afab4e30Schristos {
727*afab4e30Schristos        0,    12,    13,    13,    14,    14,    15,    16,    16,    17,
728*afab4e30Schristos       17,    18,    18,    18,    18,    18
729*afab4e30Schristos };
730*afab4e30Schristos 
731*afab4e30Schristos /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.  */
732*afab4e30Schristos static const yytype_int8 yyr2[] =
733*afab4e30Schristos {
734*afab4e30Schristos        0,     2,     0,     2,     2,     1,     2,     2,     3,     1,
735*afab4e30Schristos        2,     2,     2,     1,     4,     1
736*afab4e30Schristos };
737*afab4e30Schristos 
738*afab4e30Schristos 
739*afab4e30Schristos enum { YYENOMEM = -2 };
740*afab4e30Schristos 
741929c70cbSchristos #define yyerrok         (yyerrstatus = 0)
742929c70cbSchristos #define yyclearin       (yychar = YYEMPTY)
743929c70cbSchristos 
744929c70cbSchristos #define YYACCEPT        goto yyacceptlab
745929c70cbSchristos #define YYABORT         goto yyabortlab
746929c70cbSchristos #define YYERROR         goto yyerrorlab
747*afab4e30Schristos #define YYNOMEM         goto yyexhaustedlab
748929c70cbSchristos 
749929c70cbSchristos 
750929c70cbSchristos #define YYRECOVERING()  (!!yyerrstatus)
751929c70cbSchristos 
752929c70cbSchristos #define YYBACKUP(Token, Value)                                    \
753929c70cbSchristos   do                                                              \
754*afab4e30Schristos     if (yychar == YYEMPTY)                                        \
755929c70cbSchristos       {                                                           \
756929c70cbSchristos         yychar = (Token);                                         \
757929c70cbSchristos         yylval = (Value);                                         \
758*afab4e30Schristos         YYPOPSTACK (yylen);                                       \
759*afab4e30Schristos         yystate = *yyssp;                                         \
760929c70cbSchristos         goto yybackup;                                            \
761929c70cbSchristos       }                                                           \
762929c70cbSchristos     else                                                          \
763929c70cbSchristos       {                                                           \
764929c70cbSchristos         yyerror (YY_("syntax error: cannot back up")); \
765929c70cbSchristos         YYERROR;                                                  \
766929c70cbSchristos       }                                                           \
767*afab4e30Schristos   while (0)
768929c70cbSchristos 
769*afab4e30Schristos /* Backward compatibility with an undocumented macro.
770*afab4e30Schristos    Use YYerror or YYUNDEF. */
771*afab4e30Schristos #define YYERRCODE YYUNDEF
772929c70cbSchristos 
773929c70cbSchristos 
774929c70cbSchristos /* Enable debugging if requested.  */
775929c70cbSchristos #if YYDEBUG
776929c70cbSchristos 
777929c70cbSchristos # ifndef YYFPRINTF
778929c70cbSchristos #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
779929c70cbSchristos #  define YYFPRINTF fprintf
780929c70cbSchristos # endif
781929c70cbSchristos 
782929c70cbSchristos # define YYDPRINTF(Args)                        \
783929c70cbSchristos do {                                            \
784929c70cbSchristos   if (yydebug)                                  \
785929c70cbSchristos     YYFPRINTF Args;                             \
786*afab4e30Schristos } while (0)
787929c70cbSchristos 
788*afab4e30Schristos 
789*afab4e30Schristos 
790*afab4e30Schristos 
791*afab4e30Schristos # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)                    \
792929c70cbSchristos do {                                                                      \
793929c70cbSchristos   if (yydebug)                                                            \
794929c70cbSchristos     {                                                                     \
795929c70cbSchristos       YYFPRINTF (stderr, "%s ", Title);                                   \
796929c70cbSchristos       yy_symbol_print (stderr,                                            \
797*afab4e30Schristos                   Kind, Value); \
798929c70cbSchristos       YYFPRINTF (stderr, "\n");                                           \
799929c70cbSchristos     }                                                                     \
800*afab4e30Schristos } while (0)
801929c70cbSchristos 
802929c70cbSchristos 
803*afab4e30Schristos /*-----------------------------------.
804*afab4e30Schristos | Print this symbol's value on YYO.  |
805*afab4e30Schristos `-----------------------------------*/
806929c70cbSchristos 
807929c70cbSchristos static void
yy_symbol_value_print(FILE * yyo,yysymbol_kind_t yykind,YYSTYPE const * const yyvaluep)808*afab4e30Schristos yy_symbol_value_print (FILE *yyo,
809*afab4e30Schristos                        yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
810929c70cbSchristos {
811*afab4e30Schristos   FILE *yyoutput = yyo;
812*afab4e30Schristos   YY_USE (yyoutput);
813929c70cbSchristos   if (!yyvaluep)
814929c70cbSchristos     return;
815*afab4e30Schristos   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
816*afab4e30Schristos   YY_USE (yykind);
817*afab4e30Schristos   YY_IGNORE_MAYBE_UNINITIALIZED_END
818929c70cbSchristos }
819929c70cbSchristos 
820929c70cbSchristos 
821*afab4e30Schristos /*---------------------------.
822*afab4e30Schristos | Print this symbol on YYO.  |
823*afab4e30Schristos `---------------------------*/
824929c70cbSchristos 
825929c70cbSchristos static void
yy_symbol_print(FILE * yyo,yysymbol_kind_t yykind,YYSTYPE const * const yyvaluep)826*afab4e30Schristos yy_symbol_print (FILE *yyo,
827*afab4e30Schristos                  yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
828929c70cbSchristos {
829*afab4e30Schristos   YYFPRINTF (yyo, "%s %s (",
830*afab4e30Schristos              yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
831929c70cbSchristos 
832*afab4e30Schristos   yy_symbol_value_print (yyo, yykind, yyvaluep);
833*afab4e30Schristos   YYFPRINTF (yyo, ")");
834929c70cbSchristos }
835929c70cbSchristos 
836929c70cbSchristos /*------------------------------------------------------------------.
837929c70cbSchristos | yy_stack_print -- Print the state stack from its BOTTOM up to its |
838929c70cbSchristos | TOP (included).                                                   |
839929c70cbSchristos `------------------------------------------------------------------*/
840929c70cbSchristos 
841929c70cbSchristos static void
yy_stack_print(yy_state_t * yybottom,yy_state_t * yytop)842*afab4e30Schristos yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
843929c70cbSchristos {
844929c70cbSchristos   YYFPRINTF (stderr, "Stack now");
845*afab4e30Schristos   for (; yybottom <= yytop; yybottom++)
846*afab4e30Schristos     {
847*afab4e30Schristos       int yybot = *yybottom;
848*afab4e30Schristos       YYFPRINTF (stderr, " %d", yybot);
849*afab4e30Schristos     }
850929c70cbSchristos   YYFPRINTF (stderr, "\n");
851929c70cbSchristos }
852929c70cbSchristos 
853929c70cbSchristos # define YY_STACK_PRINT(Bottom, Top)                            \
854929c70cbSchristos do {                                                            \
855929c70cbSchristos   if (yydebug)                                                  \
856929c70cbSchristos     yy_stack_print ((Bottom), (Top));                           \
857*afab4e30Schristos } while (0)
858929c70cbSchristos 
859929c70cbSchristos 
860929c70cbSchristos /*------------------------------------------------.
861929c70cbSchristos | Report that the YYRULE is going to be reduced.  |
862929c70cbSchristos `------------------------------------------------*/
863929c70cbSchristos 
864929c70cbSchristos static void
yy_reduce_print(yy_state_t * yyssp,YYSTYPE * yyvsp,int yyrule)865*afab4e30Schristos yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
866*afab4e30Schristos                  int yyrule)
867929c70cbSchristos {
868*afab4e30Schristos   int yylno = yyrline[yyrule];
869929c70cbSchristos   int yynrhs = yyr2[yyrule];
870929c70cbSchristos   int yyi;
871*afab4e30Schristos   YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
872929c70cbSchristos              yyrule - 1, yylno);
873929c70cbSchristos   /* The symbols being reduced.  */
874929c70cbSchristos   for (yyi = 0; yyi < yynrhs; yyi++)
875929c70cbSchristos     {
876*afab4e30Schristos       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
877*afab4e30Schristos       yy_symbol_print (stderr,
878*afab4e30Schristos                        YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
879*afab4e30Schristos                        &yyvsp[(yyi + 1) - (yynrhs)]);
880*afab4e30Schristos       YYFPRINTF (stderr, "\n");
881929c70cbSchristos     }
882929c70cbSchristos }
883929c70cbSchristos 
884929c70cbSchristos # define YY_REDUCE_PRINT(Rule)          \
885929c70cbSchristos do {                                    \
886929c70cbSchristos   if (yydebug)                          \
887*afab4e30Schristos     yy_reduce_print (yyssp, yyvsp, Rule); \
888*afab4e30Schristos } while (0)
889929c70cbSchristos 
890929c70cbSchristos /* Nonzero means print parse trace.  It is left uninitialized so that
891929c70cbSchristos    multiple parsers can coexist.  */
892929c70cbSchristos int yydebug;
893929c70cbSchristos #else /* !YYDEBUG */
894*afab4e30Schristos # define YYDPRINTF(Args) ((void) 0)
895*afab4e30Schristos # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
896929c70cbSchristos # define YY_STACK_PRINT(Bottom, Top)
897929c70cbSchristos # define YY_REDUCE_PRINT(Rule)
898929c70cbSchristos #endif /* !YYDEBUG */
899929c70cbSchristos 
900929c70cbSchristos 
901929c70cbSchristos /* YYINITDEPTH -- initial size of the parser's stacks.  */
902929c70cbSchristos #ifndef YYINITDEPTH
903929c70cbSchristos # define YYINITDEPTH 200
904929c70cbSchristos #endif
905929c70cbSchristos 
906929c70cbSchristos /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
907929c70cbSchristos    if the built-in stack extension method is used).
908929c70cbSchristos 
909929c70cbSchristos    Do not make this value too large; the results are undefined if
910929c70cbSchristos    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
911929c70cbSchristos    evaluated with infinite-precision integer arithmetic.  */
912929c70cbSchristos 
913929c70cbSchristos #ifndef YYMAXDEPTH
914929c70cbSchristos # define YYMAXDEPTH 10000
915929c70cbSchristos #endif
916929c70cbSchristos 
917929c70cbSchristos 
918929c70cbSchristos 
919929c70cbSchristos 
920929c70cbSchristos 
921929c70cbSchristos 
922929c70cbSchristos /*-----------------------------------------------.
923929c70cbSchristos | Release the memory associated to this symbol.  |
924929c70cbSchristos `-----------------------------------------------*/
925929c70cbSchristos 
926929c70cbSchristos static void
yydestruct(const char * yymsg,yysymbol_kind_t yykind,YYSTYPE * yyvaluep)927*afab4e30Schristos yydestruct (const char *yymsg,
928*afab4e30Schristos             yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
929929c70cbSchristos {
930*afab4e30Schristos   YY_USE (yyvaluep);
931929c70cbSchristos   if (!yymsg)
932929c70cbSchristos     yymsg = "Deleting";
933*afab4e30Schristos   YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
934929c70cbSchristos 
935*afab4e30Schristos   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
936*afab4e30Schristos   YY_USE (yykind);
937*afab4e30Schristos   YY_IGNORE_MAYBE_UNINITIALIZED_END
938929c70cbSchristos }
939929c70cbSchristos 
940929c70cbSchristos 
941*afab4e30Schristos /* Lookahead token kind.  */
942929c70cbSchristos int yychar;
943929c70cbSchristos 
944*afab4e30Schristos /* The semantic value of the lookahead symbol.  */
945929c70cbSchristos YYSTYPE yylval;
946929c70cbSchristos /* Number of syntax errors so far.  */
947929c70cbSchristos int yynerrs;
948929c70cbSchristos 
949929c70cbSchristos 
950929c70cbSchristos 
951*afab4e30Schristos 
952929c70cbSchristos /*----------.
953929c70cbSchristos | yyparse.  |
954929c70cbSchristos `----------*/
955929c70cbSchristos 
956929c70cbSchristos int
yyparse(void)957929c70cbSchristos yyparse (void)
958929c70cbSchristos {
959*afab4e30Schristos     yy_state_fast_t yystate = 0;
960929c70cbSchristos     /* Number of tokens to shift before error messages enabled.  */
961*afab4e30Schristos     int yyerrstatus = 0;
962929c70cbSchristos 
963*afab4e30Schristos     /* Refer to the stacks through separate pointers, to allow yyoverflow
964929c70cbSchristos        to reallocate them elsewhere.  */
965929c70cbSchristos 
966*afab4e30Schristos     /* Their size.  */
967*afab4e30Schristos     YYPTRDIFF_T yystacksize = YYINITDEPTH;
968929c70cbSchristos 
969*afab4e30Schristos     /* The state stack: array, bottom, top.  */
970*afab4e30Schristos     yy_state_t yyssa[YYINITDEPTH];
971*afab4e30Schristos     yy_state_t *yyss = yyssa;
972*afab4e30Schristos     yy_state_t *yyssp = yyss;
973*afab4e30Schristos 
974*afab4e30Schristos     /* The semantic value stack: array, bottom, top.  */
975929c70cbSchristos     YYSTYPE yyvsa[YYINITDEPTH];
976929c70cbSchristos     YYSTYPE *yyvs = yyvsa;
977*afab4e30Schristos     YYSTYPE *yyvsp = yyvs;
978929c70cbSchristos 
979*afab4e30Schristos   int yyn;
980*afab4e30Schristos   /* The return value of yyparse.  */
981*afab4e30Schristos   int yyresult;
982*afab4e30Schristos   /* Lookahead symbol kind.  */
983*afab4e30Schristos   yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
984929c70cbSchristos   /* The variables used to return semantic value and location from the
985929c70cbSchristos      action routines.  */
986929c70cbSchristos   YYSTYPE yyval;
987929c70cbSchristos 
988929c70cbSchristos 
989*afab4e30Schristos 
990*afab4e30Schristos #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
991*afab4e30Schristos 
992929c70cbSchristos   /* The number of symbols on the RHS of the reduced rule.
993929c70cbSchristos      Keep to zero when no symbol should be popped.  */
994929c70cbSchristos   int yylen = 0;
995929c70cbSchristos 
996929c70cbSchristos   YYDPRINTF ((stderr, "Starting parse\n"));
997929c70cbSchristos 
998929c70cbSchristos   yychar = YYEMPTY; /* Cause a token to be read.  */
999929c70cbSchristos 
1000929c70cbSchristos   goto yysetstate;
1001929c70cbSchristos 
1002*afab4e30Schristos 
1003929c70cbSchristos /*------------------------------------------------------------.
1004*afab4e30Schristos | yynewstate -- push a new state, which is found in yystate.  |
1005929c70cbSchristos `------------------------------------------------------------*/
1006929c70cbSchristos yynewstate:
1007929c70cbSchristos   /* In all cases, when you get here, the value and location stacks
1008929c70cbSchristos      have just been pushed.  So pushing a state here evens the stacks.  */
1009929c70cbSchristos   yyssp++;
1010929c70cbSchristos 
1011*afab4e30Schristos 
1012*afab4e30Schristos /*--------------------------------------------------------------------.
1013*afab4e30Schristos | yysetstate -- set current state (the top of the stack) to yystate.  |
1014*afab4e30Schristos `--------------------------------------------------------------------*/
1015929c70cbSchristos yysetstate:
1016*afab4e30Schristos   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1017*afab4e30Schristos   YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1018*afab4e30Schristos   YY_IGNORE_USELESS_CAST_BEGIN
1019*afab4e30Schristos   *yyssp = YY_CAST (yy_state_t, yystate);
1020*afab4e30Schristos   YY_IGNORE_USELESS_CAST_END
1021*afab4e30Schristos   YY_STACK_PRINT (yyss, yyssp);
1022929c70cbSchristos 
1023929c70cbSchristos   if (yyss + yystacksize - 1 <= yyssp)
1024*afab4e30Schristos #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1025*afab4e30Schristos     YYNOMEM;
1026*afab4e30Schristos #else
1027929c70cbSchristos     {
1028929c70cbSchristos       /* Get the current used size of the three stacks, in elements.  */
1029*afab4e30Schristos       YYPTRDIFF_T yysize = yyssp - yyss + 1;
1030929c70cbSchristos 
1031*afab4e30Schristos # if defined yyoverflow
1032929c70cbSchristos       {
1033929c70cbSchristos         /* Give user a chance to reallocate the stack.  Use copies of
1034929c70cbSchristos            these so that the &'s don't force the real ones into
1035929c70cbSchristos            memory.  */
1036*afab4e30Schristos         yy_state_t *yyss1 = yyss;
1037929c70cbSchristos         YYSTYPE *yyvs1 = yyvs;
1038929c70cbSchristos 
1039929c70cbSchristos         /* Each stack pointer address is followed by the size of the
1040929c70cbSchristos            data in use in that stack, in bytes.  This used to be a
1041929c70cbSchristos            conditional around just the two extra args, but that might
1042929c70cbSchristos            be undefined if yyoverflow is a macro.  */
1043929c70cbSchristos         yyoverflow (YY_("memory exhausted"),
1044*afab4e30Schristos                     &yyss1, yysize * YYSIZEOF (*yyssp),
1045*afab4e30Schristos                     &yyvs1, yysize * YYSIZEOF (*yyvsp),
1046929c70cbSchristos                     &yystacksize);
1047929c70cbSchristos         yyss = yyss1;
1048929c70cbSchristos         yyvs = yyvs1;
1049929c70cbSchristos       }
1050*afab4e30Schristos # else /* defined YYSTACK_RELOCATE */
1051929c70cbSchristos       /* Extend the stack our own way.  */
1052929c70cbSchristos       if (YYMAXDEPTH <= yystacksize)
1053*afab4e30Schristos         YYNOMEM;
1054929c70cbSchristos       yystacksize *= 2;
1055929c70cbSchristos       if (YYMAXDEPTH < yystacksize)
1056929c70cbSchristos         yystacksize = YYMAXDEPTH;
1057929c70cbSchristos 
1058929c70cbSchristos       {
1059*afab4e30Schristos         yy_state_t *yyss1 = yyss;
1060929c70cbSchristos         union yyalloc *yyptr =
1061*afab4e30Schristos           YY_CAST (union yyalloc *,
1062*afab4e30Schristos                    YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1063929c70cbSchristos         if (! yyptr)
1064*afab4e30Schristos           YYNOMEM;
1065*afab4e30Schristos         YYSTACK_RELOCATE (yyss_alloc, yyss);
1066*afab4e30Schristos         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1067929c70cbSchristos #  undef YYSTACK_RELOCATE
1068929c70cbSchristos         if (yyss1 != yyssa)
1069929c70cbSchristos           YYSTACK_FREE (yyss1);
1070929c70cbSchristos       }
1071929c70cbSchristos # endif
1072929c70cbSchristos 
1073929c70cbSchristos       yyssp = yyss + yysize - 1;
1074929c70cbSchristos       yyvsp = yyvs + yysize - 1;
1075929c70cbSchristos 
1076*afab4e30Schristos       YY_IGNORE_USELESS_CAST_BEGIN
1077*afab4e30Schristos       YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1078*afab4e30Schristos                   YY_CAST (long, yystacksize)));
1079*afab4e30Schristos       YY_IGNORE_USELESS_CAST_END
1080929c70cbSchristos 
1081929c70cbSchristos       if (yyss + yystacksize - 1 <= yyssp)
1082929c70cbSchristos         YYABORT;
1083929c70cbSchristos     }
1084*afab4e30Schristos #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1085929c70cbSchristos 
1086*afab4e30Schristos 
1087*afab4e30Schristos   if (yystate == YYFINAL)
1088*afab4e30Schristos     YYACCEPT;
1089929c70cbSchristos 
1090929c70cbSchristos   goto yybackup;
1091929c70cbSchristos 
1092*afab4e30Schristos 
1093929c70cbSchristos /*-----------.
1094929c70cbSchristos | yybackup.  |
1095929c70cbSchristos `-----------*/
1096929c70cbSchristos yybackup:
1097929c70cbSchristos   /* Do appropriate processing given the current state.  Read a
1098*afab4e30Schristos      lookahead token if we need one and don't already have one.  */
1099929c70cbSchristos 
1100*afab4e30Schristos   /* First try to decide what to do without reference to lookahead token.  */
1101929c70cbSchristos   yyn = yypact[yystate];
1102*afab4e30Schristos   if (yypact_value_is_default (yyn))
1103929c70cbSchristos     goto yydefault;
1104929c70cbSchristos 
1105*afab4e30Schristos   /* Not known => get a lookahead token if don't already have one.  */
1106929c70cbSchristos 
1107*afab4e30Schristos   /* YYCHAR is either empty, or end-of-input, or a valid lookahead.  */
1108929c70cbSchristos   if (yychar == YYEMPTY)
1109929c70cbSchristos     {
1110*afab4e30Schristos       YYDPRINTF ((stderr, "Reading a token\n"));
1111*afab4e30Schristos       yychar = yylex ();
1112929c70cbSchristos     }
1113929c70cbSchristos 
1114929c70cbSchristos   if (yychar <= YYEOF)
1115929c70cbSchristos     {
1116*afab4e30Schristos       yychar = YYEOF;
1117*afab4e30Schristos       yytoken = YYSYMBOL_YYEOF;
1118929c70cbSchristos       YYDPRINTF ((stderr, "Now at end of input.\n"));
1119929c70cbSchristos     }
1120*afab4e30Schristos   else if (yychar == YYerror)
1121*afab4e30Schristos     {
1122*afab4e30Schristos       /* The scanner already issued an error message, process directly
1123*afab4e30Schristos          to error recovery.  But do not keep the error token as
1124*afab4e30Schristos          lookahead, it is too special and may lead us to an endless
1125*afab4e30Schristos          loop in error recovery. */
1126*afab4e30Schristos       yychar = YYUNDEF;
1127*afab4e30Schristos       yytoken = YYSYMBOL_YYerror;
1128*afab4e30Schristos       goto yyerrlab1;
1129*afab4e30Schristos     }
1130929c70cbSchristos   else
1131929c70cbSchristos     {
1132929c70cbSchristos       yytoken = YYTRANSLATE (yychar);
1133929c70cbSchristos       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1134929c70cbSchristos     }
1135929c70cbSchristos 
1136929c70cbSchristos   /* If the proper action on seeing token YYTOKEN is to reduce or to
1137929c70cbSchristos      detect an error, take that action.  */
1138929c70cbSchristos   yyn += yytoken;
1139929c70cbSchristos   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1140929c70cbSchristos     goto yydefault;
1141929c70cbSchristos   yyn = yytable[yyn];
1142929c70cbSchristos   if (yyn <= 0)
1143929c70cbSchristos     {
1144*afab4e30Schristos       if (yytable_value_is_error (yyn))
1145929c70cbSchristos         goto yyerrlab;
1146929c70cbSchristos       yyn = -yyn;
1147929c70cbSchristos       goto yyreduce;
1148929c70cbSchristos     }
1149929c70cbSchristos 
1150929c70cbSchristos   /* Count tokens shifted since error; after three, turn off error
1151929c70cbSchristos      status.  */
1152929c70cbSchristos   if (yyerrstatus)
1153929c70cbSchristos     yyerrstatus--;
1154929c70cbSchristos 
1155*afab4e30Schristos   /* Shift the lookahead token.  */
1156929c70cbSchristos   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1157929c70cbSchristos   yystate = yyn;
1158*afab4e30Schristos   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1159929c70cbSchristos   *++yyvsp = yylval;
1160*afab4e30Schristos   YY_IGNORE_MAYBE_UNINITIALIZED_END
1161929c70cbSchristos 
1162*afab4e30Schristos   /* Discard the shifted token.  */
1163*afab4e30Schristos   yychar = YYEMPTY;
1164929c70cbSchristos   goto yynewstate;
1165929c70cbSchristos 
1166929c70cbSchristos 
1167929c70cbSchristos /*-----------------------------------------------------------.
1168929c70cbSchristos | yydefault -- do the default action for the current state.  |
1169929c70cbSchristos `-----------------------------------------------------------*/
1170929c70cbSchristos yydefault:
1171929c70cbSchristos   yyn = yydefact[yystate];
1172929c70cbSchristos   if (yyn == 0)
1173929c70cbSchristos     goto yyerrlab;
1174929c70cbSchristos   goto yyreduce;
1175929c70cbSchristos 
1176929c70cbSchristos 
1177929c70cbSchristos /*-----------------------------.
1178*afab4e30Schristos | yyreduce -- do a reduction.  |
1179929c70cbSchristos `-----------------------------*/
1180929c70cbSchristos yyreduce:
1181929c70cbSchristos   /* yyn is the number of a rule to reduce with.  */
1182929c70cbSchristos   yylen = yyr2[yyn];
1183929c70cbSchristos 
1184929c70cbSchristos   /* If YYLEN is nonzero, implement the default value of the action:
1185*afab4e30Schristos      '$$ = $1'.
1186929c70cbSchristos 
1187929c70cbSchristos      Otherwise, the following line sets YYVAL to garbage.
1188929c70cbSchristos      This behavior is undocumented and Bison
1189929c70cbSchristos      users should not rely upon it.  Assigning to YYVAL
1190929c70cbSchristos      unconditionally makes the parser a bit smaller, and it avoids a
1191929c70cbSchristos      GCC warning that YYVAL may be used uninitialized.  */
1192929c70cbSchristos   yyval = yyvsp[1-yylen];
1193929c70cbSchristos 
1194929c70cbSchristos 
1195929c70cbSchristos   YY_REDUCE_PRINT (yyn);
1196929c70cbSchristos   switch (yyn)
1197929c70cbSchristos     {
1198*afab4e30Schristos   case 6: /* id: ID STRING  */
1199929c70cbSchristos #line 74 "parse.y"
1200929c70cbSchristos                 {
1201*afab4e30Schristos 		    id_str = (yyvsp[0].string);
1202929c70cbSchristos 		}
1203*afab4e30Schristos #line 1202 "parse.c"
1204929c70cbSchristos     break;
1205929c70cbSchristos 
1206*afab4e30Schristos   case 7: /* et: ET STRING  */
1207929c70cbSchristos #line 80 "parse.y"
1208929c70cbSchristos                 {
1209*afab4e30Schristos 		    base_id = name2number((yyvsp[0].string));
1210*afab4e30Schristos 		    strlcpy(name, (yyvsp[0].string), sizeof(name));
1211*afab4e30Schristos 		    free((yyvsp[0].string));
1212929c70cbSchristos 		}
1213*afab4e30Schristos #line 1212 "parse.c"
1214929c70cbSchristos     break;
1215929c70cbSchristos 
1216*afab4e30Schristos   case 8: /* et: ET STRING STRING  */
1217929c70cbSchristos #line 86 "parse.y"
1218929c70cbSchristos                 {
1219*afab4e30Schristos 		    base_id = name2number((yyvsp[-1].string));
1220*afab4e30Schristos 		    strlcpy(name, (yyvsp[0].string), sizeof(name));
1221*afab4e30Schristos 		    free((yyvsp[-1].string));
1222*afab4e30Schristos 		    free((yyvsp[0].string));
1223929c70cbSchristos 		}
1224*afab4e30Schristos #line 1223 "parse.c"
1225929c70cbSchristos     break;
1226929c70cbSchristos 
1227*afab4e30Schristos   case 11: /* statement: INDEX NUMBER  */
1228929c70cbSchristos #line 99 "parse.y"
1229929c70cbSchristos                 {
1230*afab4e30Schristos 			number = (yyvsp[0].number);
1231929c70cbSchristos 		}
1232*afab4e30Schristos #line 1231 "parse.c"
1233929c70cbSchristos     break;
1234929c70cbSchristos 
1235*afab4e30Schristos   case 12: /* statement: PREFIX STRING  */
1236929c70cbSchristos #line 103 "parse.y"
1237929c70cbSchristos                 {
1238929c70cbSchristos 		    free(prefix);
1239*afab4e30Schristos 		    asprintf (&prefix, "%s_", (yyvsp[0].string));
1240929c70cbSchristos 		    if (prefix == NULL)
1241929c70cbSchristos 			errx(1, "malloc");
1242*afab4e30Schristos 		    free((yyvsp[0].string));
1243929c70cbSchristos 		}
1244*afab4e30Schristos #line 1243 "parse.c"
1245929c70cbSchristos     break;
1246929c70cbSchristos 
1247*afab4e30Schristos   case 13: /* statement: PREFIX  */
1248929c70cbSchristos #line 111 "parse.y"
1249929c70cbSchristos                 {
1250929c70cbSchristos 		    prefix = realloc(prefix, 1);
1251929c70cbSchristos 		    if (prefix == NULL)
1252929c70cbSchristos 			errx(1, "malloc");
1253929c70cbSchristos 		    *prefix = '\0';
1254929c70cbSchristos 		}
1255*afab4e30Schristos #line 1254 "parse.c"
1256929c70cbSchristos     break;
1257929c70cbSchristos 
1258*afab4e30Schristos   case 14: /* statement: EC STRING ',' STRING  */
1259929c70cbSchristos #line 118 "parse.y"
1260929c70cbSchristos                 {
1261929c70cbSchristos 		    struct error_code *ec = malloc(sizeof(*ec));
1262929c70cbSchristos 
1263929c70cbSchristos 		    if (ec == NULL)
1264929c70cbSchristos 			errx(1, "malloc");
1265929c70cbSchristos 
1266929c70cbSchristos 		    ec->next = NULL;
1267929c70cbSchristos 		    ec->number = number;
1268929c70cbSchristos 		    if(prefix && *prefix != '\0') {
1269*afab4e30Schristos 			asprintf (&ec->name, "%s%s", prefix, (yyvsp[-2].string));
1270929c70cbSchristos 			if (ec->name == NULL)
1271929c70cbSchristos 			    errx(1, "malloc");
1272*afab4e30Schristos 			free((yyvsp[-2].string));
1273929c70cbSchristos 		    } else
1274*afab4e30Schristos 			ec->name = (yyvsp[-2].string);
1275*afab4e30Schristos 		    ec->string = (yyvsp[0].string);
1276929c70cbSchristos 		    APPEND(codes, ec);
1277929c70cbSchristos 		    number++;
1278929c70cbSchristos 		}
1279*afab4e30Schristos #line 1278 "parse.c"
1280929c70cbSchristos     break;
1281929c70cbSchristos 
1282*afab4e30Schristos   case 15: /* statement: END  */
1283929c70cbSchristos #line 138 "parse.y"
1284929c70cbSchristos                 {
1285929c70cbSchristos 			YYACCEPT;
1286929c70cbSchristos 		}
1287*afab4e30Schristos #line 1286 "parse.c"
1288929c70cbSchristos     break;
1289929c70cbSchristos 
1290929c70cbSchristos 
1291*afab4e30Schristos #line 1290 "parse.c"
1292*afab4e30Schristos 
1293929c70cbSchristos       default: break;
1294929c70cbSchristos     }
1295*afab4e30Schristos   /* User semantic actions sometimes alter yychar, and that requires
1296*afab4e30Schristos      that yytoken be updated with the new translation.  We take the
1297*afab4e30Schristos      approach of translating immediately before every use of yytoken.
1298*afab4e30Schristos      One alternative is translating here after every semantic action,
1299*afab4e30Schristos      but that translation would be missed if the semantic action invokes
1300*afab4e30Schristos      YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1301*afab4e30Schristos      if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
1302*afab4e30Schristos      incorrect destructor might then be invoked immediately.  In the
1303*afab4e30Schristos      case of YYERROR or YYBACKUP, subsequent parser actions might lead
1304*afab4e30Schristos      to an incorrect destructor call or verbose syntax error message
1305*afab4e30Schristos      before the lookahead is translated.  */
1306*afab4e30Schristos   YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1307929c70cbSchristos 
1308929c70cbSchristos   YYPOPSTACK (yylen);
1309929c70cbSchristos   yylen = 0;
1310929c70cbSchristos 
1311929c70cbSchristos   *++yyvsp = yyval;
1312929c70cbSchristos 
1313*afab4e30Schristos   /* Now 'shift' the result of the reduction.  Determine what state
1314929c70cbSchristos      that goes to, based on the state we popped back to and the rule
1315929c70cbSchristos      number reduced by.  */
1316*afab4e30Schristos   {
1317*afab4e30Schristos     const int yylhs = yyr1[yyn] - YYNTOKENS;
1318*afab4e30Schristos     const int yyi = yypgoto[yylhs] + *yyssp;
1319*afab4e30Schristos     yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1320*afab4e30Schristos                ? yytable[yyi]
1321*afab4e30Schristos                : yydefgoto[yylhs]);
1322*afab4e30Schristos   }
1323929c70cbSchristos 
1324929c70cbSchristos   goto yynewstate;
1325929c70cbSchristos 
1326929c70cbSchristos 
1327*afab4e30Schristos /*--------------------------------------.
1328*afab4e30Schristos | yyerrlab -- here on detecting error.  |
1329*afab4e30Schristos `--------------------------------------*/
1330929c70cbSchristos yyerrlab:
1331*afab4e30Schristos   /* Make sure we have latest lookahead translation.  See comments at
1332*afab4e30Schristos      user semantic actions for why this is necessary.  */
1333*afab4e30Schristos   yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1334929c70cbSchristos   /* If not already recovering from an error, report this error.  */
1335929c70cbSchristos   if (!yyerrstatus)
1336929c70cbSchristos     {
1337929c70cbSchristos       ++yynerrs;
1338929c70cbSchristos       yyerror (YY_("syntax error"));
1339929c70cbSchristos     }
1340929c70cbSchristos 
1341929c70cbSchristos   if (yyerrstatus == 3)
1342929c70cbSchristos     {
1343*afab4e30Schristos       /* If just tried and failed to reuse lookahead token after an
1344929c70cbSchristos          error, discard it.  */
1345929c70cbSchristos 
1346929c70cbSchristos       if (yychar <= YYEOF)
1347929c70cbSchristos         {
1348929c70cbSchristos           /* Return failure if at end of input.  */
1349929c70cbSchristos           if (yychar == YYEOF)
1350929c70cbSchristos             YYABORT;
1351929c70cbSchristos         }
1352929c70cbSchristos       else
1353929c70cbSchristos         {
1354929c70cbSchristos           yydestruct ("Error: discarding",
1355929c70cbSchristos                       yytoken, &yylval);
1356929c70cbSchristos           yychar = YYEMPTY;
1357929c70cbSchristos         }
1358929c70cbSchristos     }
1359929c70cbSchristos 
1360*afab4e30Schristos   /* Else will try to reuse lookahead token after shifting the error
1361929c70cbSchristos      token.  */
1362929c70cbSchristos   goto yyerrlab1;
1363929c70cbSchristos 
1364929c70cbSchristos 
1365929c70cbSchristos /*---------------------------------------------------.
1366929c70cbSchristos | yyerrorlab -- error raised explicitly by YYERROR.  |
1367929c70cbSchristos `---------------------------------------------------*/
1368929c70cbSchristos yyerrorlab:
1369*afab4e30Schristos   /* Pacify compilers when the user code never invokes YYERROR and the
1370*afab4e30Schristos      label yyerrorlab therefore never appears in user code.  */
1371*afab4e30Schristos   if (0)
1372*afab4e30Schristos     YYERROR;
1373*afab4e30Schristos   ++yynerrs;
1374929c70cbSchristos 
1375*afab4e30Schristos   /* Do not reclaim the symbols of the rule whose action triggered
1376929c70cbSchristos      this YYERROR.  */
1377929c70cbSchristos   YYPOPSTACK (yylen);
1378929c70cbSchristos   yylen = 0;
1379929c70cbSchristos   YY_STACK_PRINT (yyss, yyssp);
1380929c70cbSchristos   yystate = *yyssp;
1381929c70cbSchristos   goto yyerrlab1;
1382929c70cbSchristos 
1383929c70cbSchristos 
1384929c70cbSchristos /*-------------------------------------------------------------.
1385929c70cbSchristos | yyerrlab1 -- common code for both syntax error and YYERROR.  |
1386929c70cbSchristos `-------------------------------------------------------------*/
1387929c70cbSchristos yyerrlab1:
1388929c70cbSchristos   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
1389929c70cbSchristos 
1390*afab4e30Schristos   /* Pop stack until we find a state that shifts the error token.  */
1391929c70cbSchristos   for (;;)
1392929c70cbSchristos     {
1393929c70cbSchristos       yyn = yypact[yystate];
1394*afab4e30Schristos       if (!yypact_value_is_default (yyn))
1395929c70cbSchristos         {
1396*afab4e30Schristos           yyn += YYSYMBOL_YYerror;
1397*afab4e30Schristos           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1398929c70cbSchristos             {
1399929c70cbSchristos               yyn = yytable[yyn];
1400929c70cbSchristos               if (0 < yyn)
1401929c70cbSchristos                 break;
1402929c70cbSchristos             }
1403929c70cbSchristos         }
1404929c70cbSchristos 
1405929c70cbSchristos       /* Pop the current state because it cannot handle the error token.  */
1406929c70cbSchristos       if (yyssp == yyss)
1407929c70cbSchristos         YYABORT;
1408929c70cbSchristos 
1409929c70cbSchristos 
1410929c70cbSchristos       yydestruct ("Error: popping",
1411*afab4e30Schristos                   YY_ACCESSING_SYMBOL (yystate), yyvsp);
1412929c70cbSchristos       YYPOPSTACK (1);
1413929c70cbSchristos       yystate = *yyssp;
1414929c70cbSchristos       YY_STACK_PRINT (yyss, yyssp);
1415929c70cbSchristos     }
1416929c70cbSchristos 
1417*afab4e30Schristos   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1418929c70cbSchristos   *++yyvsp = yylval;
1419*afab4e30Schristos   YY_IGNORE_MAYBE_UNINITIALIZED_END
1420929c70cbSchristos 
1421929c70cbSchristos 
1422929c70cbSchristos   /* Shift the error token.  */
1423*afab4e30Schristos   YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
1424929c70cbSchristos 
1425929c70cbSchristos   yystate = yyn;
1426929c70cbSchristos   goto yynewstate;
1427929c70cbSchristos 
1428929c70cbSchristos 
1429929c70cbSchristos /*-------------------------------------.
1430929c70cbSchristos | yyacceptlab -- YYACCEPT comes here.  |
1431929c70cbSchristos `-------------------------------------*/
1432929c70cbSchristos yyacceptlab:
1433929c70cbSchristos   yyresult = 0;
1434*afab4e30Schristos   goto yyreturnlab;
1435*afab4e30Schristos 
1436929c70cbSchristos 
1437929c70cbSchristos /*-----------------------------------.
1438929c70cbSchristos | yyabortlab -- YYABORT comes here.  |
1439929c70cbSchristos `-----------------------------------*/
1440929c70cbSchristos yyabortlab:
1441929c70cbSchristos   yyresult = 1;
1442*afab4e30Schristos   goto yyreturnlab;
1443929c70cbSchristos 
1444*afab4e30Schristos 
1445*afab4e30Schristos /*-----------------------------------------------------------.
1446*afab4e30Schristos | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here.  |
1447*afab4e30Schristos `-----------------------------------------------------------*/
1448929c70cbSchristos yyexhaustedlab:
1449929c70cbSchristos   yyerror (YY_("memory exhausted"));
1450929c70cbSchristos   yyresult = 2;
1451*afab4e30Schristos   goto yyreturnlab;
1452929c70cbSchristos 
1453*afab4e30Schristos 
1454*afab4e30Schristos /*----------------------------------------------------------.
1455*afab4e30Schristos | yyreturnlab -- parsing is finished, clean up and return.  |
1456*afab4e30Schristos `----------------------------------------------------------*/
1457*afab4e30Schristos yyreturnlab:
1458*afab4e30Schristos   if (yychar != YYEMPTY)
1459*afab4e30Schristos     {
1460*afab4e30Schristos       /* Make sure we have latest lookahead translation.  See comments at
1461*afab4e30Schristos          user semantic actions for why this is necessary.  */
1462*afab4e30Schristos       yytoken = YYTRANSLATE (yychar);
1463929c70cbSchristos       yydestruct ("Cleanup: discarding lookahead",
1464929c70cbSchristos                   yytoken, &yylval);
1465*afab4e30Schristos     }
1466*afab4e30Schristos   /* Do not reclaim the symbols of the rule whose action triggered
1467929c70cbSchristos      this YYABORT or YYACCEPT.  */
1468929c70cbSchristos   YYPOPSTACK (yylen);
1469929c70cbSchristos   YY_STACK_PRINT (yyss, yyssp);
1470929c70cbSchristos   while (yyssp != yyss)
1471929c70cbSchristos     {
1472929c70cbSchristos       yydestruct ("Cleanup: popping",
1473*afab4e30Schristos                   YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
1474929c70cbSchristos       YYPOPSTACK (1);
1475929c70cbSchristos     }
1476929c70cbSchristos #ifndef yyoverflow
1477929c70cbSchristos   if (yyss != yyssa)
1478929c70cbSchristos     YYSTACK_FREE (yyss);
1479929c70cbSchristos #endif
1480929c70cbSchristos 
1481*afab4e30Schristos   return yyresult;
1482*afab4e30Schristos }
1483929c70cbSchristos 
1484929c70cbSchristos #line 143 "parse.y"
1485929c70cbSchristos 
1486929c70cbSchristos 
1487929c70cbSchristos static long
name2number(const char * str)1488929c70cbSchristos name2number(const char *str)
1489929c70cbSchristos {
1490929c70cbSchristos     const char *p;
1491929c70cbSchristos     long num = 0;
1492929c70cbSchristos     const char *x = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
1493929c70cbSchristos 	"abcdefghijklmnopqrstuvwxyz0123456789_";
1494929c70cbSchristos     if(strlen(str) > 4) {
1495929c70cbSchristos 	yyerror("table name too long");
1496929c70cbSchristos 	return 0;
1497929c70cbSchristos     }
1498929c70cbSchristos     for(p = str; *p; p++){
1499929c70cbSchristos 	char *q = strchr(x, *p);
1500929c70cbSchristos 	if(q == NULL) {
1501929c70cbSchristos 	    yyerror("invalid character in table name");
1502929c70cbSchristos 	    return 0;
1503929c70cbSchristos 	}
1504929c70cbSchristos 	num = (num << 6) + (q - x) + 1;
1505929c70cbSchristos     }
1506929c70cbSchristos     num <<= 8;
1507929c70cbSchristos     if(num > 0x7fffffff)
1508929c70cbSchristos 	num = -(0xffffffff - num + 1);
1509929c70cbSchristos     return num;
1510929c70cbSchristos }
1511929c70cbSchristos 
1512929c70cbSchristos void
yyerror(char * s)1513929c70cbSchristos yyerror (char *s)
1514929c70cbSchristos {
1515929c70cbSchristos      _lex_error_message ("%s\n", s);
1516929c70cbSchristos }
1517