author | kergoth <kergoth> | 2002-10-31 17:11:35 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-10-31 17:11:35 (UTC) |
commit | d955226c2197578f69c510282a4e9ad1ea8fe771 (patch) (side-by-side diff) | |
tree | 0d8f210dd012559df4e3432ccc8ce96e9bd15853 /scripts/kconfig/help.l | |
parent | 16fcb285f9ba7c514fc3f2695768a82feeb7182b (diff) | |
download | opie-d955226c2197578f69c510282a4e9ad1ea8fe771.zip opie-d955226c2197578f69c510282a4e9ad1ea8fe771.tar.gz opie-d955226c2197578f69c510282a4e9ad1ea8fe771.tar.bz2 |
Initial bits to start work on revamping the buildsystem
-rw-r--r-- | scripts/kconfig/help.l | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/scripts/kconfig/help.l b/scripts/kconfig/help.l new file mode 100644 index 0000000..5ac4c2f --- a/dev/null +++ b/scripts/kconfig/help.l @@ -0,0 +1,78 @@ +%option nounput nostdinit noyywrap 8bit +%x ENTRY +%{ +/* + * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org> + * Released under the terms of the GNU GPL v2.0. + */ + +#include <string.h> +#include <unistd.h> +#include "cml1.h" + +#define YY_DECL void helplex(char *help) +#undef YY_NULL +#define YY_NULL +%} + +%% + struct symbol *sym = NULL; + helpin = fopen(help, "r"); + if (!helpin) + return; + //help_flex_debug = 1; + yyrestart(helpin); + BEGIN(INITIAL); + +^#.*\n /* skip */ + +^CONFIG_[[:alnum:]_]+ { + char name[256]; + int ch; + while ((ch = input()) != '\n' && ch != EOF) + ; + memcpy(name, yytext, yyleng); + name[yyleng] = 0; + sym = lookup_symbol(name, SYMBOL_UNKNOWN); + new_string(); + BEGIN(ENTRY); +} + +<ENTRY>{ + [ \t].*\n+/[^ \t\n] | + <<EOF>> { + append_string(yytext, yyleng); + if (sym) { + if (sym->help) { + //printf("symbol %s has duplicated help?\n", sym->name); + free(text); + } else + sym->help = text; + sym = NULL; + } else + printf("no symbol?\n"); + BEGIN(INITIAL); + } + \n/[^ \t\n] { + append_string(yytext, yyleng); + if (sym) { + if (sym->help) { + //printf("symbol %s has duplicated help?\n", sym->name); + free(text); + } else + sym->help = text; + sym = NULL; + } else + printf("no symbol?\n"); + BEGIN(INITIAL); + } + [ \t].*\n | + . | + \n { + append_string(yytext, yyleng); + } +} + +. +\n +%% |