summary refs log tree commit diff
path: root/grammar.ebnf
blob: 1423e74f771ac4a4ad83a0cab2e288a80cd3f149 (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