Commit 1456edbb authored by Josh Triplett's avatar Josh Triplett

kconfig: Make zconf.y work with current bison

zconf.y includes zconf.hash.c from the initial code section.
zconf.hash.c references the token constants from zconf.y.  However,
current bison defines the token constants after the initial code
section, making zconf.hash.c fail to compile.  Move the include of
zconf.hash.c later in zconf.y, so bison puts it after the token
constants.
Signed-off-by: default avatarJosh Triplett <josh@joshtriplett.org>
parent a3ccf63e
/* A Bison parser, made by GNU Bison 2.3. */
/* Skeleton implementation for Bison's Yacc-like parsers in C /* A Bison parser, made by GNU Bison 2.4.1. */
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 /* Skeleton implementation for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc. Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation, either version 3 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains /* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work part or all of the Bison parser skeleton and distribute that work
...@@ -29,7 +28,7 @@ ...@@ -29,7 +28,7 @@
special exception, which will cause the skeleton and the resulting special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public Bison output files to be licensed under the GNU General Public
License without this special exception. License without this special exception.
This special exception was added by the Free Software Foundation in This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */ version 2.2 of Bison. */
...@@ -47,7 +46,7 @@ ...@@ -47,7 +46,7 @@
#define YYBISON 1 #define YYBISON 1
/* Bison version. */ /* Bison version. */
#define YYBISON_VERSION "2.3" #define YYBISON_VERSION "2.4.1"
/* Skeleton name. */ /* Skeleton name. */
#define YYSKELETON_NAME "yacc.c" #define YYSKELETON_NAME "yacc.c"
...@@ -55,94 +54,23 @@ ...@@ -55,94 +54,23 @@
/* Pure parsers. */ /* Pure parsers. */
#define YYPURE 0 #define YYPURE 0
/* Push parsers. */
#define YYPUSH 0
/* Pull parsers. */
#define YYPULL 1
/* Using locations. */ /* Using locations. */
#define YYLSP_NEEDED 0 #define YYLSP_NEEDED 0
/* Substitute the variable and function names. */ /* Substitute the variable and function names. */
#define yyparse zconfparse #define yyparse zconfparse
#define yylex zconflex #define yylex zconflex
#define yyerror zconferror #define yyerror zconferror
#define yylval zconflval #define yylval zconflval
#define yychar zconfchar #define yychar zconfchar
#define yydebug zconfdebug #define yydebug zconfdebug
#define yynerrs zconfnerrs #define yynerrs zconfnerrs
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
T_MAINMENU = 258,
T_MENU = 259,
T_ENDMENU = 260,
T_SOURCE = 261,
T_CHOICE = 262,
T_ENDCHOICE = 263,
T_COMMENT = 264,
T_CONFIG = 265,
T_MENUCONFIG = 266,
T_HELP = 267,
T_HELPTEXT = 268,
T_IF = 269,
T_ENDIF = 270,
T_DEPENDS = 271,
T_OPTIONAL = 272,
T_PROMPT = 273,
T_TYPE = 274,
T_DEFAULT = 275,
T_SELECT = 276,
T_RANGE = 277,
T_OPTION = 278,
T_ON = 279,
T_WORD = 280,
T_WORD_QUOTE = 281,
T_UNEQUAL = 282,
T_CLOSE_PAREN = 283,
T_OPEN_PAREN = 284,
T_EOL = 285,
T_OR = 286,
T_AND = 287,
T_EQUAL = 288,
T_NOT = 289
};
#endif
/* Tokens. */
#define T_MAINMENU 258
#define T_MENU 259
#define T_ENDMENU 260
#define T_SOURCE 261
#define T_CHOICE 262
#define T_ENDCHOICE 263
#define T_COMMENT 264
#define T_CONFIG 265
#define T_MENUCONFIG 266
#define T_HELP 267
#define T_HELPTEXT 268
#define T_IF 269
#define T_ENDIF 270
#define T_DEPENDS 271
#define T_OPTIONAL 272
#define T_PROMPT 273
#define T_TYPE 274
#define T_DEFAULT 275
#define T_SELECT 276
#define T_RANGE 277
#define T_OPTION 278
#define T_ON 279
#define T_WORD 280
#define T_WORD_QUOTE 281
#define T_UNEQUAL 282
#define T_CLOSE_PAREN 283
#define T_OPEN_PAREN 284
#define T_EOL 285
#define T_OR 286
#define T_AND 287
#define T_EQUAL 288
#define T_NOT 289
/* Copy the first part of user declarations. */ /* Copy the first part of user declarations. */
...@@ -163,8 +91,6 @@ ...@@ -163,8 +91,6 @@
#define LKC_DIRECT_LINK #define LKC_DIRECT_LINK
#include "lkc.h" #include "lkc.h"
#include "zconf.hash.c"
#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt) #define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
#define PRINTD 0x0001 #define PRINTD 0x0001
...@@ -188,6 +114,7 @@ static struct menu *current_menu, *current_entry; ...@@ -188,6 +114,7 @@ static struct menu *current_menu, *current_entry;
#endif #endif
/* Enabling traces. */ /* Enabling traces. */
#ifndef YYDEBUG #ifndef YYDEBUG
# define YYDEBUG 0 # define YYDEBUG 0
...@@ -206,31 +133,77 @@ static struct menu *current_menu, *current_entry; ...@@ -206,31 +133,77 @@ static struct menu *current_menu, *current_entry;
# define YYTOKEN_TABLE 0 # define YYTOKEN_TABLE 0
#endif #endif
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
T_MAINMENU = 258,
T_MENU = 259,
T_ENDMENU = 260,
T_SOURCE = 261,
T_CHOICE = 262,
T_ENDCHOICE = 263,
T_COMMENT = 264,
T_CONFIG = 265,
T_MENUCONFIG = 266,
T_HELP = 267,
T_HELPTEXT = 268,
T_IF = 269,
T_ENDIF = 270,
T_DEPENDS = 271,
T_OPTIONAL = 272,
T_PROMPT = 273,
T_TYPE = 274,
T_DEFAULT = 275,
T_SELECT = 276,
T_RANGE = 277,
T_OPTION = 278,
T_ON = 279,
T_WORD = 280,
T_WORD_QUOTE = 281,
T_UNEQUAL = 282,
T_CLOSE_PAREN = 283,
T_OPEN_PAREN = 284,
T_EOL = 285,
T_OR = 286,
T_AND = 287,
T_EQUAL = 288,
T_NOT = 289
};
#endif
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE typedef union YYSTYPE
{ {
char *string; char *string;
struct file *file; struct file *file;
struct symbol *symbol; struct symbol *symbol;
struct expr *expr; struct expr *expr;
struct menu *menu; struct menu *menu;
struct kconf_id *id; struct kconf_id *id;
}
/* Line 187 of yacc.c. */
YYSTYPE;
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif #endif
/* Copy the second part of user declarations. */ /* Copy the second part of user declarations. */
/* Line 216 of yacc.c. */ /* Include zconf.hash.c here so it can see the token constants. */
#include "zconf.hash.c"
#ifdef short #ifdef short
...@@ -306,14 +279,14 @@ typedef short int yytype_int16; ...@@ -306,14 +279,14 @@ typedef short int yytype_int16;
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
static int static int
YYID (int i) YYID (int yyi)
#else #else
static int static int
YYID (i) YYID (yyi)
int i; int yyi;
#endif #endif
{ {
return i; return yyi;
} }
#endif #endif
...@@ -394,9 +367,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ ...@@ -394,9 +367,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
/* A type that is properly aligned for any stack member. */ /* A type that is properly aligned for any stack member. */
union yyalloc union yyalloc
{ {
yytype_int16 yyss; yytype_int16 yyss_alloc;
YYSTYPE yyvs; YYSTYPE yyvs_alloc;
}; };
/* The size of the maximum gap between one aligned stack and the next. */ /* The size of the maximum gap between one aligned stack and the next. */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
...@@ -430,12 +403,12 @@ union yyalloc ...@@ -430,12 +403,12 @@ union yyalloc
elements in the stack, and YYPTR gives the new location of the elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next stack. Advance YYPTR to a properly aligned location for the next
stack. */ stack. */
# define YYSTACK_RELOCATE(Stack) \ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
do \ do \
{ \ { \
YYSIZE_T yynewbytes; \ YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack, Stack, yysize); \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
Stack = &yyptr->Stack; \ Stack = &yyptr->Stack_alloc; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \ yyptr += yynewbytes / sizeof (*yyptr); \
} \ } \
...@@ -558,18 +531,18 @@ static const yytype_int8 yyrhs[] = ...@@ -558,18 +531,18 @@ static const yytype_int8 yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] = static const yytype_uint16 yyrline[] =
{ {
0, 104, 104, 106, 108, 109, 110, 111, 112, 113, 0, 107, 107, 109, 111, 112, 113, 114, 115, 116,
114, 118, 122, 122, 122, 122, 122, 122, 122, 126, 117, 121, 125, 125, 125, 125, 125, 125, 125, 129,
127, 128, 129, 130, 131, 135, 136, 142, 150, 156, 130, 131, 132, 133, 134, 138, 139, 145, 153, 159,
164, 174, 176, 177, 178, 179, 180, 181, 184, 192, 167, 177, 179, 180, 181, 182, 183, 184, 187, 195,
198, 208, 214, 220, 223, 225, 236, 237, 242, 251, 201, 211, 217, 223, 226, 228, 239, 240, 245, 254,
256, 264, 267, 269, 270, 271, 272, 273, 276, 282, 259, 267, 270, 272, 273, 274, 275, 276, 279, 285,
293, 299, 309, 311, 316, 324, 332, 335, 337, 338, 296, 302, 312, 314, 319, 327, 335, 338, 340, 341,
339, 344, 351, 356, 364, 367, 369, 370, 371, 374, 342, 347, 354, 359, 367, 370, 372, 373, 374, 377,
382, 389, 396, 402, 409, 411, 412, 413, 416, 424, 385, 392, 399, 405, 412, 414, 415, 416, 419, 427,
426, 431, 432, 435, 436, 437, 441, 442, 445, 446, 429, 434, 435, 438, 439, 440, 444, 445, 448, 449,
449, 450, 451, 452, 453, 454, 455, 458, 459, 462, 452, 453, 454, 455, 456, 457, 458, 461, 462, 465,
463 466
}; };
#endif #endif
...@@ -985,17 +958,20 @@ yy_symbol_print (yyoutput, yytype, yyvaluep) ...@@ -985,17 +958,20 @@ yy_symbol_print (yyoutput, yytype, yyvaluep)
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
static void static void
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
#else #else
static void static void
yy_stack_print (bottom, top) yy_stack_print (yybottom, yytop)
yytype_int16 *bottom; yytype_int16 *yybottom;
yytype_int16 *top; yytype_int16 *yytop;
#endif #endif
{ {
YYFPRINTF (stderr, "Stack now"); YYFPRINTF (stderr, "Stack now");
for (; bottom <= top; ++bottom) for (; yybottom <= yytop; yybottom++)
YYFPRINTF (stderr, " %d", *bottom); {
int yybot = *yybottom;
YYFPRINTF (stderr, " %d", yybot);
}
YYFPRINTF (stderr, "\n"); YYFPRINTF (stderr, "\n");
} }
...@@ -1029,11 +1005,11 @@ yy_reduce_print (yyvsp, yyrule) ...@@ -1029,11 +1005,11 @@ yy_reduce_print (yyvsp, yyrule)
/* The symbols being reduced. */ /* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++) for (yyi = 0; yyi < yynrhs; yyi++)
{ {
fprintf (stderr, " $%d = ", yyi + 1); YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&(yyvsp[(yyi + 1) - (yynrhs)]) &(yyvsp[(yyi + 1) - (yynrhs)])
); );
fprintf (stderr, "\n"); YYFPRINTF (stderr, "\n");
} }
} }
...@@ -1343,10 +1319,8 @@ yydestruct (yymsg, yytype, yyvaluep) ...@@ -1343,10 +1319,8 @@ yydestruct (yymsg, yytype, yyvaluep)
break; break;
} }
} }
/* Prevent warnings from -Wmissing-prototypes. */ /* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM #ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus #if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM); int yyparse (void *YYPARSE_PARAM);
...@@ -1362,11 +1336,10 @@ int yyparse (); ...@@ -1362,11 +1336,10 @@ int yyparse ();
#endif /* ! YYPARSE_PARAM */ #endif /* ! YYPARSE_PARAM */
/* The lookahead symbol. */
/* The look-ahead symbol. */
int yychar; int yychar;
/* The semantic value of the look-ahead symbol. */ /* The semantic value of the lookahead symbol. */
YYSTYPE yylval; YYSTYPE yylval;
/* Number of syntax errors so far. */ /* Number of syntax errors so far. */
...@@ -1374,9 +1347,9 @@ int yynerrs; ...@@ -1374,9 +1347,9 @@ int yynerrs;
/*----------. /*-------------------------.
| yyparse. | | yyparse or yypush_parse. |
`----------*/ `-------------------------*/
#ifdef YYPARSE_PARAM #ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
...@@ -1400,66 +1373,68 @@ yyparse () ...@@ -1400,66 +1373,68 @@ yyparse ()
#endif #endif
#endif #endif
{ {
int yystate;
int yyn;
int yyresult;
/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
/* Look-ahead token as an internal (translated) token number. */
int yytoken = 0;
#if YYERROR_VERBOSE
/* Buffer for error messages, and its allocated size. */
char yymsgbuf[128];
char *yymsg = yymsgbuf;
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif
/* Three stacks and their tools:
`yyss': related to states,
`yyvs': related to semantic values,
`yyls': related to locations.
Refer to the stacks thru separate pointers, to allow yyoverflow
to reallocate them elsewhere. */
/* The state stack. */ int yystate;
yytype_int16 yyssa[YYINITDEPTH]; /* Number of tokens to shift before error messages enabled. */
yytype_int16 *yyss = yyssa; int yyerrstatus;
yytype_int16 *yyssp;
/* The semantic value stack. */ /* The stacks and their tools:
YYSTYPE yyvsa[YYINITDEPTH]; `yyss': related to states.
YYSTYPE *yyvs = yyvsa; `yyvs': related to semantic values.
YYSTYPE *yyvsp;
Refer to the stacks thru separate pointers, to allow yyoverflow
to reallocate them elsewhere. */
/* The state stack. */
yytype_int16 yyssa[YYINITDEPTH];
yytype_int16 *yyss;
yytype_int16 *yyssp;
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH];
YYSTYPE *yyvs;
YYSTYPE *yyvsp;
YYSIZE_T yystacksize = YYINITDEPTH; YYSIZE_T yystacksize;
int yyn;
int yyresult;
/* Lookahead token as an internal (translated) token number. */
int yytoken;
/* The variables used to return semantic value and location from the /* The variables used to return semantic value and location from the
action routines. */ action routines. */
YYSTYPE yyval; YYSTYPE yyval;
#if YYERROR_VERBOSE
/* Buffer for error messages, and its allocated size. */
char yymsgbuf[128];
char *yymsg = yymsgbuf;
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
/* The number of symbols on the RHS of the reduced rule. /* The number of symbols on the RHS of the reduced rule.
Keep to zero when no symbol should be popped. */ Keep to zero when no symbol should be popped. */
int yylen = 0; int yylen = 0;
yytoken = 0;
yyss = yyssa;
yyvs = yyvsa;
yystacksize = YYINITDEPTH;
YYDPRINTF ((stderr, "Starting parse\n")); YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0; yystate = 0;
yyerrstatus = 0; yyerrstatus = 0;
yynerrs = 0; yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */ yychar = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers. /* Initialize stack pointers.
Waste one element of value and location stack Waste one element of value and location stack
so that they stay on the same level as the state stack. so that they stay on the same level as the state stack.
The wasted elements are never initialized. */ The wasted elements are never initialized. */
yyssp = yyss; yyssp = yyss;
yyvsp = yyvs; yyvsp = yyvs;
...@@ -1489,7 +1464,6 @@ yyparse () ...@@ -1489,7 +1464,6 @@ yyparse ()
YYSTYPE *yyvs1 = yyvs; YYSTYPE *yyvs1 = yyvs;
yytype_int16 *yyss1 = yyss; yytype_int16 *yyss1 = yyss;
/* Each stack pointer address is followed by the size of the /* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. This used to be a data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might conditional around just the two extra args, but that might
...@@ -1497,7 +1471,6 @@ yyparse () ...@@ -1497,7 +1471,6 @@ yyparse ()
yyoverflow (YY_("memory exhausted"), yyoverflow (YY_("memory exhausted"),
&yyss1, yysize * sizeof (*yyssp), &yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp), &yyvs1, yysize * sizeof (*yyvsp),
&yystacksize); &yystacksize);
yyss = yyss1; yyss = yyss1;
...@@ -1520,9 +1493,8 @@ yyparse () ...@@ -1520,9 +1493,8 @@ yyparse ()
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr) if (! yyptr)
goto yyexhaustedlab; goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyss_alloc, yyss);
YYSTACK_RELOCATE (yyvs); YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# undef YYSTACK_RELOCATE # undef YYSTACK_RELOCATE
if (yyss1 != yyssa) if (yyss1 != yyssa)
YYSTACK_FREE (yyss1); YYSTACK_FREE (yyss1);
...@@ -1533,7 +1505,6 @@ yyparse () ...@@ -1533,7 +1505,6 @@ yyparse ()
yyssp = yyss + yysize - 1; yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1; yyvsp = yyvs + yysize - 1;
YYDPRINTF ((stderr, "Stack size increased to %lu\n", YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long int) yystacksize)); (unsigned long int) yystacksize));
...@@ -1543,6 +1514,9 @@ yyparse () ...@@ -1543,6 +1514,9 @@ yyparse ()
YYDPRINTF ((stderr, "Entering state %d\n", yystate)); YYDPRINTF ((stderr, "Entering state %d\n", yystate));
if (yystate == YYFINAL)
YYACCEPT;
goto yybackup; goto yybackup;
/*-----------. /*-----------.
...@@ -1551,16 +1525,16 @@ yyparse () ...@@ -1551,16 +1525,16 @@ yyparse ()
yybackup: yybackup:
/* Do appropriate processing given the current state. Read a /* Do appropriate processing given the current state. Read a
look-ahead token if we need one and don't already have one. */ lookahead token if we need one and don't already have one. */
/* First try to decide what to do without reference to look-ahead token. */ /* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate]; yyn = yypact[yystate];
if (yyn == YYPACT_NINF) if (yyn == YYPACT_NINF)
goto yydefault; goto yydefault;
/* Not known => get a look-ahead token if don't already have one. */ /* Not known => get a lookahead token if don't already have one. */
/* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
if (yychar == YYEMPTY) if (yychar == YYEMPTY)
{ {
YYDPRINTF ((stderr, "Reading a token: ")); YYDPRINTF ((stderr, "Reading a token: "));
...@@ -1592,20 +1566,16 @@ yybackup: ...@@ -1592,20 +1566,16 @@ yybackup:
goto yyreduce; goto yyreduce;
} }
if (yyn == YYFINAL)
YYACCEPT;
/* Count tokens shifted since error; after three, turn off error /* Count tokens shifted since error; after three, turn off error
status. */ status. */
if (yyerrstatus) if (yyerrstatus)
yyerrstatus--; yyerrstatus--;
/* Shift the look-ahead token. */ /* Shift the lookahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
/* Discard the shifted token unless it is eof. */ /* Discard the shifted token. */
if (yychar != YYEOF) yychar = YYEMPTY;
yychar = YYEMPTY;
yystate = yyn; yystate = yyn;
*++yyvsp = yylval; *++yyvsp = yylval;
...@@ -2029,7 +1999,6 @@ yyreduce: ...@@ -2029,7 +1999,6 @@ yyreduce:
break; break;
/* Line 1267 of yacc.c. */
default: break; default: break;
} }
...@@ -2041,7 +2010,6 @@ yyreduce: ...@@ -2041,7 +2010,6 @@ yyreduce:
*++yyvsp = yyval; *++yyvsp = yyval;
/* Now `shift' the result of the reduction. Determine what state /* Now `shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule that goes to, based on the state we popped back to and the rule
number reduced by. */ number reduced by. */
...@@ -2106,7 +2074,7 @@ yyerrlab: ...@@ -2106,7 +2074,7 @@ yyerrlab:
if (yyerrstatus == 3) if (yyerrstatus == 3)
{ {
/* If just tried and failed to reuse look-ahead token after an /* If just tried and failed to reuse lookahead token after an
error, discard it. */ error, discard it. */
if (yychar <= YYEOF) if (yychar <= YYEOF)
...@@ -2123,7 +2091,7 @@ yyerrlab: ...@@ -2123,7 +2091,7 @@ yyerrlab:
} }
} }
/* Else will try to reuse look-ahead token after shifting the error /* Else will try to reuse lookahead token after shifting the error
token. */ token. */
goto yyerrlab1; goto yyerrlab1;
...@@ -2180,9 +2148,6 @@ yyerrlab1: ...@@ -2180,9 +2148,6 @@ yyerrlab1:
YY_STACK_PRINT (yyss, yyssp); YY_STACK_PRINT (yyss, yyssp);
} }
if (yyn == YYFINAL)
YYACCEPT;
*++yyvsp = yylval; *++yyvsp = yylval;
...@@ -2207,7 +2172,7 @@ yyabortlab: ...@@ -2207,7 +2172,7 @@ yyabortlab:
yyresult = 1; yyresult = 1;
goto yyreturn; goto yyreturn;
#ifndef yyoverflow #if !defined(yyoverflow) || YYERROR_VERBOSE
/*-------------------------------------------------. /*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. | | yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/ `-------------------------------------------------*/
...@@ -2218,7 +2183,7 @@ yyexhaustedlab: ...@@ -2218,7 +2183,7 @@ yyexhaustedlab:
#endif #endif
yyreturn: yyreturn:
if (yychar != YYEOF && yychar != YYEMPTY) if (yychar != YYEMPTY)
yydestruct ("Cleanup: discarding lookahead", yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval); yytoken, &yylval);
/* Do not reclaim the symbols of the rule which action triggered /* Do not reclaim the symbols of the rule which action triggered
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
#define LKC_DIRECT_LINK #define LKC_DIRECT_LINK
#include "lkc.h" #include "lkc.h"
#include "zconf.hash.c"
#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt) #define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
#define PRINTD 0x0001 #define PRINTD 0x0001
...@@ -100,6 +98,11 @@ static struct menu *current_menu, *current_entry; ...@@ -100,6 +98,11 @@ static struct menu *current_menu, *current_entry;
menu_end_menu(); menu_end_menu();
} if_entry menu_entry choice_entry } if_entry menu_entry choice_entry
%{
/* Include zconf.hash.c here so it can see the token constants. */
#include "zconf.hash.c"
%}
%% %%
input: stmt_list; input: stmt_list;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment