blob: 65cd74e7d4131b366fd4293a3e3a818a86434c80 (
plain) (
tree)
|
|
Program ::= Statement+
Statement ::= (AssignmentStatement | PrintStatement | FunctionCallStatement) SEMICOLON
AssignmentStatement ::= "let" IDENTIFIER EQUALS Expression
PrintStatement ::= PRINT LPAREN Expression RPAREN -- TODO: this won't be needed once functions support arguments
FunctionCallStatement ::= IDENTIFIER LPAREN RPAREN
Expression ::= AdditiveExpression | FunctionDefinition
AdditiveExpression ::= PrimaryExpression ("+" AdditiveExpression)
PrimaryExpression ::= NUMBER | IDENTIFIER | FunctionCallStatement
FunctionDefinition ::= ARROW LBRACE Statement* ReturnStatement RBRACE
ReturnStatement ::= RETURN Expression SEMICOLON --TODO: I dont like this
|