Allows multiple attribute instances.
This patch adds the ability to have multiple attribute instances (e.g. (* foo = 1 *) (* bar = 2 *)).
This commit is contained in:
parent
c90a896448
commit
468fd3d683
19
parse.y
19
parse.y
|
|
@ -426,7 +426,7 @@ static list<named_pexpr_t>* make_named_number(perm_string name, PExpr*val =0)
|
||||||
%type <named_pexprs> port_name_list parameter_value_byname_list
|
%type <named_pexprs> port_name_list parameter_value_byname_list
|
||||||
|
|
||||||
%type <named_pexpr> attribute
|
%type <named_pexpr> attribute
|
||||||
%type <named_pexprs> attribute_list attribute_list_opt
|
%type <named_pexprs> attribute_list attribute_instance_list attribute_list_opt
|
||||||
|
|
||||||
%type <citem> case_item
|
%type <citem> case_item
|
||||||
%type <citems> case_items
|
%type <citems> case_items
|
||||||
|
|
@ -522,11 +522,24 @@ real_or_realtime
|
||||||
variety of different objects. The syntax inside the (* *) is a
|
variety of different objects. The syntax inside the (* *) is a
|
||||||
comma separated list of names or names with assigned values. */
|
comma separated list of names or names with assigned values. */
|
||||||
attribute_list_opt
|
attribute_list_opt
|
||||||
: K_PSTAR attribute_list K_STARP { $$ = $2; }
|
: attribute_instance_list
|
||||||
| K_PSTAR K_STARP { $$ = 0; }
|
|
||||||
| { $$ = 0; }
|
| { $$ = 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<named_pexpr_t>*tmp = $1;
|
||||||
|
if (tmp) {
|
||||||
|
tmp->splice(tmp->end(), *$3);
|
||||||
|
delete $3;
|
||||||
|
$$ = tmp;
|
||||||
|
} else $$ = $3;
|
||||||
|
}
|
||||||
|
;
|
||||||
|
|
||||||
attribute_list
|
attribute_list
|
||||||
: attribute_list ',' attribute
|
: attribute_list ',' attribute
|
||||||
{ list<named_pexpr_t>*tmp = $1;
|
{ list<named_pexpr_t>*tmp = $1;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue