lexing and parsing unary operators
This commit is contained in:
parent
b2c2a2f497
commit
202c1d2ca2
21 changed files with 290 additions and 130 deletions
3
grammar
3
grammar
|
|
@ -1,4 +1,5 @@
|
|||
<program> ::= <function>
|
||||
<function> ::= "int" <id> "(" ")" "{" <statement> "}"
|
||||
<statement> ::= "return" <exp> ";"
|
||||
<exp> ::= <int>
|
||||
<exp> ::= <unary_op> <exp> | <int>
|
||||
<unary_op> ::= "!" | "~" | "-"
|
||||
Loading…
Add table
Add a link
Reference in a new issue