summary refs log blame commit diff
path: root/grammar.ebnf
blob: 1ac139e00aa7a01934bb563fb704ac0d93f868ea (plain) (tree)
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 | Expression + Expression