anchor.diff:  pcontrol_terminal : expression ;
   
   cmos_switchtype
  -	: KW_CMOS | KW_RCMOS
  -	;
  +  : KW_CMOS | KW_RCMOS
  +  ;
   enable_gatetype
  -	: KW_BUFIF0 | KW_BUFIF1 | KW_NOTIF0 | KW_NOTIF1
  -	;
  +  : KW_BUFIF0 | KW_BUFIF1 | KW_NOTIF0 | KW_NOTIF1
  +  ;
   mos_switchtype
  -	: KW_NMOS | KW_PMOS | KW_RNMOS | KW_RPMOS
  -	;
  +  : KW_NMOS | KW_PMOS | KW_RNMOS | KW_RPMOS
  +  ;
   n_input_gatetype
  -	: KW_AND | KW_NAND | KW_OR | KW_NOR | KW_XOR | KW_XNOR
  -	;
  +  : KW_AND | KW_NAND | KW_OR | KW_NOR | KW_XOR | KW_XNOR
  +  ;
   n_output_gatetype
  -	: KW_BUF | KW_NOT
  -	;
  +  : KW_BUF | KW_NOT
  +  ;
   pass_en_switchtype
  -	: KW_TRANIF0 | KW_TRANIF1 | KW_RTRANIF1 | KW_RTRANIF0
  -	;
  +  : KW_TRANIF0 | KW_TRANIF1 | KW_RTRANIF1 | KW_RTRANIF0
  +  ;
   pass_switchtype
  -	: KW_TRAN | KW_RTRAN
  -	;
  +  : KW_TRAN | KW_RTRAN
  +  ;
   
   cmos_switch_instance
  -	: name_of_instance? LPAREN output_terminal COMMA input_terminal COMMA ncontrol_terminal COMMA pcontrol_terminal RPAREN
  -	;
  +  : name_of_instance? LPAREN output_terminal COMMA input_terminal COMMA ncontrol_terminal COMMA pcontrol_terminal RPAREN
  +  ;
   
   enable_gate_instance
  -	: name_of_instance? LPAREN output_terminal COMMA input_terminal COMMA enable_terminal RPAREN
  -	;
  +  : name_of_instance? LPAREN output_terminal COMMA input_terminal COMMA enable_terminal RPAREN
  +  ;
   
   mos_switch_instance
  -	: name_of_instance? LPAREN output_terminal COMMA input_terminal COMMA enable_terminal RPAREN
  -	;
  +  : name_of_instance? LPAREN output_terminal COMMA input_terminal COMMA enable_terminal RPAREN
  +  ;
   
   n_input_gate_instance
  -	: name_of_instance? LPAREN output_terminal COMMA input_terminal (COMMA input_terminal)* RPAREN
  -	;
  +  : name_of_instance? LPAREN output_terminal COMMA input_terminal (COMMA input_terminal)* RPAREN
  +  ;
   
   n_output_gate_instance
  -	: name_of_instance? LPAREN output_terminal (COMMA output_terminal)* COMMA input_terminal RPAREN
  -	;
  +  : name_of_instance? LPAREN output_terminal (COMMA output_terminal)* COMMA input_terminal RPAREN
  +  ;
   
   pass_switch_instance
  -	: name_of_instance? LPAREN inout_terminal COMMA inout_terminal RPAREN
  -	;
  +  : name_of_instance? LPAREN inout_terminal COMMA inout_terminal RPAREN
  +  ;
   
   pass_enable_switch_instance
  -	: name_of_instance? LPAREN inout_terminal COMMA inout_terminal COMMA enable_terminal RPAREN
  -	;
  +  : name_of_instance? LPAREN inout_terminal COMMA inout_terminal COMMA enable_terminal RPAREN
  +  ;
   
   pull_gate_instance
  -	: name_of_instance? LPAREN output_terminal RPAREN
  -	;
  +  : name_of_instance? LPAREN output_terminal RPAREN
  +  ;
   
   udp_instantiation
  -	: udp_identifier drive_strength? delay2? udp_instance (COMMA udp_instance)* SEMI
  -	;
  +  : udp_identifier drive_strength? delay2? udp_instance (COMMA udp_instance)* SEMI
  +  ;
   
   udp_instance
  -	: name_of_instance? LPAREN output_terminal COMMA input_terminal (COMMA input_terminal)* RPAREN
  -	;
  +  : name_of_instance? LPAREN output_terminal COMMA input_terminal (COMMA input_terminal)* RPAREN
  +  ;
   
   clocking_declaration
  -	: KW_DEFAULT? KW_CLOCKING clocking_identifier? clocking_event SEMI clocking_item* KW_ENDCLOCKING (COLON clocking_identifier)?
  -	| KW_GLOBAL KW_CLOCKING clocking_identifier? clocking_event SEMI KW_ENDCLOCKING (COLON clocking_identifier)?
  -	;
  +  : KW_DEFAULT? KW_CLOCKING clocking_identifier? clocking_event SEMI clocking_item* KW_ENDCLOCKING (COLON clocking_identifier)?
  +  | KW_GLOBAL KW_CLOCKING clocking_identifier? clocking_event SEMI KW_ENDCLOCKING (COLON clocking_identifier)?
  +  ;
   
   clocking_item
  -	: KW_DEFAULT default_skew SEMI
  -	| clocking_direction list_of_clocking_decl_assign SEMI
  -	| attribute_instances assertion_item_declaration
  -	;
  +  : KW_DEFAULT default_skew SEMI
  +  | clocking_direction list_of_clocking_decl_assign SEMI
  +  | attribute_instances assertion_item_declaration
  +  ;
   
   default_skew
  -	: KW_INPUT clocking_skew
  -	| KW_OUTPUT clocking_skew
  -	| KW_INPUT clocking_skew KW_OUTPUT clocking_skew
  -	;
  +  : KW_INPUT clocking_skew
  +  | KW_OUTPUT clocking_skew
  +  | KW_INPUT clocking_skew KW_OUTPUT clocking_skew
  +  ;
   
   clocking_direction
  -	: KW_INPUT clocking_skew?
  -	| KW_OUTPUT clocking_skew?
  -	| KW_INPUT clocking_skew? KW_OUTPUT clocking_skew?
  -	| KW_INOUT
  -	;
  +  : KW_INPUT clocking_skew?
  +  | KW_OUTPUT clocking_skew?
  +  | KW_INPUT clocking_skew? KW_OUTPUT clocking_skew?
  +  | KW_INOUT
  +  ;
   
   list_of_clocking_decl_assign
  -	: clocking_decl_assign (COMMA clocking_decl_assign)*
  -	;
  +  : clocking_decl_assign (COMMA clocking_decl_assign)*
  +  ;
   
   clocking_decl_assign
  -	: signal_identifier (EQ expression)?
  -	;
  +  : signal_identifier (EQ expression)?
  +  ;
   
   clocking_skew
  -	: edge_identifier delay_control?
  -	| delay_control
  -	;
  +  : edge_identifier delay_control?
  +  | delay_control
  +  ;
   
   module_common_item
  -	: module_or_generate_item_declaration
  -	| interface_instantiation
  -	| program_instantiation
  -	| assertion_item
  -	| bind_directive
  -	| continuous_assign
  -	| net_alias
  -	| initial_construct
  -	| final_construct
  -	| always_construct
  -	| loop_generate_construct
  -	| conditional_generate_construct
  -	| elaboration_system_task
  -	;
  +  : module_or_generate_item_declaration
  +  | interface_instantiation
  +  | program_instantiation
  +  | assertion_item
  +  | bind_directive
  +  | continuous_assign
  +  | net_alias
  +  | initial_construct
  +  | final_construct
  +  | always_construct
  +  | loop_generate_construct
  +  | conditional_generate_construct
  +  | elaboration_system_task
  +  ;
   
   module_item
  -	: port_declaration SEMI
  -	| non_port_module_item
  -	;
  +  : port_declaration SEMI
  +  | non_port_module_item
  +  ;
   
   module_or_generate_item
  -	: attribute_instances parameter_override
  -	| attribute_instances gate_instantiation
  -	| attribute_instances udp_instantiation
  -	| attribute_instances module_instantiation
  -	| attribute_instances module_common_item
  -	;
  +  : attribute_instances parameter_override
  +  | attribute_instances gate_instantiation
  +  | attribute_instances udp_instantiation
  +  | attribute_instances module_instantiation
  +  | attribute_instances module_common_item
  +  ;
   
   module_or_generate_item_declaration
  -	: package_or_generate_item_declaration
  -	| genvar_declaration
  -	| clocking_declaration
  -	| KW_DEFAULT KW_CLOCKING clocking_identifier SEMI
  -	| KW_DEFAULT KW_DISABLE KW_IFF expression_or_dist SEMI
  -	;
  +  : package_or_generate_item_declaration
  +  | genvar_declaration
  +  | clocking_declaration
  +  | KW_DEFAULT KW_CLOCKING clocking_identifier SEMI
  +  | KW_DEFAULT KW_DISABLE KW_IFF expression_or_dist SEMI
  +  ;
   
   non_port_module_item
  -	: generate_region
  -	| module_or_generate_item
  -	| specify_block
  -	| attribute_instances specparam_declaration
  -	| program_declaration
  -	| module_declaration
  -	| interface_declaration
  -	| timeunits_declaration
  -	;
  +  : generate_region
  +  | module_or_generate_item
  +  | specify_block
  +  | attribute_instances specparam_declaration
  +  | program_declaration
  +  | module_declaration
  +  | interface_declaration
  +  | timeunits_declaration
  +  ;
   
   generate_region
  -	: KW_GENERATE generate_item* KW_ENDGENERATE
  -	;
  +  : KW_GENERATE generate_item* KW_ENDGENERATE
  +  ;
   
   loop_generate_construct
  -	: KW_FOR LPAREN genvar_initialization SEMI genvar_expression SEMI genvar_iteration RPAREN generate_block
  -	;
  +  : KW_FOR LPAREN genvar_initialization SEMI genvar_expression SEMI genvar_iteration RPAREN generate_block
  +  ;
   
   genvar_initialization
  -	: KW_GENVAR? genvar_identifier EQ constant_expression
  -	;
  +  : KW_GENVAR? genvar_identifier EQ constant_expression
  +  ;
   
   genvar_iteration
  -	: genvar_identifier assignment_operator genvar_expression
  -	| inc_or_dec_operator genvar_identifier
  -	| genvar_identifier inc_or_dec_operator
  -	;
  +  : genvar_identifier assignment_operator genvar_expression
  +  | inc_or_dec_operator genvar_identifier
  +  | genvar_identifier inc_or_dec_operator
  +  ;
   
   conditional_generate_construct
  -	: if_generate_construct
  -	| case_generate_construct
  -	;
  +  : if_generate_construct
  +  | case_generate_construct
  +  ;
   
   if_generate_construct
  -	: KW_IF LPAREN constant_expression RPAREN generate_block
  -	  (KW_ELSE generate_block)?
  -	;
  +  : KW_IF LPAREN constant_expression RPAREN generate_block
  +    (KW_ELSE generate_block)?
  +  ;
   
   case_generate_construct
  -	: KW_CASE LPAREN constant_expression RPAREN case_generate_item
  -	  case_generate_item* KW_ENDCASE
  -	;
  +  : KW_CASE LPAREN constant_expression RPAREN case_generate_item
  +    case_generate_item* KW_ENDCASE
  +  ;
   
   case_generate_item
  -	: constant_expression (COMMA constant_expression)* COLON generate_block
  -	| KW_DEFAULT COLON? generate_block
  -	;
  +  : constant_expression (COMMA constant_expression)* COLON generate_block
  +  | KW_DEFAULT COLON? generate_block
  +  ;
   
   generate_block
  -	: generate_item
  -	| (generate_block_identifier COLON)? KW_BEGIN
  -	  (COLON generate_block_identifier)?
  -	  generate_item*
  -	  KW_END (COLON generate_block_identifier)?
  -	;
  +  : generate_item
  +  | (generate_block_identifier COLON)? KW_BEGIN
  +    (COLON generate_block_identifier)?
  +    generate_item*
  +    KW_END (COLON generate_block_identifier)?
  +  ;
   
   generate_item
  -	: module_or_generate_item
  -	| interface_or_generate_item
  -	| checker_or_generate_item
  -	;
  +  : module_or_generate_item
  +  | interface_or_generate_item
  +  | checker_or_generate_item
  +  ;
   
   interface_or_generate_item
  -	: attribute_instances module_common_item
  -	| attribute_instances modport_declaration
  -	| attribute_instances extern_tf_declaration
  -	;
  +  : attribute_instances module_common_item
  +  | attribute_instances modport_declaration
  +  | attribute_instances extern_tf_declaration
  +  ;
   
   extern_tf_declaration
  -	: KW_EXTERN method_prototype SEMI
  -	| KW_EXTERN KW_FORKJOIN task_prototype SEMI
  -	;
  +  : KW_EXTERN method_prototype SEMI
  +  | KW_EXTERN KW_FORKJOIN task_prototype SEMI
  +  ;
   
   checker_or_generate_item
  -	: checker_or_generate_item_declaration
  -	| initial_construct
  -	| always_construct
  -	| final_construct
  -	| assertion_item
  -	| continuous_assign
  -	| checker_generate_item
  -	;
  +  : checker_or_generate_item_declaration
  +  | initial_construct
  +  | always_construct
  +  | final_construct
  +  | assertion_item
  +  | continuous_assign
  +  | checker_generate_item
  +  ;
   
   checker_or_generate_item_declaration
  -	: KW_RAND? data_declaration
  -	| function_declaration
  -	| checker_declaration
  -	| assertion_item_declaration
  -	| covergroup_declaration
  -	| overload_declaration
  -	| genvar_declaration
  -	| clocking_declaration
  -	| KW_DEFAULT KW_CLOCKING clocking_identifier SEMI
  -	| KW_DEFAULT KW_DISABLE KW_IFF expression_or_dist SEMI
  -	| SEMI
  -	;
  +  : KW_RAND? data_declaration
  +  | function_declaration
  +  | checker_declaration
  +  | assertion_item_declaration
  +  | covergroup_declaration
  +  | overload_declaration
  +  | genvar_declaration
  +  | clocking_declaration
  +  | KW_DEFAULT KW_CLOCKING clocking_identifier SEMI
  +  | KW_DEFAULT KW_DISABLE KW_IFF expression_or_dist SEMI
  +  | SEMI
  +  ;
   
   checker_declaration
  -	: KW_CHECKER checker_identifier (LPAREN checker_port_list? RPAREN)? SEMI (attribute_instances checker_or_generate_item)* KW_ENDCHECKER (COLON checker_identifier)?
  -	;
  +  : KW_CHECKER checker_identifier (LPAREN checker_port_list? RPAREN)? SEMI (attribute_instances checker_or_generate_item)* KW_ENDCHECKER (COLON checker_identifier)?
  +  ;
   
   checker_port_list
  -	: checker_port_item (COMMA checker_port_item)*
  -	;
  +  : checker_port_item (COMMA checker_port_item)*
  +  ;
   
   checker_port_item
  -	: attribute_instances checker_port_direction? property_formal_type formal_port_identifier variable_dimension* (EQ property_actual_arg)?
  -	;
  +  : attribute_instances checker_port_direction? property_formal_type formal_port_identifier variable_dimension* (EQ property_actual_arg)?
  +  ;
   
   checker_port_direction
  -	: KW_INPUT | KW_OUTPUT
  -	;
  +  : KW_INPUT | KW_OUTPUT
  +  ;
   
   checker_generate_item
  -	: loop_generate_construct
  -	| conditional_generate_construct
  -	| generate_region
  -	| elaboration_system_task
  -	;
  +  : loop_generate_construct
  +  | conditional_generate_construct
  +  | generate_region
  +  | elaboration_system_task
  +  ;
   
   modport_declaration
  -	: KW_MODPORT modport_item (COMMA modport_item)* SEMI
  -	;
  +  : KW_MODPORT modport_item (COMMA modport_item)* SEMI
  +  ;
   
   modport_item
  -	: modport_identifier LPAREN modport_ports_declaration (COMMA modport_ports_declaration)* RPAREN
  -	;
  +  : modport_identifier LPAREN modport_ports_declaration (COMMA modport_ports_declaration)* RPAREN
  +  ;
   
   modport_ports_declaration
  -	: attribute_instances modport_simple_ports_declaration
  -	| attribute_instances modport_tf_ports_declaration
  -	| attribute_instances modport_clocking_declaration
  -	;
  +  : attribute_instances modport_simple_ports_declaration
  +  | attribute_instances modport_tf_ports_declaration
  +  | attribute_instances modport_clocking_declaration
  +  ;
   
   modport_clocking_declaration
  -	: KW_CLOCKING clocking_identifier
  -	;
  +  : KW_CLOCKING clocking_identifier
  +  ;
   
   modport_simple_ports_declaration
  -	: port_direction modport_simple_port (COMMA modport_simple_port)*
  -	;
  +  : port_direction modport_simple_port (COMMA modport_simple_port)*
  +  ;
   
   modport_simple_port
  -	: port_identifier
  -	| DOT port_identifier LPAREN expression? RPAREN
  -	;
  +  : port_identifier
  +  | DOT port_identifier LPAREN expression? RPAREN
  +  ;
   
   modport_tf_ports_declaration
  -	: import_export modport_tf_port (COMMA modport_tf_port)*
  -	;
  +  : import_export modport_tf_port (COMMA modport_tf_port)*
  +  ;
   
   modport_tf_port
  -	: method_prototype
  -	| tf_identifier
  -	;
  +  : method_prototype
  +  | tf_identifier
  +  ;
   
   import_export
  -	: KW_IMPORT | KW_EXPORT
  -	;
  +  : KW_IMPORT | KW_EXPORT
  +  ;
   
   genvar_declaration
  -	: KW_GENVAR list_of_genvar_identifiers SEMI
  -	;
  +  : KW_GENVAR list_of_genvar_identifiers SEMI
  +  ;
   
   list_of_genvar_identifiers
  -	: genvar_identifier (COMMA genvar_identifier)*
  -	;
  +  : genvar_identifier (COMMA genvar_identifier)*
  +  ;
   
   parameter_override
  -	: KW_DEFPARAM list_of_defparam_assignments
  -	;
  +  : KW_DEFPARAM list_of_defparam_assignments
  +  ;
   
   list_of_defparam_assignments
  -	: defparam_assignment (COMMA defparam_assignment)*
  -	;
  +  : defparam_assignment (COMMA defparam_assignment)*
  +  ;
   
   defparam_assignment
  -	: hierarchical_parameter_identifier EQ constant_mintypmax_expression
  -	;
  +  : hierarchical_parameter_identifier EQ constant_mintypmax_expression
  +  ;
   
   interface_declaration
  -	: interface_nonansi_header timeunits_declaration? interface_body
  -		KW_ENDINTERFACE ( COLON interface_identifier )?
  -	| interface_ansi_header timeunits_declaration? interface_body
  - 		KW_ENDINTERFACE ( COLON interface_identifier )?
  -	| attribute_instances KW_INTERFACE interface_identifier LPAREN DOT MUL RPAREN SEMI
  -		timeunits_declaration? interface_body
  - 		KW_ENDINTERFACE ( COLON interface_identifier )?
  -	| KW_EXTERN interface_nonansi_header
  -	| KW_EXTERN interface_ansi_header
  -	;
  +  : interface_nonansi_header timeunits_declaration? interface_body
  +    KW_ENDINTERFACE ( COLON interface_identifier )?
  +  | interface_ansi_header timeunits_declaration? interface_body
  +     KW_ENDINTERFACE ( COLON interface_identifier )?
  +  | attribute_instances KW_INTERFACE interface_identifier LPAREN DOT MUL RPAREN SEMI
  +    timeunits_declaration? interface_body
  +     KW_ENDINTERFACE ( COLON interface_identifier )?
  +  | KW_EXTERN interface_nonansi_header
  +  | KW_EXTERN interface_ansi_header
  +  ;
   
   interface_nonansi_header
  -	: attribute_instances KW_INTERFACE lifetime? interface_identifier
  -		package_import_declaration* parameter_port_list? list_of_ports SEMI
  -	;
  +  : attribute_instances KW_INTERFACE lifetime? interface_identifier
  +    package_import_declaration* parameter_port_list? list_of_ports SEMI
  +  ;
   interface_ansi_header
  -	: attribute_instances KW_INTERFACE lifetime? interface_identifier
  -		package_import_declaration* parameter_port_list? list_of_port_declarations? SEMI
  -	;
  +  : attribute_instances KW_INTERFACE lifetime? interface_identifier
  +    package_import_declaration* parameter_port_list? list_of_port_declarations? SEMI
  +  ;
   
   type_declaration
  -	: KW_TYPEDEF data_type type_identifier variable_dimension* SEMI
  -	| KW_TYPEDEF interface_instance_identifier constant_bit_select DOT type_identifier type_identifier SEMI
  -	| KW_TYPEDEF ( KW_ENUM | KW_STRUCT | KW_UNION | KW_CLASS | KW_INTERFACE KW_CLASS )? type_identifier SEMI
  -	;
  +  : KW_TYPEDEF data_type type_identifier variable_dimension* SEMI
  +  | KW_TYPEDEF interface_instance_identifier constant_bit_select DOT type_identifier type_identifier SEMI
  +  | KW_TYPEDEF ( KW_ENUM | KW_STRUCT | KW_UNION | KW_CLASS | KW_INTERFACE KW_CLASS )? type_identifier SEMI
  +  ;
   
   constant_bit_select
  -	: ( LSQUARE constant_expression RSQUARE )*
  -	;
  +  : ( LSQUARE constant_expression RSQUARE )*
  +  ;
   
   constant_select
  -	: ( ( DOT member_identifier constant_bit_select)* DOT member_identifier)? constant_bit_select
  -	  (LSQUARE constant_part_select_range RSQUARE)?
  -	;
  +  : ( ( DOT member_identifier constant_bit_select)* DOT member_identifier)? constant_bit_select
  +    (LSQUARE constant_part_select_range RSQUARE)?
  +  ;
   
   lifetime
  -	: KW_STATIC | KW_AUTOMATIC
  -	;
  +  : KW_STATIC | KW_AUTOMATIC
  +  ;
   
   timeunits_declaration
  -	: KW_TIMEUNIT LIT_TIME ( DIV LIT_TIME )? SEMI
  -	| KW_TIMEPRECISION LIT_TIME SEMI
  -	| KW_TIMEUNIT LIT_TIME SEMI KW_TIMEPRECISION LIT_TIME SEMI
  -	| KW_TIMEPRECISION LIT_TIME SEMI KW_TIMEUNIT LIT_TIME SEMI
  -	;
  +  : KW_TIMEUNIT LIT_TIME ( DIV LIT_TIME )? SEMI
  +  | KW_TIMEPRECISION LIT_TIME SEMI
  +  | KW_TIMEUNIT LIT_TIME SEMI KW_TIMEPRECISION LIT_TIME SEMI
  +  | KW_TIMEPRECISION LIT_TIME SEMI KW_TIMEUNIT LIT_TIME SEMI
  +  ;
   
   // TODO skip interface contents for now.
   interface_body
  -	: (~KW_ENDINTERFACE)*?
  -	;
  +  : (~KW_ENDINTERFACE)*?
  +  ;
   
   package_import_declaration
  -	: KW_IMPORT package_import_item ( COMMA package_import_item )* SEMI
  -	;
  +  : KW_IMPORT package_import_item ( COMMA package_import_item )* SEMI
  +  ;
   package_import_item
  -	: package_identifier COLON2 identifier
  -	| package_identifier COLON2 MUL
  -	;
  +  : package_identifier COLON2 identifier
  +  | package_identifier COLON2 MUL
  +  ;
   
   parameter_port_list
  -	: HASH LPAREN list_of_param_assignments (COMMA parameter_port_declaration)* RPAREN
  -	| HASH LPAREN parameter_port_declaration (COMMA parameter_port_declaration)* RPAREN
  -	| HASH LPAREN RPAREN
  -	;
  +  : HASH LPAREN list_of_param_assignments (COMMA parameter_port_declaration)* RPAREN
  +  | HASH LPAREN parameter_port_declaration (COMMA parameter_port_declaration)* RPAREN
  +  | HASH LPAREN RPAREN
  +  ;
   
   parameter_port_declaration
  -	: parameter_declaration
  -	| local_parameter_declaration
  -	| data_type list_of_param_assignments
  -	| KW_TYPE list_of_type_assignments
  -	;
  +  : parameter_declaration
  +  | local_parameter_declaration
  +  | data_type list_of_param_assignments
  +  | KW_TYPE list_of_type_assignments
  +  ;
   
   list_of_ports
  -	: LPAREN port ( COMMA port )* RPAREN
  -	;
  +  : LPAREN port ( COMMA port )* RPAREN
  +  ;
   
   port_declaration
  -	: attribute_instances
  -		( inout_declaration
  -		| input_declaration
  -		| output_declaration
  -		| ref_declaration
  -		| interface_port_declaration
  -		)
  -	;
  +  : attribute_instances
  +    ( inout_declaration
  +    | input_declaration
  +    | output_declaration
  +    | ref_declaration
  +    | interface_port_declaration
  +    )
  +  ;
   
   list_of_port_declarations
  -	: LPAREN port_declaration ( COMMA port_declaration )* RPAREN
  -	| LPAREN RPAREN
  -	;
  +  : LPAREN port_declaration ( COMMA port_declaration )* RPAREN
  +  | LPAREN RPAREN
  +  ;
   
   port: port_expression?
  -	| DOT port_identifier LPAREN ( port_expression )? RPAREN
  -	;
  +  | DOT port_identifier LPAREN ( port_expression )? RPAREN
  +  ;
   
   port_expression
  -	: port_reference
  -	| LCURLY port_reference ( COMMA port_reference )* RCURLY
  -	;
  +  : port_reference
  +  | LCURLY port_reference ( COMMA port_reference )* RCURLY
  +  ;
   
   port_reference
  -	: port_identifier
  -	| port_identifier LSQUARE constant_expression RSQUARE
  -	| port_identifier LSQUARE range_expression RSQUARE
  -	;
  +  : port_identifier
  +  | port_identifier LSQUARE constant_expression RSQUARE
  +  | port_identifier LSQUARE range_expression RSQUARE
  +  ;
   
   ref_declaration
  -	: KW_REF data_type list_of_port_identifiers
  -	;
  +  : KW_REF data_type list_of_port_identifiers
  +  ;
   
   interface_port_declaration
  -	: interface_identifier list_of_interface_identifiers
  -	| interface_identifier DOT modport_identifier list_of_interface_identifiers
  -	;
  +  : interface_identifier list_of_interface_identifiers
  +  | interface_identifier DOT modport_identifier list_of_interface_identifiers
  +  ;
   
   list_of_param_assignments
  -	: param_assignment ( COMMA param_assignment )*
  -	;
  +  : param_assignment ( COMMA param_assignment )*
  +  ;
   
   param_assignment
  -	: parameter_identifier EQ constant_expression
  -	;
  +  : parameter_identifier EQ constant_expression
  +  ;
   
   inout_declaration
  -	: KW_INOUT ( net_type )? ( KW_SIGNED )? ( range )? list_of_port_identifiers
  -	;
  +  : KW_INOUT ( net_type )? ( KW_SIGNED )? ( range )? list_of_port_identifiers
  +  ;
   input_declaration
  -	: KW_INPUT ( net_type )? ( KW_SIGNED )? ( range )? list_of_port_identifiers
  -	| KW_INPUT variable_port_type list_of_variable_identifiers
  -	;
  +  : KW_INPUT ( net_type )? ( KW_SIGNED )? ( range )? list_of_port_identifiers
  +  | KW_INPUT variable_port_type list_of_variable_identifiers
  +  ;
   output_declaration
  -	: KW_OUTPUT ( net_type )? ( KW_SIGNED )? ( range )? list_of_port_identifiers
  -	| KW_OUTPUT variable_port_type list_of_variable_identifiers
  -	;
  +  : KW_OUTPUT ( net_type )? ( KW_SIGNED )? ( range )? list_of_port_identifiers
  +  | KW_OUTPUT variable_port_type list_of_variable_identifiers
  +  ;
   
   list_of_variable_identifiers
  -	: variable_identifier variable_dimension? ( COMMA variable_identifier variable_dimension? )*
  -	;
  +  : variable_identifier variable_dimension? ( COMMA variable_identifier variable_dimension? )*
  +  ;
   
   list_of_interface_identifiers
  -	: interface_identifier ( unpacked_dimension )* ( COMMA interface_identifier ( unpacked_dimension )* )*
  -	;
  +  : interface_identifier ( unpacked_dimension )* ( COMMA interface_identifier ( unpacked_dimension )* )*
  +  ;
   
   list_of_port_identifiers
  -	: port_identifier ( COMMA port_identifier )*
  -	;
  +  : port_identifier ( COMMA port_identifier )*
  +  ;
   
   list_of_variable_port_identifiers
  -	:  port_identifier ( EQ constant_expression )? ( COMMA port_identifier ( EQ constant_expression )? )*
  -	;
  +  :  port_identifier ( EQ constant_expression )? ( COMMA port_identifier ( EQ constant_expression )? )*
  +  ;
   
   list_of_tf_variable_identifiers
  -	: port_identifier variable_dimension* (EQ expression)?
  -	  ( COMMA port_identifier variable_dimension* (EQ expression)? )*
  -	;
  +  : port_identifier variable_dimension* (EQ expression)?
  +    ( COMMA port_identifier variable_dimension* (EQ expression)? )*
  +  ;
   
   net_type
  -	: KW_SUPPLY0 | KW_SUPPLY1 | KW_TRI | KW_TRIAND | KW_TRIOR | KW_TRIREG | KW_TRI0 | KW_TRI1 | KW_UWIRE | KW_WIRE | KW_WAND | KW_WOR
  -	;
  +  : KW_SUPPLY0 | KW_SUPPLY1 | KW_TRI | KW_TRIAND | KW_TRIOR | KW_TRIREG | KW_TRI0 | KW_TRI1 | KW_UWIRE | KW_WIRE | KW_WAND | KW_WOR
  +  ;
   
   integer_type
  -	: integer_vector_type | integer_atom_type
  -	;
  +  : integer_vector_type | integer_atom_type
  +  ;
   
   integer_atom_type
  -	: KW_BYTE | KW_SHORTINT | KW_INT | KW_LONGINT | KW_INTEGER | KW_TIME
  -	;
  +  : KW_BYTE | KW_SHORTINT | KW_INT | KW_LONGINT | KW_INTEGER | KW_TIME
  +  ;
   
   integer_vector_type
  -	: KW_BIT | KW_LOGIC | KW_REG
  -	;
  +  : KW_BIT | KW_LOGIC | KW_REG
  +  ;
   
   non_integer_type
  -	: KW_SHORTREAL | KW_REAL | KW_REALTIME
  -	;
  +  : KW_SHORTREAL | KW_REAL | KW_REALTIME
  +  ;
   
   output_variable_type
  -	: KW_INTEGER | KW_TIME
  -	;
  +  : KW_INTEGER | KW_TIME
  +  ;
   
   variable_port_type
  -	: var_data_type
  -	;
  +  : var_data_type
  +  ;
   
   var_data_type
  -	: KW_VAR data_type_or_implicit
  -	| data_type
  -	;
  +  : KW_VAR data_type_or_implicit
  +  | data_type
  +  ;
   
   data_type_or_implicit
  -	: data_type
  -	| implicit_data_type
  -	;
  +  : data_type
  +  | implicit_data_type
  +  ;
   
   implicit_data_type
  -	: signing? packed_dimension*
  -	;
  +  : signing? packed_dimension*
  +  ;
   
   // TODO
   data_type
  -	: integer_vector_type signing? packed_dimension*
  -	| integer_atom_type signing?
  -	| non_integer_type
  -	| struct_union (KW_PACKED signing?)? LCURLY struct_union_member+ RCURLY packed_dimension*
  -	| KW_ENUM enum_base_type? LCURLY enum_name_declaration (COMMA enum_name_declaration)* RCURLY packed_dimension*
  -	| KW_STRING
  -	| KW_CHANDLE
  -	| KW_VIRTUAL KW_INTERFACE? interface_identifier parameter_value_assignment? (DOT modport_identifier)?
  -	| class_type
  -	| KW_EVENT
  -	| type_reference
  -	;
  +  : integer_vector_type signing? packed_dimension*
  +  | integer_atom_type signing?
  +  | non_integer_type
  +  | struct_union (KW_PACKED signing?)? LCURLY struct_union_member+ RCURLY packed_dimension*
  +  | KW_ENUM enum_base_type? LCURLY enum_name_declaration (COMMA enum_name_declaration)* RCURLY packed_dimension*
  +  | KW_STRING
  +  | KW_CHANDLE
  +  | KW_VIRTUAL KW_INTERFACE? interface_identifier parameter_value_assignment? (DOT modport_identifier)?
  +  | class_type
  +  | KW_EVENT
  +  | type_reference
  +  ;
   
   struct_union
  -	: KW_STRUCT | KW_UNION KW_TAGGED?
  -	;
  +  : KW_STRUCT | KW_UNION KW_TAGGED?
  +  ;
   
   struct_union_member
  -	: attribute_instances random_qualifier? data_type_or_void list_of_variable_decl_assignments SEMI
  -	;
  +  : attribute_instances random_qualifier? data_type_or_void list_of_variable_decl_assignments SEMI
  +  ;
   
   random_qualifier
  -	: KW_RAND | KW_RANDC
  -	;
  +  : KW_RAND | KW_RANDC
  +  ;
   
   simple_type
  -	: integer_type | non_integer_type | ps_type_identifier | ps_parameter_identifier
  -	;
  +  : integer_type | non_integer_type | ps_type_identifier | ps_parameter_identifier
  +  ;
   
   enum_base_type
  -	: integer_atom_type ( signing )?
  -	| integer_vector_type ( signing )? ( packed_dimension )?
  -	| type_identifier ( packed_dimension )?
  -	;
  +  : integer_atom_type ( signing )?
  +  | integer_vector_type ( signing )? ( packed_dimension )?
  +  | type_identifier ( packed_dimension )?
  +  ;
   
   enum_name_declaration
  -	: enum_identifier
  -	( LSQUARE integral_number ( COLON integral_number )? RSQUARE )?
  -	( EQ constant_expression )?
  -	;
  +  : enum_identifier
  +  ( LSQUARE integral_number ( COLON integral_number )? RSQUARE )?
  +  ( EQ constant_expression )?
  +  ;
   
   parameter_value_assignment
  -	: HASH LPAREN (list_of_parameter_assignments)? RPAREN
  -	;
  +  : HASH LPAREN (list_of_parameter_assignments)? RPAREN
  +  ;
   
   list_of_parameter_assignments
  -	: ordered_parameter_assignment ( COMMA ordered_parameter_assignment )*
  -	| named_parameter_assignment ( COMMA named_parameter_assignment )*
  -	;
  +  : ordered_parameter_assignment ( COMMA ordered_parameter_assignment )*
  +  | named_parameter_assignment ( COMMA named_parameter_assignment )*
  +  ;
   
   ordered_parameter_assignment
  -	: param_expression
  -	;
  +  : param_expression
  +  ;
   
   named_parameter_assignment
  -	: DOT parameter_identifier LPAREN ( param_expression )? RPAREN
  -	;
  +  : DOT parameter_identifier LPAREN ( param_expression )? RPAREN
  +  ;
   
   signing
  -	: KW_SIGNED | KW_UNSIGNED
  -	;
  +  : KW_SIGNED | KW_UNSIGNED
  +  ;
   
   unpacked_dimension
  -	: LSQUARE constant_range RSQUARE
  -	| LSQUARE constant_expression RSQUARE
  -	;
  +  : LSQUARE constant_range RSQUARE
  +  | LSQUARE constant_expression RSQUARE
  +  ;
   
   packed_dimension
  -	: LSQUARE constant_range RSQUARE
  -	| unsized_dimension
  -	;
  +  : LSQUARE constant_range RSQUARE
  +  | unsized_dimension
  +  ;
   
   associative_dimension
  -	: LSQUARE data_type RSQUARE
  -	| LSQUARE MUL RSQUARE
  -	;
  +  : LSQUARE data_type RSQUARE
  +  | LSQUARE MUL RSQUARE
  +  ;
   
   variable_dimension
  -	: unsized_dimension
  -	| unpacked_dimension
  -	| associative_dimension
  -	| queue_dimension
  -	;
  +  : unsized_dimension
  +  | unpacked_dimension
  +  | associative_dimension
  +  | queue_dimension
  +  ;
   
   queue_dimension
  -	: LSQUARE DOLLAR ( COLON constant_expression )? RSQUARE
  -	;
  +  : LSQUARE DOLLAR ( COLON constant_expression )? RSQUARE
  +  ;
   
   unsized_dimension
  -	: LSQUARE RSQUARE
  -	;
  +  : LSQUARE RSQUARE
  +  ;
   
   sized_or_unsized_dimension
  -	: unpacked_dimension | unsized_dimension
  -	;
  +  : unpacked_dimension | unsized_dimension
  +  ;
   
   constant_part_select_range
  -	: constant_range
  -	| constant_indexed_range
  -	;
  +  : constant_range
  +  | constant_indexed_range
  +  ;
   
   constant_indexed_range
  -	: constant_expression ADD_COLON constant_expression
  -	| constant_expression SUB_COLON constant_expression
  -	;
  +  : constant_expression ADD_COLON constant_expression
  +  | constant_expression SUB_COLON constant_expression
  +  ;
   
   dimension : LSQUARE dimension_constant_expression COLON dimension_constant_expression RSQUARE ;
   range : LSQUARE msb_constant_expression COLON lsb_constant_expression RSQUARE ;
  
