1 {-# LANGUAGE OverloadedStrings #-}
4 import System.Environment
6 import Data.String.Utils
8 import qualified Data.ByteString.Lazy as B
16 import Mate.BasicBlocks
17 import Mate.X86CodeGen
18 import Mate.MethodPool
29 let bclspath = B.pack $ map (fromIntegral . ord) clspath
30 cls <- getClassFile bclspath
32 hmap <- parseMethod cls "main"
36 let methods = classMethods cls; methods :: [Method Resolved]
37 let method = find (\x -> (methodName x) == "main") methods
40 entry <- compileBB hmap' (MethodInfo "main" bclspath (methodSignature m))
41 printf "executing `main' now:\n"
43 Nothing -> error "main not found"
44 Nothing -> error "main not found"
45 _ -> error "Usage: mate <class-file>"