All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFCv2 00/13] Kbuild: factor parser rules
@ 2011-05-23  8:10 Arnaud Lacombe
  2011-05-23  8:10 ` [RFCv2 01/13] kbuild: add implicit rules for parser generation Arnaud Lacombe
                   ` (15 more replies)
  0 siblings, 16 replies; 32+ messages in thread
From: Arnaud Lacombe @ 2011-05-23  8:10 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Michal Marek, Arnaud Lacombe, David Gibson

Hi,

[ Original RFC and motivation can be found at:
http://marc.info/?l=linux-kbuild&m=130456101131801&w=2 ]

I tried to re-think the order in this serie to address Michal comments.

Main changes since v1 are:
 - include scripts/dtc/' parser in the scope of the patchset
 - do not rename any parser source
 - make lexer file name consistent, ie. name it %.lex.c, not lex.%.c
 - rebase on top of v2.6.39

A few notes:
 - the parser should not include the lexer; however, this has the advantage to
   avoid having to deals with the parser's header.
 - the tuple ( "migrate parser to implicit rules", regen parser) should really
   be one commit, to enforce bisect'ability

Comments welcome!
 - Arnaud

Cc: David Gibson <david@gibson.dropbear.id.au>

Arnaud Lacombe (13):
  kbuild: add implicit rules for parser generation
  genksyms: include the lexer from the parser
  genksyms: pass hash and lookup functions name and target language
    though the input file
  genksyms: migrate parser to implicit rules
  genksym: regen parser
  kconfig: constify `kconf_id_lookup'
  kconfig: back-out parser prefix, from `zconf' to `yy'
  kconfig: kill no longer needed reference to YYDEBUG
  kconfig: migrate parser to implicit rules
  kconfig: regen parser
  dtc: include the lexer from the parser
  dtc: migrate parser to implicit rules
  dtc: regen parser

 scripts/Makefile.lib                               |   33 ++-
 scripts/dtc/Makefile                               |   29 +--
 scripts/dtc/dtc-lexer.l                            |    1 -
 scripts/dtc/dtc-lexer.lex.c_shipped                |   60 +---
 scripts/dtc/dtc-parser.tab.c_shipped               |  118 +----
 scripts/dtc/dtc-parser.tab.h_shipped               |   91 ----
 scripts/dtc/dtc-parser.y                           |    2 +
 scripts/genksyms/.gitignore                        |    6 +-
 scripts/genksyms/Makefile                          |   48 +--
 scripts/genksyms/keywords.gperf                    |    3 +
 ...{keywords.c_shipped => keywords.hash.c_shipped} |   96 ++--
 scripts/genksyms/lex.l                             |    5 +-
 .../genksyms/{lex.c_shipped => lex.lex.c_shipped}  |  360 +--------------
 scripts/genksyms/parse.h_shipped                   |   97 ----
 .../{parse.c_shipped => parse.tab.c_shipped}       |  200 +-------
 scripts/genksyms/parse.y                           |    2 +
 scripts/kconfig/.gitignore                         |    2 +-
 scripts/kconfig/Makefile                           |   31 +--
 scripts/kconfig/lkc.h                              |    4 +-
 scripts/kconfig/zconf.gperf                        |    2 +-
 scripts/kconfig/zconf.hash.c_shipped               |  273 +++++++-----
 scripts/kconfig/zconf.l                            |   20 +-
 .../{lex.zconf.c_shipped => zconf.lex.c_shipped}   |  493 +++++++++-----------
 scripts/kconfig/zconf.tab.c_shipped                |  102 ++---
 scripts/kconfig/zconf.y                            |   44 +-
 25 files changed, 614 insertions(+), 1508 deletions(-)
 delete mode 100644 scripts/dtc/dtc-parser.tab.h_shipped
 rename scripts/genksyms/{keywords.c_shipped => keywords.hash.c_shipped} (94%)
 rename scripts/genksyms/{lex.c_shipped => lex.lex.c_shipped} (89%)
 delete mode 100644 scripts/genksyms/parse.h_shipped
 rename scripts/genksyms/{parse.c_shipped => parse.tab.c_shipped} (92%)
 rename scripts/kconfig/{lex.zconf.c_shipped => zconf.lex.c_shipped} (81%)

-- 
1.7.3.4.574.g608b.dirty


^ permalink raw reply	[flat|nested] 32+ messages in thread

* [RFCv2 01/13] kbuild: add implicit rules for parser generation
  2011-05-23  8:10 [RFCv2 00/13] Kbuild: factor parser rules Arnaud Lacombe
@ 2011-05-23  8:10 ` Arnaud Lacombe
  2011-05-23  8:10 ` [RFCv2 02/13] genksyms: include the lexer from the parser Arnaud Lacombe
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 32+ messages in thread
From: Arnaud Lacombe @ 2011-05-23  8:10 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Michal Marek, Arnaud Lacombe, David Gibson

Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Michal Marek <mmarek@suse.cz>
---
 scripts/Makefile.lib |   33 ++++++++++++++++++++++++++++++++-
 1 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 1c702ca..f05270c 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -160,15 +160,46 @@ 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
+# ---------------------------------------------------------------------------
+quiet_cmd_flex = LEX     $@
+      cmd_flex = flex -o$@ -L $<
+$(src)/%.lex.c_shipped: $(src)/%.l
+	$(call cmd,flex)
+
+# YACC
+# ---------------------------------------------------------------------------
+quiet_cmd_bison = YACC    $@
+      cmd_bison = bison -o$@ -t -l $<
+$(src)/%.tab.c_shipped: $(src)/%.y
+	$(call cmd,bison)
+endif
+
 # Shipped files
 # ===========================================================================
 
 quiet_cmd_shipped = SHIPPED $@
 cmd_shipped = cat $< > $@
 
-$(obj)/%:: $(src)/%_shipped
+$(obj)/%.tab.c: $(src)/%.tab.c_shipped
+	$(call cmd,shipped)
+
+$(obj)/%.lex.c: $(src)/%.lex.c_shipped
 	$(call cmd,shipped)
 
+$(obj)/%.hash.c: $(src)/%.hash.c_shipped
+	$(call cmd,shipped)
+
+$(obj)/%:: $(src)/%_shipped
+
 # Commands useful for building a boot image
 # ===========================================================================
 # 
-- 
1.7.3.4.574.g608b.dirty


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [RFCv2 02/13] genksyms: include the lexer from the parser
  2011-05-23  8:10 [RFCv2 00/13] Kbuild: factor parser rules Arnaud Lacombe
  2011-05-23  8:10 ` [RFCv2 01/13] kbuild: add implicit rules for parser generation Arnaud Lacombe
@ 2011-05-23  8:10 ` Arnaud Lacombe
  2011-05-23  8:10 ` [RFCv2 03/13] genksyms: pass hash and lookup functions name and target language though the input file Arnaud Lacombe
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 32+ messages in thread
From: Arnaud Lacombe @ 2011-05-23  8:10 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Michal Marek, Arnaud Lacombe

---
 scripts/genksyms/lex.l   |    3 ---
 scripts/genksyms/parse.y |    2 ++
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/scripts/genksyms/lex.l b/scripts/genksyms/lex.l
index e4ddd49..adf75b6 100644
--- a/scripts/genksyms/lex.l
+++ b/scripts/genksyms/lex.l
@@ -28,9 +28,6 @@
 #include <string.h>
 #include <ctype.h>
 
-#include "genksyms.h"
-#include "parse.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.  */
 #define YY_DECL		static int yylex1(void)
diff --git a/scripts/genksyms/parse.y b/scripts/genksyms/parse.y
index ba5c242..c15e353 100644
--- a/scripts/genksyms/parse.y
+++ b/scripts/genksyms/parse.y
@@ -497,3 +497,5 @@ yyerror(const char *e)
 {
   error_with_pos("%s", e);
 }
+
+#include "lex.lex.c"
-- 
1.7.3.4.574.g608b.dirty


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [RFCv2 03/13] genksyms: pass hash and lookup functions name and target language though the input file
  2011-05-23  8:10 [RFCv2 00/13] Kbuild: factor parser rules Arnaud Lacombe
  2011-05-23  8:10 ` [RFCv2 01/13] kbuild: add implicit rules for parser generation Arnaud Lacombe
  2011-05-23  8:10 ` [RFCv2 02/13] genksyms: include the lexer from the parser Arnaud Lacombe
@ 2011-05-23  8:10 ` Arnaud Lacombe
  2011-05-23  8:10 ` [RFCv2 04/13] genksyms: migrate parser to implicit rules Arnaud Lacombe
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 32+ messages in thread
From: Arnaud Lacombe @ 2011-05-23  8:10 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Michal Marek, Arnaud Lacombe

Renaming hash and lookup functions on the command line would reduces its
genericity. Use the .gperf file to pass this information. Do the same for the
target language.
---
 scripts/genksyms/keywords.gperf |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/scripts/genksyms/keywords.gperf b/scripts/genksyms/keywords.gperf
index e6349ac..3e77a94 100644
--- a/scripts/genksyms/keywords.gperf
+++ b/scripts/genksyms/keywords.gperf
@@ -1,3 +1,6 @@
+%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);
-- 
1.7.3.4.574.g608b.dirty


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [RFCv2 04/13] genksyms: migrate parser to implicit rules
  2011-05-23  8:10 [RFCv2 00/13] Kbuild: factor parser rules Arnaud Lacombe
                   ` (2 preceding siblings ...)
  2011-05-23  8:10 ` [RFCv2 03/13] genksyms: pass hash and lookup functions name and target language though the input file Arnaud Lacombe
@ 2011-05-23  8:10 ` Arnaud Lacombe
  2011-05-23  8:10 ` [RFCv2 05/13] genksym: regen parser Arnaud Lacombe
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 32+ messages in thread
From: Arnaud Lacombe @ 2011-05-23  8:10 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Michal Marek, Arnaud Lacombe

---
 scripts/genksyms/.gitignore |    6 ++--
 scripts/genksyms/Makefile   |   48 ++----------------------------------------
 scripts/genksyms/lex.l      |    2 +-
 3 files changed, 7 insertions(+), 49 deletions(-)

diff --git a/scripts/genksyms/.gitignore b/scripts/genksyms/.gitignore
index be5cadb..8b11ab4 100644
--- a/scripts/genksyms/.gitignore
+++ b/scripts/genksyms/.gitignore
@@ -1,4 +1,4 @@
-keywords.c
-lex.c
-parse.[ch]
+*.hash.c
+*.lex.c
+*.tab.c
 genksyms
diff --git a/scripts/genksyms/Makefile b/scripts/genksyms/Makefile
index 13d03cf..11d5582 100644
--- a/scripts/genksyms/Makefile
+++ b/scripts/genksyms/Makefile
@@ -2,52 +2,10 @@
 hostprogs-y	:= genksyms
 always		:= $(hostprogs-y)
 
-genksyms-objs	:= genksyms.o parse.o lex.o
+genksyms-objs	:= genksyms.o parse.tab.o
 
 # -I needed for generated C source (shipped source)
-HOSTCFLAGS_parse.o := -Wno-uninitialized -I$(src)
+HOSTCFLAGS_parse.tab.o := -Wno-uninitialized -I$(src)
 
-# dependencies on generated files need to be listed explicitly
-$(obj)/lex.o: $(obj)/parse.h $(obj)/keywords.c
+$(obj)/parse.tab.o: $(obj)/lex.lex.c $(obj)/keywords.hash.c
 
-# -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
diff --git a/scripts/genksyms/lex.l b/scripts/genksyms/lex.l
index adf75b6..fb881b6 100644
--- a/scripts/genksyms/lex.l
+++ b/scripts/genksyms/lex.l
@@ -91,7 +91,7 @@ MC_TOKEN		([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>)
 
 /* Bring in the keyword recognizer.  */
 
-#include "keywords.c"
+#include "keywords.hash.c"
 
 
 /* Macros to append to our phrase collection list.  */
-- 
1.7.3.4.574.g608b.dirty


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [RFCv2 05/13] genksym: regen parser
  2011-05-23  8:10 [RFCv2 00/13] Kbuild: factor parser rules Arnaud Lacombe
                   ` (3 preceding siblings ...)
  2011-05-23  8:10 ` [RFCv2 04/13] genksyms: migrate parser to implicit rules Arnaud Lacombe
@ 2011-05-23  8:10 ` Arnaud Lacombe
  2011-05-23  8:10 ` [RFCv2 06/13] kconfig: constify `kconf_id_lookup' Arnaud Lacombe
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 32+ messages in thread
From: Arnaud Lacombe @ 2011-05-23  8:10 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Michal Marek, Arnaud Lacombe

---
 ...{keywords.c_shipped => keywords.hash.c_shipped} |   96 +++---
 .../genksyms/{lex.c_shipped => lex.lex.c_shipped}  |  360 +-------------------
 scripts/genksyms/parse.h_shipped                   |   97 ------
 .../{parse.c_shipped => parse.tab.c_shipped}       |  200 +----------
 4 files changed, 72 insertions(+), 681 deletions(-)
 rename scripts/genksyms/{keywords.c_shipped => keywords.hash.c_shipped} (94%)
 rename scripts/genksyms/{lex.c_shipped => lex.lex.c_shipped} (89%)
 delete mode 100644 scripts/genksyms/parse.h_shipped
 rename scripts/genksyms/{parse.c_shipped => parse.tab.c_shipped} (92%)

diff --git a/scripts/genksyms/keywords.c_shipped b/scripts/genksyms/keywords.hash.c_shipped
similarity index 94%
rename from scripts/genksyms/keywords.c_shipped
rename to scripts/genksyms/keywords.hash.c_shipped
index 8060e06..8206260 100644
--- a/scripts/genksyms/keywords.c_shipped
+++ b/scripts/genksyms/keywords.hash.c_shipped
@@ -1,5 +1,5 @@
 /* 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}
     };
 
diff --git a/scripts/genksyms/lex.c_shipped b/scripts/genksyms/lex.lex.c_shipped
similarity index 89%
rename from scripts/genksyms/lex.c_shipped
rename to scripts/genksyms/lex.lex.c_shipped
index af49390..cf37b38 100644
--- a/scripts/genksyms/lex.c_shipped
+++ b/scripts/genksyms/lex.lex.c_shipped
@@ -1,20 +1,10 @@
-#line 2 "scripts/genksyms/lex.c"
 
-#line 4 "scripts/genksyms/lex.c"
+#line 3 "scripts/genksyms/lex.lex.c_shipped"
 
 #define  YY_INT_ALIGNED short int
 
 /* A lexical scanner generated by flex */
 
-/* %not-for-header */
-
-/* %if-c-only */
-/* %if-not-reentrant */
-
-/* %endif */
-/* %endif */
-/* %ok-for-header */
-
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
@@ -23,32 +13,16 @@
 #define FLEX_BETA
 #endif
 
-/* %if-c++-only */
-/* %endif */
-
-/* %if-c-only */
-    
-/* %endif */
-
-/* %if-c-only */
-
-/* %endif */
-
 /* First, we deal with  platform-specific or compiler-specific issues. */
 
 /* begin standard C headers. */
-/* %if-c-only */
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
 #include <stdlib.h>
-/* %endif */
 
-/* %if-tables-serialization */
-/* %endif */
 /* end standard C headers. */
 
-/* %if-c-or-c++ */
 /* flex integer type definitions */
 
 #ifndef FLEXINT_H
@@ -112,11 +86,6 @@ typedef unsigned int flex_uint32_t;
 
 #endif /* ! FLEXINT_H */
 
-/* %endif */
-
-/* %if-c++-only */
-/* %endif */
-
 #ifdef __cplusplus
 
 /* The "const" storage-class-modifier is valid. */
@@ -138,13 +107,8 @@ typedef unsigned int flex_uint32_t;
 #define yyconst
 #endif
 
-/* %not-for-header */
-
 /* Returned upon end-of-file. */
 #define YY_NULL 0
-/* %ok-for-header */
-
-/* %not-for-header */
 
 /* Promotes a possibly negative, possibly signed char to an unsigned
  * integer for use as an array index.  If the signed char is negative,
@@ -152,14 +116,6 @@ typedef unsigned int flex_uint32_t;
  * double cast.
  */
 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-/* %ok-for-header */
-
-/* %if-reentrant */
-/* %endif */
-
-/* %if-not-reentrant */
-
-/* %endif */
 
 /* Enter a start condition.  This macro really ought to take a parameter,
  * but we do it the disgusting crufty way forced on us by the ()-less
@@ -196,15 +152,9 @@ typedef unsigned int flex_uint32_t;
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif
 
-/* %if-not-reentrant */
 extern int yyleng;
-/* %endif */
 
-/* %if-c-only */
-/* %if-not-reentrant */
 extern FILE *yyin, *yyout;
-/* %endif */
-/* %endif */
 
 #define EOB_ACT_CONTINUE_SCAN 0
 #define EOB_ACT_END_OF_FILE 1
@@ -237,12 +187,7 @@ typedef size_t yy_size_t;
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
 	{
-/* %if-c-only */
 	FILE *yy_input_file;
-/* %endif */
-
-/* %if-c++-only */
-/* %endif */
 
 	char *yy_ch_buf;		/* input buffer */
 	char *yy_buf_pos;		/* current position in input buffer */
@@ -303,19 +248,10 @@ struct yy_buffer_state
 	};
 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
 
-/* %if-c-only Standard (non-C++) definition */
-/* %not-for-header */
-
-/* %if-not-reentrant */
-
 /* Stack of input buffers. */
 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
-/* %endif */
-/* %ok-for-header */
-
-/* %endif */
 
 /* We provide macros for accessing buffer states in case in the
  * future we want to put the buffer states in a more general
@@ -332,11 +268,6 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
  */
 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
 
-/* %if-c-only Standard (non-C++) definition */
-
-/* %if-not-reentrant */
-/* %not-for-header */
-
 /* yy_hold_char holds the character lost when yytext is formed. */
 static char yy_hold_char;
 static int yy_n_chars;		/* number of characters read into yy_ch_buf */
@@ -351,9 +282,6 @@ static int yy_start = 0;	/* start state number */
  * instead of setting up a fresh yyin.  A bit of a hack ...
  */
 static int yy_did_buffer_switch_on_eof;
-/* %ok-for-header */
-
-/* %endif */
 
 void yyrestart (FILE *input_file  );
 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
@@ -373,8 +301,6 @@ YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len  );
 
-/* %endif */
-
 void *yyalloc (yy_size_t  );
 void *yyrealloc (void *,yy_size_t  );
 void yyfree (void *  );
@@ -403,14 +329,11 @@ void yyfree (void *  );
 
 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
 
-/* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
 /* Begin user sect3 */
 
 #define yywrap(n) 1
 #define YY_SKIP_YYWRAP
 
-#define FLEX_DEBUG
-
 typedef unsigned char YY_CHAR;
 
 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
@@ -424,28 +347,21 @@ int yylineno = 1;
 extern char *yytext;
 #define yytext_ptr yytext
 
-/* %if-c-only Standard (non-C++) definition */
-
 static yy_state_type yy_get_previous_state (void );
 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
 static int yy_get_next_buffer (void );
 static void yy_fatal_error (yyconst char msg[]  );
 
-/* %endif */
-
 /* Done after the current pattern has been matched and before the
  * corresponding action - sets up yytext.
  */
 #define YY_DO_BEFORE_ACTION \
 	(yytext_ptr) = yy_bp; \
-/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
 	yyleng = (size_t) (yy_cp - yy_bp); \
 	(yy_hold_char) = *yy_cp; \
 	*yy_cp = '\0'; \
-/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
 	(yy_c_buf_p) = yy_cp;
 
-/* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
 #define YY_NUM_RULES 13
 #define YY_END_OF_BUFFER 14
 /* This struct is not used in this scanner,
@@ -610,13 +526,7 @@ static yy_state_type yy_last_accepting_state;
 static char *yy_last_accepting_cpos;
 
 extern int yy_flex_debug;
-int yy_flex_debug = 1;
-
-static yyconst flex_int16_t yy_rule_linenum[13] =
-    {   0,
-       67,   68,   69,   72,   75,   76,   77,   83,   84,   85,
-       87,   90
-    } ;
+int yy_flex_debug = 0;
 
 /* The intent behind this definition is that it'll catch
  * any uses of REJECT which flex missed.
@@ -626,7 +536,6 @@ static yyconst flex_int16_t yy_rule_linenum[13] =
 #define YY_MORE_ADJ 0
 #define YY_RESTORE_YY_MORE_OFFSET
 char *yytext;
-#line 1 "scripts/genksyms/lex.l"
 /* Lexical analysis for genksyms.
    Copyright 1996, 1997 Linux International.
 
@@ -648,23 +557,18 @@ char *yytext;
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software Foundation,
    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-#line 25 "scripts/genksyms/lex.l"
 
 #include <limits.h>
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
 
-#include "genksyms.h"
-#include "parse.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.  */
 #define YY_DECL		static int yylex1(void)
 
 /* We don't do multiple input files.  */
 #define YY_NO_INPUT 1
-#line 668 "scripts/genksyms/lex.c"
 
 #define INITIAL 0
 
@@ -673,28 +577,15 @@ char *yytext;
  * down here because we want the user's section 1 to have been scanned first.
  * The user has a chance to override it with an option.
  */
-/* %if-c-only */
 #include <unistd.h>
-/* %endif */
-/* %if-c++-only */
-/* %endif */
 #endif
 
 #ifndef YY_EXTRA_TYPE
 #define YY_EXTRA_TYPE void *
 #endif
 
-/* %if-c-only Reentrant structure and macros (non-C++). */
-/* %if-reentrant */
-/* %if-c-only */
-
 static int yy_init_globals (void );
 
