about summary refs log tree commit diff
path: root/grammar.ebnf
diff options
context:
space:
mode:
authorBaitinq <[email protected]>2025-03-29 11:22:13 +0100
committerBaitinq <[email protected]>2025-03-29 11:27:15 +0100
commitd74c6a363cf457a2197f3f10c0d567a77573e79c (patch)
treeb82cad7904e8493c28cfa1612de2e0e081484e0c /grammar.ebnf
parentCodegen: Support void type (diff)
downloadinterpreter-d74c6a363cf457a2197f3f10c0d567a77573e79c.tar.gz
interpreter-d74c6a363cf457a2197f3f10c0d567a77573e79c.tar.bz2
interpreter-d74c6a363cf457a2197f3f10c0d567a77573e79c.zip
Feature: Add basic support for pointer references and dereferences
Diffstat (limited to 'grammar.ebnf')
-rw-r--r--grammar.ebnf4
1 files changed, 2 insertions, 2 deletions
diff --git a/grammar.ebnf b/grammar.ebnf
index 83da90a..85d824d 100644
--- a/grammar.ebnf
+++ b/grammar.ebnf
@@ -2,7 +2,7 @@ Program      ::= Statement+
 
 Statement    ::= (AssignmentStatement | ExternDeclaration | FunctionCallStatement | IfStatement | WhileStatement | ReturnStatement) SEMICOLON
 
-AssignmentStatement ::= "let"? IDENTIFIER EQUALS Expression
+AssignmentStatement ::= ("let")? ("*")? IDENTIFIER EQUALS Expression
 
 ExternDeclaration ::= "extern" IDENTIFIER EQUALS Type
 
@@ -24,7 +24,7 @@ AdditiveExpression ::= MultiplicativeExpression (("+" | "-") MultiplicativeExpre
 
 MultiplicativeExpression ::= UnaryExpression (("*" | "/" | "%") UnaryExpression)*
 
-UnaryExpression ::= ("!" | "-") UnaryExpression | PrimaryExpression
+UnaryExpression ::= ("!" | "-" | "*") UnaryExpression | PrimaryExpression
 
 PrimaryExpression ::= NUMBER | BOOLEAN | STRING | IDENTIFIER | FunctionCallStatement | FunctionDefinition | LPAREN Expression RPAREN