提交 5e05981b 编写于 作者: M Michal Marek

Merge branch 'kbuild-implicit-parser-rule' of...

Merge branch 'kbuild-implicit-parser-rule' of git://github.com/lacombar/linux-2.6 into kbuild/kbuild
......@@ -20,6 +20,10 @@ depfile = $(subst $(comma),_,$(dot-target).d)
# filename of target with directory and extension stripped
basetarget = $(basename $(notdir $@))
###
# filename of first prerequisite with directory and extension stripped
baseprereq = $(basename $(notdir $<))
###
# Escape single quote for use in echo statements
escsq = $(subst $(squote),'\$(squote)',$1)
......
......@@ -160,13 +160,51 @@ ld_flags = $(LDFLAGS) $(ldflags-y)
modname-multi = $(sort $(foreach m,$(multi-used),\
$(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=))))
ifdef REGENERATE_PARSERS
# GPERF
# ---------------------------------------------------------------------------
quiet_cmd_gperf = GPERF $@
cmd_gperf = gperf -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $<
$(src)/%.hash.c_shipped: $(src)/%.gperf
$(call cmd,gperf)
# LEX
# ---------------------------------------------------------------------------
LEX_PREFIX = $(if $(LEX_PREFIX_${baseprereq}),$(LEX_PREFIX_${baseprereq}),yy)
quiet_cmd_flex = LEX $@
cmd_flex = flex -o$@ -L -P $(LEX_PREFIX) $<
$(src)/%.lex.c_shipped: $(src)/%.l
$(call cmd,flex)
# YACC
# ---------------------------------------------------------------------------
YACC_PREFIX = $(if $(YACC_PREFIX_${baseprereq}),$(YACC_PREFIX_${baseprereq}),yy)
quiet_cmd_bison = YACC $@
cmd_bison = bison -o$@ -t -l -p $(YACC_PREFIX) $<
$(src)/%.tab.c_shipped: $(src)/%.y
$(call cmd,bison)
quiet_cmd_bison_h = YACC $@
cmd_bison_h = bison -o/dev/null --defines=$@ -t -l -p $(YACC_PREFIX) $<
$(src)/%.tab.h_shipped: $(src)/%.y
$(call cmd,bison_h)
endif
# Shipped files
# ===========================================================================
quiet_cmd_shipped = SHIPPED $@
cmd_shipped = cat $< > $@
$(obj)/%:: $(src)/%_shipped
$(obj)/%: $(src)/%_shipped
$(call cmd,shipped)
# Commands useful for building a boot image
......
......@@ -25,31 +25,5 @@ HOSTCFLAGS_dtc-lexer.lex.o := $(HOSTCFLAGS_DTC)
HOSTCFLAGS_dtc-parser.tab.o := $(HOSTCFLAGS_DTC)
# dependencies on generated files need to be listed explicitly
$(obj)/dtc-parser.tab.o: $(obj)/dtc-parser.tab.c $(obj)/dtc-parser.tab.h
$(obj)/dtc-lexer.lex.o: $(obj)/dtc-lexer.lex.c $(obj)/dtc-parser.tab.h
$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h
targets += dtc-parser.tab.c dtc-lexer.lex.c
clean-files += dtc-parser.tab.h
# GENERATE_PARSER := 1 # Uncomment to rebuild flex/bison output
ifdef GENERATE_PARSER
BISON = bison
FLEX = flex
quiet_cmd_bison = BISON $@
cmd_bison = $(BISON) -o$@ -d $<; cp $@ $@_shipped
quiet_cmd_flex = FLEX $@
cmd_flex = $(FLEX) -o$@ $<; cp $@ $@_shipped
$(obj)/dtc-parser.tab.c: $(src)/dtc-parser.y FORCE
$(call if_changed,bison)
$(obj)/dtc-parser.tab.h: $(obj)/dtc-parser.tab.c
$(obj)/dtc-lexer.lex.c: $(src)/dtc-lexer.l FORCE
$(call if_changed,flex)
endif
#line 2 "dtc-lexer.lex.c"
#line 4 "dtc-lexer.lex.c"
#line 3 "scripts/dtc/dtc-lexer.lex.c_shipped"
#define YY_INT_ALIGNED short int
......@@ -54,6 +53,7 @@ typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */
/* Limits of integral types. */
#ifndef INT8_MIN
......@@ -84,8 +84,6 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
......@@ -142,15 +140,7 @@ typedef unsigned int flex_uint32_t;
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
* Ditto for the __ia64__ case accordingly.
*/
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#endif
/* The state buf must be large enough to hold one state per character in the main buffer.
......@@ -550,7 +540,6 @@ int yy_flex_debug = 0;
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
#line 1 "dtc-lexer.l"
/*
* (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 2005.
*
......@@ -572,10 +561,6 @@ char *yytext;
*/
#define YY_NO_INPUT 1
#line 37 "dtc-lexer.l"
#include "dtc.h"
#include "srcpos.h"
#include "dtc-parser.tab.h"
......@@ -603,7 +588,6 @@ static int dts_version = 1;
static void push_input_file(const char *filename);
static int pop_input_file(void);
#line 607 "dtc-lexer.lex.c"
#define INITIAL 0
#define INCLUDE 1
......@@ -686,12 +670,7 @@ static int input (void );
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k */
#define YY_READ_BUF_SIZE 16384
#else
#define YY_READ_BUF_SIZE 8192
#endif /* __ia64__ */
#endif
/* Copy whatever the last rule matched to the standard output. */
......@@ -710,7 +689,7 @@ static int input (void );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
size_t n; \
unsigned n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
......@@ -792,10 +771,6 @@ YY_DECL
register char *yy_cp, *yy_bp;
register int yy_act;
#line 66 "dtc-lexer.l"
#line 798 "dtc-lexer.lex.c"
if ( !(yy_init) )
{
(yy_init) = 1;
......@@ -876,7 +851,6 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
/* rule 1 can match eol */
YY_RULE_SETUP
#line 67 "dtc-lexer.l"
{
char *name = strchr(yytext, '\"') + 1;
yytext[yyleng-1] = '\0';
......@@ -888,7 +862,6 @@ case YY_STATE_EOF(INCLUDE):
case YY_STATE_EOF(BYTESTRING):
case YY_STATE_EOF(PROPNODENAME):
case YY_STATE_EOF(V1):
#line 73 "dtc-lexer.l"
{
if (!pop_input_file()) {
yyterminate();
......@@ -898,7 +871,6 @@ case YY_STATE_EOF(V1):
case 2:
/* rule 2 can match eol */
YY_RULE_SETUP
#line 79 "dtc-lexer.l"
{
DPRINT("String: %s\n", yytext);
yylval.data = data_copy_escape_string(yytext+1,
......@@ -908,7 +880,6 @@ YY_RULE_SETUP
YY_BREAK
case 3:
YY_RULE_SETUP
#line 86 "dtc-lexer.l"
{
DPRINT("Keyword: /dts-v1/\n");
dts_version = 1;
......@@ -918,7 +889,6 @@ YY_RULE_SETUP
YY_BREAK
case 4:
YY_RULE_SETUP
#line 93 "dtc-lexer.l"
{
DPRINT("Keyword: /memreserve/\n");
BEGIN_DEFAULT();
......@@ -927,7 +897,6 @@ YY_RULE_SETUP
YY_BREAK
case 5:
YY_RULE_SETUP
#line 99 "dtc-lexer.l"
{
DPRINT("Label: %s\n", yytext);
yylval.labelref = xstrdup(yytext);
......@@ -937,7 +906,6 @@ YY_RULE_SETUP
YY_BREAK
case 6:
YY_RULE_SETUP
#line 106 "dtc-lexer.l"
{
yylval.literal = xstrdup(yytext);
DPRINT("Literal: '%s'\n", yylval.literal);
......@@ -946,7 +914,6 @@ YY_RULE_SETUP
YY_BREAK
case 7:
YY_RULE_SETUP
#line 112 "dtc-lexer.l"
{ /* label reference */
DPRINT("Ref: %s\n", yytext+1);
yylval.labelref = xstrdup(yytext+1);
......@@ -955,7 +922,6 @@ YY_RULE_SETUP
YY_BREAK
case 8:
YY_RULE_SETUP
#line 118 "dtc-lexer.l"
{ /* new-style path reference */
yytext[yyleng-1] = '\0';
DPRINT("Ref: %s\n", yytext+2);
......@@ -965,7 +931,6 @@ YY_RULE_SETUP
YY_BREAK
case 9:
YY_RULE_SETUP
#line 125 "dtc-lexer.l"
{
yylval.byte = strtol(yytext, NULL, 16);
DPRINT("Byte: %02x\n", (int)yylval.byte);
......@@ -974,7 +939,6 @@ YY_RULE_SETUP
YY_BREAK
case 10:
YY_RULE_SETUP
#line 131 "dtc-lexer.l"
{
DPRINT("/BYTESTRING\n");
BEGIN_DEFAULT();
......@@ -983,7 +947,6 @@ YY_RULE_SETUP
YY_BREAK
case 11:
YY_RULE_SETUP
#line 137 "dtc-lexer.l"
{
DPRINT("PropNodeName: %s\n", yytext);
yylval.propnodename = xstrdup(yytext);
......@@ -993,7 +956,6 @@ YY_RULE_SETUP
YY_BREAK
case 12:
YY_RULE_SETUP
#line 144 "dtc-lexer.l"
{
DPRINT("Binary Include\n");
return DT_INCBIN;
......@@ -1002,24 +964,20 @@ YY_RULE_SETUP
case 13:
/* rule 13 can match eol */
YY_RULE_SETUP
#line 149 "dtc-lexer.l"
/* eat whitespace */
YY_BREAK
case 14:
/* rule 14 can match eol */
YY_RULE_SETUP
#line 150 "dtc-lexer.l"
/* eat C-style comments */
YY_BREAK
case 15:
/* rule 15 can match eol */
YY_RULE_SETUP
#line 151 "dtc-lexer.l"
/* eat C++-style comments */
YY_BREAK
case 16:
YY_RULE_SETUP
#line 153 "dtc-lexer.l"
{
DPRINT("Char: %c (\\x%02x)\n", yytext[0],
(unsigned)yytext[0]);
......@@ -1037,10 +995,8 @@ YY_RULE_SETUP
YY_BREAK
case 17:
YY_RULE_SETUP
#line 168 "dtc-lexer.l"
ECHO;
YY_BREAK
#line 1044 "dtc-lexer.lex.c"
case YY_END_OF_BUFFER:
{
......@@ -1756,8 +1712,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
* scan from a @e copy of @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
* @param bytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes.
*
* @return the newly allocated buffer state object.
*/
......@@ -1996,10 +1952,6 @@ void yyfree (void * ptr )
#define YYTABLES_NAME "yytables"
#line 168 "dtc-lexer.l"
static void push_input_file(const char *filename)
{
assert(filename);
......@@ -2011,7 +1963,6 @@ static void push_input_file(const char *filename)
yypush_buffer_state(yy_create_buffer(yyin,YY_BUF_SIZE));
}
static int pop_input_file(void)
{
if (srcfile_pop() == 0)
......
/* A Bison parser, made by GNU Bison 2.4.1. */
/* A Bison parser, made by GNU Bison 2.4.3. */
/* 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.
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
2009, 2010 Free Software Foundation, Inc.
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
......@@ -46,7 +45,7 @@
#define YYBISON 1
/* Bison version. */
#define YYBISON_VERSION "2.4.1"
#define YYBISON_VERSION "2.4.3"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
......@@ -67,8 +66,6 @@
/* Copy the first part of user declarations. */
/* Line 189 of yacc.c */
#line 21 "dtc-parser.y"
#include <stdio.h>
......@@ -87,12 +84,10 @@ extern int treesource_error;
static unsigned long long eval_literal(const char *s, int base, int bits);
/* Line 189 of yacc.c */
#line 92 "dtc-parser.tab.c"
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
# define YYDEBUG 1
#endif
/* Enabling verbose error messages. */
......@@ -134,8 +129,6 @@ static unsigned long long eval_literal(const char *s, int base, int bits);
typedef union YYSTYPE
{
/* Line 214 of yacc.c */
#line 39 "dtc-parser.y"
char *propnodename;
char *literal;
......@@ -154,8 +147,6 @@ typedef union YYSTYPE
/* Line 214 of yacc.c */
#line 159 "dtc-parser.tab.c"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
......@@ -166,8 +157,6 @@ typedef union YYSTYPE
/* Copy the second part of user declarations. */
/* Line 264 of yacc.c */
#line 171 "dtc-parser.tab.c"
#ifdef short
# undef short
......@@ -217,7 +206,7 @@ typedef short int yytype_int16;
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#ifndef YY_
# if YYENABLE_NLS
# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
# define YY_(msgid) dgettext ("bison-runtime", msgid)
......@@ -607,9 +596,18 @@ static const yytype_uint8 yystos[] =
/* Like YYERROR except do call yyerror. This remains here temporarily
to ease the transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. */
Once GCC version 2 has supplanted version 1, this can go. However,
YYFAIL appears to be in use. Nevertheless, it is formally deprecated
in Bison 2.4.2's NEWS entry, where a plan to phase it out is
discussed. */
#define YYFAIL goto yyerrlab
#if defined YYFAIL
/* This is here to suppress warnings from the GCC cpp's
-Wunused-macros. Normally we don't worry about that warning, but
some users do, and we want to make it easy for users to remove
YYFAIL uses, which will produce warnings from Bison 2.5. */
#endif
#define YYRECOVERING() (!!yyerrstatus)
......@@ -666,7 +664,7 @@ while (YYID (0))
we won't break user code: when these are the locations we know. */
#ifndef YY_LOCATION_PRINT
# if YYLTYPE_IS_TRIVIAL
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
# define YY_LOCATION_PRINT(File, Loc) \
fprintf (File, "%d.%d-%d.%d", \
(Loc).first_line, (Loc).first_column, \
......@@ -1405,8 +1403,6 @@ yyreduce:
{
case 2:
/* Line 1455 of yacc.c */
#line 87 "dtc-parser.y"
{
the_boot_info = build_boot_info((yyvsp[(3) - (4)].re), (yyvsp[(4) - (4)].node),
guess_boot_cpuid((yyvsp[(4) - (4)].node)));
......@@ -1415,8 +1411,6 @@ yyreduce:
case 3:
/* Line 1455 of yacc.c */
#line 95 "dtc-parser.y"
{
(yyval.re) = NULL;
;}
......@@ -1424,8 +1418,6 @@ yyreduce:
case 4:
/* Line 1455 of yacc.c */
#line 99 "dtc-parser.y"
{
(yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re));
;}
......@@ -1433,8 +1425,6 @@ yyreduce:
case 5:
/* Line 1455 of yacc.c */
#line 106 "dtc-parser.y"
{
(yyval.re) = build_reserve_entry((yyvsp[(2) - (4)].addr), (yyvsp[(3) - (4)].addr));
;}
......@@ -1442,8 +1432,6 @@ yyreduce:
case 6:
/* Line 1455 of yacc.c */
#line 110 "dtc-parser.y"
{
add_label(&(yyvsp[(2) - (2)].re)->labels, (yyvsp[(1) - (2)].labelref));
(yyval.re) = (yyvsp[(2) - (2)].re);
......@@ -1452,8 +1440,6 @@ yyreduce:
case 7:
/* Line 1455 of yacc.c */
#line 118 "dtc-parser.y"
{
(yyval.addr) = eval_literal((yyvsp[(1) - (1)].literal), 0, 64);
;}
......@@ -1461,8 +1447,6 @@ yyreduce:
case 8:
/* Line 1455 of yacc.c */
#line 125 "dtc-parser.y"
{
(yyval.node) = name_node((yyvsp[(2) - (2)].node), "");
;}
......@@ -1470,8 +1454,6 @@ yyreduce:
case 9:
/* Line 1455 of yacc.c */
#line 129 "dtc-parser.y"
{
(yyval.node) = merge_nodes((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
;}
......@@ -1479,8 +1461,6 @@ yyreduce:
case 10:
/* Line 1455 of yacc.c */
#line 133 "dtc-parser.y"
{
struct node *target = get_node_by_ref((yyvsp[(1) - (3)].node), (yyvsp[(2) - (3)].labelref));
......@@ -1494,8 +1474,6 @@ yyreduce:
case 11:
/* Line 1455 of yacc.c */
#line 146 "dtc-parser.y"
{
(yyval.node) = build_node((yyvsp[(2) - (5)].proplist), (yyvsp[(3) - (5)].nodelist));
;}
......@@ -1503,8 +1481,6 @@ yyreduce:
case 12:
/* Line 1455 of yacc.c */
#line 153 "dtc-parser.y"
{
(yyval.proplist) = NULL;
;}
......@@ -1512,8 +1488,6 @@ yyreduce:
case 13:
/* Line 1455 of yacc.c */
#line 157 "dtc-parser.y"
{
(yyval.proplist) = chain_property((yyvsp[(2) - (2)].prop), (yyvsp[(1) - (2)].proplist));
;}
......@@ -1521,8 +1495,6 @@ yyreduce:
case 14:
/* Line 1455 of yacc.c */
#line 164 "dtc-parser.y"
{
(yyval.prop) = build_property((yyvsp[(1) - (4)].propnodename), (yyvsp[(3) - (4)].data));
;}
......@@ -1530,8 +1502,6 @@ yyreduce:
case 15:
/* Line 1455 of yacc.c */
#line 168 "dtc-parser.y"
{
(yyval.prop) = build_property((yyvsp[(1) - (2)].propnodename), empty_data);
;}
......@@ -1539,8 +1509,6 @@ yyreduce:
case 16:
/* Line 1455 of yacc.c */
#line 172 "dtc-parser.y"
{
add_label(&(yyvsp[(2) - (2)].prop)->labels, (yyvsp[(1) - (2)].labelref));
(yyval.prop) = (yyvsp[(2) - (2)].prop);
......@@ -1549,8 +1517,6 @@ yyreduce:
case 17:
/* Line 1455 of yacc.c */
#line 180 "dtc-parser.y"
{
(yyval.data) = data_merge((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].data));
;}
......@@ -1558,8 +1524,6 @@ yyreduce:
case 18:
/* Line 1455 of yacc.c */
#line 184 "dtc-parser.y"
{
(yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
;}
......@@ -1567,8 +1531,6 @@ yyreduce:
case 19:
/* Line 1455 of yacc.c */
#line 188 "dtc-parser.y"
{
(yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
;}
......@@ -1576,8 +1538,6 @@ yyreduce:
case 20:
/* Line 1455 of yacc.c */
#line 192 "dtc-parser.y"
{
(yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), REF_PATH, (yyvsp[(2) - (2)].labelref));
;}
......@@ -1585,8 +1545,6 @@ yyreduce:
case 21:
/* Line 1455 of yacc.c */
#line 196 "dtc-parser.y"
{
FILE *f = srcfile_relative_open((yyvsp[(4) - (9)].data).val, NULL);
struct data d;
......@@ -1607,8 +1565,6 @@ yyreduce:
case 22:
/* Line 1455 of yacc.c */
#line 213 "dtc-parser.y"
{
FILE *f = srcfile_relative_open((yyvsp[(4) - (5)].data).val, NULL);
struct data d = empty_data;
......@@ -1622,8 +1578,6 @@ yyreduce:
case 23:
/* Line 1455 of yacc.c */
#line 223 "dtc-parser.y"
{
(yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
;}
......@@ -1631,8 +1585,6 @@ yyreduce:
case 24:
/* Line 1455 of yacc.c */
#line 230 "dtc-parser.y"
{
(yyval.data) = empty_data;
;}
......@@ -1640,8 +1592,6 @@ yyreduce:
case 25:
/* Line 1455 of yacc.c */
#line 234 "dtc-parser.y"
{
(yyval.data) = (yyvsp[(1) - (2)].data);
;}
......@@ -1649,8 +1599,6 @@ yyreduce:
case 26:
/* Line 1455 of yacc.c */
#line 238 "dtc-parser.y"
{
(yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
;}
......@@ -1658,8 +1606,6 @@ yyreduce:
case 27:
/* Line 1455 of yacc.c */
#line 245 "dtc-parser.y"
{
(yyval.data) = empty_data;
;}
......@@ -1667,8 +1613,6 @@ yyreduce:
case 28:
/* Line 1455 of yacc.c */
#line 249 "dtc-parser.y"
{
(yyval.data) = data_append_cell((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].cell));
;}
......@@ -1676,8 +1620,6 @@ yyreduce:
case 29:
/* Line 1455 of yacc.c */
#line 253 "dtc-parser.y"
{
(yyval.data) = data_append_cell(data_add_marker((yyvsp[(1) - (2)].data), REF_PHANDLE,
(yyvsp[(2) - (2)].labelref)), -1);
......@@ -1686,8 +1628,6 @@ yyreduce:
case 30:
/* Line 1455 of yacc.c */
#line 258 "dtc-parser.y"
{
(yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
;}
......@@ -1695,8 +1635,6 @@ yyreduce:
case 31:
/* Line 1455 of yacc.c */
#line 265 "dtc-parser.y"
{
(yyval.cell) = eval_literal((yyvsp[(1) - (1)].literal), 0, 32);
;}
......@@ -1704,8 +1642,6 @@ yyreduce:
case 32:
/* Line 1455 of yacc.c */
#line 272 "dtc-parser.y"
{
(yyval.data) = empty_data;
;}
......@@ -1713,8 +1649,6 @@ yyreduce:
case 33:
/* Line 1455 of yacc.c */
#line 276 "dtc-parser.y"
{
(yyval.data) = data_append_byte((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].byte));
;}
......@@ -1722,8 +1656,6 @@ yyreduce:
case 34:
/* Line 1455 of yacc.c */
#line 280 "dtc-parser.y"
{
(yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
;}
......@@ -1731,8 +1663,6 @@ yyreduce:
case 35:
/* Line 1455 of yacc.c */
#line 287 "dtc-parser.y"
{
(yyval.nodelist) = NULL;
;}
......@@ -1740,8 +1670,6 @@ yyreduce:
case 36:
/* Line 1455 of yacc.c */
#line 291 "dtc-parser.y"
{
(yyval.nodelist) = chain_node((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].nodelist));
;}
......@@ -1749,8 +1677,6 @@ yyreduce:
case 37:
/* Line 1455 of yacc.c */
#line 295 "dtc-parser.y"
{
print_error("syntax error: properties must precede subnodes");
YYERROR;
......@@ -1759,8 +1685,6 @@ yyreduce:
case 38:
/* Line 1455 of yacc.c */
#line 303 "dtc-parser.y"
{
(yyval.node) = name_node((yyvsp[(2) - (2)].node), (yyvsp[(1) - (2)].propnodename));
;}
......@@ -1768,8 +1692,6 @@ yyreduce:
case 39:
/* Line 1455 of yacc.c */
#line 307 "dtc-parser.y"
{
add_label(&(yyvsp[(2) - (2)].node)->labels, (yyvsp[(1) - (2)].labelref));
(yyval.node) = (yyvsp[(2) - (2)].node);
......@@ -1778,8 +1700,6 @@ yyreduce:
/* Line 1455 of yacc.c */
#line 1783 "dtc-parser.tab.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
......@@ -1990,8 +1910,6 @@ yyreturn:
/* Line 1675 of yacc.c */
#line 313 "dtc-parser.y"
void print_error(char const *fmt, ...)
......
/* A Bison parser, made by GNU Bison 2.4.1. */
/* A Bison parser, made by GNU Bison 2.4.3. */
/* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
2009, 2010 Free Software Foundation, Inc.
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
......@@ -58,8 +57,6 @@
typedef union YYSTYPE
{
/* Line 1676 of yacc.c */
#line 39 "dtc-parser.y"
char *propnodename;
char *literal;
......@@ -78,8 +75,6 @@ typedef union YYSTYPE
/* Line 1676 of yacc.c */
#line 83 "dtc-parser.tab.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
......
keywords.c
lex.c
parse.[ch]
*.hash.c
*.lex.c
*.tab.c
*.tab.h
genksyms
......@@ -2,52 +2,12 @@
hostprogs-y := genksyms
always := $(hostprogs-y)
genksyms-objs := genksyms.o parse.o lex.o
genksyms-objs := genksyms.o parse.tab.o lex.lex.o
# -I needed for generated C source (shipped source)
HOSTCFLAGS_parse.o := -Wno-uninitialized -I$(src)
HOSTCFLAGS_parse.tab.o := -I$(src)
HOSTCFLAGS_lex.lex.o := -I$(src)
# dependencies on generated files need to be listed explicitly
$(obj)/lex.o: $(obj)/parse.h $(obj)/keywords.c
$(obj)/lex.lex.o: $(obj)/keywords.hash.c $(obj)/parse.tab.h
# -I needed for generated C source (shipped source)
HOSTCFLAGS_lex.o := -I$(src)
ifdef GENERATE_PARSER
# gperf
quiet_cmd_keywords.c = GPERF $@
cmd_keywords.c = gperf -L ANSI-C -a -C -E -g -H is_reserved_hash \
-k 1,3,$$ -N is_reserved_word -p -t $< > $@
$(obj)/keywords.c: $(obj)/keywords.gperf FORCE
$(call if_changed,keywords.c)
cp $@ $@_shipped
# flex
quiet_cmd_lex.c = FLEX $@
cmd_lex.c = flex -o$@ -d $<
$(obj)/lex.c: $(obj)/lex.l $(obj)/keywords.c FORCE
$(call if_changed,lex.c)
cp $@ $@_shipped
# bison
quiet_cmd_parse.c = BISON $@
cmd_parse.c = bison -o$@ -dtv $(filter-out FORCE,$^)
$(obj)/parse.c: $(obj)/parse.y FORCE
$(call if_changed,parse.c)
cp $@ $@_shipped
cp $(@:.c=.h) $(@:.c=.h)_shipped
$(obj)/parse.h: $(obj)/parse.c ;
clean-files += parse.output
endif
targets += keywords.c lex.c parse.c parse.h
%language=ANSI-C
%define hash-function-name is_reserved_hash
%define lookup-function-name is_reserved_word
%{
struct resword;
static const struct resword *is_reserved_word(register const char *str, register unsigned int len);
......
/* ANSI-C code produced by gperf version 3.0.4 */
/* Command-line: gperf -L ANSI-C -a -C -E -g -H is_reserved_hash -k '1,3,$' -N is_reserved_word -p -t scripts/genksyms/keywords.gperf */
/* Command-line: gperf -t --output-file scripts/genksyms/keywords.hash.c_shipped -a -C -E -g -k '1,3,$' -p -t scripts/genksyms/keywords.gperf */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
......@@ -28,11 +28,11 @@
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
#endif
#line 1 "scripts/genksyms/keywords.gperf"
#line 4 "scripts/genksyms/keywords.gperf"
struct resword;
static const struct resword *is_reserved_word(register const char *str, register unsigned int len);
#line 5 "scripts/genksyms/keywords.gperf"
#line 8 "scripts/genksyms/keywords.gperf"
struct resword { const char *name; int token; };
/* maximum key range = 64, duplicates = 0 */
......@@ -99,108 +99,108 @@ is_reserved_word (register const char *str, register unsigned int len)
static const struct resword wordlist[] =
{
{""}, {""}, {""},
#line 30 "scripts/genksyms/keywords.gperf"
#line 33 "scripts/genksyms/keywords.gperf"
{"asm", ASM_KEYW},
{""},
#line 12 "scripts/genksyms/keywords.gperf"
#line 15 "scripts/genksyms/keywords.gperf"
{"__asm", ASM_KEYW},
{""},
#line 13 "scripts/genksyms/keywords.gperf"
#line 16 "scripts/genksyms/keywords.gperf"
{"__asm__", ASM_KEYW},
{""}, {""},
#line 56 "scripts/genksyms/keywords.gperf"
#line 59 "scripts/genksyms/keywords.gperf"
{"__typeof__", TYPEOF_KEYW},
{""},
#line 16 "scripts/genksyms/keywords.gperf"
#line 19 "scripts/genksyms/keywords.gperf"
{"__const", CONST_KEYW},
#line 15 "scripts/genksyms/keywords.gperf"
#line 18 "scripts/genksyms/keywords.gperf"
{"__attribute__", ATTRIBUTE_KEYW},
#line 17 "scripts/genksyms/keywords.gperf"
#line 20 "scripts/genksyms/keywords.gperf"
{"__const__", CONST_KEYW},
#line 22 "scripts/genksyms/keywords.gperf"
#line 25 "scripts/genksyms/keywords.gperf"
{"__signed__", SIGNED_KEYW},
#line 48 "scripts/genksyms/keywords.gperf"
#line 51 "scripts/genksyms/keywords.gperf"
{"static", STATIC_KEYW},
{""},
#line 43 "scripts/genksyms/keywords.gperf"
#line 46 "scripts/genksyms/keywords.gperf"
{"int", INT_KEYW},
#line 36 "scripts/genksyms/keywords.gperf"
#line 39 "scripts/genksyms/keywords.gperf"
{"char", CHAR_KEYW},
#line 37 "scripts/genksyms/keywords.gperf"
#line 40 "scripts/genksyms/keywords.gperf"
{"const", CONST_KEYW},
#line 49 "scripts/genksyms/keywords.gperf"
#line 52 "scripts/genksyms/keywords.gperf"
{"struct", STRUCT_KEYW},
#line 28 "scripts/genksyms/keywords.gperf"
#line 31 "scripts/genksyms/keywords.gperf"
{"__restrict__", RESTRICT_KEYW},
#line 29 "scripts/genksyms/keywords.gperf"
#line 32 "scripts/genksyms/keywords.gperf"
{"restrict", RESTRICT_KEYW},
#line 9 "scripts/genksyms/keywords.gperf"
#line 12 "scripts/genksyms/keywords.gperf"
{"EXPORT_SYMBOL_GPL_FUTURE", EXPORT_SYMBOL_KEYW},
#line 20 "scripts/genksyms/keywords.gperf"
#line 23 "scripts/genksyms/keywords.gperf"
{"__inline__", INLINE_KEYW},
{""},
#line 24 "scripts/genksyms/keywords.gperf"
#line 27 "scripts/genksyms/keywords.gperf"
{"__volatile__", VOLATILE_KEYW},
#line 7 "scripts/genksyms/keywords.gperf"
#line 10 "scripts/genksyms/keywords.gperf"
{"EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW},
#line 27 "scripts/genksyms/keywords.gperf"
#line 30 "scripts/genksyms/keywords.gperf"
{"_restrict", RESTRICT_KEYW},
{""},
#line 14 "scripts/genksyms/keywords.gperf"
#line 17 "scripts/genksyms/keywords.gperf"
{"__attribute", ATTRIBUTE_KEYW},
#line 8 "scripts/genksyms/keywords.gperf"
#line 11 "scripts/genksyms/keywords.gperf"
{"EXPORT_SYMBOL_GPL", EXPORT_SYMBOL_KEYW},
#line 18 "scripts/genksyms/keywords.gperf"
#line 21 "scripts/genksyms/keywords.gperf"
{"__extension__", EXTENSION_KEYW},
#line 39 "scripts/genksyms/keywords.gperf"
#line 42 "scripts/genksyms/keywords.gperf"
{"enum", ENUM_KEYW},
#line 10 "scripts/genksyms/keywords.gperf"
#line 13 "scripts/genksyms/keywords.gperf"
{"EXPORT_UNUSED_SYMBOL", EXPORT_SYMBOL_KEYW},
#line 40 "scripts/genksyms/keywords.gperf"
#line 43 "scripts/genksyms/keywords.gperf"
{"extern", EXTERN_KEYW},
{""},
#line 21 "scripts/genksyms/keywords.gperf"
#line 24 "scripts/genksyms/keywords.gperf"
{"__signed", SIGNED_KEYW},
#line 11 "scripts/genksyms/keywords.gperf"
#line 14 "scripts/genksyms/keywords.gperf"
{"EXPORT_UNUSED_SYMBOL_GPL", EXPORT_SYMBOL_KEYW},
#line 51 "scripts/genksyms/keywords.gperf"
#line 54 "scripts/genksyms/keywords.gperf"
{"union", UNION_KEYW},
#line 55 "scripts/genksyms/keywords.gperf"
#line 58 "scripts/genksyms/keywords.gperf"
{"typeof", TYPEOF_KEYW},
#line 50 "scripts/genksyms/keywords.gperf"
#line 53 "scripts/genksyms/keywords.gperf"
{"typedef", TYPEDEF_KEYW},
#line 19 "scripts/genksyms/keywords.gperf"
#line 22 "scripts/genksyms/keywords.gperf"
{"__inline", INLINE_KEYW},
#line 35 "scripts/genksyms/keywords.gperf"
#line 38 "scripts/genksyms/keywords.gperf"
{"auto", AUTO_KEYW},
#line 23 "scripts/genksyms/keywords.gperf"
#line 26 "scripts/genksyms/keywords.gperf"
{"__volatile", VOLATILE_KEYW},
{""}, {""},
#line 52 "scripts/genksyms/keywords.gperf"
#line 55 "scripts/genksyms/keywords.gperf"
{"unsigned", UNSIGNED_KEYW},
{""},
#line 46 "scripts/genksyms/keywords.gperf"
#line 49 "scripts/genksyms/keywords.gperf"
{"short", SHORT_KEYW},
#line 42 "scripts/genksyms/keywords.gperf"
#line 45 "scripts/genksyms/keywords.gperf"
{"inline", INLINE_KEYW},
{""},
#line 54 "scripts/genksyms/keywords.gperf"
#line 57 "scripts/genksyms/keywords.gperf"
{"volatile", VOLATILE_KEYW},
#line 44 "scripts/genksyms/keywords.gperf"
#line 47 "scripts/genksyms/keywords.gperf"
{"long", LONG_KEYW},
#line 26 "scripts/genksyms/keywords.gperf"
#line 29 "scripts/genksyms/keywords.gperf"
{"_Bool", BOOL_KEYW},
{""}, {""},
#line 45 "scripts/genksyms/keywords.gperf"
#line 48 "scripts/genksyms/keywords.gperf"
{"register", REGISTER_KEYW},
#line 53 "scripts/genksyms/keywords.gperf"
#line 56 "scripts/genksyms/keywords.gperf"
{"void", VOID_KEYW},
#line 41 "scripts/genksyms/keywords.gperf"
#line 44 "scripts/genksyms/keywords.gperf"
{"float", FLOAT_KEYW},
#line 38 "scripts/genksyms/keywords.gperf"
#line 41 "scripts/genksyms/keywords.gperf"
{"double", DOUBLE_KEYW},
{""}, {""}, {""}, {""},
#line 47 "scripts/genksyms/keywords.gperf"
#line 50 "scripts/genksyms/keywords.gperf"
{"signed", SIGNED_KEYW}
};
......
......@@ -29,7 +29,7 @@
#include <ctype.h>
#include "genksyms.h"
#include "parse.h"
#include "parse.tab.h"
/* We've got a two-level lexer here. We let flex do basic tokenization
and then we categorize those basic tokens in the second stage. */
......@@ -94,7 +94,7 @@ MC_TOKEN ([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>)
/* Bring in the keyword recognizer. */
#include "keywords.c"
#include "keywords.hash.c"
/* Macros to append to our phrase collection list. */
......
/* A Bison parser, made by GNU Bison 2.4.1. */
/* A Bison parser, made by GNU Bison 2.4.3. */
/* 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.
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
2009, 2010 Free Software Foundation, Inc.
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
......@@ -46,7 +45,7 @@
#define YYBISON 1
/* Bison version. */
#define YYBISON_VERSION "2.4.1"
#define YYBISON_VERSION "2.4.3"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
......@@ -67,8 +66,6 @@
/* Copy the first part of user declarations. */
/* Line 189 of yacc.c */
#line 24 "scripts/genksyms/parse.y"
#include <assert.h>
......@@ -101,8 +98,6 @@ remove_list(struct string_list **pb, struct string_list **pe)
/* Line 189 of yacc.c */
#line 106 "scripts/genksyms/parse.c"
/* Enabling traces. */
#ifndef YYDEBUG
......@@ -186,8 +181,6 @@ typedef int YYSTYPE;
/* Copy the second part of user declarations. */
/* Line 264 of yacc.c */
#line 191 "scripts/genksyms/parse.c"
#ifdef short
# undef short
......@@ -237,7 +230,7 @@ typedef short int yytype_int16;
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#ifndef YY_
# if YYENABLE_NLS
# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
# define YY_(msgid) dgettext ("bison-runtime", msgid)
......@@ -855,9 +848,18 @@ static const yytype_uint8 yystos[] =
/* Like YYERROR except do call yyerror. This remains here temporarily
to ease the transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. */
Once GCC version 2 has supplanted version 1, this can go. However,
YYFAIL appears to be in use. Nevertheless, it is formally deprecated
in Bison 2.4.2's NEWS entry, where a plan to phase it out is
discussed. */
#define YYFAIL goto yyerrlab
#if defined YYFAIL
/* This is here to suppress warnings from the GCC cpp's
-Wunused-macros. Normally we don't worry about that warning, but
some users do, and we want to make it easy for users to remove
YYFAIL uses, which will produce warnings from Bison 2.5. */
#endif
#define YYRECOVERING() (!!yyerrstatus)
......@@ -914,7 +916,7 @@ while (YYID (0))
we won't break user code: when these are the locations we know. */
#ifndef YY_LOCATION_PRINT
# if YYLTYPE_IS_TRIVIAL
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
# define YY_LOCATION_PRINT(File, Loc) \
fprintf (File, "%d.%d-%d.%d", \
(Loc).first_line, (Loc).first_column, \
......@@ -1653,64 +1655,46 @@ yyreduce:
{
case 4:
/* Line 1455 of yacc.c */
#line 109 "scripts/genksyms/parse.y"
{ is_typedef = 0; is_extern = 0; current_name = NULL; decl_spec = NULL; ;}
break;
case 5:
/* Line 1455 of yacc.c */
#line 111 "scripts/genksyms/parse.y"
{ free_list(*(yyvsp[(2) - (2)]), NULL); *(yyvsp[(2) - (2)]) = NULL; ;}
break;
case 6:
/* Line 1455 of yacc.c */
#line 115 "scripts/genksyms/parse.y"
{ is_typedef = 1; ;}
break;
case 7:
/* Line 1455 of yacc.c */
#line 116 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(4) - (4)]); ;}
break;
case 8:
/* Line 1455 of yacc.c */
#line 117 "scripts/genksyms/parse.y"
{ is_typedef = 1; ;}
break;
case 9:
/* Line 1455 of yacc.c */
#line 118 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(3) - (3)]); ;}
break;
case 14:
/* Line 1455 of yacc.c */
#line 123 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(2) - (2)]); ;}
break;
case 15:
/* Line 1455 of yacc.c */
#line 124 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(2) - (2)]); ;}
break;
case 16:
/* Line 1455 of yacc.c */
#line 129 "scripts/genksyms/parse.y"
{ if (current_name) {
struct string_list *decl = (*(yyvsp[(3) - (3)]))->next;
(*(yyvsp[(3) - (3)]))->next = NULL;
......@@ -1725,15 +1709,11 @@ yyreduce:
case 17:
/* Line 1455 of yacc.c */
#line 142 "scripts/genksyms/parse.y"
{ (yyval) = NULL; ;}
break;
case 19:
/* Line 1455 of yacc.c */
#line 148 "scripts/genksyms/parse.y"
{ struct string_list *decl = *(yyvsp[(1) - (1)]);
*(yyvsp[(1) - (1)]) = NULL;
add_symbol(current_name,
......@@ -1745,8 +1725,6 @@ yyreduce:
case 20:
/* Line 1455 of yacc.c */
#line 156 "scripts/genksyms/parse.y"
{ struct string_list *decl = *(yyvsp[(3) - (3)]);
*(yyvsp[(3) - (3)]) = NULL;
free_list(*(yyvsp[(2) - (3)]), NULL);
......@@ -1760,36 +1738,26 @@ yyreduce:
case 21:
/* Line 1455 of yacc.c */
#line 169 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(4) - (4)]) ? (yyvsp[(4) - (4)]) : (yyvsp[(3) - (4)]) ? (yyvsp[(3) - (4)]) : (yyvsp[(2) - (4)]) ? (yyvsp[(2) - (4)]) : (yyvsp[(1) - (4)]); ;}
break;
case 22:
/* Line 1455 of yacc.c */
#line 174 "scripts/genksyms/parse.y"
{ decl_spec = NULL; ;}
break;
case 24:
/* Line 1455 of yacc.c */
#line 179 "scripts/genksyms/parse.y"
{ decl_spec = *(yyvsp[(1) - (1)]); ;}
break;
case 25:
/* Line 1455 of yacc.c */
#line 180 "scripts/genksyms/parse.y"
{ decl_spec = *(yyvsp[(2) - (2)]); ;}
break;
case 26:
/* Line 1455 of yacc.c */
#line 185 "scripts/genksyms/parse.y"
{ /* Version 2 checksumming ignores storage class, as that
is really irrelevant to the linkage. */
remove_node((yyvsp[(1) - (1)]));
......@@ -1799,43 +1767,31 @@ yyreduce:
case 31:
/* Line 1455 of yacc.c */
#line 197 "scripts/genksyms/parse.y"
{ is_extern = 1; (yyval) = (yyvsp[(1) - (1)]); ;}
break;
case 32:
/* Line 1455 of yacc.c */
#line 198 "scripts/genksyms/parse.y"
{ is_extern = 0; (yyval) = (yyvsp[(1) - (1)]); ;}
break;
case 37:
/* Line 1455 of yacc.c */
#line 210 "scripts/genksyms/parse.y"
{ remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_STRUCT; (yyval) = (yyvsp[(2) - (2)]); ;}
break;
case 38:
/* Line 1455 of yacc.c */
#line 212 "scripts/genksyms/parse.y"
{ remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_UNION; (yyval) = (yyvsp[(2) - (2)]); ;}
break;
case 39:
/* Line 1455 of yacc.c */
#line 214 "scripts/genksyms/parse.y"
{ remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_ENUM; (yyval) = (yyvsp[(2) - (2)]); ;}
break;
case 40:
/* Line 1455 of yacc.c */
#line 218 "scripts/genksyms/parse.y"
{ struct string_list *s = *(yyvsp[(3) - (3)]), *i = *(yyvsp[(2) - (3)]), *r;
r = copy_node(i); r->tag = SYM_STRUCT;
r->next = (*(yyvsp[(1) - (3)]))->next; *(yyvsp[(3) - (3)]) = r; (*(yyvsp[(1) - (3)]))->next = NULL;
......@@ -1846,8 +1802,6 @@ yyreduce:
case 41:
/* Line 1455 of yacc.c */
#line 225 "scripts/genksyms/parse.y"
{ struct string_list *s = *(yyvsp[(3) - (3)]), *i = *(yyvsp[(2) - (3)]), *r;
r = copy_node(i); r->tag = SYM_UNION;
r->next = (*(yyvsp[(1) - (3)]))->next; *(yyvsp[(3) - (3)]) = r; (*(yyvsp[(1) - (3)]))->next = NULL;
......@@ -1858,8 +1812,6 @@ yyreduce:
case 42:
/* Line 1455 of yacc.c */
#line 232 "scripts/genksyms/parse.y"
{ struct string_list *s = *(yyvsp[(3) - (3)]), *i = *(yyvsp[(2) - (3)]), *r;
r = copy_node(i); r->tag = SYM_ENUM;
r->next = (*(yyvsp[(1) - (3)]))->next; *(yyvsp[(3) - (3)]) = r; (*(yyvsp[(1) - (3)]))->next = NULL;
......@@ -1870,57 +1822,41 @@ yyreduce:
case 43:
/* Line 1455 of yacc.c */
#line 242 "scripts/genksyms/parse.y"
{ add_symbol(NULL, SYM_ENUM, NULL, 0); (yyval) = (yyvsp[(2) - (2)]); ;}
break;
case 44:
/* Line 1455 of yacc.c */
#line 244 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(2) - (2)]); ;}
break;
case 45:
/* Line 1455 of yacc.c */
#line 245 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(2) - (2)]); ;}
break;
case 56:
/* Line 1455 of yacc.c */
#line 259 "scripts/genksyms/parse.y"
{ (*(yyvsp[(1) - (1)]))->tag = SYM_TYPEDEF; (yyval) = (yyvsp[(1) - (1)]); ;}
break;
case 57:
/* Line 1455 of yacc.c */
#line 264 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;}
break;
case 58:
/* Line 1455 of yacc.c */
#line 268 "scripts/genksyms/parse.y"
{ (yyval) = NULL; ;}
break;
case 61:
/* Line 1455 of yacc.c */
#line 274 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(2) - (2)]); ;}
break;
case 65:
/* Line 1455 of yacc.c */
#line 280 "scripts/genksyms/parse.y"
{ /* restrict has no effect in prototypes so ignore it */
remove_node((yyvsp[(1) - (1)]));
(yyval) = (yyvsp[(1) - (1)]);
......@@ -1929,15 +1865,11 @@ yyreduce:
case 66:
/* Line 1455 of yacc.c */
#line 287 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(2) - (2)]); ;}
break;
case 68:
/* Line 1455 of yacc.c */
#line 293 "scripts/genksyms/parse.y"
{ if (current_name != NULL) {
error_with_pos("unexpected second declaration name");
YYERROR;
......@@ -1950,134 +1882,96 @@ yyreduce:
case 69:
/* Line 1455 of yacc.c */
#line 302 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(4) - (4)]); ;}
break;
case 70:
/* Line 1455 of yacc.c */
#line 304 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(4) - (4)]); ;}
break;
case 71:
/* Line 1455 of yacc.c */
#line 306 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(2) - (2)]); ;}
break;
case 72:
/* Line 1455 of yacc.c */
#line 308 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(3) - (3)]); ;}
break;
case 73:
/* Line 1455 of yacc.c */
#line 310 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(3) - (3)]); ;}
break;
case 74:
/* Line 1455 of yacc.c */
#line 316 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(2) - (2)]); ;}
break;
case 78:
/* Line 1455 of yacc.c */
#line 324 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(4) - (4)]); ;}
break;
case 79:
/* Line 1455 of yacc.c */
#line 326 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(4) - (4)]); ;}
break;
case 80:
/* Line 1455 of yacc.c */
#line 328 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(2) - (2)]); ;}
break;
case 81:
/* Line 1455 of yacc.c */
#line 330 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(3) - (3)]); ;}
break;
case 82:
/* Line 1455 of yacc.c */
#line 332 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(3) - (3)]); ;}
break;
case 83:
/* Line 1455 of yacc.c */
#line 336 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(2) - (2)]); ;}
break;
case 85:
/* Line 1455 of yacc.c */
#line 338 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(3) - (3)]); ;}
break;
case 86:
/* Line 1455 of yacc.c */
#line 342 "scripts/genksyms/parse.y"
{ (yyval) = NULL; ;}
break;
case 89:
/* Line 1455 of yacc.c */
#line 349 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(3) - (3)]); ;}
break;
case 90:
/* Line 1455 of yacc.c */
#line 354 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;}
break;
case 91:
/* Line 1455 of yacc.c */
#line 359 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;}
break;
case 93:
/* Line 1455 of yacc.c */
#line 364 "scripts/genksyms/parse.y"
{ (yyval) = NULL; ;}
break;
case 94:
/* Line 1455 of yacc.c */
#line 366 "scripts/genksyms/parse.y"
{ /* For version 2 checksums, we don't want to remember
private parameter names. */
remove_node((yyvsp[(1) - (1)]));
......@@ -2087,8 +1981,6 @@ yyreduce:
case 95:
/* Line 1455 of yacc.c */
#line 374 "scripts/genksyms/parse.y"
{ remove_node((yyvsp[(1) - (1)]));
(yyval) = (yyvsp[(1) - (1)]);
;}
......@@ -2096,43 +1988,31 @@ yyreduce:
case 96:
/* Line 1455 of yacc.c */
#line 378 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(4) - (4)]); ;}
break;
case 97:
/* Line 1455 of yacc.c */
#line 380 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(4) - (4)]); ;}
break;
case 98:
/* Line 1455 of yacc.c */
#line 382 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(2) - (2)]); ;}
break;
case 99:
/* Line 1455 of yacc.c */
#line 384 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(3) - (3)]); ;}
break;
case 100:
/* Line 1455 of yacc.c */
#line 386 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(3) - (3)]); ;}
break;
case 101:
/* Line 1455 of yacc.c */
#line 391 "scripts/genksyms/parse.y"
{ struct string_list *decl = *(yyvsp[(2) - (3)]);
*(yyvsp[(2) - (3)]) = NULL;
add_symbol(current_name, SYM_NORMAL, decl, is_extern);
......@@ -2142,120 +2022,86 @@ yyreduce:
case 102:
/* Line 1455 of yacc.c */
#line 399 "scripts/genksyms/parse.y"
{ (yyval) = NULL; ;}
break;
case 104:
/* Line 1455 of yacc.c */
#line 406 "scripts/genksyms/parse.y"
{ remove_list((yyvsp[(2) - (2)]), &(*(yyvsp[(1) - (2)]))->next); (yyval) = (yyvsp[(2) - (2)]); ;}
break;
case 105:
/* Line 1455 of yacc.c */
#line 410 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(3) - (3)]); ;}
break;
case 106:
/* Line 1455 of yacc.c */
#line 411 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(3) - (3)]); ;}
break;
case 107:
/* Line 1455 of yacc.c */
#line 415 "scripts/genksyms/parse.y"
{ (yyval) = NULL; ;}
break;
case 110:
/* Line 1455 of yacc.c */
#line 421 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(2) - (2)]); ;}
break;
case 111:
/* Line 1455 of yacc.c */
#line 426 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(3) - (3)]); ;}
break;
case 112:
/* Line 1455 of yacc.c */
#line 428 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(2) - (2)]); ;}
break;
case 113:
/* Line 1455 of yacc.c */
#line 432 "scripts/genksyms/parse.y"
{ (yyval) = NULL; ;}
break;
case 116:
/* Line 1455 of yacc.c */
#line 438 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(3) - (3)]); ;}
break;
case 117:
/* Line 1455 of yacc.c */
#line 442 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;}
break;
case 118:
/* Line 1455 of yacc.c */
#line 443 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(2) - (2)]); ;}
break;
case 120:
/* Line 1455 of yacc.c */
#line 448 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(2) - (2)]); ;}
break;
case 121:
/* Line 1455 of yacc.c */
#line 452 "scripts/genksyms/parse.y"
{ (yyval) = NULL; ;}
break;
case 123:
/* Line 1455 of yacc.c */
#line 457 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(3) - (3)]); ;}
break;
case 124:
/* Line 1455 of yacc.c */
#line 458 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(4) - (4)]); ;}
break;
case 127:
/* Line 1455 of yacc.c */
#line 467 "scripts/genksyms/parse.y"
{
const char *name = strdup((*(yyvsp[(1) - (1)]))->string);
add_symbol(name, SYM_ENUM_CONST, NULL, 0);
......@@ -2264,8 +2110,6 @@ yyreduce:
case 128:
/* Line 1455 of yacc.c */
#line 472 "scripts/genksyms/parse.y"
{
const char *name = strdup((*(yyvsp[(1) - (3)]))->string);
struct string_list *expr = copy_list_range(*(yyvsp[(3) - (3)]), *(yyvsp[(2) - (3)]));
......@@ -2275,29 +2119,21 @@ yyreduce:
case 129:
/* Line 1455 of yacc.c */
#line 479 "scripts/genksyms/parse.y"
{ (yyval) = (yyvsp[(2) - (2)]); ;}
break;
case 130:
/* Line 1455 of yacc.c */
#line 483 "scripts/genksyms/parse.y"
{ (yyval) = NULL; ;}
break;
case 132:
/* Line 1455 of yacc.c */
#line 489 "scripts/genksyms/parse.y"
{ export_symbol((*(yyvsp[(3) - (5)]))->string); (yyval) = (yyvsp[(5) - (5)]); ;}
break;
/* Line 1455 of yacc.c */
#line 2301 "scripts/genksyms/parse.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
......@@ -2508,8 +2344,6 @@ yyreturn:
/* Line 1675 of yacc.c */
#line 493 "scripts/genksyms/parse.y"
static void
......
/* A Bison parser, made by GNU Bison 2.4.1. */
/* A Bison parser, made by GNU Bison 2.4.3. */
/* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
2009, 2010 Free Software Foundation, Inc.
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
......
......@@ -2,7 +2,7 @@
# Generated files
#
config*
lex.*.c
*.lex.c
*.tab.c
*.tab.h
zconf.hash.c
......
......@@ -204,7 +204,7 @@ ifeq ($(gconf-target),1)
endif
clean-files := lkc_defs.h qconf.moc .tmp_qtcheck .tmp_gtkcheck
clean-files += zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h
clean-files += zconf.tab.c zconf.lex.c zconf.hash.c gconf.glade.h
clean-files += mconf qconf gconf nconf
clean-files += config.pot linux.pot
......@@ -220,9 +220,12 @@ always := dochecklxdialog
HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS))
# generated files seem to need this to find local include files
HOSTCFLAGS_lex.zconf.o := -I$(src)
HOSTCFLAGS_zconf.lex.o := -I$(src)
HOSTCFLAGS_zconf.tab.o := -I$(src)
LEX_PREFIX_zconf := zconf
YACC_PREFIX_zconf := zconf
HOSTLOADLIBES_qconf = $(KC_QT_LIBS) -ldl
HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS) -D LKC_DIRECT_LINK
......@@ -316,7 +319,7 @@ $(obj)/.tmp_gtkcheck:
fi
endif
$(obj)/zconf.tab.o: $(obj)/lex.zconf.c $(obj)/zconf.hash.c
$(obj)/zconf.tab.o: $(obj)/zconf.lex.c $(obj)/zconf.hash.c
$(obj)/kconfig_load.o: $(obj)/lkc_defs.h
......@@ -335,28 +338,3 @@ $(obj)/gconf.glade.h: $(obj)/gconf.glade
$(Q)intltool-extract --type=gettext/glade --srcdir=$(srctree) \
$(obj)/gconf.glade
###
# The following requires flex/bison/gperf
# By default we use the _shipped versions, uncomment the following line if
# you are modifying the flex/bison src.
# LKC_GENPARSER := 1
ifdef LKC_GENPARSER
$(obj)/zconf.tab.c: $(src)/zconf.y
$(obj)/lex.zconf.c: $(src)/zconf.l
$(obj)/zconf.hash.c: $(src)/zconf.gperf
%.tab.c: %.y
bison -l -b $* -p $(notdir $*) $<
cp $@ $@_shipped
lex.%.c: %.l
flex -L -P$(notdir $*) -o$@ $<
cp $@ $@_shipped
%.hash.c: %.gperf
gperf < $< > $@
cp $@ $@_shipped
endif
......@@ -68,9 +68,7 @@ struct kconf_id {
enum symbol_type stype;
};
#ifdef YYDEBUG
extern int zconfdebug;
#endif
int zconfparse(void);
void zconfdump(FILE *out);
......
......@@ -9,7 +9,7 @@
struct kconf_id;
static struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len);
static const struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len);
%%
mainmenu, T_MAINMENU, TF_COMMAND
......
/* ANSI-C code produced by gperf version 3.0.3 */
/* Command-line: gperf */
/* Computed positions: -k'1,3' */
/* ANSI-C code produced by gperf version 3.0.4 */
/* Command-line: gperf -t --output-file scripts/kconfig/zconf.hash.c_shipped -a -C -E -g -k '1,3,$' -p -t scripts/kconfig/zconf.gperf */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
......@@ -29,10 +28,11 @@
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
#endif
#line 10 "scripts/kconfig/zconf.gperf"
struct kconf_id;
static struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len);
/* maximum key range = 50, duplicates = 0 */
static const struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len);
/* maximum key range = 71, duplicates = 0 */
#ifdef __GNUC__
__inline
......@@ -44,34 +44,34 @@ inline
static unsigned int
kconf_id_hash (register const char *str, register unsigned int len)
{
static unsigned char asso_values[] =
static const unsigned char asso_values[] =
{
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 40, 5,
0, 0, 5, 52, 0, 20, 52, 52, 10, 20,
5, 0, 35, 52, 0, 30, 0, 15, 0, 52,
15, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52
73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 25, 25,
0, 0, 0, 5, 0, 0, 73, 73, 5, 0,
10, 5, 45, 73, 20, 20, 0, 15, 15, 73,
20, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 73, 73
};
register int hval = len;
......@@ -85,87 +85,87 @@ kconf_id_hash (register const char *str, register unsigned int len)
hval += asso_values[(unsigned char)str[0]];
break;
}
return hval;
return hval + asso_values[(unsigned char)str[len - 1]];
}
struct kconf_id_strings_t
{
char kconf_id_strings_str2[sizeof("on")];
char kconf_id_strings_str3[sizeof("env")];
char kconf_id_strings_str2[sizeof("if")];
char kconf_id_strings_str3[sizeof("int")];
char kconf_id_strings_str5[sizeof("endif")];
char kconf_id_strings_str6[sizeof("option")];
char kconf_id_strings_str7[sizeof("endmenu")];
char kconf_id_strings_str8[sizeof("optional")];
char kconf_id_strings_str7[sizeof("default")];
char kconf_id_strings_str8[sizeof("tristate")];
char kconf_id_strings_str9[sizeof("endchoice")];
char kconf_id_strings_str10[sizeof("range")];
char kconf_id_strings_str11[sizeof("choice")];
char kconf_id_strings_str12[sizeof("default")];
char kconf_id_strings_str12[sizeof("def_tristate")];
char kconf_id_strings_str13[sizeof("def_bool")];
char kconf_id_strings_str14[sizeof("help")];
char kconf_id_strings_str16[sizeof("config")];
char kconf_id_strings_str17[sizeof("def_tristate")];
char kconf_id_strings_str18[sizeof("hex")];
char kconf_id_strings_str19[sizeof("defconfig_list")];
char kconf_id_strings_str22[sizeof("if")];
char kconf_id_strings_str23[sizeof("int")];
char kconf_id_strings_str14[sizeof("defconfig_list")];
char kconf_id_strings_str17[sizeof("on")];
char kconf_id_strings_str18[sizeof("optional")];
char kconf_id_strings_str21[sizeof("option")];
char kconf_id_strings_str22[sizeof("endmenu")];
char kconf_id_strings_str23[sizeof("mainmenu")];
char kconf_id_strings_str25[sizeof("menuconfig")];
char kconf_id_strings_str27[sizeof("modules")];
char kconf_id_strings_str28[sizeof("tristate")];
char kconf_id_strings_str29[sizeof("menu")];
char kconf_id_strings_str31[sizeof("select")];
char kconf_id_strings_str32[sizeof("comment")];
char kconf_id_strings_str35[sizeof("menuconfig")];
char kconf_id_strings_str36[sizeof("string")];
char kconf_id_strings_str37[sizeof("visible")];
char kconf_id_strings_str41[sizeof("prompt")];
char kconf_id_strings_str42[sizeof("depends")];
char kconf_id_strings_str44[sizeof("bool")];
char kconf_id_strings_str46[sizeof("select")];
char kconf_id_strings_str33[sizeof("env")];
char kconf_id_strings_str35[sizeof("range")];
char kconf_id_strings_str36[sizeof("choice")];
char kconf_id_strings_str39[sizeof("bool")];
char kconf_id_strings_str41[sizeof("source")];
char kconf_id_strings_str42[sizeof("visible")];
char kconf_id_strings_str43[sizeof("hex")];
char kconf_id_strings_str46[sizeof("config")];
char kconf_id_strings_str47[sizeof("boolean")];
char kconf_id_strings_str48[sizeof("mainmenu")];
char kconf_id_strings_str51[sizeof("source")];
char kconf_id_strings_str51[sizeof("string")];
char kconf_id_strings_str54[sizeof("help")];
char kconf_id_strings_str56[sizeof("prompt")];
char kconf_id_strings_str72[sizeof("depends")];
};
static struct kconf_id_strings_t kconf_id_strings_contents =
static const struct kconf_id_strings_t kconf_id_strings_contents =
{
"on",
"env",
"if",
"int",
"endif",
"option",
"endmenu",
"optional",
"endchoice",
"range",
"choice",
"default",
"def_bool",
"help",
"config",
"tristate",
"endchoice",
"def_tristate",
"hex",
"def_bool",
"defconfig_list",
"if",
"int",
"on",
"optional",
"option",
"endmenu",
"mainmenu",
"menuconfig",
"modules",
"tristate",
"menu",
"select",
"comment",
"menuconfig",
"string",
"visible",
"prompt",
"depends",
"env",
"range",
"choice",
"bool",
"select",
"source",
"visible",
"hex",
"config",
"boolean",
"mainmenu",
"source"
"string",
"help",
"prompt",
"depends"
};
#define kconf_id_strings ((const char *) &kconf_id_strings_contents)
#ifdef __GNUC__
__inline
#ifdef __GNUC_STDC_INLINE__
#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
__attribute__ ((__gnu_inline__))
#endif
#endif
struct kconf_id *
const struct kconf_id *
kconf_id_lookup (register const char *str, register unsigned int len)
{
enum
......@@ -174,54 +174,94 @@ kconf_id_lookup (register const char *str, register unsigned int len)
MIN_WORD_LENGTH = 2,
MAX_WORD_LENGTH = 14,
MIN_HASH_VALUE = 2,
MAX_HASH_VALUE = 51
MAX_HASH_VALUE = 72
};
static struct kconf_id wordlist[] =
static const struct kconf_id wordlist[] =
{
{-1}, {-1},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str2, T_ON, TF_PARAM},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str3, T_OPT_ENV, TF_OPTION},
#line 25 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str2, T_IF, TF_COMMAND|TF_PARAM},
#line 36 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str3, T_TYPE, TF_COMMAND, S_INT},
{-1},
#line 26 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str5, T_ENDIF, TF_COMMAND},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str6, T_OPTION, TF_COMMAND},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str7, T_ENDMENU, TF_COMMAND},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str8, T_OPTIONAL, TF_COMMAND},
{-1},
#line 29 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str7, T_DEFAULT, TF_COMMAND, S_UNKNOWN},
#line 31 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str8, T_TYPE, TF_COMMAND, S_TRISTATE},
#line 20 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str9, T_ENDCHOICE, TF_COMMAND},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str10, T_RANGE, TF_COMMAND},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str11, T_CHOICE, TF_COMMAND},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str12, T_DEFAULT, TF_COMMAND, S_UNKNOWN},
{-1}, {-1},
#line 32 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str12, T_DEFAULT, TF_COMMAND, S_TRISTATE},
#line 35 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str13, T_DEFAULT, TF_COMMAND, S_BOOLEAN},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str14, T_HELP, TF_COMMAND},
{-1},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str16, T_CONFIG, TF_COMMAND},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str17, T_DEFAULT, TF_COMMAND, S_TRISTATE},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str18, T_TYPE, TF_COMMAND, S_HEX},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str19, T_OPT_DEFCONFIG_LIST,TF_OPTION},
#line 45 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str14, T_OPT_DEFCONFIG_LIST,TF_OPTION},
{-1}, {-1},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22, T_IF, TF_COMMAND|TF_PARAM},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str23, T_TYPE, TF_COMMAND, S_INT},
{-1}, {-1}, {-1},
#line 43 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str17, T_ON, TF_PARAM},
#line 28 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str18, T_OPTIONAL, TF_COMMAND},
{-1}, {-1},
#line 42 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str21, T_OPTION, TF_COMMAND},
#line 17 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22, T_ENDMENU, TF_COMMAND},
#line 15 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str23, T_MAINMENU, TF_COMMAND},
{-1},
#line 23 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str25, T_MENUCONFIG, TF_COMMAND},
{-1},
#line 44 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_OPT_MODULES, TF_OPTION},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str28, T_TYPE, TF_COMMAND, S_TRISTATE},
{-1},
#line 16 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str29, T_MENU, TF_COMMAND},
{-1}, {-1},
{-1},
#line 39 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str31, T_SELECT, TF_COMMAND},
#line 21 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str32, T_COMMENT, TF_COMMAND},
{-1}, {-1},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str35, T_MENUCONFIG, TF_COMMAND},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str36, T_TYPE, TF_COMMAND, S_STRING},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str37, T_VISIBLE, TF_COMMAND},
{-1}, {-1}, {-1},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str41, T_PROMPT, TF_COMMAND},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str42, T_DEPENDS, TF_COMMAND},
#line 46 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str33, T_OPT_ENV, TF_OPTION},
{-1},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str44, T_TYPE, TF_COMMAND, S_BOOLEAN},
#line 40 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str35, T_RANGE, TF_COMMAND},
#line 19 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str36, T_CHOICE, TF_COMMAND},
{-1}, {-1},
#line 33 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str39, T_TYPE, TF_COMMAND, S_BOOLEAN},
{-1},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str46, T_SELECT, TF_COMMAND},
#line 18 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str41, T_SOURCE, TF_COMMAND},
#line 41 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str42, T_VISIBLE, TF_COMMAND},
#line 37 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str43, T_TYPE, TF_COMMAND, S_HEX},
{-1}, {-1},
#line 22 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str46, T_CONFIG, TF_COMMAND},
#line 34 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str47, T_TYPE, TF_COMMAND, S_BOOLEAN},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str48, T_MAINMENU, TF_COMMAND},
{-1}, {-1}, {-1},
#line 38 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str51, T_TYPE, TF_COMMAND, S_STRING},
{-1}, {-1},
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str51, T_SOURCE, TF_COMMAND}
#line 24 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str54, T_HELP, TF_COMMAND},
{-1},
#line 30 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str56, T_PROMPT, TF_COMMAND},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
#line 27 "scripts/kconfig/zconf.gperf"
{(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str72, T_DEPENDS, TF_COMMAND}
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
......@@ -242,4 +282,5 @@ kconf_id_lookup (register const char *str, register unsigned int len)
}
return 0;
}
#line 47 "scripts/kconfig/zconf.gperf"
%option backup nostdinit noyywrap never-interactive full ecs
%option 8bit backup nodefault perf-report perf-report
%option nostdinit noyywrap never-interactive full ecs
%option 8bit nodefault perf-report perf-report
%option noinput
%x COMMAND HELP STRING PARAM
%{
......@@ -96,7 +96,7 @@ n [A-Za-z0-9_]
<COMMAND>{
{n}+ {
struct kconf_id *id = kconf_id_lookup(yytext, yyleng);
const struct kconf_id *id = kconf_id_lookup(yytext, yyleng);
BEGIN(PARAM);
current_pos.file = current_file;
current_pos.lineno = current_file->lineno;
......@@ -132,7 +132,7 @@ n [A-Za-z0-9_]
\n BEGIN(INITIAL); current_file->lineno++; return T_EOL;
--- /* ignore */
({n}|[-/.])+ {
struct kconf_id *id = kconf_id_lookup(yytext, yyleng);
const struct kconf_id *id = kconf_id_lookup(yytext, yyleng);
if (id && id->flags & TF_PARAM) {
zconflval.id = id;
return id->token;
......
#line 3 "scripts/kconfig/lex.zconf.c"
#line 3 "scripts/kconfig/zconf.lex.c_shipped"
#define YY_INT_ALIGNED short int
......@@ -72,6 +72,7 @@ typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */
/* Limits of integral types. */
#ifndef INT8_MIN
......@@ -102,8 +103,6 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
......@@ -160,15 +159,7 @@ typedef unsigned int flex_uint32_t;
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
* Ditto for the __ia64__ case accordingly.
*/
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#endif
/* The state buf must be large enough to hold one state per character in the main buffer.
......@@ -922,12 +913,7 @@ static int input (void );
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k */
#define YY_READ_BUF_SIZE 16384
#else
#define YY_READ_BUF_SIZE 8192
#endif /* __ia64__ */
#endif
/* Copy whatever the last rule matched to the standard output. */
......@@ -1100,7 +1086,7 @@ YY_RULE_SETUP
case 6:
YY_RULE_SETUP
{
struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng);
const struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng);
BEGIN(PARAM);
current_pos.file = current_file;
current_pos.lineno = current_file->lineno;
......@@ -1175,7 +1161,7 @@ YY_RULE_SETUP
case 19:
YY_RULE_SETUP
{
struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng);
const struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng);
if (id && id->flags & TF_PARAM) {
zconflval.id = id;
return id->token;
......@@ -2073,8 +2059,8 @@ YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr )
/** Setup the input buffer state to scan the given bytes. The next call to zconflex() will
* scan from a @e copy of @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
* @param bytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes.
*
* @return the newly allocated buffer state object.
*/
......
/* A Bison parser, made by GNU Bison 2.4.1. */
/* A Bison parser, made by GNU Bison 2.4.3. */
/* 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.
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
2009, 2010 Free Software Foundation, Inc.
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
......@@ -46,7 +45,7 @@
#define YYBISON 1
/* Bison version. */
#define YYBISON_VERSION "2.4.1"
#define YYBISON_VERSION "2.4.3"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
......@@ -102,22 +101,18 @@ extern int zconflex(void);
static void zconfprint(const char *err, ...);
static void zconf_error(const char *err, ...);
static void zconferror(const char *err);
static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken);
static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken);
struct symbol *symbol_hash[SYMBOL_HASHSIZE];
static struct menu *current_menu, *current_entry;
#define YYDEBUG 0
#if YYDEBUG
#define YYERROR_VERBOSE
#endif
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
# define YYDEBUG 1
#endif
/* Enabling verbose error messages. */
......@@ -188,7 +183,7 @@ typedef union YYSTYPE
struct symbol *symbol;
struct expr *expr;
struct menu *menu;
struct kconf_id *id;
const struct kconf_id *id;
......@@ -255,7 +250,7 @@ typedef short int yytype_int16;
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#ifndef YY_
# if YYENABLE_NLS
# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
# define YY_(msgid) dgettext ("bison-runtime", msgid)
......@@ -535,18 +530,18 @@ static const yytype_int8 yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
0, 108, 108, 108, 110, 110, 112, 114, 115, 116,
117, 118, 119, 123, 127, 127, 127, 127, 127, 127,
127, 127, 131, 132, 133, 134, 135, 136, 140, 141,
147, 155, 161, 169, 179, 181, 182, 183, 184, 185,
186, 189, 197, 203, 213, 219, 225, 228, 230, 241,
242, 247, 256, 261, 269, 272, 274, 275, 276, 277,
278, 281, 287, 298, 304, 314, 316, 321, 329, 337,
340, 342, 343, 344, 349, 356, 363, 368, 376, 379,
381, 382, 383, 386, 394, 401, 408, 414, 421, 423,
424, 425, 428, 436, 438, 439, 442, 449, 451, 456,
457, 460, 461, 462, 466, 467, 470, 471, 474, 475,
476, 477, 478, 479, 480, 483, 484, 487, 488
0, 104, 104, 104, 106, 106, 108, 110, 111, 112,
113, 114, 115, 119, 123, 123, 123, 123, 123, 123,
123, 123, 127, 128, 129, 130, 131, 132, 136, 137,
143, 151, 157, 165, 175, 177, 178, 179, 180, 181,
182, 185, 193, 199, 209, 215, 221, 224, 226, 237,
238, 243, 252, 257, 265, 268, 270, 271, 272, 273,
274, 277, 283, 294, 300, 310, 312, 317, 325, 333,
336, 338, 339, 340, 345, 352, 359, 364, 372, 375,
377, 378, 379, 382, 390, 397, 404, 410, 417, 419,
420, 421, 424, 432, 434, 435, 438, 445, 447, 452,
453, 456, 457, 458, 462, 463, 466, 467, 470, 471,
472, 473, 474, 475, 476, 479, 480, 483, 484
};
#endif
......@@ -806,9 +801,18 @@ static const yytype_uint8 yystos[] =
/* Like YYERROR except do call yyerror. This remains here temporarily
to ease the transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. */
Once GCC version 2 has supplanted version 1, this can go. However,
YYFAIL appears to be in use. Nevertheless, it is formally deprecated
in Bison 2.4.2's NEWS entry, where a plan to phase it out is
discussed. */
#define YYFAIL goto yyerrlab
#if defined YYFAIL
/* This is here to suppress warnings from the GCC cpp's
-Wunused-macros. Normally we don't worry about that warning, but
some users do, and we want to make it easy for users to remove
YYFAIL uses, which will produce warnings from Bison 2.5. */
#endif
#define YYRECOVERING() (!!yyerrstatus)
......@@ -865,7 +869,7 @@ while (YYID (0))
we won't break user code: when these are the locations we know. */
#ifndef YY_LOCATION_PRINT
# if YYLTYPE_IS_TRIVIAL
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
# define YY_LOCATION_PRINT(File, Loc) \
fprintf (File, "%d.%d-%d.%d", \
(Loc).first_line, (Loc).first_column, \
......@@ -1753,7 +1757,7 @@ yyreduce:
case 48:
{
struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string)));
const struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string)));
if (id && id->flags & TF_OPTION)
menu_add_option(id->token, (yyvsp[(3) - (3)].string));
else
......@@ -2258,10 +2262,8 @@ void conf_parse(const char *name)
modules_sym->flags |= SYMBOL_AUTO;
rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
#if YYDEBUG
if (getenv("ZCONF_DEBUG"))
zconfdebug = 1;
#endif
zconfparse();
if (zconfnerrs)
exit(1);
......@@ -2300,7 +2302,7 @@ static const char *zconf_tokenname(int token)
return "<token>";
}
static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken)
static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken)
{
if (id->token != endtoken) {
zconf_error("unexpected '%s' within %s block",
......@@ -2345,9 +2347,7 @@ static void zconf_error(const char *err, ...)
static void zconferror(const char *err)
{
#if YYDEBUG
fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
#endif
}
static void print_quoted_string(FILE *out, const char *str)
......@@ -2496,7 +2496,7 @@ void zconfdump(FILE *out)
}
}
#include "lex.zconf.c"
#include "zconf.lex.c"
#include "util.c"
#include "confdata.c"
#include "expr.c"
......
......@@ -25,16 +25,12 @@ extern int zconflex(void);
static void zconfprint(const char *err, ...);
static void zconf_error(const char *err, ...);
static void zconferror(const char *err);
static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken);
static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken);
struct symbol *symbol_hash[SYMBOL_HASHSIZE];
static struct menu *current_menu, *current_entry;
#define YYDEBUG 0
#if YYDEBUG
#define YYERROR_VERBOSE
#endif
%}
%expect 30
......@@ -45,7 +41,7 @@ static struct menu *current_menu, *current_entry;
struct symbol *symbol;
struct expr *expr;
struct menu *menu;
struct kconf_id *id;
const struct kconf_id *id;
}
%token <id>T_MAINMENU
......@@ -229,7 +225,7 @@ symbol_option_list:
/* empty */
| symbol_option_list T_WORD symbol_option_arg
{
struct kconf_id *id = kconf_id_lookup($2, strlen($2));
const struct kconf_id *id = kconf_id_lookup($2, strlen($2));
if (id && id->flags & TF_OPTION)
menu_add_option(id->token, $3);
else
......@@ -503,10 +499,8 @@ void conf_parse(const char *name)
modules_sym->flags |= SYMBOL_AUTO;
rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
#if YYDEBUG
if (getenv("ZCONF_DEBUG"))
zconfdebug = 1;
#endif
zconfparse();
if (zconfnerrs)
exit(1);
......@@ -545,7 +539,7 @@ static const char *zconf_tokenname(int token)
return "<token>";
}
static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken)
static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken)
{
if (id->token != endtoken) {
zconf_error("unexpected '%s' within %s block",
......@@ -590,9 +584,7 @@ static void zconf_error(const char *err, ...)
static void zconferror(const char *err)
{
#if YYDEBUG
fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
#endif
}
static void print_quoted_string(FILE *out, const char *str)
......@@ -741,7 +733,7 @@ void zconfdump(FILE *out)
}
}
#include "lex.zconf.c"
#include "zconf.lex.c"
#include "util.c"
#include "confdata.c"
#include "expr.c"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册