diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2018-09-07 21:52:37 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2018-09-07 21:52:37 +0200 |
commit | 87da5f12b7c055471bce6eb5e9b19607f09500ec (patch) | |
tree | d8b1b1aeed14f1bcc113d96eb916a91752c48d61 /old | |
parent | c34d5150cd44af39b12cf5af7ff627677bb82c02 (diff) | |
download | compilertests-87da5f12b7c055471bce6eb5e9b19607f09500ec.tar.gz compilertests-87da5f12b7c055471bce6eb5e9b19607f09500ec.tar.bz2 |
some dabbling with parsing ifs
Diffstat (limited to 'old')
-rw-r--r-- | old/minie.ebnf | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/old/minie.ebnf b/old/minie.ebnf index 65bbdec..04beb5a 100644 --- a/old/minie.ebnf +++ b/old/minie.ebnf @@ -9,8 +9,10 @@ Term = Factor { ( "*" | "/" ) Factor } . Expression = [ "+" | "-" ] Term { ( "+" | "-" ) Term } . VariableName = Identifier . Assignment = VariableName ":=" Expression . -Statement = Assignment . -StatementBlock = "begin" "end" | ( Statement { ";" Statement } "end" ) . +StatementList = Statement { ";" Statement } +IfStatement = "if" Condition "do" StatementList "else" StatementList "end" . +Statement = Assignment | IfStatement . +StatementBlock = "begin" StatementList "end" . VariableDeclaration = Identifier ":" Type . DeclarationBlock = "VAR" VariableDeclaration { ";" VariableDeclaration } . Module = "module" Identifier ";" DeclarationBlock StatementBlock . |