]> ruin.nu Git - proglang.git/blobdiff - Interpret.hs
CompInt, integrated compiler and interpreter for the new century
[proglang.git] / Interpret.hs
index c5ef5e0589a302c44e7ac2436cea97660312c366..0728d5181c967cf6d109f3327f2d8905e6738b1e 100644 (file)
@@ -1,4 +1,4 @@
-module Interpret (eval, execute, Value(VInt, VBool)) where
+module Interpret (interpret, eval, execute, Value(VInt, VBool)) where
 
 import Abssyntax
 import Control.Monad.State
@@ -14,6 +14,9 @@ instance Show Value where
 
 type Variables = [Map Ident Value]
 
+interpret :: [Stm] -> IO ()
+interpret s = runStateT (mapM execute s) [empty] >> return ()
+
 --eval :: (MonadState Variables m) => Exp -> m Value
 eval :: Exp -> StateT Variables IO Value
 eval (EBool b) = return (VBool b)