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