summaryrefslogtreecommitdiff
path: root/ecomp-c/minie.ebnf
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-c/minie.ebnf')
-rw-r--r--ecomp-c/minie.ebnf9
1 files changed, 6 insertions, 3 deletions
diff --git a/ecomp-c/minie.ebnf b/ecomp-c/minie.ebnf
index 484572d..be68ba8 100644
--- a/ecomp-c/minie.ebnf
+++ b/ecomp-c/minie.ebnf
@@ -17,7 +17,8 @@ Expression = SimpleExpression [ RelationalOperator SimpleExpression ] .
Assignment = Identifier [ "[" Expression "]" ] ":=" Expression .
IfStatement = "if" Expression "do" StatementSequence "else" StatementSequence "end" .
WhileStatement = "while" Expression "do" StatementSequence "end" .
-ProcedureCall = Identifier .
+ParameterList = "(" Expression { "," Expression } ")" .
+ProcedureCall = Identifier [ ParameterList ] .
Statement = Assignment | IfStatement | WhileStatement | ProcedureCall .
StatementSequence = Statement { ";" Statement } .
StatementBlock = "begin" StatementSequence "end" .
@@ -29,8 +30,10 @@ ConstDeclaration = Identifier { "," Identifier } ":" Type "=" ConstExpression .
ConstBlock = "const" { ConstDeclaration ";" } .
VariableDeclaration = Identifier { "," Identifier } ":" Type [ ":=" ConstExpression ] .
VariableBlock = "var" { VariableDeclaration ";" } .
-ProcedureDeclaration = "procedure" Identifier ";" ProcedureDeclarationBlock StatementBlock .
-ProcedureBlock = { ProcedureDeclaration } .
+ParameterDeclaration = Identifier ":" Type .
+ParamaterDeclarationList = "(" ParameterDeclaration { "," ParameterDeclaration } ")" .
+ProcedureDeclaration = "procedure" Identifier [ ParamaterDeclarationList ] ";" ProcedureDeclarationBlock StatementBlock .
ProcedureDeclarationBlock = [ ConstBlock ] [ VariableBlock ] .
+ProcedureBlock = { ProcedureDeclaration } .
DeclarationBlock = [ ConstBlock ] [ VariableBlock ] [ ProcedureBlock ] .
Module = "module" Identifier ";" DeclarationBlock StatementBlock .