In reply to Have_A_Doubt:
Precedence will get you every time!
See 1800, page 390 Table 16-1—Operator precedence and associativity
See the precedence table (with examples) from my book.
I copied that table at https://photos.app.goo.gl/1WxWpo3HHi3TK68v5
// This
sequence s1 ;
int x ;
// (
( a ##1 b, x = data , $display("T:%0t For 1, x == %0d ",$time,x ) )
and
( d ##1 e, x = data , $display("T:%0t For 2, x == %0d ",$time,x ) )
// ) // Added parenthesis around the 'and' operator
##1 ( data1 == ( x + 1 ) ) ;
endsequence
// is equivalent to
sequence s1 ;
int x ;
// (
( a ##1 b, x = data , $display("T:%0t For 1, x == %0d ",$time,x ) )
and
(( d ##1 e, x = data , $display("T:%0t For 2, x == %0d ",$time,x ) )
// ) // Added parenthesis around the 'and' operator
##1 ( data1 == ( x + 1 ) )) ;
endsequence
//
// A simpler example from my book (link to table shown above)
@c1 a ##1 @c2 b and c ##1 d
// is equivalent to
@c1 (a ##1
@c2 (b and c ##1 d))
// is NOT equivalent to the following
(@c1 a ##1 @c2 b) and (c ##1 d) // DOED NOT FOLLOW THE PRECEDENCE RULES