summaryrefslogtreecommitdiff
path: root/ecomp-c/minie.ebnf
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2020-02-29 14:10:25 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2020-02-29 14:10:25 +0100
commit515cb682ddd41a2815af4fa46ac7c17b6edbaa9d (patch)
treef767f4b17ca5907a562dd1a7b8f1952744d12718 /ecomp-c/minie.ebnf
parent37303cd173fa0d19474439c011a9ebaefa0d1604 (diff)
downloadcompilertests-515cb682ddd41a2815af4fa46ac7c17b6edbaa9d.tar.gz
compilertests-515cb682ddd41a2815af4fa46ac7c17b6edbaa9d.tar.bz2
added brakets for expressions
fixed parsing issues around identifier() - do not call it directly, always use getSym - added support for enumerations of variables in declarations
Diffstat (limited to 'ecomp-c/minie.ebnf')
-rw-r--r--ecomp-c/minie.ebnf4
1 files changed, 2 insertions, 2 deletions
diff --git a/ecomp-c/minie.ebnf b/ecomp-c/minie.ebnf
index 7e2c36b..e61f5a2 100644
--- a/ecomp-c/minie.ebnf
+++ b/ecomp-c/minie.ebnf
@@ -5,7 +5,7 @@ Special = "_" .
Identifier = Letter { Letter | Digit | Special } .
Number = Digit { Digit } .
-Factor = Number | Identifier .
+Factor = Number | Identifier | "(" Expression ")" .
Term = Factor { ( "*" | "/" ) Factor } .
Expression = Term { ( "+" | "-" ) Term } .
Assignment = Identifier ":=" Expression .
@@ -16,7 +16,7 @@ SimpleType = Identifier .
Type = SimpleType .
ConstDeclaration = Identifier ":" Type "=" Number .
ConstBlock = "const" { ConstDeclaration ";" } .
-VariableDeclaration = Identifier ":" Type .
+VariableDeclaration = Identifier { "," Identifier } ":" Type .
VariableBlock = "var" { VariableDeclaration ";" } .
DeclarationBlock = ConstBlock VariableBlock .
Module = "module" Identifier ";" DeclarationBlock StatementBlock .