-/* %endif */
-/* %if-reentrant */
-/* %endif */
-/* %endif End reentrant structures and macros. */
-
 /* Accessor methods to globals.
    These are made visible to non-reentrant scanners for convenience. */
 
@@ -724,9 +615,6 @@ int yyget_lineno (void );
 
 void yyset_lineno (int line_number  );
 
-/* %if-bison-bridge */
-/* %endif */
-
 /* Macros after this point can all be overridden by user definitions in
  * section 1.
  */
@@ -739,14 +627,8 @@ extern int yywrap (void );
 #endif
 #endif
 
-/* %not-for-header */
-
     static void yyunput (int c,char *buf_ptr  );
     
-/* %ok-for-header */
-
-/* %endif */
-
 #ifndef yytext_ptr
 static void yy_flex_strncpy (char *,yyconst char *,int );
 #endif
@@ -756,23 +638,15 @@ static int yy_flex_strlen (yyconst char * );
 #endif
 
 #ifndef YY_NO_INPUT
-/* %if-c-only Standard (non-C++) definition */
-/* %not-for-header */
 
 #ifdef __cplusplus
 static int yyinput (void );
 #else
 static int input (void );
 #endif
-/* %ok-for-header */
 
-/* %endif */
 #endif
 
-/* %if-c-only */
-
-/* %endif */
-
 /* Amount of stuff to slurp up with each read. */
 #ifndef YY_READ_BUF_SIZE
 #define YY_READ_BUF_SIZE 8192
@@ -780,14 +654,10 @@ static int input (void );
 
 /* Copy whatever the last rule matched to the standard output. */
 #ifndef ECHO
-/* %if-c-only Standard (non-C++) definition */
 /* This used to be an fputs(), but since the string might contain NUL's,
  * we now use fwrite().
  */
-#define ECHO fwrite( yytext, yyleng, 1, yyout )
-/* %endif */
-/* %if-c++-only C++ definition */
-/* %endif */
+#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
 #endif
 
 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
@@ -795,11 +665,10 @@ static int input (void );
  */
 #ifndef YY_INPUT
 #define YY_INPUT(buf,result,max_size) \
-/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
 	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
 		{ \
 		int c = '*'; \
-		int n; \
+		unsigned n; \
 		for ( n = 0; n < max_size && \
 			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
 			buf[n] = (char) c; \
@@ -824,8 +693,6 @@ static int input (void );
 			} \
 		}\
 \
-/* %if-c++-only C++ definition \ */\
-/* %endif */
 
 #endif
 
@@ -844,39 +711,20 @@ static int input (void );
 
 /* Report a fatal error. */
 #ifndef YY_FATAL_ERROR
-/* %if-c-only */
 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
-/* %endif */
-/* %if-c++-only */
-/* %endif */
 #endif
 
-/* %if-tables-serialization structures and prototypes */
-/* %not-for-header */
-
-/* %ok-for-header */
-
-/* %not-for-header */
-
-/* %tables-yydmap generated elements */
-/* %endif */
 /* end tables serialization structures and prototypes */
 
-/* %ok-for-header */
-
 /* Default declaration of generated scanner - a define so the user can
  * easily add parameters.
  */
 #ifndef YY_DECL
 #define YY_DECL_IS_OURS 1
-/* %if-c-only Standard (non-C++) definition */
 
 extern int yylex (void);
 
 #define YY_DECL int yylex (void)
-/* %endif */
-/* %if-c++-only C++ definition */
-/* %endif */
 #endif /* !YY_DECL */
 
 /* Code executed at the beginning of each rule, after yytext and yyleng
@@ -891,15 +739,12 @@ extern int yylex (void);
 #define YY_BREAK break;
 #endif
 
-/* %% [6.0] YY_RULE_SETUP definition goes here */
 #define YY_RULE_SETUP \
 	if ( yyleng > 0 ) \
 		YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
 				(yytext[yyleng - 1] == '\n'); \
 	YY_USER_ACTION
 
-/* %not-for-header */
-
 /** The main scanner function which does all the work.
  */
 YY_DECL
@@ -908,13 +753,7 @@ YY_DECL
 	register char *yy_cp, *yy_bp;
 	register int yy_act;
     
-/* %% [7.0] user's declarations go here */
-#line 63 "scripts/genksyms/lex.l"
-
-
-
  /* Keep track of our location in the original source files.  */
