@@ -554,6 +554,10 @@ int yyverilogerror(const char *error)
554
554
// whereas the table gives them in decreasing order.
555
555
// The precendence of the assertion operators is lower than
556
556
// those in Table 11-2.
557
+ //
558
+ // SEQUENCE_TO_PROPERTY is an artificial token to give
559
+ // the right precedence to the conversion of a sequence_expr
560
+ // to a property_expr.
557
561
%nonassoc " property_expr_abort" // accept_on , reject_on , ...
558
562
%nonassoc " property_expr_clocking_event" // @(...) property_expr
559
563
%nonassoc " always" " s_always" " eventually" " s_eventually"
@@ -564,6 +568,7 @@ int yyverilogerror(const char *error)
564
568
%right " iff"
565
569
%left " or"
566
570
%left " and"
571
+ %nonassoc SEQUENCE_TO_PROPERTY
567
572
%nonassoc " not" " nexttime" " s_nexttime"
568
573
%left " intersect"
569
574
%left " within"
@@ -2419,7 +2424,7 @@ sequence_formal_type:
2419
2424
// for property_expr into property_expr and property_expr_proper.
2420
2425
2421
2426
property_expr:
2422
- sequence_expr
2427
+ sequence_expr %prec SEQUENCE_TO_PROPERTY
2423
2428
| property_expr_proper
2424
2429
;
2425
2430
@@ -2582,8 +2587,12 @@ sequence_expr_proper:
2582
2587
// preserve the operand ordering as in the source code
2583
2588
stack_expr ($$).operands ().insert (stack_expr ($$).operands ().begin (), stack_expr ($1 ));
2584
2589
}
2590
+ | sequence_expr " and" sequence_expr
2591
+ { init ($$, ID_sva_and); mto ($$, $1 ); mto ($$, $3 ); }
2585
2592
| sequence_expr " intersect" sequence_expr
2586
2593
{ init ($$, ID_sva_sequence_intersect); mto ($$, $1 ); mto ($$, $3 ); }
2594
+ | sequence_expr " or" sequence_expr
2595
+ { init ($$, ID_sva_or); mto ($$, $1 ); mto ($$, $3 ); }
2587
2596
| " first_match" ' (' sequence_expr ' )'
2588
2597
{ init ($$, ID_sva_sequence_first_match); mto ($$, $3 ); }
2589
2598
| " first_match" ' (' sequence_expr ' ,' sequence_match_item_brace ' )'
0 commit comments