summaryrefslogtreecommitdiff
path: root/old
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2018-08-16 16:05:07 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2018-08-16 16:05:07 +0200
commitef905e956911d0010532ee8348c144474ce8f1d6 (patch)
tree19c624b5efcbcae1423ba5b2754e29805dabba12 /old
parente010c35dd67d24a6bbf1acd5ae0ed1d64d0d905d (diff)
downloadcompilertests-ef905e956911d0010532ee8348c144474ce8f1d6.tar.gz
compilertests-ef905e956911d0010532ee8348c144474ce8f1d6.tar.bz2
crenshaw: started to implement functions, added a todo
Diffstat (limited to 'old')
-rw-r--r--old/crenshaw.ebnf7
1 files changed, 5 insertions, 2 deletions
diff --git a/old/crenshaw.ebnf b/old/crenshaw.ebnf
index 8b1effa..880ad6c 100644
--- a/old/crenshaw.ebnf
+++ b/old/crenshaw.ebnf
@@ -2,7 +2,10 @@ 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".
Num = Digit .
-Variable = Letter .
+Name = Letter .
+Variable = Name .
+Function = "(" Name ")" .
+Ident = Variable | Function.
Expression = Term { ( "+" | "-" ) Term } .
Term = Factor { ( "*" | "/" ) Factor } .
-Factor = Num | "(" Expression ")" | Variable .
+Factor = Num | "(" Expression ")" | Ident .