diff --git a/parse.y b/parse.y index 9ad2c3e4f..75ff5b473 100644 --- a/parse.y +++ b/parse.y @@ -426,7 +426,7 @@ static list* make_named_number(perm_string name, PExpr*val =0) %type port_name_list parameter_value_byname_list %type attribute -%type attribute_list attribute_list_opt +%type attribute_list attribute_instance_list attribute_list_opt %type case_item %type case_items @@ -522,11 +522,24 @@ real_or_realtime variety of different objects. The syntax inside the (* *) is a comma separated list of names or names with assigned values. */ attribute_list_opt - : K_PSTAR attribute_list K_STARP { $$ = $2; } - | K_PSTAR K_STARP { $$ = 0; } + : attribute_instance_list | { $$ = 0; } ; +attribute_instance_list + : K_PSTAR K_STARP { $$ = 0; } + | K_PSTAR attribute_list K_STARP { $$ = $2; } + | attribute_instance_list K_PSTAR K_STARP { $$ = $1; } + | attribute_instance_list K_PSTAR attribute_list K_STARP + { list*tmp = $1; + if (tmp) { + tmp->splice(tmp->end(), *$3); + delete $3; + $$ = tmp; + } else $$ = $3; + } + ; + attribute_list : attribute_list ',' attribute { list*tmp = $1;