grammer vs precedence table

P

Pallav singh

Hi

i have following grammer and predence table for operators
should user be allowed to write expresion like

not if ( expressiont ) property_expr

++++++++++++++++++++++++++++++++++++++++++
GRAMMER
++++++++++++++++++++++++++++++++++++++++++
property_expr ::=
sequence_expr
| ( property_expr )
| not property_expr
| property_expr or property_expr
| property_expr and property_expr
| sequence_expr |-> property_expr
| sequence_expr |=> property_expr
| if ( expression_or_dist ) property_expr [ else property_expr ]
| property_instance
| clocking_event property_expr

++++++++++++++++++++++++++++++++++++++++++
lists the property operators from highest to lowest precedence and
shows the associativity of the non-unary operators
++++++++++++++++++++++++++++++++++++++++++
operators Associativity
[*], [=], [->] —
## Left
throughout Right
within Left
intersect Left
not —
and Left
or Left
if...else Right
|->, |=> Right

Thanks
Pallav Singh
 
O

osmium

Pallav said:
i have following grammer and predence table for operators
should user be allowed to write expresion like

not if ( expressiont ) property_expr

++++++++++++++++++++++++++++++++++++++++++
GRAMMER
++++++++++++++++++++++++++++++++++++++++++
property_expr ::=
sequence_expr
( property_expr )
not property_expr
property_expr or property_expr
property_expr and property_expr
sequence_expr |-> property_expr
sequence_expr |=> property_expr
if ( expression_or_dist ) property_expr [ else property_expr ]
property_instance
clocking_event property_expr

++++++++++++++++++++++++++++++++++++++++++
lists the property operators from highest to lowest precedence and
shows the associativity of the non-unary operators
++++++++++++++++++++++++++++++++++++++++++
operators Associativity
[*], [=], [->] —
## Left
throughout Right
within Left
intersect Left
not —
and Left
or Left
if...else Right
->, |=> Right

I can't figure out what your question is, but if there is a perceived
disagreement between grammar and precedence I would go with the grammar,
hands down.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top