From d74c6a363cf457a2197f3f10c0d567a77573e79c Mon Sep 17 00:00:00 2001 From: Baitinq Date: Sat, 29 Mar 2025 11:22:13 +0100 Subject: Feature: Add basic support for pointer references and dereferences --- grammar.ebnf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'grammar.ebnf') 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 -- cgit 1.4.1