@@ -2785,27 +2785,38 @@ disable_statement: TOK_DISABLE hierarchical_task_or_block_identifier ';'
2785
2785
// A.6.6 Conditional statements
2786
2786
2787
2787
conditional_statement :
2788
- TOK_IF ' (' expression ' )' statement_or_null %prec LT_TOK_ELSE
2789
- { init($$ , ID_if); mto($$ , $3 ); mto($$ , $5 ); }
2790
- | TOK_IF ' (' expression ' )' statement_or_null TOK_ELSE statement_or_null
2791
- { init($$ , ID_if); mto($$ , $3 ); mto($$ , $5 ); mto($$ , $7 ); }
2788
+ unique_priority_opt TOK_IF ' (' expression ' )' statement_or_null %prec LT_TOK_ELSE
2789
+ { init($$ , ID_if); mto($$ , $4 ); mto($$ , $6 ); }
2790
+ | unique_priority_opt TOK_IF ' (' expression ' )' statement_or_null TOK_ELSE statement_or_null
2791
+ { init($$ , ID_if); mto($$ , $4 ); mto($$ , $6 ); mto($$ , $8 ); }
2792
+ ;
2793
+
2794
+ unique_priority_opt :
2795
+ /* Optional */
2796
+ { init($$ ); }
2797
+ | TOK_UNIQUE
2798
+ { init($$ , ID_verilog_unique); }
2799
+ | TOK_UNIQUE0
2800
+ { init($$ , ID_verilog_unique0); }
2801
+ | TOK_PRIORITY
2802
+ { init($$ , ID_verilog_priority); }
2792
2803
;
2793
2804
2794
2805
// System Verilog standard 1800-2017
2795
2806
// A.6.7 Case statements
2796
2807
2797
2808
case_statement :
2798
- TOK_CASE ' (' expression ' )' case_item_brace TOK_ENDCASE
2799
- { init($$ , ID_case); mto($$ , $3 );
2800
- Forall_operands (it, stack_expr($5 ))
2809
+ unique_priority_opt TOK_CASE ' (' expression ' )' case_item_brace TOK_ENDCASE
2810
+ { init($$ , ID_case); mto($$ , $4 );
2811
+ Forall_operands (it, stack_expr($6 ))
2801
2812
stack_expr($$).add_to_operands(std::move(*it)); }
2802
- | TOK_CASEX ' (' expression ' )' case_item_brace TOK_ENDCASE
2803
- { init($$ , ID_casex); mto($$ , $3 );
2804
- Forall_operands (it, stack_expr($5 ))
2813
+ | unique_priority_opt TOK_CASEX ' (' expression ' )' case_item_brace TOK_ENDCASE
2814
+ { init($$ , ID_casex); mto($$ , $4 );
2815
+ Forall_operands (it, stack_expr($6 ))
2805
2816
stack_expr($$).add_to_operands(std::move(*it)); }
2806
- | TOK_CASEZ ' (' expression ' )' case_item_brace TOK_ENDCASE
2807
- { init($$ , ID_casez); mto($$ , $3 );
2808
- Forall_operands (it, stack_expr($5 ))
2817
+ | unique_priority_opt TOK_CASEZ ' (' expression ' )' case_item_brace TOK_ENDCASE
2818
+ { init($$ , ID_casez); mto($$ , $4 );
2819
+ Forall_operands (it, stack_expr($6 ))
2809
2820
stack_expr($$).add_to_operands(std::move(*it)); }
2810
2821
;
2811
2822
0 commit comments