From 4f22177aa5fdbdd8166ba59938018fc53a4ad2ba Mon Sep 17 00:00:00 2001 From: Greg Watson Date: Wed, 25 Jun 2003 15:27:41 +0000 Subject: Simple printing of options. Will make this better. git-svn-id: svn://svn.coreboot.org/coreboot/trunk@916 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/newconfig/config.g | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'util/newconfig/config.g') diff --git a/util/newconfig/config.g b/util/newconfig/config.g index e6a3787f62..41e0726e9f 100644 --- a/util/newconfig/config.g +++ b/util/newconfig/config.g @@ -1101,13 +1101,19 @@ parser Config: rule option<>: OPTION ID EQ value {{ if (C): setoptionstmt(ID, value) }} - rule opif: IF ID {{ c = lookup(ID) }} - (option<>)* [ ELSE (option<>)* ] END + rule opif<>: IF ID {{ c = lookup(ID) }} + (opstmt<>)* + [ ELSE (opstmt<>)* ] END + + rule opstmt<>: option<> + | opif<> + | pprint<> - rule opstmt: option<<1>> - | opif # print clashes with a python keyword - rule pprint<>: PRINT STR {{ if (C): print "%s\n"%STR}} + rule pprint<>: PRINT + ( STR {{ if (C): print "%s" % dequote(STR) }} + | ID {{ if (C): print "%s" % getformated(ID, curpart) }} + ) # ENTRY for parsing a delayed value rule delexpr: "{" expr "}" {{ return expr }} @@ -1116,7 +1122,7 @@ parser Config: rule board: LOADOPTIONS {{ loadoptions() }} TARGET DIRPATH {{ target(DIRPATH) }} (uses<<1>>)* - (opstmt)* + (opstmt<<1>>)* mainboard {{ return 1 }} rule defstmts<>: {{ d = 0 }} -- cgit v1.2.3