From 5a88cb5c018a7abdf61914c1436a6c57d222e3c6 Mon Sep 17 00:00:00 2001 From: Cary R Date: Tue, 13 Nov 2007 20:49:05 -0800 Subject: [PATCH] Remove shift/reduce problems from dimensions patch. This patch needs to be applied after the dimensions checking patch to remove the shift/reduce errors it created. --- parse.y | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/parse.y b/parse.y index dd08c9ac0..dfd6f39e5 100644 --- a/parse.y +++ b/parse.y @@ -226,7 +226,7 @@ static list* list_from_identifier(list*tmp, char*id) %type cont_assign cont_assign_list %type range range_opt -%type dimensions_opt +%type dimensions_opt dimensions %type net_type var_type net_type_opt %type gatetype %type port_type @@ -2496,7 +2496,10 @@ range_opt ; dimensions_opt : { $$ = 0; } - | '[' expression ':' expression ']' + | dimensions { $$ = $1; } + +dimensions + : '[' expression ':' expression ']' { list *tmp = new list; index_component_t index; if (!pform_expression_is_constant($2)) @@ -2510,7 +2513,7 @@ dimensions_opt tmp->push_back(index); $$ = tmp; } - | dimensions_opt '[' expression ':' expression ']' + | dimensions '[' expression ':' expression ']' { list *tmp = $1; index_component_t index; if (!pform_expression_is_constant($3))