-#line 918 "scripts/genksyms/lex.c"
 
 	if ( !(yy_init) )
 		{
@@ -928,18 +767,10 @@ YY_DECL
 			(yy_start) = 1;	/* first start state */
 
 		if ( ! yyin )
-/* %if-c-only */
 			yyin = stdin;
-/* %endif */
-/* %if-c++-only */
-/* %endif */
 
 		if ( ! yyout )
-/* %if-c-only */
 			yyout = stdout;
-/* %endif */
-/* %if-c++-only */
-/* %endif */
 
 		if ( ! YY_CURRENT_BUFFER ) {
 			yyensure_buffer_stack ();
@@ -952,7 +783,6 @@ YY_DECL
 
 	while ( 1 )		/* loops until end-of-file is reached */
 		{
-/* %% [8.0] yymore()-related code goes here */
 		yy_cp = (yy_c_buf_p);
 
 		/* Support of yytext. */
@@ -963,7 +793,6 @@ YY_DECL
 		 */
 		yy_bp = yy_cp;
 
-/* %% [9.0] code to set up and find next match goes here */
 		yy_current_state = (yy_start);
 		yy_current_state += YY_AT_BOL();
 yy_match:
@@ -987,7 +816,6 @@ yy_match:
 		while ( yy_base[yy_current_state] != 266 );
 
 yy_find_action:
-/* %% [10.0] code to find the action number goes here */
 		yy_act = yy_accept[yy_current_state];
 		if ( yy_act == 0 )
 			{ /* have to back up */
@@ -998,30 +826,10 @@ yy_find_action:
 
 		YY_DO_BEFORE_ACTION;
 
-/* %% [11.0] code for yylineno update goes here */
-
 do_action:	/* This label is used only to access EOF actions. */
 
-/* %% [12.0] debug code goes here */
-		if ( yy_flex_debug )
-			{
-			if ( yy_act == 0 )
-				fprintf( stderr, "--scanner backing up\n" );
-			else if ( yy_act < 13 )
-				fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
-				         (long)yy_rule_linenum[yy_act], yytext );
-			else if ( yy_act == 13 )
-				fprintf( stderr, "--accepting default rule (\"%s\")\n",
-				         yytext );
-			else if ( yy_act == 14 )
-				fprintf( stderr, "--(end of buffer or a NUL)\n" );
-			else
-				fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
-			}
-
 		switch ( yy_act )
 	{ /* beginning of action switch */
-/* %% [13.0] actions go here */
 			case 0: /* must back up */
 			/* undo the effects of YY_DO_BEFORE_ACTION */
 			*yy_cp = (yy_hold_char);
@@ -1032,42 +840,35 @@ do_action:	/* This label is used only to access EOF actions. */
 case 1:
 /* rule 1 can match eol */
 YY_RULE_SETUP
-#line 67 "scripts/genksyms/lex.l"
 return FILENAME;
 	YY_BREAK
 case 2:
 /* rule 2 can match eol */
 YY_RULE_SETUP
-#line 68 "scripts/genksyms/lex.l"
 cur_line++;
 	YY_BREAK
 case 3:
 /* rule 3 can match eol */
 YY_RULE_SETUP
-#line 69 "scripts/genksyms/lex.l"
 cur_line++;
 	YY_BREAK
 /* Ignore all other whitespace.  */
 case 4:
 YY_RULE_SETUP
-#line 72 "scripts/genksyms/lex.l"
 ;
 	YY_BREAK
 case 5:
 /* rule 5 can match eol */
 YY_RULE_SETUP
-#line 75 "scripts/genksyms/lex.l"
 return STRING;
 	YY_BREAK
 case 6:
 /* rule 6 can match eol */
 YY_RULE_SETUP
-#line 76 "scripts/genksyms/lex.l"
 return CHAR;
 	YY_BREAK
 case 7:
 YY_RULE_SETUP
-#line 77 "scripts/genksyms/lex.l"
 return IDENT;
 	YY_BREAK
 /* The Pedant requires that the other C multi-character tokens be
@@ -1076,36 +877,29 @@ return IDENT;
     around them properly.  */
 case 8:
 YY_RULE_SETUP
-#line 83 "scripts/genksyms/lex.l"
 return OTHER;
 	YY_BREAK
 case 9:
 YY_RULE_SETUP
-#line 84 "scripts/genksyms/lex.l"
 return INT;
 	YY_BREAK
 case 10:
 YY_RULE_SETUP
-#line 85 "scripts/genksyms/lex.l"
 return REAL;
 	YY_BREAK
 case 11:
 YY_RULE_SETUP
-#line 87 "scripts/genksyms/lex.l"
 return DOTS;
 	YY_BREAK
 /* All other tokens are single characters.  */
 case 12:
 YY_RULE_SETUP
-#line 90 "scripts/genksyms/lex.l"
 return yytext[0];
 	YY_BREAK
 case 13:
 YY_RULE_SETUP
-#line 93 "scripts/genksyms/lex.l"
 ECHO;
 	YY_BREAK
-#line 1109 "scripts/genksyms/lex.c"
 case YY_STATE_EOF(INITIAL):
 	yyterminate();
 
@@ -1172,7 +966,6 @@ case YY_STATE_EOF(INITIAL):
 
 			else
 				{
-/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
 				yy_cp = (yy_c_buf_p);
 				goto yy_find_action;
 				}
@@ -1238,14 +1031,6 @@ case YY_STATE_EOF(INITIAL):
 	} /* end of action switch */
 		} /* end of scanning one token */
 } /* end of yylex */
-/* %ok-for-header */
-
-/* %if-c++-only */
-/* %not-for-header */
-
-/* %ok-for-header */
-
-/* %endif */
 
 /* yy_get_next_buffer - try to read in a new buffer
  *
@@ -1254,11 +1039,7 @@ case YY_STATE_EOF(INITIAL):
  *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  *	EOB_ACT_END_OF_FILE - end of file
  */
-/* %if-c-only */
 static int yy_get_next_buffer (void)
-/* %endif */
-/* %if-c++-only */
-/* %endif */
 {
     	register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
 	register char *source = (yytext_ptr);
@@ -1392,24 +1173,16 @@ static int yy_get_next_buffer (void)
 
 /* yy_get_previous_state - get the state just before the EOB char was reached */
 
-/* %if-c-only */
-/* %not-for-header */
-
     static yy_state_type yy_get_previous_state (void)
-/* %endif */
-/* %if-c++-only */
-/* %endif */
 {
 	register yy_state_type yy_current_state;
 	register char *yy_cp;
     
-/* %% [15.0] code to get the start state into yy_current_state goes here */
 	yy_current_state = (yy_start);
 	yy_current_state += YY_AT_BOL();
 
 	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
 		{
-/* %% [16.0] code to find the next state goes here */
 		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
 		if ( yy_accept[yy_current_state] )
 			{
@@ -1433,15 +1206,10 @@ static int yy_get_next_buffer (void)
  * synopsis
  *	next_state = yy_try_NUL_trans( current_state );
  */
-/* %if-c-only */
     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
-/* %endif */
-/* %if-c++-only */
-/* %endif */
 {
 	register int yy_is_jam;
-    /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
-	register char *yy_cp = (yy_c_buf_p);
+    	register char *yy_cp = (yy_c_buf_p);
 
 	register YY_CHAR yy_c = 1;
 	if ( yy_accept[yy_current_state] )
@@ -1461,12 +1229,7 @@ static int yy_get_next_buffer (void)
 	return yy_is_jam ? 0 : yy_current_state;
 }
 
-/* %if-c-only */
-
     static void yyunput (int c, register char * yy_bp )
-/* %endif */
-/* %if-c++-only */
-/* %endif */
 {
 	register char *yy_cp;
     
@@ -1498,17 +1261,11 @@ static int yy_get_next_buffer (void)
 
 	*--yy_cp = (char) c;
 
-/* %% [18.0] update yylineno here */
-
 	(yytext_ptr) = yy_bp;
 	(yy_hold_char) = *yy_cp;
 	(yy_c_buf_p) = yy_cp;
 }
-/* %if-c-only */
 
-/* %endif */
-
-/* %if-c-only */
 #ifndef YY_NO_INPUT
 #ifdef __cplusplus
     static int yyinput (void)
@@ -1516,9 +1273,6 @@ static int yy_get_next_buffer (void)
     static int input  (void)
 #endif
 
-/* %endif */
-/* %if-c++-only */
-/* %endif */
 {
 	int c;
     
@@ -1582,25 +1336,18 @@ static int yy_get_next_buffer (void)
 	*(yy_c_buf_p) = '\0';	/* preserve yytext */
 	(yy_hold_char) = *++(yy_c_buf_p);
 
-/* %% [19.0] update BOL and yylineno */
 	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
 
 	return c;
 }
-/* %if-c-only */
 #endif	/* ifndef YY_NO_INPUT */
-/* %endif */
 
 /** Immediately switch to a different input stream.
  * @param input_file A readable stream.
  * 
  * @note This function does not reset the start condition to @c INITIAL .
  */
-/* %if-c-only */
     void yyrestart  (FILE * input_file )
-/* %endif */
-/* %if-c++-only */
-/* %endif */
 {
     
 	if ( ! YY_CURRENT_BUFFER ){
@@ -1617,11 +1364,7 @@ static int yy_get_next_buffer (void)
  * @param new_buffer The new input buffer.
  * 
  */
-/* %if-c-only */
     void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
-/* %endif */
-/* %if-c++-only */
-/* %endif */
 {
     
 	/* TODO. We should be able to replace this entire function body
@@ -1652,11 +1395,7 @@ static int yy_get_next_buffer (void)
 	(yy_did_buffer_switch_on_eof) = 1;
 }
 
-/* %if-c-only */
 static void yy_load_buffer_state  (void)
-/* %endif */
-/* %if-c++-only */
-/* %endif */
 {
     	(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
 	(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
@@ -1670,11 +1409,7 @@ static void yy_load_buffer_state  (void)
  * 
  * @return the allocated buffer state.
  */
-/* %if-c-only */
     YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
-/* %endif */
-/* %if-c++-only */
-/* %endif */
 {
 	YY_BUFFER_STATE b;
     
@@ -1702,11 +1437,7 @@ static void yy_load_buffer_state  (void)
  * @param b a buffer created with yy_create_buffer()
  * 
  */
-/* %if-c-only */
     void yy_delete_buffer (YY_BUFFER_STATE  b )
-/* %endif */
-/* %if-c++-only */
-/* %endif */
 {
     
 	if ( ! b )
@@ -1721,26 +1452,15 @@ static void yy_load_buffer_state  (void)
 	yyfree((void *) b  );
 }
 
-/* %if-c-only */
-
 #ifndef __cplusplus
 extern int isatty (int );
 #endif /* __cplusplus */
     
-/* %endif */
-
-/* %if-c++-only */
-/* %endif */
-
 /* Initializes or reinitializes a buffer.
  * This function is sometimes called more than once on the same buffer,
  * such as during a yyrestart() or at EOF.
  */
-/* %if-c-only */
     static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
-/* %endif */
-/* %if-c++-only */
-/* %endif */
 
 {
 	int oerrno = errno;
@@ -1759,13 +1479,8 @@ extern int isatty (int );
         b->yy_bs_column = 0;
     }
 
-/* %if-c-only */
-
         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
     
-/* %endif */
-/* %if-c++-only */
-/* %endif */
 	errno = oerrno;
 }
 
@@ -1773,11 +1488,7 @@ extern int isatty (int );
  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
  * 
  */
-/* %if-c-only */
     void yy_flush_buffer (YY_BUFFER_STATE  b )
-/* %endif */
-/* %if-c++-only */
-/* %endif */
 {
     	if ( ! b )
 		return;
@@ -1800,18 +1511,13 @@ extern int isatty (int );
 		yy_load_buffer_state( );
 }
 
-/* %if-c-or-c++ */
 /** Pushes the new state onto the stack. The new state becomes
  *  the current state. This function will allocate the stack
  *  if necessary.
  *  @param new_buffer The new state.
  *  
  */
-/* %if-c-only */
 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
-/* %endif */
-/* %if-c++-only */
-/* %endif */
 {
     	if (new_buffer == NULL)
 		return;
@@ -1836,18 +1542,12 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
 	yy_load_buffer_state( );
 	(yy_did_buffer_switch_on_eof) = 1;
 }
-/* %endif */
 
-/* %if-c-or-c++ */
 /** Removes and deletes the top of the stack, if present.
  *  The next element becomes the new top.
  *  
  */
-/* %if-c-only */
 void yypop_buffer_state (void)
-/* %endif */
-/* %if-c++-only */
-/* %endif */
 {
     	if (!YY_CURRENT_BUFFER)
 		return;
@@ -1862,17 +1562,11 @@ void yypop_buffer_state (void)
 		(yy_did_buffer_switch_on_eof) = 1;
 	}
 }
-/* %endif */
 
-/* %if-c-or-c++ */
 /* Allocates the stack if it does not exist.
  *  Guarantees space for at least one push.
  */
-/* %if-c-only */
 static void yyensure_buffer_stack (void)
-/* %endif */
-/* %if-c++-only */
-/* %endif */
 {
 	int num_to_alloc;
     
@@ -1914,9 +1608,7 @@ static void yyensure_buffer_stack (void)
 		(yy_buffer_stack_max) = num_to_alloc;
 	}
 }
-/* %endif */
 
-/* %if-c-only */
 /** Setup the input buffer state to scan directly from a user-specified character buffer.
  * @param base the character buffer
  * @param size the size in bytes of the character buffer
@@ -1951,9 +1643,7 @@ YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
 
 	return b;
 }
-/* %endif */
 
-/* %if-c-only */
 /** Setup the input buffer state to scan a string. The next call to yylex() will
  * scan from a @e copy of @a str.
  * @param yystr a NUL-terminated string to scan
@@ -1967,9 +1657,7 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
     
 	return yy_scan_bytes(yystr,strlen(yystr) );
 }
-/* %endif */
 
-/* %if-c-only */
 /** 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 bytes the byte buffer to scan
@@ -2006,21 +1694,16 @@ YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
 
 	return b;
 }
-/* %endif */
 
 #ifndef YY_EXIT_FAILURE
 #define YY_EXIT_FAILURE 2
 #endif
 
-/* %if-c-only */
 static void yy_fatal_error (yyconst char* msg )
 {
     	(void) fprintf( stderr, "%s\n", msg );
 	exit( YY_EXIT_FAILURE );
 }
-/* %endif */
-/* %if-c++-only */
-/* %endif */
 
 /* Redefine yyless() so it works in section 3 code. */
 
@@ -2041,10 +1724,6 @@ static void yy_fatal_error (yyconst char* msg )
 
 /* Accessor  methods (get/set functions) to struct members. */
 
-/* %if-c-only */
-/* %if-reentrant */
-/* %endif */
-
 /** Get the current line number.
  * 
  */
@@ -2087,9 +1766,6 @@ char *yyget_text  (void)
         return yytext;
 }
 
-/* %if-reentrant */
-/* %endif */
-
 /** Set the current line number.
  * @param line_number
  * 
@@ -2126,14 +1802,6 @@ void yyset_debug (int  bdebug )
         yy_flex_debug = bdebug ;
 }
 
-/* %endif */
-
-/* %if-reentrant */
-/* %if-bison-bridge */
-/* %endif */
-/* %endif if-c-only */
-
-/* %if-c-only */
 static int yy_init_globals (void)
 {
         /* Initialization is the same as for the non-reentrant scanner.
@@ -2161,9 +1829,7 @@ static int yy_init_globals (void)
      */
     return 0;
 }
-/* %endif */
 
-/* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
 int yylex_destroy  (void)
 {
@@ -2183,11 +1849,8 @@ int yylex_destroy  (void)
      * yylex() is called, initialization will occur. */
     yy_init_globals( );
 
-/* %if-reentrant */
-/* %endif */
     return 0;
 }
-/* %endif */
 
 /*
  * Internal utility routines.
@@ -2235,21 +1898,11 @@ void yyfree (void * ptr )
 	free( (char *) ptr );	/* see yyrealloc() for (char *) cast */
 }
 
-/* %if-tables-serialization definitions */
-/* %define-yytables   The name for this specific scanner's tables. */
 #define YYTABLES_NAME "yytables"
-/* %endif */
-
-/* %ok-for-header */
-
-#line 93 "scripts/genksyms/lex.l"
-
-
 
 /* Bring in the keyword recognizer.  */
 
-#include "keywords.c"
-
+#include "keywords.hash.c"
 
 /* Macros to append to our phrase collection list.  */
 
@@ -2274,7 +1927,6 @@ void yyfree (void * ptr )
 
 #define APP		_APP(yytext, yyleng)
 
-
 /* The second stage lexer.  Here we incorporate knowledge of the state
    of the parser to tailor the tokens that are returned.  */
 
diff --git a/scripts/genksyms/parse.h_shipped b/scripts/genksyms/parse.h_shipped
deleted file mode 100644
index 5175236..0000000
--- a/scripts/genksyms/parse.h_shipped
+++ /dev/null
@@ -1,97 +0,0 @@
-
-/* A Bison parser, made by GNU Bison 2.4.1.  */
-
-/* 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.
-   
-   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
-   the Free Software Foundation, either version 3 of the License, or
-   (at your option) any later version.
-   
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* As a special exception, you may create a larger work that contains
-   part or all of the Bison parser skeleton and distribute that work
-   under terms of your choice, so long as that work isn't itself a
-   parser generator using the skeleton or a modified version thereof
-   as a parser skeleton.  Alternatively, if you modify or redistribute
-   the parser skeleton itself, you may (at your option) remove this
-   special exception, which will cause the skeleton and the resulting
-   Bison output files to be licensed under the GNU General Public
-   License without this special exception.
-   
-   This special exception was added by the Free Software Foundation in
-   version 2.2 of Bison.  */
-
-
-/* Tokens.  */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     ASM_KEYW = 258,
-     ATTRIBUTE_KEYW = 259,
-     AUTO_KEYW = 260,
-     BOOL_KEYW = 261,
-     CHAR_KEYW = 262,
-     CONST_KEYW = 263,
-     DOUBLE_KEYW = 264,
-     ENUM_KEYW = 265,
-     EXTERN_KEYW = 266,
-     EXTENSION_KEYW = 267,
-     FLOAT_KEYW = 268,
-     INLINE_KEYW = 269,
-     INT_KEYW = 270,
-     LONG_KEYW = 271,
-     REGISTER_KEYW = 272,
-     RESTRICT_KEYW = 273,
-     SHORT_KEYW = 274,
-     SIGNED_KEYW = 275,
-     STATIC_KEYW = 276,
-     STRUCT_KEYW = 277,
-     TYPEDEF_KEYW = 278,
-     UNION_KEYW = 279,
-     UNSIGNED_KEYW = 280,
-     VOID_KEYW = 281,
-     VOLATILE_KEYW = 282,
-     TYPEOF_KEYW = 283,
-     EXPORT_SYMBOL_KEYW = 284,
-     ASM_PHRASE = 285,
-     ATTRIBUTE_PHRASE = 286,
-     BRACE_PHRASE = 287,
-     BRACKET_PHRASE = 288,
-     EXPRESSION_PHRASE = 289,
-     CHAR = 290,
-     DOTS = 291,
-     IDENT = 292,
-     INT = 293,
-     REAL = 294,
-     STRING = 295,
-     TYPE = 296,
-     OTHER = 297,
-     FILENAME = 298
-   };
-#endif
-
-
-
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef int YYSTYPE;
-# define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-#endif
-
-extern YYSTYPE yylval;
-
-
diff --git a/scripts/genksyms/parse.c_shipped b/scripts/genksyms/parse.tab.c_shipped
similarity index 92%
rename from scripts/genksyms/parse.c_shipped
rename to scripts/genksyms/parse.tab.c_shipped
index 1a0b860..67f19e7 100644
--- a/scripts/genksyms/parse.c_shipped
+++ b/scripts/genksyms/parse.tab.c_shipped
@@ -1,10 +1,9 @@
-
-/* 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
@@ -2518,3 +2352,5 @@ yyerror(const char *e)
   error_with_pos("%s", e);
 }
 
+#include "lex.lex.c"
+
-- 
1.7.3.4.574.g608b.dirty


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [RFCv2 06/13] kconfig: constify `kconf_id_lookup'
  2011-05-23  8:10 [RFCv2 00/13] Kbuild: factor parser rules Arnaud Lacombe
                   ` (4 preceding siblings ...)
  2011-05-23  8:10 ` [RFCv2 05/13] genksym: regen parser Arnaud Lacombe
@ 2011-05-23  8:10 ` Arnaud Lacombe
  2011-05-23  8:10 ` [RFCv2 07/13] kconfig: back-out parser prefix, from `zconf' to `yy' Arnaud Lacombe
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 32+ messages in thread
From: Arnaud Lacombe @ 2011-05-23  8:10 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Michal Marek, Arnaud Lacombe

---
 scripts/kconfig/Makefile    |    2 +-
 scripts/kconfig/zconf.gperf |    2 +-
 scripts/kconfig/zconf.l     |    4 ++--
 scripts/kconfig/zconf.y     |    8 ++++----
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 368ae30..088ed9b 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -348,7 +348,7 @@ lex.%.c: %.l
 	cp $@ $@_shipped
 
 %.hash.c: %.gperf
-	gperf < $< > $@
+	gperf -C < $< > $@
 	cp $@ $@_shipped
 
 endif
diff --git a/scripts/kconfig/zconf.gperf b/scripts/kconfig/zconf.gperf
index c9e690e..f14ab41 100644
--- a/scripts/kconfig/zconf.gperf
+++ b/scripts/kconfig/zconf.gperf
@@ -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
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l
index 3dbaec1..ee92b10 100644
--- a/scripts/kconfig/zconf.l
+++ b/scripts/kconfig/zconf.l
@@ -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;
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 49fb4ab..98c5716 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -25,7 +25,7 @@ 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];
 
@@ -45,7 +45,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 +229,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
@@ -545,7 +545,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",
-- 
1.7.3.4.574.g608b.dirty


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [RFCv2 07/13] kconfig: back-out parser prefix, from `zconf' to `yy'
  2011-05-23  8:10 [RFCv2 00/13] Kbuild: factor parser rules Arnaud Lacombe
                   ` (5 preceding siblings ...)
  2011-05-23  8:10 ` [RFCv2 06/13] kconfig: constify `kconf_id_lookup' Arnaud Lacombe
@ 2011-05-23  8:10 ` Arnaud Lacombe
  2011-05-23  8:54   ` Yann E. MORIN
  2011-05-23  8:10 ` [RFCv2 08/13] kconfig: kill no longer needed reference to YYDEBUG Arnaud Lacombe
                   ` (8 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Arnaud Lacombe @ 2011-05-23  8:10 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Michal Marek, Arnaud Lacombe

---
 scripts/kconfig/lkc.h   |    2 +-
 scripts/kconfig/zconf.l |   16 ++++++++--------
 scripts/kconfig/zconf.y |   22 +++++++++++-----------
 3 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index febf0c9..716c36c 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -69,7 +69,7 @@ struct kconf_id {
 };
 
 #ifdef YYDEBUG
-extern int zconfdebug;
+extern int yyebug;
 #endif
 
 int zconfparse(void);
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l
index ee92b10..cf549c7 100644
--- a/scripts/kconfig/zconf.l
+++ b/scripts/kconfig/zconf.l
@@ -101,11 +101,11 @@ n	[A-Za-z0-9_]
 		current_pos.file = current_file;
 		current_pos.lineno = current_file->lineno;
 		if (id && id->flags & TF_COMMAND) {
-			zconflval.id = id;
+			yylval.id = id;
 			return id->token;
 		}
 		alloc_string(yytext, yyleng);
-		zconflval.string = text;
+		yylval.string = text;
 		return T_WORD;
 	}
 	.
@@ -134,11 +134,11 @@ n	[A-Za-z0-9_]
 	({n}|[-/.])+	{
 		const struct kconf_id *id = kconf_id_lookup(yytext, yyleng);
 		if (id && id->flags & TF_PARAM) {
-			zconflval.id = id;
+			yylval.id = id;
 			return id->token;
 		}
 		alloc_string(yytext, yyleng);
-		zconflval.string = text;
+		yylval.string = text;
 		return T_WORD;
 	}
 	#.*	/* comment */
@@ -152,7 +152,7 @@ n	[A-Za-z0-9_]
 <STRING>{
 	[^'"\\\n]+/\n	{
 		append_string(yytext, yyleng);
-		zconflval.string = text;
+		yylval.string = text;
 		return T_WORD_QUOTE;
 	}
 	[^'"\\\n]+	{
@@ -160,7 +160,7 @@ n	[A-Za-z0-9_]
 	}
 	\\.?/\n	{
 		append_string(yytext + 1, yyleng - 1);
-		zconflval.string = text;
+		yylval.string = text;
 		return T_WORD_QUOTE;
 	}
 	\\.?	{
@@ -169,7 +169,7 @@ n	[A-Za-z0-9_]
 	\'|\"	{
 		if (str == yytext[0]) {
 			BEGIN(PARAM);
-			zconflval.string = text;
+			yylval.string = text;
 			return T_WORD_QUOTE;
 		} else
 			append_string(yytext, 1);
@@ -252,7 +252,7 @@ void zconf_starthelp(void)
 
 static void zconf_endhelp(void)
 {
-	zconflval.string = text;
+	yylval.string = text;
 	BEGIN(INITIAL);
 }
 
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 98c5716..8564238 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -21,10 +21,10 @@
 
 int cdebug = PRINTD;
 
-extern int zconflex(void);
+extern int yylex(void);
 static void zconfprint(const char *err, ...);
 static void zconf_error(const char *err, ...);
-static void zconferror(const char *err);
+static void yyerror(const char *err);
 static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken);
 
 struct symbol *symbol_hash[SYMBOL_HASHSIZE];
@@ -505,10 +505,10 @@ void conf_parse(const char *name)
 
 #if YYDEBUG
 	if (getenv("ZCONF_DEBUG"))
-		zconfdebug = 1;
+		yydebug = 1;
 #endif
-	zconfparse();
-	if (zconfnerrs)
+	yyparse();
+	if (yynerrs)
 		exit(1);
 	if (!modules_sym->prop) {
 		struct property *prop;
@@ -523,9 +523,9 @@ void conf_parse(const char *name)
 	menu_finalize(&rootmenu);
 	for_all_symbols(i, sym) {
 		if (sym_check_deps(sym))
-			zconfnerrs++;
+			yynerrs++;
         }
-	if (zconfnerrs)
+	if (yynerrs)
 		exit(1);
 	sym_set_change_count(1);
 }
@@ -550,7 +550,7 @@ static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtok
 	if (id->token != endtoken) {
 		zconf_error("unexpected '%s' within %s block",
 			kconf_id_strings + id->name, zconf_tokenname(starttoken));
-		zconfnerrs++;
+		yynerrs++;
 		return false;
 	}
 	if (current_menu->file != current_file) {
@@ -559,7 +559,7 @@ static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtok
 		fprintf(stderr, "%s:%d: location of the '%s'\n",
 			current_menu->file->name, current_menu->lineno,
 			zconf_tokenname(starttoken));
-		zconfnerrs++;
+		yynerrs++;
 		return false;
 	}
 	return true;
@@ -580,7 +580,7 @@ static void zconf_error(const char *err, ...)
 {
 	va_list ap;
 
-	zconfnerrs++;
+	yynerrs++;
 	fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
 	va_start(ap, err);
 	vfprintf(stderr, err, ap);
@@ -588,7 +588,7 @@ static void zconf_error(const char *err, ...)
 	fprintf(stderr, "\n");
 }
 
-static void zconferror(const char *err)
+static void yyerror(const char *err)
 {
 #if YYDEBUG
 	fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
-- 
1.7.3.4.574.g608b.dirty


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [RFCv2 08/13] kconfig: kill no longer needed reference to YYDEBUG
  2011-05-23  8:10 [RFCv2 00/13] Kbuild: factor parser rules Arnaud Lacombe
                   ` (6 preceding siblings ...)
  2011-05-23  8:10 ` [RFCv2 07/13] kconfig: back-out parser prefix, from `zconf' to `yy' Arnaud Lacombe
@ 2011-05-23  8:10 ` Arnaud Lacombe
  2011-05-23  8:10 ` [RFCv2 09/13] kconfig: migrate parser to implicit rules Arnaud Lacombe
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 32+ messages in thread
From: Arnaud Lacombe @ 2011-05-23  8:10 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Michal Marek, Arnaud Lacombe

---
 scripts/kconfig/lkc.h   |    2 --
 scripts/kconfig/zconf.y |   12 +++---------
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index 716c36c..81d25b0 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -68,9 +68,7 @@ struct kconf_id {
 	enum symbol_type stype;
 };
 
-#ifdef YYDEBUG
 extern int yyebug;
-#endif
 
 int zconfparse(void);
 void zconfdump(FILE *out);
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 8564238..8f8dc70 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -31,10 +31,6 @@ struct symbol *symbol_hash[SYMBOL_HASHSIZE];
 
 static struct menu *current_menu, *current_entry;
 
-#define YYDEBUG 0
-#if YYDEBUG
-#define YYERROR_VERBOSE
-#endif
 %}
 %expect 30
 
@@ -503,10 +499,10 @@ 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"))
+	if (getenv("ZCONF_DEBUG")) {
+		extern int yydebug;
 		yydebug = 1;
-#endif
+	}
 	yyparse();
 	if (yynerrs)
 		exit(1);
@@ -590,9 +586,7 @@ static void zconf_error(const char *err, ...)
 
 static void yyerror(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)
-- 
1.7.3.4.574.g608b.dirty


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [RFCv2 09/13] kconfig: migrate parser to implicit rules
  2011-05-23  8:10 [RFCv2 00/13] Kbuild: factor parser rules Arnaud Lacombe
                   ` (7 preceding siblings ...)
  2011-05-23  8:10 ` [RFCv2 08/13] kconfig: kill no longer needed reference to YYDEBUG Arnaud Lacombe
@ 2011-05-23  8:10 ` Arnaud Lacombe
  2011-05-23  8:10 ` [RFCv2 10/13] kconfig: regen parser Arnaud Lacombe
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 32+ messages in thread
From: Arnaud Lacombe @ 2011-05-23  8:10 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Michal Marek, Arnaud Lacombe

---
 scripts/kconfig/.gitignore |    2 +-
 scripts/kconfig/Makefile   |   25 -------------------------
 scripts/kconfig/zconf.y    |    2 +-
 3 files changed, 2 insertions(+), 27 deletions(-)

diff --git a/scripts/kconfig/.gitignore b/scripts/kconfig/.gitignore
index 624f650..ee120d4 100644
--- a/scripts/kconfig/.gitignore
+++ b/scripts/kconfig/.gitignore
@@ -2,7 +2,7 @@
 # Generated files
 #
 config*
-lex.*.c
+*.lex.c
 *.tab.c
 *.tab.h
 zconf.hash.c
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 088ed9b..c9ec4d6 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -327,28 +327,3 @@ $(obj)/lkc_defs.h: $(src)/lkc_proto.h
 $(obj)/gconf.glade.h: $(obj)/gconf.glade
 	intltool-extract --type=gettext/glade $(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 -C < $< > $@
-	cp $@ $@_shipped
-
-endif
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 8f8dc70..157d31f 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -735,7 +735,7 @@ void zconfdump(FILE *out)
 	}
 }
 
-#include "lex.zconf.c"
+#include "zconf.lex.c"
 #include "util.c"
 #include "confdata.c"
 #include "expr.c"
-- 
1.7.3.4.574.g608b.dirty


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [RFCv2 10/13] kconfig: regen parser
  2011-05-23  8:10 [RFCv2 00/13] Kbuild: factor parser rules Arnaud Lacombe
                   ` (8 preceding siblings ...)
  2011-05-23  8:10 ` [RFCv2 09/13] kconfig: migrate parser to implicit rules Arnaud Lacombe
@ 2011-05-23  8:10 ` Arnaud Lacombe
  2011-05-23  8:10 ` [RFCv2 11/13] dtc: include the lexer from the parser Arnaud Lacombe
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 32+ messages in thread
From: Arnaud Lacombe @ 2011-05-23  8:10 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Michal Marek, Arnaud Lacombe

---
 scripts/kconfig/Makefile                           |    6 +-
 scripts/kconfig/zconf.hash.c_shipped               |  273 +++++++-----
 .../{lex.zconf.c_shipped => zconf.lex.c_shipped}   |  493 +++++++++-----------
 scripts/kconfig/zconf.tab.c_shipped                |  102 ++---
 4 files changed, 438 insertions(+), 436 deletions(-)
 rename scripts/kconfig/{lex.zconf.c_shipped => zconf.lex.c_shipped} (81%)

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index c9ec4d6..f34f4d1 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -197,7 +197,7 @@ gconf-objs	:= gconf.o kconfig_load.o zconf.tab.o
 endif
 
 clean-files	:= lkc_defs.h qconf.moc .tmp_qtcheck \
-		   .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h
+		   .tmp_gtkcheck zconf.tab.c zconf.lex.c zconf.hash.c gconf.glade.h
 clean-files     += mconf qconf gconf nconf
 clean-files     += config.pot linux.pot
 
@@ -213,7 +213,7 @@ 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)
 
 HOSTLOADLIBES_qconf	= $(KC_QT_LIBS) -ldl
@@ -309,7 +309,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
 
diff --git a/scripts/kconfig/zconf.hash.c_shipped b/scripts/kconfig/zconf.hash.c_shipped
index 4055d5d..40df000 100644
--- a/scripts/kconfig/zconf.hash.c_shipped
+++ b/scripts/kconfig/zconf.hash.c_shipped
@@ -1,6 +1,5 @@
-/* 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"
 
diff --git a/scripts/kconfig/lex.zconf.c_shipped b/scripts/kconfig/zconf.lex.c_shipped
similarity index 81%
rename from scripts/kconfig/lex.zconf.c_shipped
rename to scripts/kconfig/zconf.lex.c_shipped
index 6eb0397..2a97008 100644
--- a/scripts/kconfig/lex.zconf.c_shipped
+++ b/scripts/kconfig/zconf.lex.c_shipped
@@ -1,29 +1,10 @@
 
-#line 3 "scripts/kconfig/lex.zconf.c"
+#line 3 "scripts/kconfig/zconf.lex.c_shipped"
 
 #define  YY_INT_ALIGNED short int
 
 /* A lexical scanner generated by flex */
 
-#define yy_create_buffer zconf_create_buffer
-#define yy_delete_buffer zconf_delete_buffer
-#define yy_flex_debug zconf_flex_debug
-#define yy_init_buffer zconf_init_buffer
-#define yy_flush_buffer zconf_flush_buffer
-#define yy_load_buffer_state zconf_load_buffer_state
-#define yy_switch_to_buffer zconf_switch_to_buffer
-#define yyin zconfin
-#define yyleng zconfleng
-#define yylex zconflex
-#define yylineno zconflineno
-#define yyout zconfout
-#define yyrestart zconfrestart
-#define yytext zconftext
-#define yywrap zconfwrap
-#define yyalloc zconfalloc
-#define yyrealloc zconfrealloc
-#define yyfree zconffree
-
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
@@ -72,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
@@ -102,8 +84,6 @@ typedef unsigned int flex_uint32_t;
 #define UINT32_MAX             (4294967295U)
 #endif
 
-#endif /* ! C99 */
-
 #endif /* ! FLEXINT_H */
 
 #ifdef __cplusplus
@@ -154,21 +134,13 @@ typedef unsigned int flex_uint32_t;
 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
 
 /* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE zconfrestart(zconfin  )
+#define YY_NEW_FILE yyrestart(yyin  )
 
 #define YY_END_OF_BUFFER_CHAR 0
 
 /* 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.
@@ -180,9 +152,9 @@ typedef unsigned int flex_uint32_t;
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif
 
-extern int zconfleng;
+extern int yyleng;
 
-extern FILE *zconfin, *zconfout;
+extern FILE *yyin, *yyout;
 
 #define EOB_ACT_CONTINUE_SCAN 0
 #define EOB_ACT_END_OF_FILE 1
@@ -194,13 +166,13 @@ extern FILE *zconfin, *zconfout;
 #define yyless(n) \
 	do \
 		{ \
-		/* Undo effects of setting up zconftext. */ \
+		/* Undo effects of setting up yytext. */ \
         int yyless_macro_arg = (n); \
         YY_LESS_LINENO(yyless_macro_arg);\
 		*yy_cp = (yy_hold_char); \
 		YY_RESTORE_YY_MORE_OFFSET \
 		(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
-		YY_DO_BEFORE_ACTION; /* set up zconftext again */ \
+		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
 		} \
 	while ( 0 )
 
@@ -268,8 +240,8 @@ struct yy_buffer_state
 	 * possible backing-up.
 	 *
 	 * When we actually see the EOF, we change the status to "new"
-	 * (via zconfrestart()), so that the user can continue scanning by
-	 * just pointing zconfin at a new input file.
+	 * (via yyrestart()), so that the user can continue scanning by
+	 * just pointing yyin at a new input file.
 	 */
 #define YY_BUFFER_EOF_PENDING 2
 
@@ -296,51 +268,51 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
  */
 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
 
-/* yy_hold_char holds the character lost when zconftext is formed. */
+/* yy_hold_char holds the character lost when yytext is formed. */
 static char yy_hold_char;
 static int yy_n_chars;		/* number of characters read into yy_ch_buf */
-int zconfleng;
+int yyleng;
 
 /* Points to current character in buffer. */
 static char *yy_c_buf_p = (char *) 0;
 static int yy_init = 0;		/* whether we need to initialize */
 static int yy_start = 0;	/* start state number */
 
-/* Flag which is used to allow zconfwrap()'s to do buffer switches
- * instead of setting up a fresh zconfin.  A bit of a hack ...
+/* Flag which is used to allow yywrap()'s to do buffer switches
+ * instead of setting up a fresh yyin.  A bit of a hack ...
  */
 static int yy_did_buffer_switch_on_eof;
 
-void zconfrestart (FILE *input_file  );
-void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
-YY_BUFFER_STATE zconf_create_buffer (FILE *file,int size  );
-void zconf_delete_buffer (YY_BUFFER_STATE b  );
-void zconf_flush_buffer (YY_BUFFER_STATE b  );
-void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer  );
-void zconfpop_buffer_state (void );
+void yyrestart (FILE *input_file  );
+void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
+YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
+void yy_delete_buffer (YY_BUFFER_STATE b  );
+void yy_flush_buffer (YY_BUFFER_STATE b  );
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
+void yypop_buffer_state (void );
 
-static void zconfensure_buffer_stack (void );
-static void zconf_load_buffer_state (void );
-static void zconf_init_buffer (YY_BUFFER_STATE b,FILE *file  );
+static void yyensure_buffer_stack (void );
+static void yy_load_buffer_state (void );
+static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
 
-#define YY_FLUSH_BUFFER zconf_flush_buffer(YY_CURRENT_BUFFER )
+#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
 
-YY_BUFFER_STATE zconf_scan_buffer (char *base,yy_size_t size  );
-YY_BUFFER_STATE zconf_scan_string (yyconst char *yy_str  );
-YY_BUFFER_STATE zconf_scan_bytes (yyconst char *bytes,int len  );
+YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
+YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
+YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len  );
 
-void *zconfalloc (yy_size_t  );
-void *zconfrealloc (void *,yy_size_t  );
-void zconffree (void *  );
+void *yyalloc (yy_size_t  );
+void *yyrealloc (void *,yy_size_t  );
+void yyfree (void *  );
 
-#define yy_new_buffer zconf_create_buffer
+#define yy_new_buffer yy_create_buffer
 
 #define yy_set_interactive(is_interactive) \
 	{ \
 	if ( ! YY_CURRENT_BUFFER ){ \
-        zconfensure_buffer_stack (); \
+        yyensure_buffer_stack (); \
 		YY_CURRENT_BUFFER_LVALUE =    \
-            zconf_create_buffer(zconfin,YY_BUF_SIZE ); \
+            yy_create_buffer(yyin,YY_BUF_SIZE ); \
 	} \
 	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
 	}
@@ -348,9 +320,9 @@ void zconffree (void *  );
 #define yy_set_bol(at_bol) \
 	{ \
 	if ( ! YY_CURRENT_BUFFER ){\
-        zconfensure_buffer_stack (); \
+        yyensure_buffer_stack (); \
 		YY_CURRENT_BUFFER_LVALUE =    \
-            zconf_create_buffer(zconfin,YY_BUF_SIZE ); \
+            yy_create_buffer(yyin,YY_BUF_SIZE ); \
 	} \
 	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
 	}
@@ -359,21 +331,21 @@ void zconffree (void *  );
 
 /* Begin user sect3 */
 
-#define zconfwrap(n) 1
+#define yywrap(n) 1
 #define YY_SKIP_YYWRAP
 
 typedef unsigned char YY_CHAR;
 
-FILE *zconfin = (FILE *) 0, *zconfout = (FILE *) 0;
+FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
 
 typedef int yy_state_type;
 
-extern int zconflineno;
+extern int yylineno;
 
-int zconflineno = 1;
+int yylineno = 1;
 
-extern char *zconftext;
-#define yytext_ptr zconftext
+extern char *yytext;
+#define yytext_ptr yytext
 static yyconst flex_int16_t yy_nxt[][17] =
     {
     {
@@ -701,11 +673,11 @@ static int yy_get_next_buffer (void );
 static void yy_fatal_error (yyconst char msg[]  );
 
 /* Done after the current pattern has been matched and before the
- * corresponding action - sets up zconftext.
+ * corresponding action - sets up yytext.
  */
 #define YY_DO_BEFORE_ACTION \
 	(yytext_ptr) = yy_bp; \
-	zconfleng = (size_t) (yy_cp - yy_bp); \
+	yyleng = (size_t) (yy_cp - yy_bp); \
 	(yy_hold_char) = *yy_cp; \
 	*yy_cp = '\0'; \
 	(yy_c_buf_p) = yy_cp;
@@ -761,8 +733,8 @@ static yyconst flex_int32_t yy_ec[256] =
         1,    1,    1,    1,    1
     } ;
 
-extern int zconf_flex_debug;
-int zconf_flex_debug = 0;
+extern int yy_flex_debug;
+int yy_flex_debug = 0;
 
 /* The intent behind this definition is that it'll catch
  * any uses of REJECT which flex missed.
@@ -771,7 +743,7 @@ int zconf_flex_debug = 0;
 #define yymore() yymore_used_but_not_detected
 #define YY_MORE_ADJ 0
 #define YY_RESTORE_YY_MORE_OFFSET
-char *zconftext;
+char *yytext;
 #define YY_NO_INPUT 1
 
 /*
@@ -862,31 +834,31 @@ static int yy_init_globals (void );
 /* Accessor methods to globals.
    These are made visible to non-reentrant scanners for convenience. */
 
-int zconflex_destroy (void );
+int yylex_destroy (void );
 
-int zconfget_debug (void );
+int yyget_debug (void );
 
-void zconfset_debug (int debug_flag  );
+void yyset_debug (int debug_flag  );
 
-YY_EXTRA_TYPE zconfget_extra (void );
+YY_EXTRA_TYPE yyget_extra (void );
 
-void zconfset_extra (YY_EXTRA_TYPE user_defined  );
+void yyset_extra (YY_EXTRA_TYPE user_defined  );
 
-FILE *zconfget_in (void );
+FILE *yyget_in (void );
 
-void zconfset_in  (FILE * in_str  );
+void yyset_in  (FILE * in_str  );
 
-FILE *zconfget_out (void );
+FILE *yyget_out (void );
 
-void zconfset_out  (FILE * out_str  );
+void yyset_out  (FILE * out_str  );
 
-int zconfget_leng (void );
+int yyget_leng (void );
 
-char *zconfget_text (void );
+char *yyget_text (void );
 
-int zconfget_lineno (void );
+int yyget_lineno (void );
 
-void zconfset_lineno (int line_number  );
+void yyset_lineno (int line_number  );
 
 /* Macros after this point can all be overridden by user definitions in
  * section 1.
@@ -894,9 +866,9 @@ void zconfset_lineno (int line_number  );
 
 #ifndef YY_SKIP_YYWRAP
 #ifdef __cplusplus
-extern "C" int zconfwrap (void );
+extern "C" int yywrap (void );
 #else
-extern int zconfwrap (void );
+extern int yywrap (void );
 #endif
 #endif
 
@@ -922,12 +894,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. */
@@ -935,7 +902,7 @@ static int input (void );
 /* This used to be an fputs(), but since the string might contain NUL's,
  * we now use fwrite().
  */
-#define ECHO do { if (fwrite( zconftext, zconfleng, 1, zconfout )) {} } while (0)
+#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
 #endif
 
 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
@@ -944,7 +911,7 @@ static int input (void );
 #ifndef YY_INPUT
 #define YY_INPUT(buf,result,max_size) \
 	errno=0; \
-	while ( (result = read( fileno(zconfin), (char *) buf, max_size )) < 0 ) \
+	while ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
 	{ \
 		if( errno != EINTR) \
 		{ \
@@ -952,7 +919,7 @@ static int input (void );
 			break; \
 		} \
 		errno=0; \
-		clearerr(zconfin); \
+		clearerr(yyin); \
 	}\
 \
 
@@ -984,12 +951,12 @@ static int input (void );
 #ifndef YY_DECL
 #define YY_DECL_IS_OURS 1
 
-extern int zconflex (void);
+extern int yylex (void);
 
-#define YY_DECL int zconflex (void)
+#define YY_DECL int yylex (void)
 #endif /* !YY_DECL */
 
-/* Code executed at the beginning of each rule, after zconftext and zconfleng
+/* Code executed at the beginning of each rule, after yytext and yyleng
  * have been set up.
  */
 #ifndef YY_USER_ACTION
@@ -1026,26 +993,26 @@ YY_DECL
 		if ( ! (yy_start) )
 			(yy_start) = 1;	/* first start state */
 
-		if ( ! zconfin )
-			zconfin = stdin;
+		if ( ! yyin )
+			yyin = stdin;
 
-		if ( ! zconfout )
-			zconfout = stdout;
+		if ( ! yyout )
+			yyout = stdout;
 
 		if ( ! YY_CURRENT_BUFFER ) {
-			zconfensure_buffer_stack ();
+			yyensure_buffer_stack ();
 			YY_CURRENT_BUFFER_LVALUE =
-				zconf_create_buffer(zconfin,YY_BUF_SIZE );
+				yy_create_buffer(yyin,YY_BUF_SIZE );
 		}
 
-		zconf_load_buffer_state( );
+		yy_load_buffer_state( );
 		}
 
 	while ( 1 )		/* loops until end-of-file is reached */
 		{
 		yy_cp = (yy_c_buf_p);
 
-		/* Support of zconftext. */
+		/* Support of yytext. */
 		*yy_cp = (yy_hold_char);
 
 		/* yy_bp points to the position in yy_ch_buf of the start of
@@ -1092,7 +1059,7 @@ YY_RULE_SETUP
 case 5:
 YY_RULE_SETUP
 {
-	unput(zconftext[0]);
+	unput(yytext[0]);
 	BEGIN(COMMAND);
 }
 	YY_BREAK
@@ -1100,16 +1067,16 @@ 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(yytext, yyleng);
 		BEGIN(PARAM);
 		current_pos.file = current_file;
 		current_pos.lineno = current_file->lineno;
 		if (id && id->flags & TF_COMMAND) {
-			zconflval.id = id;
+			yylval.id = id;
 			return id->token;
 		}
-		alloc_string(zconftext, zconfleng);
-		zconflval.string = text;
+		alloc_string(yytext, yyleng);
+		yylval.string = text;
 		return T_WORD;
 	}
 	YY_BREAK
@@ -1158,7 +1125,7 @@ return T_UNEQUAL;
 case 16:
 YY_RULE_SETUP
 {
-		str = zconftext[0];
+		str = yytext[0];
 		new_string();
 		BEGIN(STRING);
 	}
@@ -1175,13 +1142,13 @@ 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(yytext, yyleng);
 		if (id && id->flags & TF_PARAM) {
-			zconflval.id = id;
+			yylval.id = id;
 			return id->token;
 		}
-		alloc_string(zconftext, zconfleng);
-		zconflval.string = text;
+		alloc_string(yytext, yyleng);
+		yylval.string = text;
 		return T_WORD;
 	}
 	YY_BREAK
@@ -1206,49 +1173,49 @@ case YY_STATE_EOF(PARAM):
 
 case 23:
 /* rule 23 can match eol */
-*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
+*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
 (yy_c_buf_p) = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up zconftext again */
+YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
 {
-		append_string(zconftext, zconfleng);
-		zconflval.string = text;
+		append_string(yytext, yyleng);
+		yylval.string = text;
 		return T_WORD_QUOTE;
 	}
 	YY_BREAK
 case 24:
 YY_RULE_SETUP
 {
-		append_string(zconftext, zconfleng);
+		append_string(yytext, yyleng);
 	}
 	YY_BREAK
 case 25:
 /* rule 25 can match eol */
-*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
+*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
 (yy_c_buf_p) = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up zconftext again */
+YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
 {
-		append_string(zconftext + 1, zconfleng - 1);
-		zconflval.string = text;
+		append_string(yytext + 1, yyleng - 1);
+		yylval.string = text;
 		return T_WORD_QUOTE;
 	}
 	YY_BREAK
 case 26:
 YY_RULE_SETUP
 {
-		append_string(zconftext + 1, zconfleng - 1);
+		append_string(yytext + 1, yyleng - 1);
 	}
 	YY_BREAK
 case 27:
 YY_RULE_SETUP
 {
-		if (str == zconftext[0]) {
+		if (str == yytext[0]) {
 			BEGIN(PARAM);
-			zconflval.string = text;
+			yylval.string = text;
 			return T_WORD_QUOTE;
 		} else
-			append_string(zconftext, 1);
+			append_string(yytext, 1);
 	}
 	YY_BREAK
 case 28:
@@ -1271,8 +1238,8 @@ case 29:
 YY_RULE_SETUP
 {
 		ts = 0;
-		for (i = 0; i < zconfleng; i++) {
-			if (zconftext[i] == '\t')
+		for (i = 0; i < yyleng; i++) {
+			if (yytext[i] == '\t')
 				ts = (ts & ~7) + 8;
 			else
 				ts++;
@@ -1294,9 +1261,9 @@ YY_RULE_SETUP
 	YY_BREAK
 case 30:
 /* rule 30 can match eol */
-*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
+*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
 (yy_c_buf_p) = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up zconftext again */
+YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
 {
 		current_file->lineno++;
@@ -1315,12 +1282,12 @@ YY_RULE_SETUP
 case 32:
 YY_RULE_SETUP
 {
-		while (zconfleng) {
-			if ((zconftext[zconfleng-1] != ' ') && (zconftext[zconfleng-1] != '\t'))
+		while (yyleng) {
+			if ((yytext[yyleng-1] != ' ') && (yytext[yyleng-1] != '\t'))
 				break;
-			zconfleng--;
+			yyleng--;
 		}
-		append_string(zconftext, zconfleng);
+		append_string(yytext, yyleng);
 		if (!first_ts)
 			first_ts = last_ts;
 	}
@@ -1339,7 +1306,7 @@ case YY_STATE_EOF(COMMAND):
 		zconf_endfile();
 		return T_EOL;
 	}
-	fclose(zconfin);
+	fclose(yyin);
 	yyterminate();
 }
 	YY_BREAK
@@ -1361,15 +1328,15 @@ YY_FATAL_ERROR( "flex scanner jammed" );
 			{
 			/* We're scanning a new file or input source.  It's
 			 * possible that this happened because the user
-			 * just pointed zconfin at a new source and called
-			 * zconflex().  If so, then we have to assure
+			 * just pointed yyin at a new source and called
+			 * yylex().  If so, then we have to assure
 			 * consistency between YY_CURRENT_BUFFER and our
 			 * globals.  Here is the right place to do so, because
 			 * this is the first action (other than possibly a
 			 * back-up) that will match for the new input source.
 			 */
 			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-			YY_CURRENT_BUFFER_LVALUE->yy_input_file = zconfin;
+			YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
 			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
 			}
 
@@ -1422,11 +1389,11 @@ YY_FATAL_ERROR( "flex scanner jammed" );
 				{
 				(yy_did_buffer_switch_on_eof) = 0;
 
-				if ( zconfwrap( ) )
+				if ( yywrap( ) )
 					{
 					/* Note: because we've taken care in
 					 * yy_get_next_buffer() to have set up
-					 * zconftext, we can now set up
+					 * yytext, we can now set up
 					 * yy_c_buf_p so that if some total
 					 * hoser (like flex itself) wants to
 					 * call the scanner after we return the
@@ -1475,7 +1442,7 @@ YY_FATAL_ERROR( "flex scanner jammed" );
 			"fatal flex scanner internal error--no action found" );
 	} /* end of action switch */
 		} /* end of scanning one token */
-} /* end of zconflex */
+} /* end of yylex */
 
 /* yy_get_next_buffer - try to read in a new buffer
  *
@@ -1553,7 +1520,7 @@ static int yy_get_next_buffer (void)
 
 				b->yy_ch_buf = (char *)
 					/* Include room in for 2 EOB chars. */
-					zconfrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
+					yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
 				}
 			else
 				/* Can't grow it, we don't own it. */
@@ -1585,7 +1552,7 @@ static int yy_get_next_buffer (void)
 		if ( number_to_move == YY_MORE_ADJ )
 			{
 			ret_val = EOB_ACT_END_OF_FILE;
-			zconfrestart(zconfin  );
+			yyrestart(yyin  );
 			}
 
 		else
@@ -1602,7 +1569,7 @@ static int yy_get_next_buffer (void)
 	if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
 		/* Extend the array by 50%, plus the number we really need. */
 		yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
-		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) zconfrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
+		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
 		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
 			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
 	}
@@ -1654,7 +1621,7 @@ static int yy_get_next_buffer (void)
     
     yy_cp = (yy_c_buf_p);
 
-	/* undo effects of setting up zconftext */
+	/* undo effects of setting up yytext */
 	*yy_cp = (yy_hold_char);
 
 	if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
@@ -1726,13 +1693,13 @@ static int yy_get_next_buffer (void)
 					 */
 
 					/* Reset buffer status. */
-					zconfrestart(zconfin );
+					yyrestart(yyin );
 
 					/*FALLTHROUGH*/
 
 				case EOB_ACT_END_OF_FILE:
 					{
-					if ( zconfwrap( ) )
+					if ( yywrap( ) )
 						return EOF;
 
 					if ( ! (yy_did_buffer_switch_on_eof) )
@@ -1752,7 +1719,7 @@ static int yy_get_next_buffer (void)
 		}
 
 	c = *(unsigned char *) (yy_c_buf_p);	/* cast for 8-bit char's */
-	*(yy_c_buf_p) = '\0';	/* preserve zconftext */
+	*(yy_c_buf_p) = '\0';	/* preserve yytext */
 	(yy_hold_char) = *++(yy_c_buf_p);
 
 	return c;
@@ -1764,32 +1731,32 @@ static int yy_get_next_buffer (void)
  * 
  * @note This function does not reset the start condition to @c INITIAL .
  */
-    void zconfrestart  (FILE * input_file )
+    void yyrestart  (FILE * input_file )
 {
     
 	if ( ! YY_CURRENT_BUFFER ){
-        zconfensure_buffer_stack ();
+        yyensure_buffer_stack ();
 		YY_CURRENT_BUFFER_LVALUE =
-            zconf_create_buffer(zconfin,YY_BUF_SIZE );
+            yy_create_buffer(yyin,YY_BUF_SIZE );
 	}
 
-	zconf_init_buffer(YY_CURRENT_BUFFER,input_file );
-	zconf_load_buffer_state( );
+	yy_init_buffer(YY_CURRENT_BUFFER,input_file );
+	yy_load_buffer_state( );
 }
 
 /** Switch to a different input buffer.
  * @param new_buffer The new input buffer.
  * 
  */
-    void zconf_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
+    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
 {
     
 	/* TODO. We should be able to replace this entire function body
 	 * with
-	 *		zconfpop_buffer_state();
-	 *		zconfpush_buffer_state(new_buffer);
+	 *		yypop_buffer_state();
+	 *		yypush_buffer_state(new_buffer);
      */
-	zconfensure_buffer_stack ();
+	yyensure_buffer_stack ();
 	if ( YY_CURRENT_BUFFER == new_buffer )
 		return;
 
@@ -1802,21 +1769,21 @@ static int yy_get_next_buffer (void)
 		}
 
 	YY_CURRENT_BUFFER_LVALUE = new_buffer;
-	zconf_load_buffer_state( );
+	yy_load_buffer_state( );
 
 	/* We don't actually know whether we did this switch during
-	 * EOF (zconfwrap()) processing, but the only time this flag
-	 * is looked at is after zconfwrap() is called, so it's safe
+	 * EOF (yywrap()) processing, but the only time this flag
+	 * is looked at is after yywrap() is called, so it's safe
 	 * to go ahead and always set it.
 	 */
 	(yy_did_buffer_switch_on_eof) = 1;
 }
 
-static void zconf_load_buffer_state  (void)
+static void yy_load_buffer_state  (void)
 {
     	(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
 	(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
-	zconfin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+	yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
 	(yy_hold_char) = *(yy_c_buf_p);
 }
 
@@ -1826,35 +1793,35 @@ static void zconf_load_buffer_state  (void)
  * 
  * @return the allocated buffer state.
  */
-    YY_BUFFER_STATE zconf_create_buffer  (FILE * file, int  size )
+    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
 {
 	YY_BUFFER_STATE b;
     
-	b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state )  );
+	b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
 	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" );
+		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
 
 	b->yy_buf_size = size;
 
 	/* yy_ch_buf has to be 2 characters longer than the size given because
 	 * we need to put in 2 end-of-buffer characters.
 	 */
-	b->yy_ch_buf = (char *) zconfalloc(b->yy_buf_size + 2  );
+	b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
 	if ( ! b->yy_ch_buf )
-		YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" );
+		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
 
 	b->yy_is_our_buffer = 1;
 
-	zconf_init_buffer(b,file );
+	yy_init_buffer(b,file );
 
 	return b;
 }
 
 /** Destroy the buffer.
- * @param b a buffer created with zconf_create_buffer()
+ * @param b a buffer created with yy_create_buffer()
  * 
  */
-    void zconf_delete_buffer (YY_BUFFER_STATE  b )
+    void yy_delete_buffer (YY_BUFFER_STATE  b )
 {
     
 	if ( ! b )
@@ -1864,27 +1831,27 @@ static void zconf_load_buffer_state  (void)
 		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
 
 	if ( b->yy_is_our_buffer )
-		zconffree((void *) b->yy_ch_buf  );
+		yyfree((void *) b->yy_ch_buf  );
 
-	zconffree((void *) b  );
+	yyfree((void *) b  );
 }
 
 /* Initializes or reinitializes a buffer.
  * This function is sometimes called more than once on the same buffer,
- * such as during a zconfrestart() or at EOF.
+ * such as during a yyrestart() or at EOF.
  */
-    static void zconf_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
+    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
 
 {
 	int oerrno = errno;
     
-	zconf_flush_buffer(b );
+	yy_flush_buffer(b );
 
 	b->yy_input_file = file;
 	b->yy_fill_buffer = 1;
 
-    /* If b is the current buffer, then zconf_init_buffer was _probably_
-     * called from zconfrestart() or through yy_get_next_buffer.
+    /* If b is the current buffer, then yy_init_buffer was _probably_
+     * called from yyrestart() or through yy_get_next_buffer.
      * In that case, we don't want to reset the lineno or column.
      */
     if (b != YY_CURRENT_BUFFER){
@@ -1901,7 +1868,7 @@ static void zconf_load_buffer_state  (void)
  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
  * 
  */
-    void zconf_flush_buffer (YY_BUFFER_STATE  b )
+    void yy_flush_buffer (YY_BUFFER_STATE  b )
 {
     	if ( ! b )
 		return;
@@ -1921,7 +1888,7 @@ static void zconf_load_buffer_state  (void)
 	b->yy_buffer_status = YY_BUFFER_NEW;
 
 	if ( b == YY_CURRENT_BUFFER )
-		zconf_load_buffer_state( );
+		yy_load_buffer_state( );
 }
 
 /** Pushes the new state onto the stack. The new state becomes
@@ -1930,14 +1897,14 @@ static void zconf_load_buffer_state  (void)
  *  @param new_buffer The new state.
  *  
  */
-void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
 {
     	if (new_buffer == NULL)
 		return;
 
-	zconfensure_buffer_stack();
+	yyensure_buffer_stack();
 
-	/* This block is copied from zconf_switch_to_buffer. */
+	/* This block is copied from yy_switch_to_buffer. */
 	if ( YY_CURRENT_BUFFER )
 		{
 		/* Flush out information for old buffer. */
@@ -1951,8 +1918,8 @@ void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
 		(yy_buffer_stack_top)++;
 	YY_CURRENT_BUFFER_LVALUE = new_buffer;
 
-	/* copied from zconf_switch_to_buffer. */
-	zconf_load_buffer_state( );
+	/* copied from yy_switch_to_buffer. */
+	yy_load_buffer_state( );
 	(yy_did_buffer_switch_on_eof) = 1;
 }
 
@@ -1960,18 +1927,18 @@ void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
  *  The next element becomes the new top.
  *  
  */
-void zconfpop_buffer_state (void)
+void yypop_buffer_state (void)
 {
     	if (!YY_CURRENT_BUFFER)
 		return;
 
-	zconf_delete_buffer(YY_CURRENT_BUFFER );
+	yy_delete_buffer(YY_CURRENT_BUFFER );
 	YY_CURRENT_BUFFER_LVALUE = NULL;
 	if ((yy_buffer_stack_top) > 0)
 		--(yy_buffer_stack_top);
 
 	if (YY_CURRENT_BUFFER) {
-		zconf_load_buffer_state( );
+		yy_load_buffer_state( );
 		(yy_did_buffer_switch_on_eof) = 1;
 	}
 }
@@ -1979,7 +1946,7 @@ void zconfpop_buffer_state (void)
 /* Allocates the stack if it does not exist.
  *  Guarantees space for at least one push.
  */
-static void zconfensure_buffer_stack (void)
+static void yyensure_buffer_stack (void)
 {
 	int num_to_alloc;
     
@@ -1990,11 +1957,11 @@ static void zconfensure_buffer_stack (void)
 		 * immediate realloc on the next call.
          */
 		num_to_alloc = 1;
-		(yy_buffer_stack) = (struct yy_buffer_state**)zconfalloc
+		(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
 								(num_to_alloc * sizeof(struct yy_buffer_state*)
 								);
 		if ( ! (yy_buffer_stack) )
-			YY_FATAL_ERROR( "out of dynamic memory in zconfensure_buffer_stack()" );
+			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
 								  
 		memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
 				
@@ -2009,12 +1976,12 @@ static void zconfensure_buffer_stack (void)
 		int grow_size = 8 /* arbitrary grow size */;
 
 		num_to_alloc = (yy_buffer_stack_max) + grow_size;
-		(yy_buffer_stack) = (struct yy_buffer_state**)zconfrealloc
+		(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
 								((yy_buffer_stack),
 								num_to_alloc * sizeof(struct yy_buffer_state*)
 								);
 		if ( ! (yy_buffer_stack) )
-			YY_FATAL_ERROR( "out of dynamic memory in zconfensure_buffer_stack()" );
+			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
 
 		/* zero only the new slots.*/
 		memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
@@ -2028,7 +1995,7 @@ static void zconfensure_buffer_stack (void)
  * 
  * @return the newly allocated buffer state object. 
  */
-YY_BUFFER_STATE zconf_scan_buffer  (char * base, yy_size_t  size )
+YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
 {
 	YY_BUFFER_STATE b;
     
@@ -2038,9 +2005,9 @@ YY_BUFFER_STATE zconf_scan_buffer  (char * base, yy_size_t  size )
 		/* They forgot to leave room for the EOB's. */
 		return 0;
 
-	b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state )  );
+	b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
 	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_buffer()" );
+		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
 
 	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
 	b->yy_buf_pos = b->yy_ch_buf = base;
@@ -2052,33 +2019,33 @@ YY_BUFFER_STATE zconf_scan_buffer  (char * base, yy_size_t  size )
 	b->yy_fill_buffer = 0;
 	b->yy_buffer_status = YY_BUFFER_NEW;
 
-	zconf_switch_to_buffer(b  );
+	yy_switch_to_buffer(b  );
 
 	return b;
 }
 
-/** Setup the input buffer state to scan a string. The next call to zconflex() will
+/** Setup the input buffer state to scan a string. The next call to yylex() will
  * scan from a @e copy of @a str.
  * @param yystr a NUL-terminated string to scan
  * 
  * @return the newly allocated buffer state object.
  * @note If you want to scan bytes that may contain NUL values, then use
- *       zconf_scan_bytes() instead.
+ *       yy_scan_bytes() instead.
  */
-YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr )
+YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
 {
     
-	return zconf_scan_bytes(yystr,strlen(yystr) );
+	return yy_scan_bytes(yystr,strlen(yystr) );
 }
 
-/** Setup the input buffer state to scan the given bytes. The next call to zconflex() will
+/** 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.
  */
-YY_BUFFER_STATE zconf_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
+YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
 {
 	YY_BUFFER_STATE b;
 	char *buf;
@@ -2087,18 +2054,18 @@ YY_BUFFER_STATE zconf_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
     
 	/* Get memory for full buffer, including space for trailing EOB's. */
 	n = _yybytes_len + 2;
-	buf = (char *) zconfalloc(n  );
+	buf = (char *) yyalloc(n  );
 	if ( ! buf )
-		YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_bytes()" );
+		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
 
 	for ( i = 0; i < _yybytes_len; ++i )
 		buf[i] = yybytes[i];
 
 	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
 
-	b = zconf_scan_buffer(buf,n );
+	b = yy_scan_buffer(buf,n );
 	if ( ! b )
-		YY_FATAL_ERROR( "bad buffer in zconf_scan_bytes()" );
+		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
 
 	/* It's okay to grow etc. this buffer, and we should throw it
 	 * away when we're done.
@@ -2124,14 +2091,14 @@ static void yy_fatal_error (yyconst char* msg )
 #define yyless(n) \
 	do \
 		{ \
-		/* Undo effects of setting up zconftext. */ \
+		/* Undo effects of setting up yytext. */ \
         int yyless_macro_arg = (n); \
         YY_LESS_LINENO(yyless_macro_arg);\
-		zconftext[zconfleng] = (yy_hold_char); \
-		(yy_c_buf_p) = zconftext + yyless_macro_arg; \
+		yytext[yyleng] = (yy_hold_char); \
+		(yy_c_buf_p) = yytext + yyless_macro_arg; \
 		(yy_hold_char) = *(yy_c_buf_p); \
 		*(yy_c_buf_p) = '\0'; \
-		zconfleng = yyless_macro_arg; \
+		yyleng = yyless_macro_arg; \
 		} \
 	while ( 0 )
 
@@ -2140,85 +2107,85 @@ static void yy_fatal_error (yyconst char* msg )
 /** Get the current line number.
  * 
  */
-int zconfget_lineno  (void)
+int yyget_lineno  (void)
 {
         
-    return zconflineno;
+    return yylineno;
 }
 
 /** Get the input stream.
  * 
  */
-FILE *zconfget_in  (void)
+FILE *yyget_in  (void)
 {
-        return zconfin;
+        return yyin;
 }
 
 /** Get the output stream.
  * 
  */
-FILE *zconfget_out  (void)
+FILE *yyget_out  (void)
 {
-        return zconfout;
+        return yyout;
 }
 
 /** Get the length of the current token.
  * 
  */
-int zconfget_leng  (void)
+int yyget_leng  (void)
 {
-        return zconfleng;
+        return yyleng;
 }
 
 /** Get the current token.
  * 
  */
 
-char *zconfget_text  (void)
+char *yyget_text  (void)
 {
-        return zconftext;
+        return yytext;
 }
 
 /** Set the current line number.
  * @param line_number
  * 
  */
-void zconfset_lineno (int  line_number )
+void yyset_lineno (int  line_number )
 {
     
-    zconflineno = line_number;
+    yylineno = line_number;
 }
 
 /** Set the input stream. This does not discard the current
  * input buffer.
  * @param in_str A readable stream.
  * 
- * @see zconf_switch_to_buffer
+ * @see yy_switch_to_buffer
  */
-void zconfset_in (FILE *  in_str )
+void yyset_in (FILE *  in_str )
 {
-        zconfin = in_str ;
+        yyin = in_str ;
 }
 
-void zconfset_out (FILE *  out_str )
+void yyset_out (FILE *  out_str )
 {
-        zconfout = out_str ;
+        yyout = out_str ;
 }
 
-int zconfget_debug  (void)
+int yyget_debug  (void)
 {
-        return zconf_flex_debug;
+        return yy_flex_debug;
 }
 
-void zconfset_debug (int  bdebug )
+void yyset_debug (int  bdebug )
 {
-        zconf_flex_debug = bdebug ;
+        yy_flex_debug = bdebug ;
 }
 
 static int yy_init_globals (void)
 {
         /* Initialization is the same as for the non-reentrant scanner.
-     * This function is called from zconflex_destroy(), so don't allocate here.
+     * This function is called from yylex_destroy(), so don't allocate here.
      */
 
     (yy_buffer_stack) = 0;
@@ -2230,36 +2197,36 @@ static int yy_init_globals (void)
 
 /* Defined in main.c */
 #ifdef YY_STDINIT
-    zconfin = stdin;
-    zconfout = stdout;
+    yyin = stdin;
+    yyout = stdout;
 #else
-    zconfin = (FILE *) 0;
-    zconfout = (FILE *) 0;
+    yyin = (FILE *) 0;
+    yyout = (FILE *) 0;
 #endif
 
     /* For future reference: Set errno on error, since we are called by
-     * zconflex_init()
+     * yylex_init()
      */
     return 0;
 }
 
-/* zconflex_destroy is for both reentrant and non-reentrant scanners. */
-int zconflex_destroy  (void)
+/* yylex_destroy is for both reentrant and non-reentrant scanners. */
+int yylex_destroy  (void)
 {
     
     /* Pop the buffer stack, destroying each element. */
 	while(YY_CURRENT_BUFFER){
-		zconf_delete_buffer(YY_CURRENT_BUFFER  );
+		yy_delete_buffer(YY_CURRENT_BUFFER  );
 		YY_CURRENT_BUFFER_LVALUE = NULL;
-		zconfpop_buffer_state();
+		yypop_buffer_state();
 	}
 
 	/* Destroy the stack itself. */
-	zconffree((yy_buffer_stack) );
+	yyfree((yy_buffer_stack) );
 	(yy_buffer_stack) = NULL;
 
     /* Reset the globals. This is important in a non-reentrant scanner so the next time
-     * zconflex() is called, initialization will occur. */
+     * yylex() is called, initialization will occur. */
     yy_init_globals( );
 
     return 0;
@@ -2289,12 +2256,12 @@ static int yy_flex_strlen (yyconst char * s )
 }
 #endif
 
-void *zconfalloc (yy_size_t  size )
+void *yyalloc (yy_size_t  size )
 {
 	return (void *) malloc( size );
 }
 
-void *zconfrealloc  (void * ptr, yy_size_t  size )
+void *yyrealloc  (void * ptr, yy_size_t  size )
 {
 	/* The cast to (char *) in the following accommodates both
 	 * implementations that use char* generic pointers, and those
@@ -2306,9 +2273,9 @@ void *zconfrealloc  (void * ptr, yy_size_t  size )
 	return (void *) realloc( (char *) ptr, size );
 }
 
-void zconffree (void * ptr )
+void yyfree (void * ptr )
 {
-	free( (char *) ptr );	/* see zconfrealloc() for (char *) cast */
+	free( (char *) ptr );	/* see yyrealloc() for (char *) cast */
 }
 
 #define YYTABLES_NAME "yytables"
@@ -2322,7 +2289,7 @@ void zconf_starthelp(void)
 
 static void zconf_endhelp(void)
 {
-	zconflval.string = text;
+	yylval.string = text;
 	BEGIN(INITIAL);
 }
 
@@ -2352,8 +2319,8 @@ FILE *zconf_fopen(const char *name)
 
 void zconf_initscan(const char *name)
 {
-	zconfin = zconf_fopen(name);
-	if (!zconfin) {
+	yyin = zconf_fopen(name);
+	if (!yyin) {
 		printf("can't find file %s\n", name);
 		exit(1);
 	}
@@ -2373,13 +2340,13 @@ void zconf_nextfile(const char *name)
 	memset(buf, 0, sizeof(*buf));
 
 	current_buf->state = YY_CURRENT_BUFFER;
-	zconfin = zconf_fopen(file->name);
-	if (!zconfin) {
+	yyin = zconf_fopen(file->name);
+	if (!yyin) {
 		printf("%s:%d: can't open file \"%s\"\n",
 		    zconf_curname(), zconf_lineno(), file->name);
 		exit(1);
 	}
-	zconf_switch_to_buffer(zconf_create_buffer(zconfin,YY_BUF_SIZE));
+	yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE));
 	buf->parent = current_buf;
 	current_buf = buf;
 
@@ -2410,9 +2377,9 @@ static void zconf_endfile(void)
 
 	parent = current_buf->parent;
 	if (parent) {
-		fclose(zconfin);
-		zconf_delete_buffer(YY_CURRENT_BUFFER);
-		zconf_switch_to_buffer(parent->state);
+		fclose(yyin);
+		yy_delete_buffer(YY_CURRENT_BUFFER);
+		yy_switch_to_buffer(parent->state);
 	}
 	free(current_buf);
 	current_buf = parent;
diff --git a/scripts/kconfig/zconf.tab.c_shipped b/scripts/kconfig/zconf.tab.c_shipped
index 4c5495e..1bff55f 100644
--- a/scripts/kconfig/zconf.tab.c_shipped
+++ b/scripts/kconfig/zconf.tab.c_shipped
@@ -1,10 +1,9 @@
-
-/* 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"
@@ -63,14 +62,6 @@
 /* Using locations.  */
 #define YYLSP_NEEDED 0
 
-/* Substitute the variable and function names.  */
-#define yyparse         zconfparse
-#define yylex           zconflex
-#define yyerror         zconferror
-#define yylval          zconflval
-#define yychar          zconfchar
-#define yydebug         zconfdebug
-#define yynerrs         zconfnerrs
 
 
 /* Copy the first part of user declarations.  */
@@ -98,26 +89,22 @@
 
 int cdebug = PRINTD;
 
-extern int zconflex(void);
+extern int yylex(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 void yyerror(const char *err);
+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 +175,7 @@ typedef union YYSTYPE
 	struct symbol *symbol;
 	struct expr *expr;
 	struct menu *menu;
-	struct kconf_id *id;
+	const struct kconf_id *id;
 
 
 
@@ -255,7 +242,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 +522,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 +793,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 +861,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 +1749,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,12 +2254,12 @@ 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)
+	if (getenv("ZCONF_DEBUG")) {
+		extern int yydebug;
+		yydebug = 1;
+	}
+	yyparse();
+	if (yynerrs)
 		exit(1);
 	if (!modules_sym->prop) {
 		struct property *prop;
@@ -2278,9 +2274,9 @@ void conf_parse(const char *name)
 	menu_finalize(&rootmenu);
 	for_all_symbols(i, sym) {
 		if (sym_check_deps(sym))
-			zconfnerrs++;
+			yynerrs++;
         }
-	if (zconfnerrs)
+	if (yynerrs)
 		exit(1);
 	sym_set_change_count(1);
 }
@@ -2300,12 +2296,12 @@ 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",
 			kconf_id_strings + id->name, zconf_tokenname(starttoken));
-		zconfnerrs++;
+		yynerrs++;
 		return false;
 	}
 	if (current_menu->file != current_file) {
@@ -2314,7 +2310,7 @@ static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken)
 		fprintf(stderr, "%s:%d: location of the '%s'\n",
 			current_menu->file->name, current_menu->lineno,
 			zconf_tokenname(starttoken));
-		zconfnerrs++;
+		yynerrs++;
 		return false;
 	}
 	return true;
@@ -2335,7 +2331,7 @@ static void zconf_error(const char *err, ...)
 {
 	va_list ap;
 
-	zconfnerrs++;
+	yynerrs++;
 	fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
 	va_start(ap, err);
 	vfprintf(stderr, err, ap);
@@ -2343,11 +2339,9 @@ static void zconf_error(const char *err, ...)
 	fprintf(stderr, "\n");
 }
 
-static void zconferror(const char *err)
+static void yyerror(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 +2490,7 @@ void zconfdump(FILE *out)
 	}
 }
 
-#include "lex.zconf.c"
+#include "zconf.lex.c"
 #include "util.c"
 #include "confdata.c"
 #include "expr.c"
-- 
1.7.3.4.574.g608b.dirty


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [RFCv2 11/13] dtc: include the lexer from the parser
  2011-05-23  8:10 [RFCv2 00/13] Kbuild: factor parser rules Arnaud Lacombe
                   ` (9 preceding siblings ...)
  2011-05-23  8:10 ` [RFCv2 10/13] kconfig: regen parser Arnaud Lacombe
@ 2011-05-23  8:10 ` Arnaud Lacombe
  2011-05-23  8:10 ` [RFCv2 12/13] dtc: migrate parser to implicit rules Arnaud Lacombe
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 32+ messages in thread
From: Arnaud Lacombe @ 2011-05-23  8:10 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Michal Marek, Arnaud Lacombe, David Gibson

Cc: David Gibson <david@gibson.dropbear.id.au>
---
 scripts/dtc/dtc-lexer.l  |    1 -
 scripts/dtc/dtc-parser.y |    2 ++
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l
index e866ea5..9fc1a95 100644
--- a/scripts/dtc/dtc-lexer.l
+++ b/scripts/dtc/dtc-lexer.l
@@ -36,7 +36,6 @@ LINECOMMENT	"//".*\n
 %{
 #include "dtc.h"
 #include "srcpos.h"
-#include "dtc-parser.tab.h"
 
 YYLTYPE yylloc;
 
diff --git a/scripts/dtc/dtc-parser.y b/scripts/dtc/dtc-parser.y
index 5e84a67..42bd7a3 100644
--- a/scripts/dtc/dtc-parser.y
+++ b/scripts/dtc/dtc-parser.y
@@ -343,3 +343,5 @@ static unsigned long long eval_literal(const char *s, int base, int bits)
 		print_error("bad literal");
 	return val;
 }
+
+#include "dtc-lexer.lex.c"
-- 
1.7.3.4.574.g608b.dirty


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [RFCv2 12/13] dtc: migrate parser to implicit rules
  2011-05-23  8:10 [RFCv2 00/13] Kbuild: factor parser rules Arnaud Lacombe
                   ` (10 preceding siblings ...)
  2011-05-23  8:10 ` [RFCv2 11/13] dtc: include the lexer from the parser Arnaud Lacombe
@ 2011-05-23  8:10 ` Arnaud Lacombe
  2011-05-23  8:10 ` [RFCv2 13/13] dtc: regen parser Arnaud Lacombe
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 32+ messages in thread
From: Arnaud Lacombe @ 2011-05-23  8:10 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Michal Marek, Arnaud Lacombe, David Gibson

Cc: David Gibson <david@gibson.dropbear.id.au>
---
 scripts/dtc/Makefile |   29 ++---------------------------
 1 files changed, 2 insertions(+), 27 deletions(-)

diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile
index 04a31c1..e448fb1 100644
--- a/scripts/dtc/Makefile
+++ b/scripts/dtc/Makefile
@@ -5,7 +5,7 @@ always		:= $(hostprogs-y)
 
 dtc-objs	:= dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
 		   srcpos.o checks.o util.o
-dtc-objs	+= dtc-lexer.lex.o dtc-parser.tab.o
+dtc-objs	+= dtc-parser.tab.o
 
 # Source files need to get at the userspace version of libfdt_env.h to compile
 
@@ -21,35 +21,10 @@ HOSTCFLAGS_srcpos.o := $(HOSTCFLAGS_DTC)
 HOSTCFLAGS_treesource.o := $(HOSTCFLAGS_DTC)
 HOSTCFLAGS_util.o := $(HOSTCFLAGS_DTC)
 
-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-parser.tab.o: $(obj)/dtc-lexer.lex.c
 
 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
-- 
1.7.3.4.574.g608b.dirty


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [RFCv2 13/13] dtc: regen parser
  2011-05-23  8:10 [RFCv2 00/13] Kbuild: factor parser rules Arnaud Lacombe
                   ` (11 preceding siblings ...)
  2011-05-23  8:10 ` [RFCv2 12/13] dtc: migrate parser to implicit rules Arnaud Lacombe
@ 2011-05-23  8:10 ` Arnaud Lacombe
  2011-05-23  8:39 ` [RFCv2 00/13] Kbuild: factor parser rules Arnaud Lacombe
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 32+ messages in thread
From: Arnaud Lacombe @ 2011-05-23  8:10 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Michal Marek, Arnaud Lacombe, David Gibson

Cc: David Gibson <david@gibson.dropbear.id.au>
---
 scripts/dtc/dtc-lexer.lex.c_shipped  |   60 ++----------------
 scripts/dtc/dtc-parser.tab.c_shipped |  118 ++++++----------------------------
 scripts/dtc/dtc-parser.tab.h_shipped |   91 --------------------------
 3 files changed, 24 insertions(+), 245 deletions(-)
 delete mode 100644 scripts/dtc/dtc-parser.tab.h_shipped

diff --git a/scripts/dtc/dtc-lexer.lex.c_shipped b/scripts/dtc/dtc-lexer.lex.c_shipped
index 50c4420..db944de 100644
--- a/scripts/dtc/dtc-lexer.lex.c_shipped
+++ b/scripts/dtc/dtc-lexer.lex.c_shipped
@@ -1,6 +1,5 @@
-#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,13 +561,8 @@ char *yytext;
  */
 #define YY_NO_INPUT 1
 
-
-
-
-#line 37 "dtc-lexer.l"
 #include "dtc.h"
 #include "srcpos.h"
-#include "dtc-parser.tab.h"
 
 YYLTYPE yylloc;
 
@@ -603,7 +587,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 +669,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 +688,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 +770,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 +850,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 +861,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 +870,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 +879,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 +888,6 @@ YY_RULE_SETUP
 	YY_BREAK
 case 4:
 YY_RULE_SETUP
-#line 93 "dtc-lexer.l"
 {
 			DPRINT("Keyword: /memreserve/\n");
 			BEGIN_DEFAULT();
@@ -927,7 +896,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 +905,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 +913,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 +921,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 +930,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 +938,6 @@ YY_RULE_SETUP
 	YY_BREAK
 case 10:
 YY_RULE_SETUP
-#line 131 "dtc-lexer.l"
 {
 			DPRINT("/BYTESTRING\n");
 			BEGIN_DEFAULT();
@@ -983,7 +946,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 +955,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 +963,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 +994,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 +1711,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 +1951,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 +1962,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)
diff --git a/scripts/dtc/dtc-parser.tab.c_shipped b/scripts/dtc/dtc-parser.tab.c_shipped
index 9be2eea..c848aeb 100644
--- a/scripts/dtc/dtc-parser.tab.c_shipped
+++ b/scripts/dtc/dtc-parser.tab.c_shipped
@@ -1,10 +1,9 @@
-
-/* 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, ...)
@@ -2026,3 +1944,5 @@ static unsigned long long eval_literal(const char *s, int base, int bits)
 	return val;
 }
 
+#include "dtc-lexer.lex.c"
+
diff --git a/scripts/dtc/dtc-parser.tab.h_shipped b/scripts/dtc/dtc-parser.tab.h_shipped
deleted file mode 100644
index 95c9547..0000000
--- a/scripts/dtc/dtc-parser.tab.h_shipped
+++ /dev/null
@@ -1,91 +0,0 @@
-
-/* A Bison parser, made by GNU Bison 2.4.1.  */
-
-/* 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.
-   
-   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
-   the Free Software Foundation, either version 3 of the License, or
-   (at your option) any later version.
-   
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* As a special exception, you may create a larger work that contains
-   part or all of the Bison parser skeleton and distribute that work
-   under terms of your choice, so long as that work isn't itself a
-   parser generator using the skeleton or a modified version thereof
-   as a parser skeleton.  Alternatively, if you modify or redistribute
-   the parser skeleton itself, you may (at your option) remove this
-   special exception, which will cause the skeleton and the resulting
-   Bison output files to be licensed under the GNU General Public
-   License without this special exception.
-   
-   This special exception was added by the Free Software Foundation in
-   version 2.2 of Bison.  */
-
-
-/* Tokens.  */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     DT_V1 = 258,
-     DT_MEMRESERVE = 259,
-     DT_PROPNODENAME = 260,
-     DT_LITERAL = 261,
-     DT_BASE = 262,
-     DT_BYTE = 263,
-     DT_STRING = 264,
-     DT_LABEL = 265,
-     DT_REF = 266,
-     DT_INCBIN = 267
-   };
-#endif
-
-
-
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
-{
-
-/* Line 1676 of yacc.c  */
-#line 39 "dtc-parser.y"
-
-	char *propnodename;
-	char *literal;
-	char *labelref;
-	unsigned int cbase;
-	uint8_t byte;
-	struct data data;
-
-	uint64_t addr;
-	cell_t cell;
-	struct property *prop;
-	struct property *proplist;
-	struct node *node;
-	struct node *nodelist;
-	struct reserve_info *re;
-
-
-
-/* Line 1676 of yacc.c  */
-#line 83 "dtc-parser.tab.h"
-} YYSTYPE;
-# define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-#endif
-
-extern YYSTYPE yylval;
-
-
-- 
1.7.3.4.574.g608b.dirty


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* Re: [RFCv2 00/13] Kbuild: factor parser rules
  2011-05-23  8:10 [RFCv2 00/13] Kbuild: factor parser rules Arnaud Lacombe
                   ` (12 preceding siblings ...)
  2011-05-23  8:10 ` [RFCv2 13/13] dtc: regen parser Arnaud Lacombe
@ 2011-05-23  8:39 ` Arnaud Lacombe
  2011-05-24 10:47 ` Michal Marek
  2011-06-03 17:16 ` [RFCv3] " Arnaud Lacombe
  15 siblings, 0 replies; 32+ messages in thread
From: Arnaud Lacombe @ 2011-05-23  8:39 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Michal Marek, Arnaud Lacombe, David Gibson

Hi,

On Mon, May 23, 2011 at 4:10 AM, Arnaud Lacombe <lacombar@gmail.com> wrote:
> Hi,
> [...]
> A few notes:
>  - the parser should not include the lexer; however, this has the advantage to
>   avoid having to deals with the parser's header.
fixed in https://github.com/lacombar/linux-2.6/commits/kbuild-implicit-parser-rule.

new diffstat:

% git ds -M v2.6.39..HEAD
 scripts/Makefile.lib                               |   38 ++-
 scripts/dtc/Makefile                               |   23 -
 scripts/dtc/dtc-lexer.lex.c_shipped                |   59 +---
 scripts/dtc/dtc-parser.tab.c_shipped               |  116 +----
 scripts/dtc/dtc-parser.tab.h_shipped               |   11 +-
 scripts/genksyms/.gitignore                        |    7 +-
 scripts/genksyms/Makefile                          |   48 +--
 scripts/genksyms/keywords.gperf                    |    3 +
 ...{keywords.c_shipped => keywords.hash.c_shipped} |   96 ++--
 scripts/genksyms/lex.l                             |    4 +-
 .../genksyms/{lex.c_shipped => lex.lex.c_shipped}  |  359 +--------------
 .../{parse.c_shipped => parse.tab.c_shipped}       |  198 +-------
 .../{parse.h_shipped => parse.tab.h_shipped}       |    7 +-
 scripts/kconfig/.gitignore                         |    2 +-
 scripts/kconfig/Makefile                           |   31 +--
 scripts/kconfig/lkc.h                              |    4 +-
 scripts/kconfig/zconf.gperf                        |    2 +-
 scripts/kconfig/zconf.hash.c_shipped               |  273 +++++++-----
 scripts/kconfig/zconf.l                            |   20 +-
 .../{lex.zconf.c_shipped => zconf.lex.c_shipped}   |  493 +++++++++-----------
 scripts/kconfig/zconf.tab.c_shipped                |  102 ++---
 .../zconf.tab.h_shipped}                           |   96 ++--
 scripts/kconfig/zconf.y                            |   44 +-
 23 files changed, 668 insertions(+), 1368 deletions(-)

That should remove any incompatibilities with the upstream dtc tree.

 - Arnaud

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [RFCv2 07/13] kconfig: back-out parser prefix, from `zconf' to `yy'
  2011-05-23  8:10 ` [RFCv2 07/13] kconfig: back-out parser prefix, from `zconf' to `yy' Arnaud Lacombe
@ 2011-05-23  8:54   ` Yann E. MORIN
  2011-05-23  9:07     ` Arnaud Lacombe
  0 siblings, 1 reply; 32+ messages in thread
From: Yann E. MORIN @ 2011-05-23  8:54 UTC (permalink / raw)
  To: Arnaud Lacombe; +Cc: linux-kbuild, Michal Marek

Arnaud, All,

On Monday 23 May 2011 101033 Arnaud Lacombe wrote:
> ---
>  scripts/kconfig/lkc.h   |    2 +-
>  scripts/kconfig/zconf.l |   16 ++++++++--------
>  scripts/kconfig/zconf.y |   22 +++++++++++-----------
>  3 files changed, 20 insertions(+), 20 deletions(-)
> 
> diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
> index febf0c9..716c36c 100644
> --- a/scripts/kconfig/lkc.h
> +++ b/scripts/kconfig/lkc.h
> @@ -69,7 +69,7 @@ struct kconf_id {
>  };
>  
>  #ifdef YYDEBUG
> -extern int zconfdebug;
> +extern int yyebug;

Missing 'd' in yyebug, maybe? See below...

[--SNIP--]
> diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
> index 98c5716..8564238 100644
> --- a/scripts/kconfig/zconf.y
> +++ b/scripts/kconfig/zconf.y
> @@ -21,10 +21,10 @@
>  
>  int cdebug = PRINTD;
>  
> -extern int zconflex(void);
> +extern int yylex(void);
>  static void zconfprint(const char *err, ...);
>  static void zconf_error(const char *err, ...);
> -static void zconferror(const char *err);
> +static void yyerror(const char *err);
>  static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken);
>  
>  struct symbol *symbol_hash[SYMBOL_HASHSIZE];
> @@ -505,10 +505,10 @@ void conf_parse(const char *name)
>  
>  #if YYDEBUG
>  	if (getenv("ZCONF_DEBUG"))
> -		zconfdebug = 1;
> +		yydebug = 1;

... here we use yydebug with a 'd'.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +0/33 662376056 | Software  Designer | \ / CAMPAIGN     |   ^                |
| --==< O_o >==-- '------------.-------:  X  AGAINST      |  /e\  There is no  |
| http://ymorin.is-a-geek.org/ | (*_*) | / \ HTML MAIL    |  """  conspiracy.  |
'------------------------------'-------'------------------'--------------------'

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [RFCv2 07/13] kconfig: back-out parser prefix, from `zconf' to `yy'
  2011-05-23  8:54   ` Yann E. MORIN
@ 2011-05-23  9:07     ` Arnaud Lacombe
  0 siblings, 0 replies; 32+ messages in thread
From: Arnaud Lacombe @ 2011-05-23  9:07 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: linux-kbuild, Michal Marek

Hi,

On Mon, May 23, 2011 at 4:54 AM, Yann E. MORIN
<yann.morin.1998@anciens.enib.fr> wrote:
> Arnaud, All,
>
> On Monday 23 May 2011 101033 Arnaud Lacombe wrote:
>> ---
>>  scripts/kconfig/lkc.h   |    2 +-
>>  scripts/kconfig/zconf.l |   16 ++++++++--------
>>  scripts/kconfig/zconf.y |   22 +++++++++++-----------
>>  3 files changed, 20 insertions(+), 20 deletions(-)
>>
>> diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
>> index febf0c9..716c36c 100644
>> --- a/scripts/kconfig/lkc.h
>> +++ b/scripts/kconfig/lkc.h
>> @@ -69,7 +69,7 @@ struct kconf_id {
>>  };
>>
>>  #ifdef YYDEBUG
>> -extern int zconfdebug;
>> +extern int yyebug;
>
> Missing 'd' in yyebug, maybe? See below...
>
indeed :) ...fixed,

