summaryrefslogtreecommitdiffstats
path: root/src/build/ifcompiler/initCompiler.y
diff options
context:
space:
mode:
authorCamVan Nguyen <ctnguyen@us.ibm.com>2011-11-10 13:22:16 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2011-11-15 18:13:18 -0600
commit4d9344f1025ee77e24e88249dd3e32f3d4c9a3ba (patch)
treed3d41ed886b43bf0a0f955702d207b31c3050510 /src/build/ifcompiler/initCompiler.y
parent22b8b1dc178665eb32f923e47211f549b4d1913f (diff)
downloadtalos-hostboot-4d9344f1025ee77e24e88249dd3e32f3d4c9a3ba.tar.gz
talos-hostboot-4d9344f1025ee77e24e88249dd3e32f3d4c9a3ba.zip
Added initfile compiler support for attribute enums
Change-Id: I78a2a85831b545e7213e08a272fec482bd69cdf1 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/493 Tested-by: Jenkins Server Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com> Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/build/ifcompiler/initCompiler.y')
-rwxr-xr-xsrc/build/ifcompiler/initCompiler.y5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/build/ifcompiler/initCompiler.y b/src/build/ifcompiler/initCompiler.y
index 672a2039e..4c86575d0 100755
--- a/src/build/ifcompiler/initCompiler.y
+++ b/src/build/ifcompiler/initCompiler.y
@@ -22,6 +22,7 @@
// D754106 dgilbert 06/14/10 Create
// D774126 dgilbert 09/30/10 Add ERROR: to yyerror message
// andrewg 09/19/11 Updates based on review
+// camvanng 11/08/11 Added support for attribute enums
// End Change Log *********************************************************************************
/**
* @file initCompiler.y
@@ -76,6 +77,7 @@ int scom;
%token <str_ptr> INIT_ID
%token <str_ptr> INIT_VERSIONS
%token <str_ptr> ATTRIBUTE_INDEX
+%token <str_ptr> ATTRIBUTE_ENUM
/* Define terminal symbols that don't have any associated data */
@@ -233,6 +235,7 @@ idrows: id_col { init::dbg << $1->listing(NULL); current_scom->add_row_
id_col: INIT_ID { $$ = new init::Rpn(*($1),yyscomlist->get_symbols()); $$->push_op(init::Rpn::EQ); delete $1; }
| INIT_INTEGER { $$ = new init::Rpn($1,yyscomlist->get_symbols()); $$->push_op(init::Rpn::EQ); }
| '{' num_list '}' { $$ = $2; $2->push_op(init::Rpn::LIST); $2->push_op(init::Rpn::EQ); }
+ | ATTRIBUTE_ENUM { $$ = new init::Rpn((yyscomlist->get_symbols())->get_attr_enum_val(*($1)),yyscomlist->get_symbols()); $$->push_op(init::Rpn::EQ); delete $1; }
;
@@ -241,6 +244,7 @@ num_list: INIT_INTEGER { $$ = new init::Rpn($1,yyscomlist->get_symbols());
| INIT_ID { $$ = new init::Rpn(*($1),yyscomlist->get_symbols()); }
| num_list ',' INIT_INTEGER { $$ = $1; $1->merge(new init::Rpn($3,yyscomlist->get_symbols())); }
| num_list ',' INIT_ID { $$ = $1; $1->merge(new init::Rpn(*($3),yyscomlist->get_symbols())); }
+ | ATTRIBUTE_ENUM { $$ = new init::Rpn((yyscomlist->get_symbols())->get_attr_enum_val(*($1)),yyscomlist->get_symbols()); }
;
@@ -255,6 +259,7 @@ define: INIT_DEFINE INIT_ID '=' expr ';'
/* expr should return an RPN string of some kind */
expr: INIT_INTEGER { $$= new init::Rpn($1,yyscomlist->get_symbols()); }
| INIT_ID { $$= new init::Rpn(*($1),yyscomlist->get_symbols()); delete $1; }
+ | ATTRIBUTE_ENUM { $$= new init::Rpn((yyscomlist->get_symbols())->get_attr_enum_val(*($1)),yyscomlist->get_symbols()); delete $1; }
| INIT_INT64 { $$=new init::Rpn($1,yyscomlist->get_symbols()); }
| expr ATTRIBUTE_INDEX { $1->push_array_index(*($2)); }
| expr INIT_LOGIC_OR expr { $$ = $1->push_merge($3,init::Rpn::OR); }
OpenPOWER on IntegriCloud