summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/config/parser.yy
diff options
context:
space:
mode:
authorschodet2005-04-13 21:08:01 +0000
committerschodet2005-04-13 21:08:01 +0000
commitaffc465467f55b37cbde63b1c60aa5298a14da4f (patch)
tree66f8f7bd4d620b0cd2d9ed6e64bff4cccc8ee32e /2005/i/robert/src/config/parser.yy
parentce622316783e905dcf67d0b647f70d5299136faf (diff)
Finition de config.
Diffstat (limited to '2005/i/robert/src/config/parser.yy')
-rw-r--r--2005/i/robert/src/config/parser.yy47
1 files changed, 42 insertions, 5 deletions
diff --git a/2005/i/robert/src/config/parser.yy b/2005/i/robert/src/config/parser.yy
index 4bd744f..3397c57 100644
--- a/2005/i/robert/src/config/parser.yy
+++ b/2005/i/robert/src/config/parser.yy
@@ -67,18 +67,19 @@ void yyerror (const char *);
%token IMG DATA
%type<a> int_list
-//%type<a> float_list
-//%type<a> string_list
+%type<a> float_list
+%type<a> string_list
%destructor { delete $$; } ID STRING
%destructor { delete $$.a; } int_list
-//%destructor { delete $$.a; } float_list
-//%destructor { delete $$.a; } string_list
+%destructor { delete $$.a; } float_list
+%destructor { delete $$.a; } string_list
%%
input:
- confitem
+ /* Nothing. */
+ | confitem
| input '\n' confitem
| input '\n'
;
@@ -102,6 +103,16 @@ confitem:
delete $1;
delete $4.a;
}
+ | ID '=' '(' float_list ')' {
+ yyextra->configData.add (*$1, *$4.a);
+ delete $1;
+ delete $4.a;
+ }
+ | ID '=' '(' string_list ')' {
+ yyextra->configData.add (*$1, *$4.a);
+ delete $1;
+ delete $4.a;
+ }
;
int_list:
@@ -116,6 +127,32 @@ int_list:
}
;
+float_list:
+ FLOAT {
+ $$.a = new any (Config::FloatList ());
+ $$.fl = any_cast<Config::FloatList> ($$.a);
+ $$.fl->push_back ($1);
+ }
+ | float_list FLOAT {
+ $1.fl->push_back ($2);
+ $$ = $1;
+ }
+;
+
+string_list:
+ STRING {
+ $$.a = new any (Config::StringList ());
+ $$.sl = any_cast<Config::StringList> ($$.a);
+ $$.sl->push_back (*$1);
+ delete $1;
+ }
+ | string_list STRING {
+ $1.sl->push_back (*$2);
+ $$ = $1;
+ delete $2;
+ }
+;
+
%%
void yyerror (const char *e)