Thanks,
 - Arnaud

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [RFCv2 00/13] Kbuild: factor parser rules
  2011-05-23  8:10 [RFCv2 00/13] Kbuild: factor parser rules Arnaud Lacombe
                   ` (13 preceding siblings ...)
  2011-05-23  8:39 ` [RFCv2 00/13] Kbuild: factor parser rules Arnaud Lacombe
@ 2011-05-24 10:47 ` Michal Marek
  2011-05-24 14:18   ` Arnaud Lacombe
  2011-06-03 17:16 ` [RFCv3] " Arnaud Lacombe
  15 siblings, 1 reply; 32+ messages in thread
From: Michal Marek @ 2011-05-24 10:47 UTC (permalink / raw)
  To: Arnaud Lacombe; +Cc: linux-kbuild, David Gibson

On 23.5.2011 10:10, Arnaud Lacombe wrote:
> Hi,
>
> [ Original RFC and motivation can be found at:
> http://marc.info/?l=linux-kbuild&m=130456101131801&w=2 ]
>
> I tried to re-think the order in this serie to address Michal comments.
>
> Main changes since v1 are:
>   - include scripts/dtc/' parser in the scope of the patchset
>   - do not rename any parser source
>   - make lexer file name consistent, ie. name it %.lex.c, not lex.%.c
>   - rebase on top of v2.6.39
>
> A few notes:
>   - the parser should not include the lexer; however, this has the advantage to
>     avoid having to deals with the parser's header.
>   - the tuple ( "migrate parser to implicit rules", regen parser) should really
>     be one commit, to enforce bisect'ability
>
> Comments welcome!
>   - Arnaud

Hi,

thanks for the series, but I will probably not have time to review it 
before this merge window closes. So it will have to wait for .41 most 
likely.

Michal

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [RFCv2 00/13] Kbuild: factor parser rules
  2011-05-24 10:47 ` Michal Marek
