summaryrefslogtreecommitdiff
path: root/old
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2018-09-29 21:29:28 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2018-09-29 21:29:28 +0200
commit9e5c8a8491c6bd1aff0cddb093c55a580f7fcbb1 (patch)
treeb5529b1d06d797ed31e16a5b3e6558ebc77659e0 /old
parent0edac98af9ced6ae42059f2989a5fe4bd4c75d27 (diff)
downloadcompilertests-9e5c8a8491c6bd1aff0cddb093c55a580f7fcbb1.tar.gz
compilertests-9e5c8a8491c6bd1aff0cddb093c55a580f7fcbb1.tar.bz2
more work on parameter lists, added string parser
Diffstat (limited to 'old')
-rw-r--r--old/minie.ebnf15
1 files changed, 9 insertions, 6 deletions
diff --git a/old/minie.ebnf b/old/minie.ebnf
index 42dcc15..2562aaa 100644
--- a/old/minie.ebnf
+++ b/old/minie.ebnf
@@ -1,22 +1,25 @@
Digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" .
Letter = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" |
"a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z".
-Identifier = Letter { Letter | Digit } .
+Character = Digit | Letter | "!" | " " | "#" | "$" | "%" | "'" | "(" | ")" | "*" | "+" | "," | "," | "-" | "." | "/" | "[" | "]" | "\" | "^" | "_" | "`" | "{" | "|" | "}" | "~" .
Number = Digit { Digit } .
-Constant = Number .
-Factor = [ "+" | "-" ] Constant | VariableName | "(" Expression ")" .
+String = """ { Character | """ """ } """ | "'" .
+Identifier = Letter { Letter | Digit } .
+
+QualifiedIdentifier = Identifier [ "." Identifier ];
+Factor = [ "+" | "-" ] Number | String | QualifiedIdentifier | "(" Expression ")" .
Term = Factor { ( "*" | "/" ) Factor } .
Expression = Term { ( "+" | "-" ) Term } .
VariableName = Identifier .
Assignment = VariableName ":=" Expression .
StatementList = Statement { ";" Statement }
IfStatement = "if" Condition "do" StatementList "else" StatementList "end" .
-QualifiedIdentifier = Identifier [ "." Identifier ];
-ParameterList = "(" ")" .
+ParameterList = "(" [ Expression { "," Expression } ] ")" .
ProdecureCall = QualifiedIdentifier ParameterList .
Statement = Assignment | IfStatement | ProcedureCall .
StatementBlock = "begin" StatementList "end" .
-VariableDeclaration = Identifier ":" Type .
+VariableName = Identifier .
+VariableDeclaration = VariableName ":" Type .
VariableBlock = "VAR" { VariableDeclaration ";" } .
ImportBlock = "IMPORT" Identifier { "," Identifier } .
ProcedureDeclaration = "PROCEDURE" Identifier ";" DeclarationBlock StatementBlock .