summary refs log blame commit diff
path: root/grammar.ebnf
blob: 5340ba4fa849dce619ce26c931363a2a0e5e2f17 (plain) (tree)
1
2
3
4
5
6
7
8
9
10

                      
                                                                              




                                                                       

                                     
                                                            
Program ::= Statement+

Statement ::= (VariableStatement | PrintStatement | ReturnStatement) SEMICOLON

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

PrintStatement :== PRINT LPAREN Expression RPAREN

ReturnStatement :== RETURN Expression

Expression :== NUMBER | IDENTIFIER | Expression + Expression