type Verbosity = Int
+cHeader = "#include <stdio.h>\nint read(){\nint n;\nscanf(\"%d\",&n);\nreturn n;\n}\nint main(void){\n"
+
+cFooter = "return 0;}"
+
putStrV :: Verbosity -> String -> IO ()
putStrV v s = if v > 1 then putStrLn s else return ()
putStrLn s
Ok (Program s) -> do
runStateT (mapM typeCheckStm s) [empty]
- putStr $ concat (map compileStm s)
+ putStr $ cHeader++concat (map compileStm s)++cFooter
return ()
showTree :: (Show a, Print a) => Int -> a -> IO ()