summaryrefslogtreecommitdiff
path: root/old
diff options
context:
space:
mode:
Diffstat (limited to 'old')
-rw-r--r--old/minie.ebnf10
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 .