lcc/grammar
2020-08-20 17:11:43 +02:00

5 lines
No EOL
179 B
Text

<program> ::= <function>
<function> ::= "int" <id> "(" ")" "{" <statement> "}"
<statement> ::= "return" <exp> ";"
<exp> ::= <unary_op> <exp> | <int>
<unary_op> ::= "!" | "~" | "-"