Skip to content
Snippets Groups Projects
Commit ec389e8e authored by Hans-Peter Deifel's avatar Hans-Peter Deifel
Browse files

Compile to C in main function

parent d461be32
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,7 @@ data CFG = CFG
{ cfgGraph :: Graph
, cfgGetBlock :: Vertex -> (Block, Text, [Text])
, cfgGetVertex :: Text -> Maybe Vertex
, cfgEntryVertex :: Vertex
, cfgEntryVertex :: Vertex -- TODO Remove
}
instance Show CFG where
......
......@@ -5,6 +5,8 @@ import qualified Data.Text.IO as T
import qualified CFG.Parser as P
import CFG.Graph
import CFG.IR
import CFG.C
main :: IO ()
main = do
......@@ -12,5 +14,5 @@ main = do
case P.parseFile "<stdin>" cntnt of
Left err -> print err
Right res -> do
let graphs = map graphify res
print graphs
let funs = map (compileToC . fmap flattenCFG . cfg) res
mapM_ T.putStrLn funs
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment