diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2018-12-26 21:46:01 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2018-12-26 21:46:01 +0100 |
commit | 50c50f34707df53e373ed2d772098162179142f9 (patch) | |
tree | 56e0fd512f57966509fdf21497be778b551d32bd /old | |
parent | 62d6644b2ab51ee8dda46752f1e7c8d422b65e04 (diff) | |
download | compilertests-50c50f34707df53e373ed2d772098162179142f9.tar.gz compilertests-50c50f34707df53e373ed2d772098162179142f9.tar.bz2 |
added formal parameter declarations for procedures and return types for functions
added for loop
Diffstat (limited to 'old')
-rw-r--r-- | old/minie.ebnf | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/old/minie.ebnf b/old/minie.ebnf index ef38829..adb2eeb 100644 --- a/old/minie.ebnf +++ b/old/minie.ebnf @@ -16,15 +16,19 @@ StatementList = Statement { ";" Statement } IfStatement = "if" Condition "do" StatementList "else" StatementList "end" . ParameterList = "(" [ Expression { "," Expression } ] ")" . ProdecureCall = QualifiedIdentifier ParameterList . -Statement = Assignment | IfStatement | ProcedureCall . +ForStatement = "for" identifier ":=" Expression "to" Expression "do" StatementList "end" . +Statement = Assignment | IfStatement | ForStatement | ProcedureCall . StatementBlock = "begin" StatementList "end" . VariableName = Identifier . SimpleType = Identifier . -ArrayType = "array" Length "of" Type . +ArrayType = "array" [ Number ] "of" Type . Type = SimpleType | ArrayType . VariableDeclaration = VariableName ":" Type . VariableBlock = "var" { VariableDeclaration ";" } . ImportBlock = "import" Identifier { "," Identifier } . -ProcedureDeclaration = "procedure" Identifier ";" DeclarationBlock StatementBlock . +ParameterDeclaration = "(" [ Parameter { ";" Parameter } ] ")" [ ":" QualifiedIdentifier ] . +Parameter = ident ":" ParameterType . +ParameterType = [ "array" "of" ] Type . +ProcedureDeclaration = "procedure" Identifier [ ParameterDeclaration ] ";" DeclarationBlock StatementBlock . DeclarationBlock = [ VariableBlock ] { ProcedureDeclaration ";" } . Module = "module" Identifier ";" [ ImportBlock ] DeclarationBlock StatementBlock . |