@@ -4007,7 +4007,7 @@ unsigned_number: TOK_NUMBER
4007
4007
// A.8.2 Subroutine calls
4008
4008
4009
4009
tf_call:
4010
- hierarchical_tf_identifier list_of_arguments_paren
4010
+ hierarchical_identifier list_of_arguments_paren_opt
4011
4011
{ init ($$, ID_function_call);
4012
4012
stack_expr ($$).operands ().reserve (2 );
4013
4013
mto ($$, $1 ); mto ($$, $2 ); }
@@ -4020,6 +4020,7 @@ list_of_arguments_paren:
4020
4020
4021
4021
list_of_arguments_paren_opt:
4022
4022
/* Optional */
4023
+ { init ($$); }
4023
4024
| list_of_arguments_paren
4024
4025
;
4025
4026
@@ -4054,8 +4055,17 @@ subroutine_call:
4054
4055
| system_tf_call
4055
4056
;
4056
4057
4057
- function_subroutine_call: subroutine_call
4058
- ;
4058
+ // We deviate from the 1800-2017 grammar to remove the ambiguity
4059
+ // between function calls without parentheses and variables.
4060
+ // Note that this does not affect system function identifiers ($...),
4061
+ // which cannot be variables.
4062
+ function_subroutine_call:
4063
+ hierarchical_tf_identifier list_of_arguments_paren
4064
+ { init ($$, ID_function_call);
4065
+ stack_expr ($$).operands ().reserve (2 );
4066
+ mto ($$, $1 ); mto ($$, $2 ); }
4067
+ | system_tf_call
4068
+ ;
4059
4069
4060
4070
event_trigger: TOK_MINUSGREATER hierarchical_event_identifier ' ;'
4061
4071
{ init ($$, ID_verilog_event_trigger); mto ($$, $2 ); }
0 commit comments