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

13
src/BC/Types.hs Normal file
View File

@@ -0,0 +1,13 @@
module BC.Types where
data Value = BInt Integer
| BOp String
| BErr String
instance Show Value where
show (BInt i) = show i
show (BOp o) = o
show (BErr e) = "error: " ++ e
isErr :: Value -> Bool
isErr (BErr _) = True
isErr _ = False