diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2020-02-29 14:10:25 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2020-02-29 14:10:25 +0100 |
commit | 515cb682ddd41a2815af4fa46ac7c17b6edbaa9d (patch) | |
tree | f767f4b17ca5907a562dd1a7b8f1952744d12718 /ecomp-c/minie.ebnf | |
parent | 37303cd173fa0d19474439c011a9ebaefa0d1604 (diff) | |
download | compilertests-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.ebnf | 4 |
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 . |