@ 2011-05-24 14:18   ` Arnaud Lacombe
  0 siblings, 0 replies; 32+ messages in thread
From: Arnaud Lacombe @ 2011-05-24 14:18 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild, David Gibson

Hi,

2011/5/24 Michal Marek <mmarek@suse.cz>:
> On 23.5.2011 10:10, Arnaud Lacombe wrote:
>>
>> Hi,
>>
>> [ Original RFC and motivation can be found at:
>> http://marc.info/?l=linux-kbuild&m=130456101131801&w=2 ]
>>
>> I tried to re-think the order in this serie to address Michal comments.
>>
>> Main changes since v1 are:
>>  - include scripts/dtc/' parser in the scope of the patchset
>>  - do not rename any parser source
>>  - make lexer file name consistent, ie. name it %.lex.c, not lex.%.c
>>  - rebase on top of v2.6.39
>>
>> A few notes:
>>  - the parser should not include the lexer; however, this has the
>> advantage to
>>    avoid having to deals with the parser's header.
>>  - the tuple ( "migrate parser to implicit rules", regen parser) should
>> really
>>    be one commit, to enforce bisect'ability
>>
>> Comments welcome!
>>  - Arnaud
>
> Hi,
>
> thanks for the series, but I will probably not have time to review it before
> this merge window closes. So it will have to wait for .41 most likely.
>
fine with me, I am not entirely happy with that serie anyway, so I'll
certainly do another iteration after -rc1 (to include whatever has
changed in the mean time).

 - Arnaud

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [RFCv3] Kbuild: factor parser rules
  2011-05-23  8:10 [RFCv2 00/13] Kbuild: factor parser rules Arnaud Lacombe
                   ` (14 preceding siblings ...)
  2011-05-24 10:47 ` Michal Marek
@ 2011-06-03 17:16 ` Arnaud Lacombe
  2011-06-07 15:29   ` Michal Marek
  15 siblings, 1 reply; 32+ messages in thread
From: Arnaud Lacombe @ 2011-06-03 17:16 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Michal Marek, Arnaud Lacombe

Hi Michal,

Here is some update concerning the parser generation merge. I do not repost the
whole serie as it may be overkill. You can find the latest branch at:

git://github.com/lacombar/linux-2.6.git kbuild-implicit-parser-rule

You'll find an updated diff between v2 [rebased on top of v3.0-rc1] and v3
below.

Changes since v2:
 - allow a parser to specify the prefix to be used. This will allow for multiple
   parser to use the implicit rules, which was not previously possible, as it
   was using the `yy' default.
 - drop the zconf prefix changes
 - add a `baseprereq' global to kbuild, which mimics `basetarget'
 - rebase on top of v3.0-rc1

