blob: 35a70795922b7645fa2a7d63a64f4a93c436ede5 (
plain) (
tree)
|
|
Program ::= Statement+
Statement ::= (AssignmentStatement | FunctionCallStatement) SEMICOLON
AssignmentStatement ::= "let" IDENTIFIER EQUALS Expression
FunctionCallStatement ::= IDENTIFIER LPAREN FunctionArguments? RPAREN
FunctionArguments ::= Expression ("," Expression)*
Expression ::= AdditiveExpression | FunctionDefinition
AdditiveExpression ::= PrimaryExpression ("+" AdditiveExpression)
PrimaryExpression ::= NUMBER | IDENTIFIER | FunctionCallStatement
FunctionDefinition ::= LPAREN FunctionParamters? RPAREN ARROW LBRACE Statement* ReturnStatement RBRACE
FunctionParameters ::= IDENTIFIER ("," IDENTIFIER)*
ReturnStatement ::= RETURN Expression SEMICOLON --TODO: I dont like this
|