36 lines
690 B
Plaintext
Executable File
36 lines
690 B
Plaintext
Executable File
|
|
|
|
expr -> unaryOp
|
|
expr -> binaryOp
|
|
expr -> ternaryOp
|
|
expr -> isolation
|
|
expr -> NUMBER
|
|
|
|
unaryOp -> 55>-? expr
|
|
|
|
binaryOp -> expr 60<^ expr
|
|
binaryOp -> expr 50<* expr
|
|
binaryOp -> expr 50</ expr
|
|
binaryOp -> expr 40<+ expr
|
|
binaryOp -> expr 40<- expr
|
|
|
|
ternaryOp -> expr 90>? expr 90<: expr
|
|
|
|
|
|
isolation -> ( expr )
|
|
|
|
|
|
|
|
####################################
|
|
|
|
|
|
NUMBER is a terminal
|
|
|
|
40<+ expr means that token "+" is a left associative ( < ) operator of precedence 40
|
|
|
|
and
|
|
|
|
55>-? expr means that token "-" is a right associative ( > ) operator of precedence 55 repeated at most once
|
|
|
|
|
|
10>? expr means that token "?" is a right associative ( > ) operator of precedence 10 |