Changes since v1:
 - include scripts/dtc/' parser in the scope of the patchset
 - do not rename any parser source
 - make lexer file name consistent, ie. name it %.lex.c, not lex.%.c
 - rebase on top of v2.6.39

I am still not a huge fan of the {YACC,LEX}_PREFIX_ naming, if you got a better
idea, it is most welcome !

Regards,
 - Arnaud

Arnaud Lacombe (11):
      kbuild: add `baseprereq'
      kbuild: add implicit rules for parser generation
      genksyms: pass hash and lookup functions name and target language though the input file
      genksyms: migrate parser to implicit rules
      genksym: regen parser
      kconfig: constify `kconf_id_lookup'
      kconfig: kill no longer needed reference to YYDEBUG
      kconfig: migrate parser to implicit rules
      kconfig: regen parser
      dtc: migrate parser to implicit rules
      dtc: regen parser

---
 scripts/Kbuild.include   |    4 ++++
 scripts/Makefile.lib     |    5 +++--
 scripts/kconfig/Makefile |    3 +++
 scripts/kconfig/lkc.h    |    2 +-
 scripts/kconfig/zconf.l  |   16 ++++++++--------
 scripts/kconfig/zconf.y  |   28 ++++++++++++++--------------
 6 files changed, 33 insertions(+), 25 deletions(-)

diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index be39cd1..d897278 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -21,6 +21,10 @@ depfile = $(subst $(comma),_,$(dot-target).d)
 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)
 
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 104d53f5..f76d9ba 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -171,14 +171,15 @@ $(src)/%.hash.c_shipped: $(src)/%.gperf
 # LEX
 # ---------------------------------------------------------------------------
 quiet_cmd_flex = LEX     $@
-      cmd_flex = flex -o$@ -L $<
+      cmd_flex = flex -o$@ -L -P $(if $(LEX_PREFIX_${baseprereq}),$(LEX_PREFIX_${baseprereq}),yy) $<
+
 $(src)/%.lex.c_shipped: $(src)/%.l
 	$(call cmd,flex)
 
 # YACC
 # ---------------------------------------------------------------------------
 quiet_cmd_bison = YACC    $@
-      cmd_bison = bison -o$@ -d -t -l $<
+      cmd_bison = bison -o$@ -d -t -l -p $(if $(YACC_PREFIX_${baseprereq}),$(YACC_PREFIX_${baseprereq}),yy) $<
 $(src)/%.tab.c_shipped: $(src)/%.y
 	$(call cmd,bison)
 
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 536012d..0b4276c 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -223,6 +223,9 @@ HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC)
 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
 
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index 9fab6d3..f34a0a9 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -68,7 +68,7 @@ struct kconf_id {
 	enum symbol_type stype;
 };
 
-extern int yydebug;
+extern int zconfdebug;
 
 int zconfparse(void);
 void zconfdump(FILE *out);
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l
index 9ca6e5f..98aad53 100644
--- a/scripts/kconfig/zconf.l
+++ b/scripts/kconfig/zconf.l
@@ -101,11 +101,11 @@ n	[A-Za-z0-9_]
 		current_pos.file = current_file;
 		current_pos.lineno = current_file->lineno;
 		if (id && id->flags & TF_COMMAND) {
-			yylval.id = id;
+			zconflval.id = id;
 			return id->token;
 		}
 		alloc_string(yytext, yyleng);
-		yylval.string = text;
+		zconflval.string = text;
 		return T_WORD;
 	}
 	.
@@ -134,11 +134,11 @@ n	[A-Za-z0-9_]
 	({n}|[-/.])+	{
 		const struct kconf_id *id = kconf_id_lookup(yytext, yyleng);
 		if (id && id->flags & TF_PARAM) {
-			yylval.id = id;
+			zconflval.id = id;
 			return id->token;
 		}
 		alloc_string(yytext, yyleng);
-		yylval.string = text;
+		zconflval.string = text;
 		return T_WORD;
 	}
 	#.*	/* comment */
