summaryrefslogtreecommitdiff
path: root/ecomp-c/minie.ebnf
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-c/minie.ebnf')
-rw-r--r--ecomp-c/minie.ebnf5
1 files changed, 3 insertions, 2 deletions
diff --git a/ecomp-c/minie.ebnf b/ecomp-c/minie.ebnf
index bd1eb08..be82d9e 100644
--- a/ecomp-c/minie.ebnf
+++ b/ecomp-c/minie.ebnf
@@ -18,9 +18,10 @@ StatementSequence = Statement { ";" Statement } .
StatementBlock = "begin" StatementList "end" .
SimpleType = Identifier .
Type = SimpleType .
-ConstDeclaration = Identifier { "," Identifier } ":" Type "=" ( Number | Identifier ).
+ConstExpression = ( Number | Identifier ) .
+ConstDeclaration = Identifier { "," Identifier } ":" Type "=" ConstExpression .
ConstBlock = "const" { ConstDeclaration ";" } .
-VariableDeclaration = Identifier { "," Identifier } ":" Type .
+VariableDeclaration = Identifier { "," Identifier } ":" Type [ ":=" ConstExpression ] .
VariableBlock = "var" { VariableDeclaration ";" } .
DeclarationBlock = ConstBlock VariableBlock .
Module = "module" Identifier ";" DeclarationBlock StatementBlock .