]> ruin.nu Git - proglang.git/blobdiff - Typecheck.hs
CompInt, integrated compiler and interpreter for the new century
[proglang.git] / Typecheck.hs
index 70aad706a88cfc5b38a1863744ccce563772e490..1b0baa00ed5d48dc760f029f9759e8bb821eed9c 100644 (file)
@@ -1,4 +1,4 @@
-module Typecheck (typeCheckExp, typeCheckStm, typeCheckVar) where 
+module Typecheck (typeCheck,typeCheckExp, typeCheckStm, typeCheckVar) where 
 
 
 import Abssyntax
@@ -16,6 +16,9 @@ assert :: Monad m => Bool -> String -> m ()
 assert True _ = return ()
 assert False s = fail s
 
+typeCheck :: [Stm] -> IO ()
+typeCheck s = runStateT (mapM typeCheckStm s) [empty] >> return ()
+
 typeCheckExp :: (MonadState Types m) => Exp -> m Type
 typeCheckExp (BiOpExp e o e') = do
        t1 <- typeCheckExp e