@@ -152,7 +152,7 @@ n	[A-Za-z0-9_]
 <STRING>{
 	[^'"\\\n]+/\n	{
 		append_string(yytext, yyleng);
-		yylval.string = text;
+		zconflval.string = text;
 		return T_WORD_QUOTE;
 	}
 	[^'"\\\n]+	{
@@ -160,7 +160,7 @@ n	[A-Za-z0-9_]
 	}
 	\\.?/\n	{
 		append_string(yytext + 1, yyleng - 1);
-		yylval.string = text;
+		zconflval.string = text;
 		return T_WORD_QUOTE;
 	}
 	\\.?	{
@@ -169,7 +169,7 @@ n	[A-Za-z0-9_]
 	\'|\"	{
 		if (str == yytext[0]) {
 			BEGIN(PARAM);
-			yylval.string = text;
+			zconflval.string = text;
 			return T_WORD_QUOTE;
 		} else
 			append_string(yytext, 1);
@@ -252,7 +252,7 @@ void zconf_starthelp(void)
 
 static void zconf_endhelp(void)
 {
-	yylval.string = text;
+	zconflval.string = text;
 	BEGIN(INITIAL);
 }
 
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 157d31f..f661b4c 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -21,10 +21,10 @@
 
 int cdebug = PRINTD;
 
-extern int yylex(void);
+extern int zconflex(void);
 static void zconfprint(const char *err, ...);
 static void zconf_error(const char *err, ...);
-static void yyerror(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];
@@ -499,12 +499,12 @@ void conf_parse(const char *name)
 	modules_sym->flags |= SYMBOL_AUTO;
 	rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
 
-	if (getenv("ZCONF_DEBUG")) {
-		extern int yydebug;
-		yydebug = 1;
-	}
-	yyparse();
-	if (yynerrs)
+#if YYDEBUG
+	if (getenv("ZCONF_DEBUG"))
+		zconfdebug = 1;
+#endif
+	zconfparse();
+	if (zconfnerrs)
 		exit(1);
 	if (!modules_sym->prop) {
 		struct property *prop;
@@ -519,9 +519,9 @@ void conf_parse(const char *name)
 	menu_finalize(&rootmenu);
 	for_all_symbols(i, sym) {
 		if (sym_check_deps(sym))
-			yynerrs++;
+			zconfnerrs++;
         }
-	if (yynerrs)
+	if (zconfnerrs)
 		exit(1);
 	sym_set_change_count(1);
 }
@@ -546,7 +546,7 @@ static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtok
 	if (id->token != endtoken) {
 		zconf_error("unexpected '%s' within %s block",
 			kconf_id_strings + id->name, zconf_tokenname(starttoken));
-		yynerrs++;
+		zconfnerrs++;
 		return false;
 	}
 	if (current_menu->file != current_file) {
@@ -555,7 +555,7 @@ static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtok
 		fprintf(stderr, "%s:%d: location of the '%s'\n",
 			current_menu->file->name, current_menu->lineno,
 			zconf_tokenname(starttoken));
-		yynerrs++;
+		zconfnerrs++;
 		return false;
 	}
 	return true;
@@ -576,7 +576,7 @@ static void zconf_error(const char *err, ...)
 {
 	va_list ap;
 
-	yynerrs++;
+	zconfnerrs++;
 	fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
 	va_start(ap, err);
 	vfprintf(stderr, err, ap);
@@ -584,7 +584,7 @@ static void zconf_error(const char *err, ...)
 	fprintf(stderr, "\n");
 }
 
-static void yyerror(const char *err)
+static void zconferror(const char *err)
 {
 	fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
 }

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* Re: [RFCv3] Kbuild: factor parser rules
  2011-06-03 17:16 ` [RFCv3] " Arnaud Lacombe
@ 2011-06-07 15:29   ` Michal Marek
  2011-06-07 15:52     ` Arnaud Lacombe
  2011-06-07 20:52     ` [RFCv4] " Arnaud Lacombe
  0 siblings, 2 replies; 32+ messages in thread
From: Michal Marek @ 2011-06-07 15:29 UTC (permalink / raw)
  To: Arnaud Lacombe; +Cc: linux-kbuild

On Fri, Jun 03, 2011 at 01:16:52PM -0400, Arnaud Lacombe wrote:
> Hi Michal,
> 
> Here is some update concerning the parser generation merge. I do not repost the
> whole serie as it may be overkill. You can find the latest branch at:
> 
> git://github.com/lacombar/linux-2.6.git kbuild-implicit-parser-rule
> 
> You'll find an updated diff between v2 [rebased on top of v3.0-rc1] and v3
> below.
> 
> Changes since v2:
>  - allow a parser to specify the prefix to be used. This will allow for multiple
>    parser to use the implicit rules, which was not previously possible, as it
>    was using the `yy' default.
>  - drop the zconf prefix changes
>  - add a `baseprereq' global to kbuild, which mimics `basetarget'
>  - rebase on top of v3.0-rc1

Nice. But it still breaks the _shipped rule for files other than those
handled explicitely. I guess the problem you are trying to solve is the
double-colon in rule? That was added back in 2002 by
http://git.kernel.org/?p=linux/kernel/git/tglx/history.git;a=commitdiff;h=2e8556ce
and it looks to me like a hack to make the _shipped rule fire early
enough.  Maybe it's not needed nowadays at all, because 53c700.o is a
normal object file and not the final module. Nevertheless, if I change
it to a normal rule and delete the ones added by you, it all works fine
except for genksyms:

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index f76d9ba..520f958 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -192,20 +192,10 @@ endif
 quiet_cmd_shipped = SHIPPED $@
 cmd_shipped = cat $< > $@
 
-$(obj)/%.tab.c: $(src)/%.tab.c_shipped
-	$(call cmd,shipped)
-
-$(obj)/%.tab.h: $(src)/%.tab.h_shipped
-	$(call cmd,shipped)
 
-$(obj)/%.lex.c: $(src)/%.lex.c_shipped
+$(obj)/%: $(src)/%_shipped
 	$(call cmd,shipped)
 
-$(obj)/%.hash.c: $(src)/%.hash.c_shipped
-	$(call cmd,shipped)
-
-$(obj)/%:: $(src)/%_shipped
-
 # Commands useful for building a boot image
 # ===========================================================================
 # 

I'll look into the problem with genksyms later today.

Michal

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* Re: [RFCv3] Kbuild: factor parser rules
  2011-06-07 15:29   ` Michal Marek
@ 2011-06-07 15:52     ` Arnaud Lacombe
  2011-06-07 20:52     ` [RFCv4] " Arnaud Lacombe
  1 sibling, 0 replies; 32+ messages in thread
From: Arnaud Lacombe @ 2011-06-07 15:52 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild

Hi,

On Tue, Jun 7, 2011 at 11:29 AM, Michal Marek <mmarek@suse.cz> wrote:
> On Fri, Jun 03, 2011 at 01:16:52PM -0400, Arnaud Lacombe wrote:
>> Hi Michal,
>>
>> Here is some update concerning the parser generation merge. I do not repost the
>> whole serie as it may be overkill. You can find the latest branch at:
>>
>> git://github.com/lacombar/linux-2.6.git kbuild-implicit-parser-rule
>>
>> You'll find an updated diff between v2 [rebased on top of v3.0-rc1] and v3
>> below.
>>
>> Changes since v2:
>>  - allow a parser to specify the prefix to be used. This will allow for multiple
>>    parser to use the implicit rules, which was not previously possible, as it
>>    was using the `yy' default.
>>  - drop the zconf prefix changes
>>  - add a `baseprereq' global to kbuild, which mimics `basetarget'
>>  - rebase on top of v3.0-rc1
>
> Nice. But it still breaks the _shipped rule for files other than those
> handled explicitely. I guess the problem you are trying to solve is the
> double-colon in rule? That was added back in 2002 by
> http://git.kernel.org/?p=linux/kernel/git/tglx/history.git;a=commitdiff;h=2e8556ce
> and it looks to me like a hack to make the _shipped rule fire early
> enough.  Maybe it's not needed nowadays at all, because 53c700.o is a
> normal object file and not the final module. Nevertheless, if I change
> it to a normal rule and delete the ones added by you, it all works fine
> except for genksyms:
>
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index f76d9ba..520f958 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -192,20 +192,10 @@ endif
>  quiet_cmd_shipped = SHIPPED $@
>  cmd_shipped = cat $< > $@
>
> -$(obj)/%.tab.c: $(src)/%.tab.c_shipped
> -       $(call cmd,shipped)
> -
> -$(obj)/%.tab.h: $(src)/%.tab.h_shipped
> -       $(call cmd,shipped)
>
> -$(obj)/%.lex.c: $(src)/%.lex.c_shipped
> +$(obj)/%: $(src)/%_shipped
>        $(call cmd,shipped)
>
> -$(obj)/%.hash.c: $(src)/%.hash.c_shipped
> -       $(call cmd,shipped)
> -
> -$(obj)/%:: $(src)/%_shipped
> -
Do'h! This is why the _shipped stuff is broken, it was missing a
"$(call cmd,shipped)" here. I'll address that issue today. Eventually
without duplicating targets.

 - Arnaud

>  # Commands useful for building a boot image
>  # ===========================================================================
>  #
>
> I'll look into the problem with genksyms later today.
>
> Michal
>

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [RFCv4] Kbuild: factor parser rules
  2011-06-07 15:29   ` Michal Marek
  2011-06-07 15:52     ` Arnaud Lacombe
@ 2011-06-07 20:52     ` Arnaud Lacombe
  2011-06-07 21:27       ` Arnaud Lacombe
  2011-06-08  5:03       ` [RFCv5] " Arnaud Lacombe
  1 sibling, 2 replies; 32+ messages in thread
From: Arnaud Lacombe @ 2011-06-07 20:52 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Michal Marek, Arnaud Lacombe

Hi Michal,

Here is some update concerning the parser generation merge. I do not repost the
whole serie as it may be overkill. You can find the latest branch at:

git://github.com/lacombar/linux-2.6.git kbuild-implicit-parser-rule

For the record, I did full test build in the following environment:

% cat allno.config 
CONFIG_SCSI=y
CONFIG_SCSI_LOWLEVEL=y
CONFIG_SCSI_AIC7XXX=y
CONFIG_SCSI_AIC79XX=y
CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
CONFIG_AIC79XX_REG_PRETTY_PRINT=y
CONFIG_NETDEVICES=y
CONFIG_NET=y
CONFIG_HDLC=y
CONFIG_EISA=y
CONFIG_PCI=y
CONFIG_VT=y
CONFIG_HW_CONSOLE=y
CONFIG_WAN=y
CONFIG_WANXL=y

% gmake CONFIG_DTC=y CONFIG_MODVERSIONS=y REGENERATE_PARSERS=1 \
    scripts allnoconfig vmlinux

finalize without error.

Then, re-started after having updated the parsers:

% touch scripts/*/*.[ly]

finalized without error.

Then, various combinaison of:

% git clean -fdx scripts/

% rm -f $(find . -name *_shipped | sed 's/_shipped//')

% rm -f $(find scripts/ -name '*_shipped') scripts/dtc/dtc-parser.tab.* scripts/genksyms/parse.tab.*

All build finalized without error.

You'll find an updated diff between v3 and v4 below.

Changes since v3:
 - fix the %_shipped implicit rule
 - attempt to tweak the relation between `$(src)/%.tab.c_shipped' and
   `$(src)/%.tab.h_shipped' to make it more robust. This is _very_ delicate as
   gmake has trouble to properly generate `$(obj)/%.tab.h' from
   `$(src)/%.tab.h_shipped' if it is missing and requires
   `$(src)/%.tab.c_shipped' to be created. This now survives a full deletion of
   the %_shipped files.
 - a few spacing nits
 - removes a few useless explicit dependency
 - do not degerate extra `lex.debug' file when regenerating kconfig's parser
 - removed missed occurences of YYDEBUG

Changes since v2:
 - allow a parser to specify the prefix to be used. This will allow for multiple
  parser to use the implicit rules, which was not previously possible, as it
  was using the `yy' default.
 - drop the zconf prefix changes
 - add a `baseprereq' global to kbuild, which mimics `basetarget'
 - rebase on top of v3.0-rc1

Changes since v1:
 - include scripts/dtc/' parser in the scope of the patchset
 - do not rename any parser source
 - make lexer file name consistent, ie. name it %.lex.c, not lex.%.c
 - rebase on top of v2.6.39

Regards,
 - Arnaud

Arnaud Lacombe (13):
      kbuild: add `baseprereq'
      kbuild: add implicit rules for parser generation
      kbuild: simplify the %_shipped rule
      genksyms: pass hash and lookup functions name and target language though the input file
      genksyms: migrate parser to implicit rules
      genksym: regen parser
      kconfig: constify `kconf_id_lookup'
      kconfig: kill no longer needed reference to YYDEBUG
      kconfig/zconf.l: do not ask to generate backup
      kconfig: migrate parser to implicit rules
      kconfig: regen parser
      dtc: migrate parser to implicit rules
      dtc: regen parser

---
 scripts/Makefile.lib      |   19 +++++--------------
 scripts/dtc/Makefile      |    3 +--
 scripts/genksyms/Makefile |    5 ++++-
 scripts/kconfig/zconf.l   |    4 ++--
 scripts/kconfig/zconf.y   |    2 --
 5 files changed, 12 insertions(+), 21 deletions(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index f76d9ba..ad062b7 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -161,10 +161,12 @@ 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)
 
@@ -180,10 +182,10 @@ $(src)/%.lex.c_shipped: $(src)/%.l
 # ---------------------------------------------------------------------------
 quiet_cmd_bison = YACC    $@
       cmd_bison = bison -o$@ -d -t -l -p $(if $(YACC_PREFIX_${baseprereq}),$(YACC_PREFIX_${baseprereq}),yy) $<
-$(src)/%.tab.c_shipped: $(src)/%.y
+
+$(src)/%.tab.c_shipped $(src)/%.tab.h_shipped: $(src)/%.y
 	$(call cmd,bison)
 
-$(src)/%.tab.h_shipped: $(src)/%.tab.c_shipped
 endif
 
 # Shipped files
@@ -192,20 +194,9 @@ endif
 quiet_cmd_shipped = SHIPPED $@
 cmd_shipped = cat $< > $@
 
-$(obj)/%.tab.c: $(src)/%.tab.c_shipped
-	$(call cmd,shipped)
-
-$(obj)/%.tab.h: $(src)/%.tab.h_shipped
+$(obj)/%: $(src)/%_shipped
 	$(call cmd,shipped)
 
-$(obj)/%.lex.c: $(src)/%.lex.c_shipped
-	$(call cmd,shipped)
-
-$(obj)/%.hash.c: $(src)/%.hash.c_shipped
-	$(call cmd,shipped)
-
-$(obj)/%:: $(src)/%_shipped
-
 # Commands useful for building a boot image
 # ===========================================================================
 # 
diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile
index 5bac1cb..a957ab4 100644
--- a/scripts/dtc/Makefile
+++ b/scripts/dtc/Makefile
@@ -26,7 +26,6 @@ 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
 
-targets += dtc-parser.tab.c dtc-lexer.lex.c
+$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.c $(obj)/dtc-parser.tab.h
 
diff --git a/scripts/genksyms/Makefile b/scripts/genksyms/Makefile
index fdaf764..0b883e3 100644
--- a/scripts/genksyms/Makefile
+++ b/scripts/genksyms/Makefile
@@ -7,5 +7,8 @@ genksyms-objs	:= genksyms.o parse.tab.o lex.lex.o
 # -I needed for generated C source (shipped source)
 HOSTCFLAGS_parse.tab.o := -Wno-uninitialized -I$(src)
 
-$(obj)/lex.lex.o: $(obj)/parse.tab.h $(obj)/keywords.hash.c
+$(obj)/parse.tab.o: $(obj)/parse.tab.c $(obj)/parse.tab.h
+
+$(obj)/lex.lex.o: $(obj)/keywords.hash.c
+$(obj)/lex.lex.o: $(obj)/parse.tab.c $(obj)/parse.tab.h
 
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l
index 98aad53..ddee5fc 100644
--- a/scripts/kconfig/zconf.l
+++ b/scripts/kconfig/zconf.l
@@ -1,5 +1,5 @@
-%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
 %{
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index f661b4c..c38cc5a 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -499,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);

-- 
1.7.3.4.574.g608b.dirty

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* Re: [RFCv4] Kbuild: factor parser rules
  2011-06-07 20:52     ` [RFCv4] " Arnaud Lacombe
@ 2011-06-07 21:27       ` Arnaud Lacombe
  2011-06-08  5:03       ` [RFCv5] " Arnaud Lacombe
  1 sibling, 0 replies; 32+ messages in thread
From: Arnaud Lacombe @ 2011-06-07 21:27 UTC (permalink / raw)
  To: linux-kbuild, LKML; +Cc: Michal Marek

Hi,

[Bringing that on linux-kernel@, to try to get a little more audience,
and eventually a gmake(1) guru. Original motivation about the serie
available at http://marc.info/?l=linux-kbuild&m=130456101131801&w=2.
All diff applies to the v4 of the RFC.]

On Tue, Jun 7, 2011 at 4:52 PM, Arnaud Lacombe <lacombar@gmail.com> wrote:
> [...]
> Changes since v3:
>  - fix the %_shipped implicit rule
>  - attempt to tweak the relation between `$(src)/%.tab.c_shipped' and
>   `$(src)/%.tab.h_shipped' to make it more robust. This is _very_ delicate as
>   gmake has trouble to properly generate `$(obj)/%.tab.h' from
>   `$(src)/%.tab.h_shipped' if it is missing and requires
>   `$(src)/%.tab.c_shipped' to be created. This now survives a full deletion of
>   the %_shipped file.
Just to illustrate the delicacy of this part, forbidding make(1) to
delete the intermediate target, by declaring a .SECONDARY target
without any prerequisite (which would seem a desirable behavior):

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index a0fd502..801dc84 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -463,3 +463,5 @@ endif
 # information in a variable se we can use it in if_changed and friends.

 .PHONY: $(PHONY)
+
+.SECONDARY:

require to change the order of the .c and .h in the prerequisite:

diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile
index a957ab4..87d3374 100644
--- a/scripts/dtc/Makefile
+++ b/scripts/dtc/Makefile
@@ -25,7 +25,7 @@ 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-parser.tab.o: $(obj)/dtc-parser.tab.h $(obj)/dtc-parser.tab.c

-$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.c $(obj)/dtc-parser.tab.h
+$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h $(obj)/dtc-parser.tab.c

diff --git a/scripts/genksyms/Makefile b/scripts/genksyms/Makefile
index 0b883e3..9ce8220 100644
--- a/scripts/genksyms/Makefile
+++ b/scripts/genksyms/Makefile
@@ -7,8 +7,8 @@ genksyms-objs   := genksyms.o parse.tab.o lex.lex.o
 # -I needed for generated C source (shipped source)
 HOSTCFLAGS_parse.tab.o := -Wno-uninitialized -I$(src)

-$(obj)/parse.tab.o: $(obj)/parse.tab.c $(obj)/parse.tab.h
+$(obj)/parse.tab.o: $(obj)/parse.tab.h $(obj)/parse.tab.c

 $(obj)/lex.lex.o: $(obj)/keywords.hash.c
-$(obj)/lex.lex.o: $(obj)/parse.tab.c $(obj)/parse.tab.h
+$(obj)/lex.lex.o: $(obj)/parse.tab.h $(obj)/parse.tab.c

else, the .h is regenerated first. Something we do not want. However,
if we revert the change to the precedent version, that is:

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index ad062b7..fc7a8da 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -183,9 +183,11 @@ $(src)/%.lex.c_shipped: $(src)/%.l
 quiet_cmd_bison = YACC    $@
       cmd_bison = bison -o$@ -d -t -l -p $(if
$(YACC_PREFIX_${baseprereq}),$(YACC_PREFIX_${baseprereq}),yy) $<

-$(src)/%.tab.c_shipped $(src)/%.tab.h_shipped: $(src)/%.y
+$(src)/%.tab.c_shipped: $(src)/%.y
        $(call cmd,bison)

+$(src)/%.tab.h_shipped: $(src)/%.tab.c_shipped
+

which would seem more "logical", the chaining breaks:

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/data.o
  LEX     scripts/dtc/dtc-lexer.lex.c_shipped
  SHIPPED scripts/dtc/dtc-lexer.lex.c
gmake[3]: *** No rule to make target `scripts/dtc/dtc-parser.tab.h',
needed by `scripts/dtc/dtc-lexer.lex.o'.  Stop.
gmake[2]: *** [scripts/dtc] Error 2
gmake[1]: *** [scripts] Error 2
gmake: *** [scripts] Error 2

So, make(1) is smart enough to link, in the general case,
`scripts/dtc/dtc-parser.tab.c' to
`scripts/dtc/dtc-parser.tab.c_shipped' then to
`scripts/dtc/dtc-parser.y'. However, it seems to be unable to link
`scripts/dtc/dtc-parser.tab.h' to
`scripts/dtc/dtc-parser.tab.h_shipped', which in turns is be linked
explicitly to `scripts/dtc/dtc-parser.tab.c_shipped' and
`scripts/dtc/dtc-parser.y'.

A possible more robust workaround for this situation would be to
generate the shipped header independently from the parser source. In
which case we would have something ala:

  # YACC
 # ---------------------------------------------------------------------------
 quiet_cmd_bison = YACC    $@
      cmd_bison = bison -o$@ -t -l -p [...]

$(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 [...]

$(src)/%.tab.h_shipped: $(src)/%.y
       $(call cmd,bison_h)

Regards,
 - Arnaud

ps: this is all with gmake 3.82.

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [RFCv5] Kbuild: factor parser rules
  2011-06-07 20:52     ` [RFCv4] " Arnaud Lacombe
  2011-06-07 21:27       ` Arnaud Lacombe
@ 2011-06-08  5:03       ` Arnaud Lacombe
  2011-06-08 15:38         ` Michal Marek
  1 sibling, 1 reply; 32+ messages in thread
From: Arnaud Lacombe @ 2011-06-08  5:03 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Michal Marek, Arnaud Lacombe

Hi Michal,

Here is some update concerning the parser generation merge. I do not repost the
whole serie as it may be overkill. You can find the latest branch at:

git://github.com/lacombar/linux-2.6.git kbuild-implicit-parser-rule

So let't get it done the safe way...

Changes since v4:
 - split the parser definition and its associated header. This workaround
   gmake(1) inabilities to link implicit rules [... or my own to find the right
   sequence :)]. As you can see with the incremental diff, the .tab.c is
   absolutly not alterated by this change
 - nuke the unused `scripts/kconfig/zconf.tab.h_shipped'
 - avoids long lines in the lexer/parser command
 - clean-up {genksyms,dtc}/Makefile

Changes since v3:
 - fix the %_shipped implicit rule
 - attempt to tweak the relation between `$(src)/%.tab.c_shipped' and
  `$(src)/%.tab.h_shipped' to make it more robust. This is _very_ delicate as
  gmake has trouble to properly generate `$(obj)/%.tab.h' from
  `$(src)/%.tab.h_shipped' if it is missing and requires
  `$(src)/%.tab.c_shipped' to be created. This now survives a full deletion of
  the i%_shipped files.
 - a few spacing nits
 - removes a few useless explicit dependency
 - do not degerate extra `lex.debug' file when regenerating kconfig's parser
 - removed missed occurences of YYDEBUG

Changes since v2:
 - allow a parser to specify the prefix to be used. This will allow for multiple
 parser to use the implicit rules, which was not previously possible, as it
 was using the `yy' default.
 - drop the zconf prefix changes
 - add a `baseprereq' global to kbuild, which mimics `basetarget'
 - rebase on top of v3.0-rc1

Changes since v1:
 - include scripts/dtc/' parser in the scope of the patchset
 - do not rename any parser source
 - make lexer file name consistent, ie. name it %.lex.c, not lex.%.c
 - rebase on top of v2.6.39

Regards,
 - Arnaud

Arnaud Lacombe (14):
      kbuild: add `baseprereq'
      kbuild: add implicit rules for parser generation
      kbuild: simplify the %_shipped rule
      genksyms: pass hash and lookup functions name and target language though the input file
      genksyms: drop -Wno-uninitialized from HOSTCFLAGS_parse.tab.o
      genksyms: migrate parser to implicit rules
      genksym: regen parser
      kconfig: constify `kconf_id_lookup'
      kconfig: kill no longer needed reference to YYDEBUG
      kconfig/zconf.l: do not ask to generate backup
      kconfig: migrate parser to implicit rules
      kconfig: regen parser
      dtc: migrate parser to implicit rules
      dtc: regen parser

---
 scripts/Makefile.lib                |   16 +++++-
 scripts/dtc/Makefile                |    4 +-
 scripts/genksyms/Makefile           |    9 ++--
 scripts/kconfig/zconf.tab.h_shipped |  101 -----------------------------------
 4 files changed, 18 insertions(+), 112 deletions(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index ad062b7..aeea84a 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -172,20 +172,30 @@ $(src)/%.hash.c_shipped: $(src)/%.gperf
 
 # LEX
 # ---------------------------------------------------------------------------
+LEX_PREFIX = $(if $(LEX_PREFIX_${baseprereq}),$(LEX_PREFIX_${baseprereq}),yy)
+
 quiet_cmd_flex = LEX     $@
-      cmd_flex = flex -o$@ -L -P $(if $(LEX_PREFIX_${baseprereq}),$(LEX_PREFIX_${baseprereq}),yy) $<
+      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$@ -d -t -l -p $(if $(YACC_PREFIX_${baseprereq}),$(YACC_PREFIX_${baseprereq}),yy) $<
+      cmd_bison = bison -o$@ -t -l -p $(YACC_PREFIX) $<
 
-$(src)/%.tab.c_shipped $(src)/%.tab.h_shipped: $(src)/%.y
+$(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
diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile
index a957ab4..6d1c6bb 100644
--- a/scripts/dtc/Makefile
+++ b/scripts/dtc/Makefile
@@ -25,7 +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-parser.tab.c $(obj)/dtc-parser.tab.h
+$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h
 
diff --git a/scripts/genksyms/Makefile b/scripts/genksyms/Makefile
index 0b883e3..a551090 100644
--- a/scripts/genksyms/Makefile
+++ b/scripts/genksyms/Makefile
@@ -5,10 +5,9 @@ always		:= $(hostprogs-y)
 genksyms-objs	:= genksyms.o parse.tab.o lex.lex.o
 
 # -I needed for generated C source (shipped source)
-HOSTCFLAGS_parse.tab.o := -Wno-uninitialized -I$(src)
+HOSTCFLAGS_parse.tab.o := -I$(src)
+HOSTCFLAGS_lex.lex.o := -I$(src)
 
-$(obj)/parse.tab.o: $(obj)/parse.tab.c $(obj)/parse.tab.h
-
-$(obj)/lex.lex.o: $(obj)/keywords.hash.c
-$(obj)/lex.lex.o: $(obj)/parse.tab.c $(obj)/parse.tab.h
+# dependencies on generated files need to be listed explicitly
+$(obj)/lex.lex.o: $(obj)/keywords.hash.c $(obj)/parse.tab.h
 
diff --git a/scripts/kconfig/zconf.tab.h_shipped b/scripts/kconfig/zconf.tab.h_shipped
deleted file mode 100644
index 724a7e8..0000000
--- a/scripts/kconfig/zconf.tab.h_shipped
+++ /dev/null
@@ -1,101 +0,0 @@
-/* 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,
-   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
-   the Free Software Foundation, either version 3 of the License, or
-   (at your option) any later version.
-   
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* As a special exception, you may create a larger work that contains
-   part or all of the Bison parser skeleton and distribute that work
-   under terms of your choice, so long as that work isn't itself a
-   parser generator using the skeleton or a modified version thereof
-   as a parser skeleton.  Alternatively, if you modify or redistribute
-   the parser skeleton itself, you may (at your option) remove this
-   special exception, which will cause the skeleton and the resulting
-   Bison output files to be licensed under the GNU General Public
-   License without this special exception.
-   
-   This special exception was added by the Free Software Foundation in
-   version 2.2 of Bison.  */
-
-
-/* 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_VISIBLE = 278,
-     T_OPTION = 279,
-     T_ON = 280,
-     T_WORD = 281,
-     T_WORD_QUOTE = 282,
-     T_UNEQUAL = 283,
-     T_CLOSE_PAREN = 284,
-     T_OPEN_PAREN = 285,
-     T_EOL = 286,
-     T_OR = 287,
-     T_AND = 288,
-     T_EQUAL = 289,
-     T_NOT = 290
-   };
-#endif
-
-
-
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
-{
-
-
-	char *string;
-	struct file *file;
-	struct symbol *symbol;
-	struct expr *expr;
-	struct menu *menu;
-	const struct kconf_id *id;
-
-
-
-} YYSTYPE;
-# define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-#endif
-
-extern YYSTYPE zconflval;
-
-

-- 
1.7.3.4.574.g608b.dirty

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* Re: [RFCv5] Kbuild: factor parser rules
  2011-06-08  5:03       ` [RFCv5] " Arnaud Lacombe
@ 2011-06-08 15:38         ` Michal Marek
  2011-06-08 16:11           ` Arnaud Lacombe
  0 siblings, 1 reply; 32+ messages in thread
From: Michal Marek @ 2011-06-08 15:38 UTC (permalink / raw)
  To: Arnaud Lacombe; +Cc: linux-kbuild

On Wed, Jun 08, 2011 at 01:03:28AM -0400, Arnaud Lacombe wrote:
> Hi Michal,
> 
> Here is some update concerning the parser generation merge. I do not repost the
> whole serie as it may be overkill. You can find the latest branch at:
> 
> git://github.com/lacombar/linux-2.6.git kbuild-implicit-parser-rule
> 
> So let't get it done the safe way...
> 
> Changes since v4:
> [...]


Hi, I found now what my problem with genksyms was. I use O= and you
removed the -I$(src) for the lexer (which is a generated file, but needs
genksyms.h from the source directory). With the following patch,
everything should work again (test builds still running, but they built
genksyms already):

diff --git a/scripts/genksyms/Makefile b/scripts/genksyms/Makefile
index 0b883e3..ee1071f 100644
--- a/scripts/genksyms/Makefile
+++ b/scripts/genksyms/Makefile
@@ -6,6 +6,7 @@ genksyms-objs	:= genksyms.o parse.tab.o lex.lex.o
 
 # -I needed for generated C source (shipped source)
 HOSTCFLAGS_parse.tab.o := -Wno-uninitialized -I$(src)
+HOSTCFLAGS_lex.lex.o := -I$(src)
 
 $(obj)/parse.tab.o: $(obj)/parse.tab.c $(obj)/parse.tab.h
 
Michal

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* Re: [RFCv5] Kbuild: factor parser rules
  2011-06-08 15:38         ` Michal Marek
@ 2011-06-08 16:11           ` Arnaud Lacombe
  2011-06-08 20:34             ` Michal Marek
  0 siblings, 1 reply; 32+ messages in thread
From: Arnaud Lacombe @ 2011-06-08 16:11 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild

Hi,

On Wed, Jun 8, 2011 at 11:38 AM, Michal Marek <mmarek@suse.cz> wrote:
> On Wed, Jun 08, 2011 at 01:03:28AM -0400, Arnaud Lacombe wrote:
>> Hi Michal,
>>
>> Here is some update concerning the parser generation merge. I do not repost the
>> whole serie as it may be overkill. You can find the latest branch at:
>>
>> git://github.com/lacombar/linux-2.6.git kbuild-implicit-parser-rule
>>
>> So let't get it done the safe way...
>>
>> Changes since v4:
>> [...]
>
>
> Hi, I found now what my problem with genksyms was. I use O= and you
> removed the -I$(src) for the lexer (which is a generated file, but needs
> genksyms.h from the source directory). With the following patch,
> everything should work again (test builds still running, but they built
> genksyms already):
>
yes, I spotted that yesterday, this is fixed in v5.

 - Arnaud

> diff --git a/scripts/genksyms/Makefile b/scripts/genksyms/Makefile
> index 0b883e3..ee1071f 100644
> --- a/scripts/genksyms/Makefile
> +++ b/scripts/genksyms/Makefile
> @@ -6,6 +6,7 @@ genksyms-objs   := genksyms.o parse.tab.o lex.lex.o
>
>  # -I needed for generated C source (shipped source)
>  HOSTCFLAGS_parse.tab.o := -Wno-uninitialized -I$(src)
> +HOSTCFLAGS_lex.lex.o := -I$(src)
>
>  $(obj)/parse.tab.o: $(obj)/parse.tab.c $(obj)/parse.tab.h
>
> Michal
>

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [RFCv5] Kbuild: factor parser rules
  2011-06-08 16:11           ` Arnaud Lacombe
@ 2011-06-08 20:34             ` Michal Marek
  2011-06-08 21:10               ` Arnaud Lacombe
  0 siblings, 1 reply; 32+ messages in thread
From: Michal Marek @ 2011-06-08 20:34 UTC (permalink / raw)
  To: Arnaud Lacombe; +Cc: linux-kbuild

Dne 8.6.2011 18:11, Arnaud Lacombe napsal(a):
> Hi,
> 
> On Wed, Jun 8, 2011 at 11:38 AM, Michal Marek <mmarek@suse.cz> wrote:
>> On Wed, Jun 08, 2011 at 01:03:28AM -0400, Arnaud Lacombe wrote:
>>> Hi Michal,
>>>
>>> Here is some update concerning the parser generation merge. I do not repost the
>>> whole serie as it may be overkill. You can find the latest branch at:
>>>
>>> git://github.com/lacombar/linux-2.6.git kbuild-implicit-parser-rule
>>>
>>> So let't get it done the safe way...
>>>
>>> Changes since v4:
>>> [...]
>>
>>
>> Hi, I found now what my problem with genksyms was. I use O= and you
>> removed the -I$(src) for the lexer (which is a generated file, but needs
>> genksyms.h from the source directory). With the following patch,
>> everything should work again (test builds still running, but they built
>> genksyms already):
>>
> yes, I spotted that yesterday, this is fixed in v5.

Then please push it to github :)

$ git ls-remote git://github.com/lacombar/linux-2.6.git | grep
kbuild-implicit-parser-rule
a483784894fcbba51be58afc4a2ff1373ed96ca0
refs/heads/kbuild-implicit-parser-rule
$ git show
a483784894fcbba51be58afc4a2ff1373ed96ca0:scripts/genksyms/Makefile |
grep FLAGS
HOSTCFLAGS_parse.tab.o := -Wno-uninitialized -I$(src)
$

Michal

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [RFCv5] Kbuild: factor parser rules
  2011-06-08 20:34             ` Michal Marek
@ 2011-06-08 21:10               ` Arnaud Lacombe
  2011-06-09 12:09                 ` Michal Marek
  0 siblings, 1 reply; 32+ messages in thread
From: Arnaud Lacombe @ 2011-06-08 21:10 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild

Hi,

On Wed, Jun 8, 2011 at 4:34 PM, Michal Marek <mmarek@suse.cz> wrote:
> Dne 8.6.2011 18:11, Arnaud Lacombe napsal(a):
>> Hi,
>>
>> On Wed, Jun 8, 2011 at 11:38 AM, Michal Marek <mmarek@suse.cz> wrote:
>>> On Wed, Jun 08, 2011 at 01:03:28AM -0400, Arnaud Lacombe wrote:
>>>> Hi Michal,
>>>>
>>>> Here is some update concerning the parser generation merge. I do not repost the
>>>> whole serie as it may be overkill. You can find the latest branch at:
>>>>
>>>> git://github.com/lacombar/linux-2.6.git kbuild-implicit-parser-rule
>>>>
>>>> So let't get it done the safe way...
>>>>
>>>> Changes since v4:
>>>> [...]
>>>
>>>
>>> Hi, I found now what my problem with genksyms was. I use O= and you
>>> removed the -I$(src) for the lexer (which is a generated file, but needs
>>> genksyms.h from the source directory). With the following patch,
>>> everything should work again (test builds still running, but they built
>>> genksyms already):
>>>
>> yes, I spotted that yesterday, this is fixed in v5.
>
> Then please push it to github :)
>
@#$... I should stop sending stuff at 1 a.m. This is now fixed. New
head is c51572047d18641be2350d188f9493f6a39f6b26.

Btw, as a small remainder, none of the patch are Signed-off. When
you'll be happy with the branch, I'll post the serie for final review.

 - Arnaud

> $ git ls-remote git://github.com/lacombar/linux-2.6.git | grep
> kbuild-implicit-parser-rule
> a483784894fcbba51be58afc4a2ff1373ed96ca0
> refs/heads/kbuild-implicit-parser-rule
> $ git show
> a483784894fcbba51be58afc4a2ff1373ed96ca0:scripts/genksyms/Makefile |
> grep FLAGS
> HOSTCFLAGS_parse.tab.o := -Wno-uninitialized -I$(src)
> $
>
> Michal
>

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [RFCv5] Kbuild: factor parser rules
  2011-06-08 21:10               ` Arnaud Lacombe
@ 2011-06-09 12:09                 ` Michal Marek
  2011-06-09 18:16                   ` Arnaud Lacombe
  0 siblings, 1 reply; 32+ messages in thread
From: Michal Marek @ 2011-06-09 12:09 UTC (permalink / raw)
  To: Arnaud Lacombe; +Cc: linux-kbuild

On 8.6.2011 23:10, Arnaud Lacombe wrote:
> @#$... I should stop sending stuff at 1 a.m. This is now fixed. New
> head is c51572047d18641be2350d188f9493f6a39f6b26.
>
> Btw, as a small remainder, none of the patch are Signed-off. When
> you'll be happy with the branch, I'll post the serie for final review.

Thanks, this looks perfect now, please add your signoffs and push once more.

Michal

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [RFCv5] Kbuild: factor parser rules
  2011-06-09 12:09                 ` Michal Marek
@ 2011-06-09 18:16                   ` Arnaud Lacombe
  2011-06-23 21:07                     ` Michal Marek
  0 siblings, 1 reply; 32+ messages in thread
From: Arnaud Lacombe @ 2011-06-09 18:16 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild

Hi,

On Thu, Jun 9, 2011 at 8:09 AM, Michal Marek <mmarek@suse.cz> wrote:
> On 8.6.2011 23:10, Arnaud Lacombe wrote:
>>
>> @#$... I should stop sending stuff at 1 a.m. This is now fixed. New
>> head is c51572047d18641be2350d188f9493f6a39f6b26.
>>
>> Btw, as a small remainder, none of the patch are Signed-off. When
>> you'll be happy with the branch, I'll post the serie for final review.
>
> Thanks, this looks perfect now, please add your signoffs and push once more.
>
Done,

The following changes since commit 55922c9d1b84b89cb946c777fddccb3247e7df2c:

  Linux 3.0-rc1 (2011-05-29 17:43:36 -0700)

are available in the git repository at:
  git@github.com:lacombar/linux-2.6.git kbuild-implicit-parser-rule

Arnaud Lacombe (14):
      kbuild: add `baseprereq'
      kbuild: add implicit rules for parser generation
      kbuild: simplify the %_shipped rule
      genksyms: pass hash and lookup functions name and target
language though the input file
      genksyms: drop -Wno-uninitialized from HOSTCFLAGS_parse.tab.o
      genksyms: migrate parser to implicit rules
      genksym: regen parser
      kconfig: constify `kconf_id_lookup'
      kconfig: kill no longer needed reference to YYDEBUG
      kconfig/zconf.l: do not ask to generate backup
      kconfig: migrate parser to implicit rules
      kconfig: regen parser
      dtc: migrate parser to implicit rules
      dtc: regen parser

 scripts/Kbuild.include                             |    4 +
 scripts/Makefile.lib                               |   40 +++-
 scripts/dtc/Makefile                               |   28 +--
 scripts/dtc/dtc-lexer.lex.c_shipped                |   59 +---
 scripts/dtc/dtc-parser.tab.c_shipped               |  116 +------
 scripts/dtc/dtc-parser.tab.h_shipped               |   11 +-
 scripts/genksyms/.gitignore                        |    7 +-
 scripts/genksyms/Makefile                          |   48 +---
 scripts/genksyms/keywords.gperf                    |    3 +
 ...{keywords.c_shipped => keywords.hash.c_shipped} |   96 +++---
 scripts/genksyms/lex.l                             |    4 +-
 .../genksyms/{lex.c_shipped => lex.lex.c_shipped}  |  359 +-------------------
 .../{parse.c_shipped => parse.tab.c_shipped}       |  198 +----------
 .../{parse.h_shipped => parse.tab.h_shipped}       |    7 +-
 scripts/kconfig/.gitignore                         |    2 +-
 scripts/kconfig/Makefile                           |   34 +--
 scripts/kconfig/lkc.h                              |    2 -
 scripts/kconfig/zconf.gperf                        |    2 +-
 scripts/kconfig/zconf.hash.c_shipped               |  273 +++++++++-------
 scripts/kconfig/zconf.l                            |    8 +-
 .../{lex.zconf.c_shipped => zconf.lex.c_shipped}   |   26 +--
 scripts/kconfig/zconf.tab.c_shipped                |   68 ++--
 scripts/kconfig/zconf.y                            |   18 +-
 23 files changed, 370 insertions(+), 1043 deletions(-)
 rename scripts/genksyms/{keywords.c_shipped => keywords.hash.c_shipped} (94%)
 rename scripts/genksyms/{lex.c_shipped => lex.lex.c_shipped} (89%)
 rename scripts/genksyms/{parse.c_shipped => parse.tab.c_shipped} (92%)
 rename scripts/genksyms/{parse.h_shipped => parse.tab.h_shipped} (96%)
 rename scripts/kconfig/{lex.zconf.c_shipped => zconf.lex.c_shipped} (98%)

 - Arnaud

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [RFCv5] Kbuild: factor parser rules
  2011-06-09 18:16                   ` Arnaud Lacombe
@ 2011-06-23 21:07                     ` Michal Marek
  0 siblings, 0 replies; 32+ messages in thread
From: Michal Marek @ 2011-06-23 21:07 UTC (permalink / raw)
  To: Arnaud Lacombe; +Cc: linux-kbuild

On 9.6.2011 20:16, Arnaud Lacombe wrote:
> Hi,
> 
> On Thu, Jun 9, 2011 at 8:09 AM, Michal Marek <mmarek@suse.cz> wrote:
>> On 8.6.2011 23:10, Arnaud Lacombe wrote:
>>>
>>> @#$... I should stop sending stuff at 1 a.m. This is now fixed. New
>>> head is c51572047d18641be2350d188f9493f6a39f6b26.
>>>
>>> Btw, as a small remainder, none of the patch are Signed-off. When
>>> you'll be happy with the branch, I'll post the serie for final review.
>>
>> Thanks, this looks perfect now, please add your signoffs and push once more.
>>
> Done,
> 
> The following changes since commit 55922c9d1b84b89cb946c777fddccb3247e7df2c:
> 
>   Linux 3.0-rc1 (2011-05-29 17:43:36 -0700)
> 
> are available in the git repository at:
>   git@github.com:lacombar/linux-2.6.git kbuild-implicit-parser-rule

Merged now, sorry for the delay.

Michal

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2011-06-23 21:07 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-23  8:10 [RFCv2 00/13] Kbuild: factor parser rules Arnaud Lacombe
2011-05-23  8:10 ` [RFCv2 01/13] kbuild: add implicit rules for parser generation Arnaud Lacombe
2011-05-23  8:10 ` [RFCv2 02/13] genksyms: include the lexer from the parser Arnaud Lacombe
2011-05-23  8:10 ` [RFCv2 03/13] genksyms: pass hash and lookup functions name and target language though the input file Arnaud Lacombe
2011-05-23  8:10 ` [RFCv2 04/13] genksyms: migrate parser to implicit rules Arnaud Lacombe
2011-05-23  8:10 ` [RFCv2 05/13] genksym: regen parser Arnaud Lacombe
2011-05-23  8:10 ` [RFCv2 06/13] kconfig: constify `kconf_id_lookup' Arnaud Lacombe
2011-05-23  8:10 ` [RFCv2 07/13] kconfig: back-out parser prefix, from `zconf' to `yy' Arnaud Lacombe
2011-05-23  8:54   ` Yann E. MORIN
2011-05-23  9:07     ` Arnaud Lacombe
2011-05-23  8:10 ` [RFCv2 08/13] kconfig: kill no longer needed reference to YYDEBUG Arnaud Lacombe
2011-05-23  8:10 ` [RFCv2 09/13] kconfig: migrate parser to implicit rules Arnaud Lacombe
2011-05-23  8:10 ` [RFCv2 10/13] kconfig: regen parser Arnaud Lacombe
2011-05-23  8:10 ` [RFCv2 11/13] dtc: include the lexer from the parser Arnaud Lacombe
2011-05-23  8:10 ` [RFCv2 12/13] dtc: migrate parser to implicit rules Arnaud Lacombe
2011-05-23  8:10 ` [RFCv2 13/13] dtc: regen parser Arnaud Lacombe
2011-05-23  8:39 ` [RFCv2 00/13] Kbuild: factor parser rules Arnaud Lacombe
2011-05-24 10:47 ` Michal Marek
2011-05-24 14:18   ` Arnaud Lacombe
2011-06-03 17:16 ` [RFCv3] " Arnaud Lacombe
2011-06-07 15:29   ` Michal Marek
2011-06-07 15:52     ` Arnaud Lacombe
2011-06-07 20:52     ` [RFCv4] " Arnaud Lacombe
2011-06-07 21:27       ` Arnaud Lacombe
2011-06-08  5:03       ` [RFCv5] " Arnaud Lacombe
2011-06-08 15:38         ` Michal Marek
2011-06-08 16:11           ` Arnaud Lacombe
2011-06-08 20:34             ` Michal Marek
2011-06-08 21:10               ` Arnaud Lacombe
2011-06-09 12:09                 ` Michal Marek
2011-06-09 18:16                   ` Arnaud Lacombe
2011-06-23 21:07                     ` Michal Marek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.