broken shitty code

This commit is contained in:
Clemens-Dautermann 2020-08-23 00:54:58 +02:00
parent e6b20b5aa9
commit 5ec5c64775
28 changed files with 322 additions and 72 deletions

View file

@ -1,5 +1,10 @@
<program> ::= <function>
<function> ::= "int" <id> "(" ")" "{" <statement> "}"
<statement> ::= "return" <exp> ";"
<exp> ::= <unary_op> <exp> | <int>
<unary_op> ::= "!" | "~" | "-"
<exp> ::= <term> { ("+" | "-") <term> }
<term> ::= <factor> { ("*" | "/") <factor> }
<factor> ::= "(" <exp> ")" | <unary_op> <factor> | <int>
<unary_op> ::= "!" | "~" | "-"
------------
6+5+2*(3-2)+9