ffi: added strange hack in order to build master on my machine:
[mate.git] / Mate.hs
diff --git a/Mate.hs b/Mate.hs
index fcd8ffca3d745fdc6bf67ac610ea711279133803..b787c260d3a432a72bb9de885e8f5f6b59a5a673 100644 (file)
--- a/Mate.hs
+++ b/Mate.hs
@@ -1,7 +1,32 @@
 {-# LANGUAGE OverloadedStrings #-}
 module Main where
 
+import System.Environment
+
+import Text.Printf
+
+import JVM.Converter
+import JVM.Dump
+
+import Mate.BasicBlocks
 import Mate.X86CodeGen
+import Mate.MethodPool
 
 main ::  IO ()
-main = test_01
+main = do
+  args <- getArgs
+  register_signal
+  initMethodPool
+  case args of
+    [clspath] -> do
+      cls <- parseClassFile clspath
+      dumpClass cls
+      hmap <- parseMethod cls "main"
+      printMapBB hmap
+      case hmap of
+        Just hmap' -> do
+          entry <- compileBB hmap' cls "main"
+          printf "executing `main' now:\n"
+          executeFuncPtr entry
+        Nothing -> error "main not found"
+    _ -> error "Usage: mate <class-file>"