summaryrefslogtreecommitdiff
path: root/old
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2018-09-06 21:12:33 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2018-09-06 21:12:33 +0200
commit6b354f74920750e3bb36748b439d09a85d8f3364 (patch)
tree88a5bbf818e87be562b2237459481344fad202d6 /old
parent050fc2ae7fc8b182825fe209081bae304f1cf9c5 (diff)
downloadcompilertests-6b354f74920750e3bb36748b439d09a85d8f3364.tar.gz
compilertests-6b354f74920750e3bb36748b439d09a85d8f3364.tar.bz2
added expressions
Diffstat (limited to 'old')
-rw-r--r--old/minie.ebnf6
1 files changed, 4 insertions, 2 deletions
diff --git a/old/minie.ebnf b/old/minie.ebnf
index 2407766..e8be909 100644
--- a/old/minie.ebnf
+++ b/old/minie.ebnf
@@ -1,10 +1,12 @@
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".
+ "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 } .
Number = Digit { Digit } .
Constant = Number .
-Expression = Constant .
+Factor = Constant | VariableName | "(" Expression ")" .
+Term = Factor { ( "*" | "/" ) Factor } .
+Expression = Term { ( "+" | "-" ) Term } .
VariableName = Identifier .
Assignment = VariableName ":=" Expression .
Statement = Assignment .