diff options
Diffstat (limited to 'grammar.ebnf')
| -rw-r--r-- | grammar.ebnf | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/grammar.ebnf b/grammar.ebnf index 562f2f8..cbc3f0a 100644 --- a/grammar.ebnf +++ b/grammar.ebnf @@ -1,8 +1,10 @@ Program ::= Statement+ -Statement ::= (AssignmentStatement | FunctionCallStatement | IfStatement | WhileStatement | ReturnStatement) SEMICOLON +Statement ::= (AssignmentStatement | ExternDeclaration | FunctionCallStatement | IfStatement | WhileStatement | ReturnStatement) SEMICOLON -AssignmentStatement ::= "let" IDENTIFIER EQUALS (Type | Expression) +AssignmentStatement ::= "let"? IDENTIFIER EQUALS Expression + +ExternDeclaration ::= "extern" IDENTIFIER EQUALS Type FunctionCallStatement ::= (IDENTIFIER | FunctionDefinition) LPAREN FunctionArguments? RPAREN |