summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
04272db)
Flex and Bison provide an option to change the prefix of globally-
visible symbols. This is useful to link multiple lexers and/or
parsers into the same executable. However, Kconfig (and any other
host programs in kernel) uses a single lexer and parser. I do not
see a good reason to change the default 'yy' prefix.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
current_pos.file = current_file;
current_pos.lineno = current_file->lineno;
if (id && id->flags & TF_COMMAND) {
current_pos.file = current_file;
current_pos.lineno = current_file->lineno;
if (id && id->flags & TF_COMMAND) {
return id->token;
}
alloc_string(yytext, yyleng);
return id->token;
}
alloc_string(yytext, yyleng);
- zconflval.string = text;
return T_WORD;
}
. warn_ignored_character(*yytext);
return T_WORD;
}
. warn_ignored_character(*yytext);
({n}|[/.])+ {
const struct kconf_id *id = kconf_id_lookup(yytext, yyleng);
if (id && id->flags & TF_PARAM) {
({n}|[/.])+ {
const struct kconf_id *id = kconf_id_lookup(yytext, yyleng);
if (id && id->flags & TF_PARAM) {
return id->token;
}
alloc_string(yytext, yyleng);
return id->token;
}
alloc_string(yytext, yyleng);
- zconflval.string = text;
return T_WORD;
}
#.* /* comment */
return T_WORD;
}
#.* /* comment */
<STRING>{
[^'"\\\n]+/\n {
append_string(yytext, yyleng);
<STRING>{
[^'"\\\n]+/\n {
append_string(yytext, yyleng);
- zconflval.string = text;
return T_WORD_QUOTE;
}
[^'"\\\n]+ {
return T_WORD_QUOTE;
}
[^'"\\\n]+ {
}
\\.?/\n {
append_string(yytext + 1, yyleng - 1);
}
\\.?/\n {
append_string(yytext + 1, yyleng - 1);
- zconflval.string = text;
return T_WORD_QUOTE;
}
\\.? {
return T_WORD_QUOTE;
}
\\.? {
\'|\" {
if (str == yytext[0]) {
BEGIN(PARAM);
\'|\" {
if (str == yytext[0]) {
BEGIN(PARAM);
- zconflval.string = text;
return T_WORD_QUOTE;
} else
append_string(yytext, 1);
return T_WORD_QUOTE;
} else
append_string(yytext, 1);
static void zconf_endhelp(void)
{
static void zconf_endhelp(void)
{
- zconflval.string = text;
-extern int zconflex(void);
+int yylex(void);
+static void yyerror(const char *err);
static void zconfprint(const char *err, ...);
static void zconf_error(const char *err, ...);
static void zconfprint(const char *err, ...);
static void zconf_error(const char *err, ...);
-static void zconferror(const char *err);
static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken);
struct symbol *symbol_hash[SYMBOL_HASHSIZE];
static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken);
struct symbol *symbol_hash[SYMBOL_HASHSIZE];
rootmenu.prompt = menu_add_prompt(P_MENU, "CARL9170 Firmware Configuration", NULL);
if (getenv("ZCONF_DEBUG"))
rootmenu.prompt = menu_add_prompt(P_MENU, "CARL9170 Firmware Configuration", NULL);
if (getenv("ZCONF_DEBUG"))
- zconfdebug = 1;
- zconfparse();
- if (zconfnerrs)
+ yydebug = 1;
+ yyparse();
+ if (yynerrs)
exit(1);
if (!modules_sym)
modules_sym = sym_find( "n" );
exit(1);
if (!modules_sym)
modules_sym = sym_find( "n" );
menu_finalize(&rootmenu);
for_all_symbols(i, sym) {
if (sym_check_deps(sym))
menu_finalize(&rootmenu);
for_all_symbols(i, sym) {
if (sym_check_deps(sym))
exit(1);
sym_set_change_count(1);
}
exit(1);
sym_set_change_count(1);
}
if (id->token != endtoken) {
zconf_error("unexpected '%s' within %s block",
id->name, zconf_tokenname(starttoken));
if (id->token != endtoken) {
zconf_error("unexpected '%s' within %s block",
id->name, zconf_tokenname(starttoken));
return false;
}
if (current_menu->file != current_file) {
return false;
}
if (current_menu->file != current_file) {
fprintf(stderr, "%s:%d: location of the '%s'\n",
current_menu->file->name, current_menu->lineno,
zconf_tokenname(starttoken));
fprintf(stderr, "%s:%d: location of the '%s'\n",
current_menu->file->name, current_menu->lineno,
zconf_tokenname(starttoken));
return false;
}
return true;
return false;
}
return true;
fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
va_start(ap, err);
vfprintf(stderr, err, ap);
fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
va_start(ap, err);
vfprintf(stderr, err, ap);
-static void zconferror(const char *err)
+static void yyerror(const char *err)
{
fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
}
{
fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
}