added parser and eval stub

This commit is contained in:
2017-04-28 18:07:46 +02:00
parent 71983ddf3e
commit 4c965e8891
6 changed files with 79 additions and 11 deletions

9
src/BC/Eval.hs Normal file
View File

@@ -0,0 +1,9 @@
module BC.Eval (eval) where
import BC.Types
eval :: [Value] -> Value
eval [x@(BInt _)] = x
eval [(BOp x)] = BErr ("operation " ++ x ++ " requires arguments")
eval (x:xy) = x
eval [] = BOp ""