positive.code: unsigned_number : number ;
  
  identifier
  	: simple_identifier
  	// TODO escaped_identifier disabled for now because it isn't used much and causes an ambiguity
  	// escaped_identifier
  	;
  
  identifier_list
  	: identifier (COMMA identifier)*
  	;
  
  escaped_identifier
  	: simple_identifier // TODO
  	;
  
  simple_identifier
  	: ID
  	// Special tokens that are not really keywords but tokenized to avoid semantic predicates in the grammar.
  	| KW_STD
  	| KW_NEW
  	| KW_OPTION
  	| KW_FIND
  	| KW_FIND_INDEX
  	| KW_FIND_FIRST
  	| KW_FIND_FIRST_INDEX
  	| KW_FIND_LAST
  	| KW_FIND_LAST_INDEX
  	| KW_MIN
  	| KW_MAX
  	| KW_UNIQUE_INDEX
  	| KW_REVERSE
  	| KW_SORT
  	| KW_RSORT
  	| KW_SHUFFLE
  	| KW_SUM
  	| KW_PRODUCT
  	;
  
  system_tf_identifier
  	: SYSTEM_ID | DOLLAR_FATAL | DOLLAR_ERROR | DOLLAR_WARNING | DOLLAR_INFO
  	;
  
  arrayed_identifier : simple_arrayed_identifier | escaped_arrayed_identifier ;
  block_identifier : identifier ;
  
negative.code: cross_identifier : identifier ;
  
  ps_covergroup_identifier
    : package_scope? covergroup_identifier
    ;
  
  // TODO not strictly correct
  c_identifier : identifier ;
  