@@ -750,19 +750,68 @@ program_declaration:
750750 ;
751751
752752checker_declaration:
753- TOK_CHECKER checker_identifier
754- {
755- init ($$, ID_verilog_checker);
756- stack_expr ($$).set (ID_base_name, stack_expr ($2 ).id ());
757- }
758- ' ;'
753+ TOK_CHECKER { init ($$); } checker_identifier
754+ checker_port_list_paren_opt ' ;'
759755 checker_or_generate_item_brace
760756 TOK_ENDCHECKER
761757 {
762- $$ = $3 ;
758+ init ($$);
759+ irept attributes;
760+ exprt parameter_port_list;
761+ stack_expr ($$) = verilog_parse_treet::create_module (
762+ attributes, // attributes,
763+ stack_expr ($2 ), // module_keyword
764+ stack_expr ($3 ), // name
765+ parameter_port_list, // parameter_port_list
766+ stack_expr ($4 ), // ports
767+ stack_expr ($6 ) // module_items
768+ );
769+ stack_expr ($$).id (ID_verilog_checker);
763770 }
764771 ;
765772
773+ checker_port_list_paren_opt:
774+ /* Optional */
775+ { init ($$); }
776+ | ' (' checker_port_list_opt ' )'
777+ { $$ = $2 ; }
778+ ;
779+
780+ checker_port_list_opt:
781+ /* Optional */
782+ { init ($$); }
783+ | checker_port_list
784+ ;
785+
786+ checker_port_list:
787+ checker_port_item
788+ { init ($$); mts ($$, $1 ); }
789+ | checker_port_list checker_port_item
790+ { $$ = $1 ; mts ($$, $2 ); }
791+ ;
792+
793+ checker_port_item:
794+ attribute_instance_brace
795+ checker_port_direction_opt
796+ property_formal_type
797+ formal_port_identifier
798+ variable_dimension_brace
799+ { init ($$, ID_decl);
800+ stack_expr ($$).set (ID_class, stack_expr ($2 ).id ());
801+ addswap ($$, ID_type, $3 );
802+ mto ($$, $4 ); /* declarator */
803+ }
804+ ;
805+
806+ checker_port_direction_opt:
807+ /* Optional */
808+ { init ($$); }
809+ | TOK_INPUT
810+ { init ($$, ID_input); }
811+ | TOK_OUTPUT
812+ { init ($$, ID_output); }
813+ ;
814+
766815class_declaration:
767816 TOK_CLASS class_identifier
768817 ' ;'
@@ -1030,7 +1079,9 @@ non_port_interface_item:
10301079
10311080checker_or_generate_item_brace:
10321081 /* Optional */
1082+ { init ($$); }
10331083 | checker_or_generate_item_brace attribute_instance_brace checker_or_generate_item
1084+ { $$ = $1 ; mts ($$, $3 ); }
10341085 ;
10351086
10361087checker_or_generate_item:
@@ -2323,7 +2374,8 @@ property_port_item:
23232374 ;
23242375
23252376property_formal_type:
2326- TOK_PROPERTY
2377+ sequence_formal_type
2378+ | TOK_PROPERTY
23272379 ;
23282380
23292381property_spec:
@@ -2334,6 +2386,14 @@ property_spec:
23342386 | property_expr
23352387 ;
23362388
2389+ sequence_formal_type:
2390+ data_type
2391+ | TOK_SEQUENCE
2392+ { init ($$, ID_verilog_sequence); }
2393+ | TOK_UNTYPED
2394+ { init ($$, ID_verilog_untyped); }
2395+ ;
2396+
23372397// The 1800-2017 grammar has an ambiguity where
23382398// '(' expression ')' can either be an expression or a property_expr,
23392399// which yields a reduce/reduce conflict. Hence, we split the rules
0 commit comments