* Help by KConfig expansion
@ 2005-09-16 8:12 Ahmad Reza Cheraghi
2005-09-17 1:43 ` Roman Zippel
0 siblings, 1 reply; 5+ messages in thread
From: Ahmad Reza Cheraghi @ 2005-09-16 8:12 UTC (permalink / raw)
To: linux-kernel
Im all the time going through all the file in the
<KERNEL>/scripts/kconfig without any success. I dont
find any beginning and any end.
I want to expand the Kconfig by a new Attribute. The
property of the attribute is just to give out the
message that is written beside it, to a new component
of the struct menu or struct poperty.
e.g.
config BLA
bool "bla"
auto "blabla"
That what is written beside the "auto" should save in
the Component called char *auto in one of the above
mentioned struct. There must be some changes in the
file zconf.tab.c. Any Suggestion how to this??
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Help by KConfig expansion
2005-09-16 8:12 Help by KConfig expansion Ahmad Reza Cheraghi
@ 2005-09-17 1:43 ` Roman Zippel
2005-09-19 16:57 ` Ahmad Reza Cheraghi
0 siblings, 1 reply; 5+ messages in thread
From: Roman Zippel @ 2005-09-17 1:43 UTC (permalink / raw)
To: Ahmad Reza Cheraghi; +Cc: linux-kernel
Hi,
On Fri, 16 Sep 2005, Ahmad Reza Cheraghi wrote:
> That what is written beside the "auto" should save in
> the Component called char *auto in one of the above
> mentioned struct. There must be some changes in the
> file zconf.tab.c. Any Suggestion how to this??
You have to modify zconf.l/zconf.y for this and regenerate this file
(check the Makefile). First you have to define the keywords in zconf.l
and then extend the parser in zconf.y to recognize them and add the data
to the internal structures.
bye, Roman
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Help by KConfig expansion
2005-09-17 1:43 ` Roman Zippel
@ 2005-09-19 16:57 ` Ahmad Reza Cheraghi
2005-09-19 17:06 ` Sam Ravnborg
0 siblings, 1 reply; 5+ messages in thread
From: Ahmad Reza Cheraghi @ 2005-09-19 16:57 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1230 bytes --]
Dear Roman
> You have to modify zconf.l/zconf.y for this and
> regenerate this file
> (check the Makefile). First you have to define the
> keywords in zconf.l
> and then extend the parser in zconf.y to recognize
> them and add the data
> to the internal structures.
I tryed to do this. I saw how the attribute "comment"
is definded in the zconf.l and zconf.y, and definded
the the attribute "autorule" exactly the same way. But
it still don't work. Even though I changed the
zconf.tab.c_shipped as well but it still dont work. I
dont understand the switch-case for yyn(line 1274 in
zconf.tab.c_shipped). Why does a the function
"menu_add_prop(P_COMMENT...)" (line 1587) gets called
by the case 75? How do you declare such a case number?
e.g. case 100 should calle
"menu_add_prop(P_AUTORULE...)".
I seriously wouldn't take your time by asking that, if
I didn't tryed any thing out, what comes up in my
mind. I realy cant figure it out by myself. I send you
diff file(patch) of what I changed. To see me what I
did wrong and what I should do.
Your sincerly
A.R.Cheraghi
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
[-- Attachment #2: pat1604154112 --]
[-- Type: application/octet-stream, Size: 6667 bytes --]
diff -uNr linux.org/arch/i386/Kconfig linux-2.6.13/arch/i386/Kconfig
--- linux.org/arch/i386/Kconfig 2005-08-29 01:41:01.000000000 +0200
+++ linux-2.6.13/arch/i386/Kconfig 2005-09-19 03:08:48.000000000 +0200
@@ -8,6 +8,7 @@
config X86
bool
default y
+ autorule
help
This is Linux's home port. Linux was originally native to the Intel
386, and runs on all the later x86 processors including the Intel
diff -uNr linux.org/scripts/kconfig/expr.h linux-2.6.13/scripts/kconfig/expr.h
--- linux.org/scripts/kconfig/expr.h 2005-08-29 01:41:01.000000000 +0200
+++ linux-2.6.13/scripts/kconfig/expr.h 2005-09-19 02:38:43.000000000 +0200
@@ -101,7 +101,7 @@
#define SYMBOL_HASHMASK 0xff
enum prop_type {
- P_UNKNOWN, P_PROMPT, P_COMMENT, P_MENU, P_DEFAULT, P_CHOICE, P_SELECT, P_RANGE
+ P_UNKNOWN, P_PROMPT, P_COMMENT, P_MENU, P_DEFAULT, P_CHOICE, P_SELECT, P_RANGE, P_AUTORULE
};
struct property {
diff -uNr linux.org/scripts/kconfig/lex.zconf.c_shipped linux-2.6.13/scripts/kconfig/lex.zconf.c_shipped
--- linux.org/scripts/kconfig/lex.zconf.c_shipped 2005-08-29 01:41:01.000000000 +0200
+++ linux-2.6.13/scripts/kconfig/lex.zconf.c_shipped 2005-09-19 03:24:56.000000000 +0200
@@ -2755,6 +2755,11 @@
break;
}
+case 100:
+YY_RULE_SETUP
+BEGIN(PARAM); return T_AUTORULE;
+ YY_BREAK
+
default:
YY_FATAL_ERROR(
"fatal flex scanner internal error--no action found" );
Binärdateien linux.org/scripts/kconfig/.lex.zconf.c_shipped.swp and linux-2.6.13/scripts/kconfig/.lex.zconf.c_shipped.swp sind verschieden.
diff -uNr linux.org/scripts/kconfig/symbol.c linux-2.6.13/scripts/kconfig/symbol.c
--- linux.org/scripts/kconfig/symbol.c 2005-08-29 01:41:01.000000000 +0200
+++ linux-2.6.13/scripts/kconfig/symbol.c 2005-09-19 02:51:06.000000000 +0200
@@ -799,6 +799,8 @@
return "prompt";
case P_COMMENT:
return "comment";
+ case P_AUTORULE:
+ return "autorule";
case P_MENU:
return "menu";
case P_DEFAULT:
diff -uNr linux.org/scripts/kconfig/zconf.l linux-2.6.13/scripts/kconfig/zconf.l
--- linux.org/scripts/kconfig/zconf.l 2005-08-29 01:41:01.000000000 +0200
+++ linux-2.6.13/scripts/kconfig/zconf.l 2005-09-19 03:35:40.000000000 +0200
@@ -117,6 +117,7 @@
"select" BEGIN(PARAM); return T_SELECT;
"enable" BEGIN(PARAM); return T_SELECT;
"range" BEGIN(PARAM); return T_RANGE;
+ "autorule" BEGIN(PARAM); return T_AUTORULE;
{n}+ {
alloc_string(yytext, yyleng);
zconflval.string = text;
diff -uNr linux.org/scripts/kconfig/zconf.tab.c_shipped linux-2.6.13/scripts/kconfig/zconf.tab.c_shipped
--- linux.org/scripts/kconfig/zconf.tab.c_shipped 2005-08-29 01:41:01.000000000 +0200
+++ linux-2.6.13/scripts/kconfig/zconf.tab.c_shipped 2005-09-19 03:15:39.000000000 +0200
@@ -100,7 +100,8 @@
T_OR = 293,
T_AND = 294,
T_EQUAL = 295,
- T_NOT = 296
+ T_NOT = 296,
+ T_AUTORULE = 297
};
#endif
#define T_MAINMENU 258
@@ -142,6 +143,7 @@
#define T_AND 294
#define T_EQUAL 295
#define T_NOT 296
+#define T_AUTORULE 297
@@ -434,12 +436,12 @@
134, 142, 152, 154, 155, 156, 157, 160, 166, 173,
179, 186, 192, 198, 204, 210, 216, 222, 230, 239,
245, 254, 255, 261, 263, 264, 265, 266, 269, 275,
- 281, 287, 293, 299, 301, 306, 315, 324, 325, 331,
+ 281, 287, 293, 297, 299, 301, 306, 315, 324, 325,
333, 334, 335, 340, 347, 353, 362, 363, 369, 371,
372, 373, 374, 377, 383, 390, 397, 404, 410, 417,
418, 419, 422, 427, 432, 440, 442, 447, 448, 451,
452, 453, 457, 457, 459, 460, 463, 464, 465, 466,
- 467, 468, 469, 472, 473
+ 467, 468, 469, 472, 473, 331
};
#endif
@@ -455,7 +457,7 @@
"T_DEF_TRISTATE", "T_BOOLEAN", "T_DEF_BOOLEAN", "T_STRING", "T_INT",
"T_HEX", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", "T_EOF", "T_EOL",
"T_CLOSE_PAREN", "T_OPEN_PAREN", "T_ON", "T_SELECT", "T_RANGE", "T_OR",
- "T_AND", "T_EQUAL", "T_NOT", "$accept", "input", "block",
+ "T_AND", "T_EQUAL", "T_NOT", "$accept", "input", "block",
"common_block", "config_entry_start", "config_stmt",
"menuconfig_entry_start", "menuconfig_stmt", "config_option_list",
"config_option", "choice", "choice_entry", "choice_end", "choice_stmt",
@@ -463,7 +465,7 @@
"if_stmt", "if_block", "menu", "menu_entry", "menu_end", "menu_stmt",
"menu_block", "source", "source_stmt", "comment", "comment_stmt",
"help_start", "help", "depends_list", "depends", "prompt_stmt_opt",
- "prompt", "end", "nl_or_eof", "if_expr", "expr", "symbol", 0
+ "prompt", "end", "nl_or_eof", "if_expr", "expr", "symbol", "T_AUTORULE", 0
};
#endif
@@ -476,7 +478,7 @@
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
- 295, 296
+ 295, 296, 297
};
# endif
Binärdateien linux.org/scripts/kconfig/.zconf.tab.c_shipped.swp and linux-2.6.13/scripts/kconfig/.zconf.tab.c_shipped.swp sind verschieden.
diff -uNr linux.org/scripts/kconfig/zconf.tab.h_shipped linux-2.6.13/scripts/kconfig/zconf.tab.h_shipped
--- linux.org/scripts/kconfig/zconf.tab.h_shipped 2005-08-29 01:41:01.000000000 +0200
+++ linux-2.6.13/scripts/kconfig/zconf.tab.h_shipped 2005-09-19 02:57:25.000000000 +0200
@@ -65,6 +65,7 @@
T_AND = 288,
T_EQUAL = 289,
T_NOT = 290
+ T_AUTORULE = 297
};
#endif
#define T_MAINMENU 258
@@ -100,7 +101,7 @@
#define T_AND 288
#define T_EQUAL 289
#define T_NOT 290
-
+#define T_AUTORULE 297
diff -uNr linux.org/scripts/kconfig/zconf.y linux-2.6.13/scripts/kconfig/zconf.y
--- linux.org/scripts/kconfig/zconf.y 2005-08-29 01:41:01.000000000 +0200
+++ linux-2.6.13/scripts/kconfig/zconf.y 2005-09-19 03:29:44.000000000 +0200
@@ -75,6 +75,7 @@
%token T_ON
%token T_SELECT
%token T_RANGE
+%token T_AUTORULE
%left T_OR
%left T_AND
@@ -401,6 +402,14 @@
menu_end_entry();
};
+autorule: T_AUTORULE prompt T_EOL
+{
+ menu_add_entry(NULL);
+ menu_add_prop(P_AUTORULE, $2, NULL, NULL);
+ printd(DEBUG_PARSE, "%s:%d:autorule\n", zconf_curname(), zconf_lineno());
+};
+
+
/* help option */
help_start: T_HELP T_EOL
@@ -651,6 +660,11 @@
print_quoted_string(out, prop->text);
fputs("\n", out);
break;
+ case P_AUTORULE:
+ fputs("\nautorule ", out);
+ print_quoted_string(out, prop->text);
+ fputs("\n", out);
+ break;
case P_MENU:
fputs("\nmenu ", out);
print_quoted_string(out, prop->text);
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Help by KConfig expansion
2005-09-19 16:57 ` Ahmad Reza Cheraghi
@ 2005-09-19 17:06 ` Sam Ravnborg
2005-09-19 22:01 ` Ahmad Reza Cheraghi
0 siblings, 1 reply; 5+ messages in thread
From: Sam Ravnborg @ 2005-09-19 17:06 UTC (permalink / raw)
To: Ahmad Reza Cheraghi; +Cc: linux-kernel
> I tryed to do this. I saw how the attribute "comment"
> is definded in the zconf.l and zconf.y, and definded
> the the attribute "autorule" exactly the same way. But
> it still don't work. Even though I changed the
> zconf.tab.c_shipped as well but it still dont work.
You need to generate the source using bison.
You must understand that zconf.l is an input file for flex.
Likewise zconf.y is input for bison.
See scripts/kconfig/Makefile for how to generate the files.
Sam
Or even simpler - apply following patch:
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -129,9 +129,9 @@ HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.
$(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o $(obj)/kxgettext: $(obj)/zconf.tab.h
-$(obj)/zconf.tab.h: $(src)/zconf.tab.h_shipped
-$(obj)/zconf.tab.c: $(src)/zconf.tab.c_shipped
-$(obj)/lex.zconf.c: $(src)/lex.zconf.c_shipped
+#$(obj)/zconf.tab.h: $(src)/zconf.tab.h_shipped
+#$(obj)/zconf.tab.c: $(src)/zconf.tab.c_shipped
+#$(obj)/lex.zconf.c: $(src)/lex.zconf.c_shipped
$(obj)/qconf.o: $(obj)/.tmp_qtcheck
@@ -212,7 +212,7 @@ $(obj)/lkc_defs.h: $(src)/lkc_proto.h
# The following requires flex/bison
# By default we use the _shipped versions, uncomment the following line if
# you are modifying the flex/bison src.
-# LKC_GENPARSER := 1
+LKC_GENPARSER := 1
ifdef LKC_GENPARSER
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Help by KConfig expansion
2005-09-19 17:06 ` Sam Ravnborg
@ 2005-09-19 22:01 ` Ahmad Reza Cheraghi
0 siblings, 0 replies; 5+ messages in thread
From: Ahmad Reza Cheraghi @ 2005-09-19 22:01 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: linux-kernel
--- Sam Ravnborg <sam@ravnborg.org> wrote:
> > I tryed to do this. I saw how the attribute
> "comment"
> > is definded in the zconf.l and zconf.y, and
> definded
> > the the attribute "autorule" exactly the same way.
> But
> > it still don't work. Even though I changed the
> > zconf.tab.c_shipped as well but it still dont
> work.
>
> You need to generate the source using bison.
> You must understand that zconf.l is an input file
> for flex.
> Likewise zconf.y is input for bison.
>
> See scripts/kconfig/Makefile for how to generate the
> files.
>
It works. Thanks you very much.
Regards
A.R.Cheraghi
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-09-19 22:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-16 8:12 Help by KConfig expansion Ahmad Reza Cheraghi
2005-09-17 1:43 ` Roman Zippel
2005-09-19 16:57 ` Ahmad Reza Cheraghi
2005-09-19 17:06 ` Sam Ravnborg
2005-09-19 22:01 ` Ahmad Reza Cheraghi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®