summary refs log tree commit diff
path: root/grammar.ebnf
blob: cc087feecf4417dfc64be504081a79945d5fdaa9 (plain) (blame)
1
2
3
4
5
6
7
8
9
Program ::= Statement+

Statement ::= (VariableStatement | PrintStatement) SEMICOLON

VariableStatement ::= ("let" IDENTIFIER | IDENTIFIER) EQUALS Expression

PrintStatement :== PRINT LPAREN Expression RPAREN

Expression :== NUMBER | IDENTIFIER | LPAREN Expression RPAREN