{-# LANGUAGE RecordWildCards, BangPatterns #-}
-- | This module declares (low-level) data types for Java .class files
-- structures, and Binary instances to read/write them.
-module JVM.ClassFile where
+module JVM.ClassFile
+ (ClassFile (..),
+ CpInfo (..),
+ FieldInfo (..),
+ MethodInfo (..),
+ AttributeInfo (..),
+ FieldType,
+ FieldSignature, MethodSignature (..), ReturnSignature (..)
+ )
+ where
import Control.Monad
import Control.Applicative
putStrLn "Methods:"
forM_ (methods cls) $ \m -> do
putStr ">> Method "
- B.putStrLn (methodName m)
+ B.putStr (methodName m)
+ print (methodSignature m)
case attrByName m "Code" of
Nothing -> putStrLn "(no code)\n"
Just bytecode -> let code = decodeS (0 :: Integer) bytecode