[back]
# this grammar is the same as rules-03.txt except priorities
# are used to specify precedence

# start rule
start -> expr

# expr
[AssignExprNode]
expr -> expr assign-op(^!)15 expr (>!)14
[OrExprNode]
expr -> expr or-op    (^!)13 expr (>!)12
[AndExprNode]
expr -> expr and-op   (^!)11 expr (>!)10
[EqExprNode]
expr -> expr eq-op    (^!)9  expr (>!)8
[RelExprNode]
expr -> expr rel-op   (^!)7  expr (>!)6
[ShiftExprNode]
expr -> expr shift-op (^!)5  expr (>!)4
[AddExprNode]
expr -> expr add-op   (^!)3  expr (>!)2
[MulExprNode]
expr -> expr mul-op   (^!)1  expr (>!)0
[UnaryExprNode]
expr -> unary-op expr

# primary expressions
[PrimaryExpr1Node]
expr -> IDENT
[PrimaryExpr2Node]
expr -> NUMBER
[PrimaryExpr3Node]
expr -> LPAREN expr RPAREN

# asignment operator
assign-op -> ASSIGN

# logical or operator
or-op -> OR

# logical and operator
and-op -> AND

# equality operators
eq-op -> EQ
eq-op -> NE

# relational operators
rel-op -> LT
rel-op -> GT
rel-op -> LE
rel-op -> GE

# shift operators
shift-op -> LSHIFT
shift-op -> RSHIFT

# additive operators
add-op -> PLUS
add-op -> MINUS

# multiplicative operators
mul-op -> TIMES
mul-op -> DIVIDE

# unary operators
unary-op -> PLUS
unary-op -> MINUS


[back]