| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
H2JVM
Description
Unified entry point for the H2JVM library.
This module exposes the high-level, type-safe API for assembling JVM bytecode classes.
For general usage, see the H2JVM.Builder and H2JVM.Builder.Code modules
for constructing class and method bodies, and classFileBytes to serialise.
Synopsis
- data ClassFile = ClassFile {}
- data ClassFileAttribute
- data InnerClassInfo = InnerClassInfo {}
- data JVMVersion
- data MajorVersion
- data MinorVersion
- unwrapMajor :: MajorVersion -> Word16
- unwrapMinor :: MinorVersion -> Word16
- getMajor :: JVMVersion -> MajorVersion
- getMinor :: JVMVersion -> MinorVersion
- java6 :: JVMVersion
- java7 :: JVMVersion
- java8 :: JVMVersion
- java9 :: JVMVersion
- java10 :: JVMVersion
- java11 :: JVMVersion
- java12 :: JVMVersion
- java13 :: JVMVersion
- java14 :: JVMVersion
- java15 :: JVMVersion
- java16 :: JVMVersion
- java17 :: JVMVersion
- java18 :: JVMVersion
- java19 :: JVMVersion
- java20 :: JVMVersion
- java21 :: JVMVersion
- data ClassAccessFlag
- = CPublic
- | CFinal
- | CSuper
- | CInterface
- | CAbstract
- | CSynthetic
- | CAnnotation
- | CEnum
- data MethodAccessFlag
- data ClassFileField = ClassFileField {}
- data ClassFileMethod = ClassFileMethod {}
- newtype MethodAttribute = Code CodeAttributeData
- data CodeAttributeData = CodeAttributeData {}
- data ExceptionTableEntry = ExceptionTableEntry {}
- data CodeAttribute
- data QualifiedClassName
- data PackageName
- data ClassName
- parseQualifiedClassName :: Text -> QualifiedClassName
- parseClassName :: Text -> ClassName
- parsePackageName :: Text -> PackageName
- classFilePath :: ClassFile -> FilePath
- data MethodDescriptor = MethodDescriptor {}
- data ReturnDescriptor
- data FieldType
- data PrimitiveType
- data ConstantPoolEntry
- = CPClassEntry ClassInfoType
- | CPFieldRefEntry FieldRef
- | CPMethodRefEntry MethodRef
- | CPInterfaceMethodRefEntry MethodRef
- | CPStringEntry Text
- | CPIntegerEntry Int32
- | CPFloatEntry Float
- | CPLongEntry Int64
- | CPDoubleEntry Double
- | CPNameAndTypeEntry Text Text
- | CPUTF8Entry Text
- | CPMethodHandleEntry MethodHandleEntry
- | CPMethodTypeEntry MethodDescriptor
- | CPInvokeDynamicEntry BootstrapMethod Text MethodDescriptor
- data MethodHandleEntry
- data FieldRef = FieldRef ClassInfoType Text FieldType
- data MethodRef = MethodRef ClassInfoType Text MethodDescriptor
- data BootstrapMethod = BootstrapMethod MethodHandleEntry [BootstrapArgument]
- data BootstrapArgument
- data CodeBuilder (m :: k) a
- runCodeBuilder :: forall (r :: [(Type -> Type) -> Type -> Type]) a. HasCallStack => Eff ((CodeBuilder :: (Type -> Type) -> Type -> Type) ': r) a -> Eff r (a, [CodeAttribute], NonEmpty Instruction)
- emit :: forall (r :: [Effect]). (CodeBuilder :: (Type -> Type) -> Type -> Type) :> r => Instruction -> Eff r ()
- newLabel :: forall {k} (es :: [Effect]). (HasCallStack, (CodeBuilder :: (Type -> Type) -> Type -> Type) :> es) => Eff es Label
- data Label
- type Instruction = Instruction' Label
- data Instruction' label
- = ALoad U2
- | AStore U2
- | AReturn
- | AConstNull
- | Dup
- | IAnd
- | If (IfCond label)
- | Instanceof ClassInfoType
- | InvokeStatic ClassInfoType Text MethodDescriptor
- | InvokeInterface ClassInfoType Text MethodDescriptor
- | InvokeVirtual ClassInfoType Text MethodDescriptor
- | InvokeDynamic BootstrapMethod Text MethodDescriptor
- | InvokeSpecial ClassInfoType Text MethodDescriptor
- | IOr
- | ILoad U2
- | IStore U2
- | Label label
- | LDC LDCEntry
- | PutStatic ClassInfoType Text FieldType
- | GetField ClassInfoType Text FieldType
- | GetStatic ClassInfoType Text FieldType
- | PutField ClassInfoType Text FieldType
- | Goto label
- | CheckCast ClassInfoType
- | Return
- | IReturn
- | IConst0
- | IConst1
- | New ClassInfoType
- | ArrayLength
- | AALoad
- | IfICmp (IfCond label)
- | IAdd
- | ISub
- | IMul
- | IDiv
- data LDCEntry
- classFileBytes :: ClassFile -> Either CodeConverterError ByteString
- data CodeConverterError
Core Types
High-level representation of a Java class file.
Constructors
| ClassFile | |
Fields
| |
data ClassFileAttribute Source #
Attributes that can be attached to a class file.
Constructors
| InnerClasses [InnerClassInfo] | The |
| EnclosingMethod | The |
| Signature | The |
| SourceFile Text | The name of the source file this class was compiled from. |
| SourceDebugExtension | The |
| Deprecated | The |
| RuntimeVisibleAnnotations | The annotations visible at runtime. |
| RuntimeInvisibleAnnotations | The annotations invisible at runtime. |
| BootstrapMethods [BootstrapMethod] | Bootstrap methods for |
Instances
data InnerClassInfo Source #
Information about an inner class.
Constructors
| InnerClassInfo | |
Fields
| |
Instances
data JVMVersion Source #
A JVM Version Number.
Instances
| Show JVMVersion Source # | |
Defined in H2JVM.JVMVersion Methods showsPrec :: Int -> JVMVersion -> ShowS # show :: JVMVersion -> String # showList :: [JVMVersion] -> ShowS # | |
| Eq JVMVersion Source # | |
Defined in H2JVM.JVMVersion | |
| Ord JVMVersion Source # | |
Defined in H2JVM.JVMVersion Methods compare :: JVMVersion -> JVMVersion -> Ordering # (<) :: JVMVersion -> JVMVersion -> Bool # (<=) :: JVMVersion -> JVMVersion -> Bool # (>) :: JVMVersion -> JVMVersion -> Bool # (>=) :: JVMVersion -> JVMVersion -> Bool # max :: JVMVersion -> JVMVersion -> JVMVersion # min :: JVMVersion -> JVMVersion -> JVMVersion # | |
| Pretty JVMVersion Source # | |
Defined in H2JVM.JVMVersion | |
data MajorVersion Source #
A Major JVM version.
Instances
data MinorVersion Source #
A Minor JVM version.
Instances
unwrapMajor :: MajorVersion -> Word16 Source #
Unwrap the MajorVersion to obtain the raw Word16 value.
unwrapMinor :: MinorVersion -> Word16 Source #
Unwrap the MinorVersion to obtain the raw Word16 value.
getMajor :: JVMVersion -> MajorVersion Source #
Extract the MajorVersion from a JVMVersion.
getMinor :: JVMVersion -> MinorVersion Source #
Extract the MinorVersion from a JVMVersion (always 0 for standard JVMs).
java6 :: JVMVersion Source #
JVM Version number representing Java 6 (class file major version 50).
java7 :: JVMVersion Source #
JVM Version number representing Java 7 (class file major version 51).
java8 :: JVMVersion Source #
JVM Version number representing Java 8 (class file major version 52).
java9 :: JVMVersion Source #
JVM Version number representing Java 9 (class file major version 53).
java10 :: JVMVersion Source #
JVM Version number representing Java 10 (class file major version 54).
java11 :: JVMVersion Source #
JVM Version number representing Java 11 (class file major version 55).
java12 :: JVMVersion Source #
JVM Version number representing Java 12 (class file major version 56).
java13 :: JVMVersion Source #
JVM Version number representing Java 13 (class file major version 57).
java14 :: JVMVersion Source #
JVM Version number representing Java 14 (class file major version 58).
java15 :: JVMVersion Source #
JVM Version number representing Java 15 (class file major version 59).
java16 :: JVMVersion Source #
JVM Version number representing Java 16 (class file major version 60).
java17 :: JVMVersion Source #
JVM Version number representing Java 17 (class file major version 61).
java18 :: JVMVersion Source #
JVM Version number representing Java 18 (class file major version 62).
java19 :: JVMVersion Source #
JVM Version number representing Java 19 (class file major version 63).
java20 :: JVMVersion Source #
JVM Version number representing Java 20 (class file major version 64).
java21 :: JVMVersion Source #
JVM Version number representing Java 21 (class file major version 65).
data ClassAccessFlag Source #
Access flags for a class.
Constructors
| CPublic | |
| CFinal | |
| CSuper | |
| CInterface | |
| CAbstract | |
| CSynthetic | |
| CAnnotation | |
| CEnum |
Instances
data MethodAccessFlag Source #
Access flags for a method.
Constructors
| MPublic | |
| MPrivate | |
| MProtected | |
| MStatic | |
| MFinal | |
| MSynchronized | |
| MBridge | |
| MVarargs | |
| MNative | |
| MAbstract | |
| MStrict | |
| MSynthetic |
Instances
data ClassFileField Source #
A field in a Java class file.
Constructors
| ClassFileField | |
Fields
| |
Instances
| Show ClassFileField Source # | |
Defined in H2JVM.ClassFile.Field Methods showsPrec :: Int -> ClassFileField -> ShowS # show :: ClassFileField -> String # showList :: [ClassFileField] -> ShowS # | |
| Pretty ClassFileField Source # | |
Defined in H2JVM.ClassFile.Field Methods pretty :: ClassFileField -> Doc ann Source # prettyList :: [ClassFileField] -> Doc ann Source # | |
data ClassFileMethod Source #
A high level representation of a method in a class file.
Constructors
| ClassFileMethod | |
Fields
| |
Instances
| Show ClassFileMethod Source # | |
Defined in H2JVM.ClassFile.Method Methods showsPrec :: Int -> ClassFileMethod -> ShowS # show :: ClassFileMethod -> String # showList :: [ClassFileMethod] -> ShowS # | |
| Pretty ClassFileMethod Source # | |
Defined in H2JVM.ClassFile.Method Methods pretty :: ClassFileMethod -> Doc ann Source # prettyList :: [ClassFileMethod] -> Doc ann Source # | |
newtype MethodAttribute Source #
An attribute of a method.
Constructors
| Code CodeAttributeData | The bytecode instructions and execution context of the method body. |
Instances
data CodeAttributeData Source #
The data contained in a Code attribute.
Constructors
| CodeAttributeData | |
Fields
| |
Instances
| Data CodeAttributeData Source # | |||||
Defined in H2JVM.ClassFile.Method Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CodeAttributeData -> c CodeAttributeData # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CodeAttributeData # toConstr :: CodeAttributeData -> Constr # dataTypeOf :: CodeAttributeData -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CodeAttributeData) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CodeAttributeData) # gmapT :: (forall b. Data b => b -> b) -> CodeAttributeData -> CodeAttributeData # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CodeAttributeData -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CodeAttributeData -> r # gmapQ :: (forall d. Data d => d -> u) -> CodeAttributeData -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> CodeAttributeData -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> CodeAttributeData -> m CodeAttributeData # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CodeAttributeData -> m CodeAttributeData # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CodeAttributeData -> m CodeAttributeData # | |||||
| Generic CodeAttributeData Source # | |||||
Defined in H2JVM.ClassFile.Method Associated Types
Methods from :: CodeAttributeData -> Rep CodeAttributeData x # to :: Rep CodeAttributeData x -> CodeAttributeData # | |||||
| Show CodeAttributeData Source # | |||||
Defined in H2JVM.ClassFile.Method Methods showsPrec :: Int -> CodeAttributeData -> ShowS # show :: CodeAttributeData -> String # showList :: [CodeAttributeData] -> ShowS # | |||||
| DataMergeable CodeAttributeData Source # | |||||
Defined in H2JVM.ClassFile.Method Methods merge :: CodeAttributeData -> CodeAttributeData -> CodeAttributeData Source # | |||||
| Pretty CodeAttributeData Source # | |||||
Defined in H2JVM.ClassFile.Method Methods pretty :: CodeAttributeData -> Doc ann Source # prettyList :: [CodeAttributeData] -> Doc ann Source # | |||||
| type Rep CodeAttributeData Source # | |||||
Defined in H2JVM.ClassFile.Method type Rep CodeAttributeData = D1 ('MetaData "CodeAttributeData" "H2JVM.ClassFile.Method" "h2jvm-0.1.0.0-LWhbtWHvrTPFtGJV7ONYMS" 'False) (C1 ('MetaCons "CodeAttributeData" 'PrefixI 'True) ((S1 ('MetaSel ('Just "maxStack") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 U2) :*: S1 ('MetaSel ('Just "maxLocals") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 U2)) :*: (S1 ('MetaSel ('Just "code") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty Instruction)) :*: (S1 ('MetaSel ('Just "exceptionTable") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ExceptionTableEntry]) :*: S1 ('MetaSel ('Just "codeAttributes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [CodeAttribute]))))) | |||||
data ExceptionTableEntry Source #
An entry in the method's exception handler table.
Constructors
| ExceptionTableEntry | |
Fields
| |
Instances
| Data ExceptionTableEntry Source # | |||||
Defined in H2JVM.ClassFile.Method Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ExceptionTableEntry -> c ExceptionTableEntry # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ExceptionTableEntry # toConstr :: ExceptionTableEntry -> Constr # dataTypeOf :: ExceptionTableEntry -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ExceptionTableEntry) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ExceptionTableEntry) # gmapT :: (forall b. Data b => b -> b) -> ExceptionTableEntry -> ExceptionTableEntry # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ExceptionTableEntry -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ExceptionTableEntry -> r # gmapQ :: (forall d. Data d => d -> u) -> ExceptionTableEntry -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ExceptionTableEntry -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ExceptionTableEntry -> m ExceptionTableEntry # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ExceptionTableEntry -> m ExceptionTableEntry # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ExceptionTableEntry -> m ExceptionTableEntry # | |||||
| Generic ExceptionTableEntry Source # | |||||
Defined in H2JVM.ClassFile.Method Associated Types
Methods from :: ExceptionTableEntry -> Rep ExceptionTableEntry x # to :: Rep ExceptionTableEntry x -> ExceptionTableEntry # | |||||
| Show ExceptionTableEntry Source # | |||||
Defined in H2JVM.ClassFile.Method Methods showsPrec :: Int -> ExceptionTableEntry -> ShowS # show :: ExceptionTableEntry -> String # showList :: [ExceptionTableEntry] -> ShowS # | |||||
| Pretty ExceptionTableEntry Source # | |||||
Defined in H2JVM.ClassFile.Method Methods pretty :: ExceptionTableEntry -> Doc ann Source # prettyList :: [ExceptionTableEntry] -> Doc ann Source # | |||||
| type Rep ExceptionTableEntry Source # | |||||
Defined in H2JVM.ClassFile.Method type Rep ExceptionTableEntry = D1 ('MetaData "ExceptionTableEntry" "H2JVM.ClassFile.Method" "h2jvm-0.1.0.0-LWhbtWHvrTPFtGJV7ONYMS" 'False) (C1 ('MetaCons "ExceptionTableEntry" 'PrefixI 'True) ((S1 ('MetaSel ('Just "startPc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "endPc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "handlerPc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "catchType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ClassInfoType))))) | |||||
data CodeAttribute Source #
Additional properties of the compiled method bytecode.
Constructors
| LineNumberTable [LineNumberTableEntry] | Line number information for debugging stack traces. |
| StackMapTable [StackMapFrame] | Stack map frame table for JVM verification. |
Instances
| Data CodeAttribute Source # | |||||
Defined in H2JVM.ClassFile.Method Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CodeAttribute -> c CodeAttribute # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CodeAttribute # toConstr :: CodeAttribute -> Constr # dataTypeOf :: CodeAttribute -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CodeAttribute) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CodeAttribute) # gmapT :: (forall b. Data b => b -> b) -> CodeAttribute -> CodeAttribute # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CodeAttribute -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CodeAttribute -> r # gmapQ :: (forall d. Data d => d -> u) -> CodeAttribute -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> CodeAttribute -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> CodeAttribute -> m CodeAttribute # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CodeAttribute -> m CodeAttribute # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CodeAttribute -> m CodeAttribute # | |||||
| Generic CodeAttribute Source # | |||||
Defined in H2JVM.ClassFile.Method Associated Types
| |||||
| Show CodeAttribute Source # | |||||
Defined in H2JVM.ClassFile.Method Methods showsPrec :: Int -> CodeAttribute -> ShowS # show :: CodeAttribute -> String # showList :: [CodeAttribute] -> ShowS # | |||||
| Eq CodeAttribute Source # | |||||
Defined in H2JVM.ClassFile.Method Methods (==) :: CodeAttribute -> CodeAttribute -> Bool # (/=) :: CodeAttribute -> CodeAttribute -> Bool # | |||||
| DataMergeable CodeAttribute Source # | |||||
Defined in H2JVM.ClassFile.Method Methods merge :: CodeAttribute -> CodeAttribute -> CodeAttribute Source # | |||||
| Pretty CodeAttribute Source # | |||||
Defined in H2JVM.ClassFile.Method | |||||
| type Rep CodeAttribute Source # | |||||
Defined in H2JVM.ClassFile.Method type Rep CodeAttribute = D1 ('MetaData "CodeAttribute" "H2JVM.ClassFile.Method" "h2jvm-0.1.0.0-LWhbtWHvrTPFtGJV7ONYMS" 'False) (C1 ('MetaCons "LineNumberTable" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [LineNumberTableEntry])) :+: C1 ('MetaCons "StackMapTable" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [StackMapFrame]))) | |||||
Names, Types and Descriptors
data QualifiedClassName Source #
A fully qualified JVM class name, consisting of a PackageName and a ClassName.
For example, "java.lang.Object" would be represented as .QualifiedClassName (PackageName ["java","lang"]) (ClassName "Object")
Instances
| Data QualifiedClassName Source # | |
Defined in H2JVM.Name Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> QualifiedClassName -> c QualifiedClassName # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c QualifiedClassName # toConstr :: QualifiedClassName -> Constr # dataTypeOf :: QualifiedClassName -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c QualifiedClassName) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c QualifiedClassName) # gmapT :: (forall b. Data b => b -> b) -> QualifiedClassName -> QualifiedClassName # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> QualifiedClassName -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> QualifiedClassName -> r # gmapQ :: (forall d. Data d => d -> u) -> QualifiedClassName -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> QualifiedClassName -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> QualifiedClassName -> m QualifiedClassName # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> QualifiedClassName -> m QualifiedClassName # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> QualifiedClassName -> m QualifiedClassName # | |
| IsString QualifiedClassName Source # | |
Defined in H2JVM.Name Methods fromString :: String -> QualifiedClassName # | |
| Show QualifiedClassName Source # | |
Defined in H2JVM.Name Methods showsPrec :: Int -> QualifiedClassName -> ShowS # show :: QualifiedClassName -> String # showList :: [QualifiedClassName] -> ShowS # | |
| Eq QualifiedClassName Source # | |
Defined in H2JVM.Name Methods (==) :: QualifiedClassName -> QualifiedClassName -> Bool # (/=) :: QualifiedClassName -> QualifiedClassName -> Bool # | |
| Ord QualifiedClassName Source # | |
Defined in H2JVM.Name Methods compare :: QualifiedClassName -> QualifiedClassName -> Ordering # (<) :: QualifiedClassName -> QualifiedClassName -> Bool # (<=) :: QualifiedClassName -> QualifiedClassName -> Bool # (>) :: QualifiedClassName -> QualifiedClassName -> Bool # (>=) :: QualifiedClassName -> QualifiedClassName -> Bool # max :: QualifiedClassName -> QualifiedClassName -> QualifiedClassName # min :: QualifiedClassName -> QualifiedClassName -> QualifiedClassName # | |
| Pretty QualifiedClassName Source # | |
Defined in H2JVM.Name Methods pretty :: QualifiedClassName -> Doc ann Source # prettyList :: [QualifiedClassName] -> Doc ann Source # | |
data PackageName Source #
A JVM package name.
This is defined as a potentially empty list of identifiers, which would be separated by dots in the source code, e.g. "java.lang" would be represented as PackageName ["java","lang"].
Instances
| Data PackageName Source # | |
Defined in H2JVM.Name Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PackageName -> c PackageName # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PackageName # toConstr :: PackageName -> Constr # dataTypeOf :: PackageName -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PackageName) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PackageName) # gmapT :: (forall b. Data b => b -> b) -> PackageName -> PackageName # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PackageName -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PackageName -> r # gmapQ :: (forall d. Data d => d -> u) -> PackageName -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> PackageName -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> PackageName -> m PackageName # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PackageName -> m PackageName # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PackageName -> m PackageName # | |
| Show PackageName Source # | |
Defined in H2JVM.Name Methods showsPrec :: Int -> PackageName -> ShowS # show :: PackageName -> String # showList :: [PackageName] -> ShowS # | |
| Eq PackageName Source # | |
Defined in H2JVM.Name | |
| Ord PackageName Source # | |
Defined in H2JVM.Name Methods compare :: PackageName -> PackageName -> Ordering # (<) :: PackageName -> PackageName -> Bool # (<=) :: PackageName -> PackageName -> Bool # (>) :: PackageName -> PackageName -> Bool # (>=) :: PackageName -> PackageName -> Bool # max :: PackageName -> PackageName -> PackageName # min :: PackageName -> PackageName -> PackageName # | |
Instances
| Data ClassName Source # | |
Defined in H2JVM.Name Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ClassName -> c ClassName # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ClassName # toConstr :: ClassName -> Constr # dataTypeOf :: ClassName -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ClassName) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ClassName) # gmapT :: (forall b. Data b => b -> b) -> ClassName -> ClassName # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ClassName -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ClassName -> r # gmapQ :: (forall d. Data d => d -> u) -> ClassName -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ClassName -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ClassName -> m ClassName # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ClassName -> m ClassName # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ClassName -> m ClassName # | |
| Show ClassName Source # | |
| Eq ClassName Source # | |
| Ord ClassName Source # | |
parseQualifiedClassName :: Text -> QualifiedClassName Source #
Parse a QualifiedClassName from a Text
>>>parseQualifiedClassName "java.lang.Object"QualifiedClassName (PackageName ["java","lang"]) (ClassName "Object")
>>>parseQualifiedClassName "Object"QualifiedClassName (PackageName []) (ClassName "Object")
This function is lenient and will accept invalid class names: >>> parseQualifiedClassName "123invalid" QualifiedClassName (PackageName []) (ClassName "123invalid")
parseClassName :: Text -> ClassName Source #
parsePackageName :: Text -> PackageName Source #
Parse a PackageName from a Text
>>>parsePackageName "java.lang"PackageName ["java","lang"]
>>>parsePackageName ""PackageName []
classFilePath :: ClassFile -> FilePath Source #
Determine the standard relative output filepath for a class (e.g., "javalangObject.class").
data MethodDescriptor Source #
Represents a JVM method type signature descriptor (§4.3.3).
Constructors
| MethodDescriptor | |
Fields
| |
Instances
| Data MethodDescriptor Source # | |
Defined in H2JVM.Descriptor Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MethodDescriptor -> c MethodDescriptor # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c MethodDescriptor # toConstr :: MethodDescriptor -> Constr # dataTypeOf :: MethodDescriptor -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c MethodDescriptor) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MethodDescriptor) # gmapT :: (forall b. Data b => b -> b) -> MethodDescriptor -> MethodDescriptor # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MethodDescriptor -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MethodDescriptor -> r # gmapQ :: (forall d. Data d => d -> u) -> MethodDescriptor -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> MethodDescriptor -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> MethodDescriptor -> m MethodDescriptor # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MethodDescriptor -> m MethodDescriptor # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MethodDescriptor -> m MethodDescriptor # | |
| Show MethodDescriptor Source # | |
Defined in H2JVM.Descriptor Methods showsPrec :: Int -> MethodDescriptor -> ShowS # show :: MethodDescriptor -> String # showList :: [MethodDescriptor] -> ShowS # | |
| Eq MethodDescriptor Source # | |
Defined in H2JVM.Descriptor Methods (==) :: MethodDescriptor -> MethodDescriptor -> Bool # (/=) :: MethodDescriptor -> MethodDescriptor -> Bool # | |
| Ord MethodDescriptor Source # | |
Defined in H2JVM.Descriptor Methods compare :: MethodDescriptor -> MethodDescriptor -> Ordering # (<) :: MethodDescriptor -> MethodDescriptor -> Bool # (<=) :: MethodDescriptor -> MethodDescriptor -> Bool # (>) :: MethodDescriptor -> MethodDescriptor -> Bool # (>=) :: MethodDescriptor -> MethodDescriptor -> Bool # max :: MethodDescriptor -> MethodDescriptor -> MethodDescriptor # min :: MethodDescriptor -> MethodDescriptor -> MethodDescriptor # | |
| Pretty MethodDescriptor Source # | |
Defined in H2JVM.Descriptor Methods pretty :: MethodDescriptor -> Doc ann Source # prettyList :: [MethodDescriptor] -> Doc ann Source # | |
data ReturnDescriptor Source #
Represents a method return type descriptor.
Constructors
| VoidReturn | A void return ( |
| TypeReturn FieldType | A return of some |
Instances
| Data ReturnDescriptor Source # | |
Defined in H2JVM.Descriptor Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ReturnDescriptor -> c ReturnDescriptor # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ReturnDescriptor # toConstr :: ReturnDescriptor -> Constr # dataTypeOf :: ReturnDescriptor -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ReturnDescriptor) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ReturnDescriptor) # gmapT :: (forall b. Data b => b -> b) -> ReturnDescriptor -> ReturnDescriptor # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ReturnDescriptor -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ReturnDescriptor -> r # gmapQ :: (forall d. Data d => d -> u) -> ReturnDescriptor -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ReturnDescriptor -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ReturnDescriptor -> m ReturnDescriptor # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ReturnDescriptor -> m ReturnDescriptor # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ReturnDescriptor -> m ReturnDescriptor # | |
| Show ReturnDescriptor Source # | |
Defined in H2JVM.Descriptor Methods showsPrec :: Int -> ReturnDescriptor -> ShowS # show :: ReturnDescriptor -> String # showList :: [ReturnDescriptor] -> ShowS # | |
| Eq ReturnDescriptor Source # | |
Defined in H2JVM.Descriptor Methods (==) :: ReturnDescriptor -> ReturnDescriptor -> Bool # (/=) :: ReturnDescriptor -> ReturnDescriptor -> Bool # | |
| Ord ReturnDescriptor Source # | |
Defined in H2JVM.Descriptor Methods compare :: ReturnDescriptor -> ReturnDescriptor -> Ordering # (<) :: ReturnDescriptor -> ReturnDescriptor -> Bool # (<=) :: ReturnDescriptor -> ReturnDescriptor -> Bool # (>) :: ReturnDescriptor -> ReturnDescriptor -> Bool # (>=) :: ReturnDescriptor -> ReturnDescriptor -> Bool # max :: ReturnDescriptor -> ReturnDescriptor -> ReturnDescriptor # min :: ReturnDescriptor -> ReturnDescriptor -> ReturnDescriptor # | |
| Pretty ReturnDescriptor Source # | |
Defined in H2JVM.Descriptor Methods pretty :: ReturnDescriptor -> Doc ann Source # prettyList :: [ReturnDescriptor] -> Doc ann Source # | |
JVM field type, corresponding to the FieldType production in the JVM specification.
Used in places such as method descriptors and field descriptors.
Constructors
| PrimitiveFieldType PrimitiveType | |
| ObjectFieldType QualifiedClassName | |
| ArrayFieldType FieldType |
Instances
| Data FieldType Source # | |
Defined in H2JVM.Type Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FieldType -> c FieldType # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FieldType # toConstr :: FieldType -> Constr # dataTypeOf :: FieldType -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FieldType) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FieldType) # gmapT :: (forall b. Data b => b -> b) -> FieldType -> FieldType # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FieldType -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FieldType -> r # gmapQ :: (forall d. Data d => d -> u) -> FieldType -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> FieldType -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> FieldType -> m FieldType # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FieldType -> m FieldType # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FieldType -> m FieldType # | |
| Show FieldType Source # | |
| Eq FieldType Source # | |
| Ord FieldType Source # | |
| Pretty FieldType Source # | |
data PrimitiveType Source #
JVM primitive types.
Corresponds to the BaseType production in the JVM specification.
Instances
| Data PrimitiveType Source # | |
Defined in H2JVM.Type Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PrimitiveType -> c PrimitiveType # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PrimitiveType # toConstr :: PrimitiveType -> Constr # dataTypeOf :: PrimitiveType -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PrimitiveType) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PrimitiveType) # gmapT :: (forall b. Data b => b -> b) -> PrimitiveType -> PrimitiveType # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PrimitiveType -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PrimitiveType -> r # gmapQ :: (forall d. Data d => d -> u) -> PrimitiveType -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> PrimitiveType -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> PrimitiveType -> m PrimitiveType # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PrimitiveType -> m PrimitiveType # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PrimitiveType -> m PrimitiveType # | |
| Bounded PrimitiveType Source # | |
Defined in H2JVM.Type | |
| Enum PrimitiveType Source # | |
Defined in H2JVM.Type Methods succ :: PrimitiveType -> PrimitiveType # pred :: PrimitiveType -> PrimitiveType # toEnum :: Int -> PrimitiveType # fromEnum :: PrimitiveType -> Int # enumFrom :: PrimitiveType -> [PrimitiveType] # enumFromThen :: PrimitiveType -> PrimitiveType -> [PrimitiveType] # enumFromTo :: PrimitiveType -> PrimitiveType -> [PrimitiveType] # enumFromThenTo :: PrimitiveType -> PrimitiveType -> PrimitiveType -> [PrimitiveType] # | |
| Show PrimitiveType Source # | |
Defined in H2JVM.Type Methods showsPrec :: Int -> PrimitiveType -> ShowS # show :: PrimitiveType -> String # showList :: [PrimitiveType] -> ShowS # | |
| Eq PrimitiveType Source # | |
Defined in H2JVM.Type Methods (==) :: PrimitiveType -> PrimitiveType -> Bool # (/=) :: PrimitiveType -> PrimitiveType -> Bool # | |
| Ord PrimitiveType Source # | |
Defined in H2JVM.Type Methods compare :: PrimitiveType -> PrimitiveType -> Ordering # (<) :: PrimitiveType -> PrimitiveType -> Bool # (<=) :: PrimitiveType -> PrimitiveType -> Bool # (>) :: PrimitiveType -> PrimitiveType -> Bool # (>=) :: PrimitiveType -> PrimitiveType -> Bool # max :: PrimitiveType -> PrimitiveType -> PrimitiveType # min :: PrimitiveType -> PrimitiveType -> PrimitiveType # | |
| Pretty PrimitiveType Source # | |
Defined in H2JVM.Type | |
Constant Pool
data ConstantPoolEntry Source #
High-level, type-safe representation of a constant pool entry This tries to hide indexes as much as possible, instead just allowing the values to be provided directly. These are transformed into the correct indexes when the constant pool is built, which uses a state monad to avoid repeating entries.
Constructors
| CPClassEntry | A class reference |
Fields
| |
| CPFieldRefEntry FieldRef | |
| CPMethodRefEntry MethodRef | |
| CPInterfaceMethodRefEntry MethodRef | |
| CPStringEntry Text | |
| CPIntegerEntry Int32 | |
| CPFloatEntry Float | |
| CPLongEntry Int64 | |
| CPDoubleEntry Double | |
| CPNameAndTypeEntry Text Text | |
| CPUTF8Entry Text | |
| CPMethodHandleEntry MethodHandleEntry | |
| CPMethodTypeEntry MethodDescriptor | |
| CPInvokeDynamicEntry | CONSTANT_InvokeDynamic_info |
Fields
| |
Instances
| Show ConstantPoolEntry Source # | |
Defined in H2JVM.ConstantPool Methods showsPrec :: Int -> ConstantPoolEntry -> ShowS # show :: ConstantPoolEntry -> String # showList :: [ConstantPoolEntry] -> ShowS # | |
| Eq ConstantPoolEntry Source # | |
Defined in H2JVM.ConstantPool Methods (==) :: ConstantPoolEntry -> ConstantPoolEntry -> Bool # (/=) :: ConstantPoolEntry -> ConstantPoolEntry -> Bool # | |
| Ord ConstantPoolEntry Source # | |
Defined in H2JVM.ConstantPool Methods compare :: ConstantPoolEntry -> ConstantPoolEntry -> Ordering # (<) :: ConstantPoolEntry -> ConstantPoolEntry -> Bool # (<=) :: ConstantPoolEntry -> ConstantPoolEntry -> Bool # (>) :: ConstantPoolEntry -> ConstantPoolEntry -> Bool # (>=) :: ConstantPoolEntry -> ConstantPoolEntry -> Bool # max :: ConstantPoolEntry -> ConstantPoolEntry -> ConstantPoolEntry # min :: ConstantPoolEntry -> ConstantPoolEntry -> ConstantPoolEntry # | |
data MethodHandleEntry Source #
A Method Handle type entry in the constant pool (§4.4.8).
Constructors
| MHGetField FieldRef | read field |
| MHGetStatic FieldRef | read static field |
| MHPutField FieldRef | write field |
| MHPutStatic FieldRef | write static field |
| MHInvokeVirtual MethodRef | invoke virtual method |
| MHNewInvokeSpecial MethodRef | invoke special method (e.g. |
| MHInvokeStatic MethodRef | invoke static method |
| MHInvokeSpecial MethodRef | invoke private/super method |
| MHInvokeInterface MethodRef | invoke interface method |
Instances
| Data MethodHandleEntry Source # | |
Defined in H2JVM.ConstantPool Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MethodHandleEntry -> c MethodHandleEntry # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c MethodHandleEntry # toConstr :: MethodHandleEntry -> Constr # dataTypeOf :: MethodHandleEntry -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c MethodHandleEntry) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MethodHandleEntry) # gmapT :: (forall b. Data b => b -> b) -> MethodHandleEntry -> MethodHandleEntry # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MethodHandleEntry -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MethodHandleEntry -> r # gmapQ :: (forall d. Data d => d -> u) -> MethodHandleEntry -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> MethodHandleEntry -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> MethodHandleEntry -> m MethodHandleEntry # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MethodHandleEntry -> m MethodHandleEntry # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MethodHandleEntry -> m MethodHandleEntry # | |
| Show MethodHandleEntry Source # | |
Defined in H2JVM.ConstantPool Methods showsPrec :: Int -> MethodHandleEntry -> ShowS # show :: MethodHandleEntry -> String # showList :: [MethodHandleEntry] -> ShowS # | |
| Eq MethodHandleEntry Source # | |
Defined in H2JVM.ConstantPool Methods (==) :: MethodHandleEntry -> MethodHandleEntry -> Bool # (/=) :: MethodHandleEntry -> MethodHandleEntry -> Bool # | |
| Ord MethodHandleEntry Source # | |
Defined in H2JVM.ConstantPool Methods compare :: MethodHandleEntry -> MethodHandleEntry -> Ordering # (<) :: MethodHandleEntry -> MethodHandleEntry -> Bool # (<=) :: MethodHandleEntry -> MethodHandleEntry -> Bool # (>) :: MethodHandleEntry -> MethodHandleEntry -> Bool # (>=) :: MethodHandleEntry -> MethodHandleEntry -> Bool # max :: MethodHandleEntry -> MethodHandleEntry -> MethodHandleEntry # min :: MethodHandleEntry -> MethodHandleEntry -> MethodHandleEntry # | |
| Pretty MethodHandleEntry Source # | |
Defined in H2JVM.ConstantPool Methods pretty :: MethodHandleEntry -> Doc ann Source # prettyList :: [MethodHandleEntry] -> Doc ann Source # | |
A reference to a field, consisting of the containing class type, field name, and field type.
Constructors
| FieldRef ClassInfoType Text FieldType |
Instances
| Data FieldRef Source # | |
Defined in H2JVM.ConstantPool Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FieldRef -> c FieldRef # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FieldRef # toConstr :: FieldRef -> Constr # dataTypeOf :: FieldRef -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FieldRef) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FieldRef) # gmapT :: (forall b. Data b => b -> b) -> FieldRef -> FieldRef # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FieldRef -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FieldRef -> r # gmapQ :: (forall d. Data d => d -> u) -> FieldRef -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> FieldRef -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> FieldRef -> m FieldRef # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FieldRef -> m FieldRef # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FieldRef -> m FieldRef # | |
| Show FieldRef Source # | |
| Eq FieldRef Source # | |
| Ord FieldRef Source # | |
Defined in H2JVM.ConstantPool | |
| Pretty FieldRef Source # | |
A reference to a method, consisting of the containing class type, method name, and descriptor signature.
Constructors
| MethodRef | |
Fields
| |
Instances
| Data MethodRef Source # | |
Defined in H2JVM.ConstantPool Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MethodRef -> c MethodRef # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c MethodRef # toConstr :: MethodRef -> Constr # dataTypeOf :: MethodRef -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c MethodRef) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MethodRef) # gmapT :: (forall b. Data b => b -> b) -> MethodRef -> MethodRef # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MethodRef -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MethodRef -> r # gmapQ :: (forall d. Data d => d -> u) -> MethodRef -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> MethodRef -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> MethodRef -> m MethodRef # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MethodRef -> m MethodRef # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MethodRef -> m MethodRef # | |
| Show MethodRef Source # | |
| Eq MethodRef Source # | |
| Ord MethodRef Source # | |
| Pretty MethodRef Source # | |
data BootstrapMethod Source #
A Bootstrap Method specification, used in invokedynamic call sites (§4.7.23).
Constructors
| BootstrapMethod MethodHandleEntry [BootstrapArgument] | Construct a bootstrap method referencing a method handle and its static arguments. |
Instances
| Data BootstrapMethod Source # | |
Defined in H2JVM.ConstantPool Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BootstrapMethod -> c BootstrapMethod # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BootstrapMethod # toConstr :: BootstrapMethod -> Constr # dataTypeOf :: BootstrapMethod -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BootstrapMethod) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BootstrapMethod) # gmapT :: (forall b. Data b => b -> b) -> BootstrapMethod -> BootstrapMethod # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BootstrapMethod -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BootstrapMethod -> r # gmapQ :: (forall d. Data d => d -> u) -> BootstrapMethod -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> BootstrapMethod -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> BootstrapMethod -> m BootstrapMethod # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BootstrapMethod -> m BootstrapMethod # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BootstrapMethod -> m BootstrapMethod # | |
| Show BootstrapMethod Source # | |
Defined in H2JVM.ConstantPool Methods showsPrec :: Int -> BootstrapMethod -> ShowS # show :: BootstrapMethod -> String # showList :: [BootstrapMethod] -> ShowS # | |
| Eq BootstrapMethod Source # | |
Defined in H2JVM.ConstantPool Methods (==) :: BootstrapMethod -> BootstrapMethod -> Bool # (/=) :: BootstrapMethod -> BootstrapMethod -> Bool # | |
| Ord BootstrapMethod Source # | |
Defined in H2JVM.ConstantPool Methods compare :: BootstrapMethod -> BootstrapMethod -> Ordering # (<) :: BootstrapMethod -> BootstrapMethod -> Bool # (<=) :: BootstrapMethod -> BootstrapMethod -> Bool # (>) :: BootstrapMethod -> BootstrapMethod -> Bool # (>=) :: BootstrapMethod -> BootstrapMethod -> Bool # max :: BootstrapMethod -> BootstrapMethod -> BootstrapMethod # min :: BootstrapMethod -> BootstrapMethod -> BootstrapMethod # | |
| Pretty BootstrapMethod Source # | |
Defined in H2JVM.ConstantPool Methods pretty :: BootstrapMethod -> Doc ann Source # prettyList :: [BootstrapMethod] -> Doc ann Source # | |
data BootstrapArgument Source #
A static argument for a bootstrap method.
Constructors
| BMClassArg ClassInfoType | A Class reference argument. |
| BMStringArg Text | A String constant argument. |
| BMIntArg Int32 | An integer constant argument. |
| BMMethodArg MethodDescriptor | A Method type descriptor argument. |
| BMMethodHandleArg MethodHandleEntry | A Method handle argument. |
Instances
| Data BootstrapArgument Source # | |
Defined in H2JVM.ConstantPool Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BootstrapArgument -> c BootstrapArgument # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BootstrapArgument # toConstr :: BootstrapArgument -> Constr # dataTypeOf :: BootstrapArgument -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BootstrapArgument) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BootstrapArgument) # gmapT :: (forall b. Data b => b -> b) -> BootstrapArgument -> BootstrapArgument # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BootstrapArgument -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BootstrapArgument -> r # gmapQ :: (forall d. Data d => d -> u) -> BootstrapArgument -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> BootstrapArgument -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> BootstrapArgument -> m BootstrapArgument # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BootstrapArgument -> m BootstrapArgument # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BootstrapArgument -> m BootstrapArgument # | |
| Show BootstrapArgument Source # | |
Defined in H2JVM.ConstantPool Methods showsPrec :: Int -> BootstrapArgument -> ShowS # show :: BootstrapArgument -> String # showList :: [BootstrapArgument] -> ShowS # | |
| Eq BootstrapArgument Source # | |
Defined in H2JVM.ConstantPool Methods (==) :: BootstrapArgument -> BootstrapArgument -> Bool # (/=) :: BootstrapArgument -> BootstrapArgument -> Bool # | |
| Ord BootstrapArgument Source # | |
Defined in H2JVM.ConstantPool Methods compare :: BootstrapArgument -> BootstrapArgument -> Ordering # (<) :: BootstrapArgument -> BootstrapArgument -> Bool # (<=) :: BootstrapArgument -> BootstrapArgument -> Bool # (>) :: BootstrapArgument -> BootstrapArgument -> Bool # (>=) :: BootstrapArgument -> BootstrapArgument -> Bool # max :: BootstrapArgument -> BootstrapArgument -> BootstrapArgument # min :: BootstrapArgument -> BootstrapArgument -> BootstrapArgument # | |
| Pretty BootstrapArgument Source # | |
Defined in H2JVM.ConstantPool Methods pretty :: BootstrapArgument -> Doc ann Source # prettyList :: [BootstrapArgument] -> Doc ann Source # | |
Code Generation & Instructions
data CodeBuilder (m :: k) a Source #
The CodeBuilder effect, which allows emitting instructions and adding code attributes in a monadic style.
Instances
| type DispatchOf (CodeBuilder :: (Type -> Type) -> Type -> Type) Source # | |
Defined in H2JVM.Builder.Code | |
Arguments
| :: forall (r :: [(Type -> Type) -> Type -> Type]) a. HasCallStack | |
| => Eff ((CodeBuilder :: (Type -> Type) -> Type -> Type) ': r) a | |
| -> Eff r (a, [CodeAttribute], NonEmpty Instruction) | the result of the computation, the list of emitted code attributes, and the list of emitted instructions, in the order they were emitted. |
Run a CodeBuilder effect, returning the emitted code and attributes.
Throws an imprecise exception if no code was emitted, since a code block with no instructions is invalid.
emit :: forall (r :: [Effect]). (CodeBuilder :: (Type -> Type) -> Type -> Type) :> r => Instruction -> Eff r () Source #
Emit a single instruction.
newLabel :: forall {k} (es :: [Effect]). (HasCallStack, (CodeBuilder :: (Type -> Type) -> Type -> Type) :> es) => Eff es Label Source #
Create a new, unique Label.
A unique label for an instruction.
Instances
| Data Label Source # | |
Defined in H2JVM.Builder.Label Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Label -> c Label # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Label # dataTypeOf :: Label -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Label) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Label) # gmapT :: (forall b. Data b => b -> b) -> Label -> Label # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Label -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Label -> r # gmapQ :: (forall d. Data d => d -> u) -> Label -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Label -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Label -> m Label # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Label -> m Label # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Label -> m Label # | |
| Show Label Source # | |
| Eq Label Source # | |
| Ord Label Source # | |
| Pretty Label Source # | |
type Instruction = Instruction' Label Source #
An instruction whose labels are the Label type.
This is probably the type you want.
data Instruction' label Source #
An instruction with a polymorphic label type.
Constructors
| ALoad U2 | aload_n |
| AStore U2 | astore_n |
| AReturn | |
| AConstNull | |
| Dup | |
| IAnd | |
| If (IfCond label) | Encodes |
| Instanceof ClassInfoType | |
| InvokeStatic ClassInfoType Text MethodDescriptor | |
| InvokeInterface ClassInfoType Text MethodDescriptor | |
| InvokeVirtual ClassInfoType Text MethodDescriptor | |
| InvokeDynamic BootstrapMethod Text MethodDescriptor | |
| InvokeSpecial ClassInfoType Text MethodDescriptor | |
| IOr | |
| ILoad U2 | |
| IStore U2 | |
| Label label | |
| LDC LDCEntry | |
| PutStatic ClassInfoType Text FieldType | |
| GetField ClassInfoType Text FieldType | |
| GetStatic ClassInfoType Text FieldType | |
| PutField ClassInfoType Text FieldType | |
| Goto label | |
| CheckCast ClassInfoType | |
| Return | |
| IReturn | |
| IConst0 | |
| IConst1 | |
| New ClassInfoType | |
| ArrayLength | |
| AALoad | |
| IfICmp (IfCond label) | Encodes |
| IAdd | |
| ISub | |
| IMul | |
| IDiv |
Instances
| Functor Instruction' Source # | |||||
Defined in H2JVM.Instruction Methods fmap :: (a -> b) -> Instruction' a -> Instruction' b # (<$) :: a -> Instruction' b -> Instruction' a # | |||||
| Data label => Data (Instruction' label) Source # | |||||
Defined in H2JVM.Instruction Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Instruction' label -> c (Instruction' label) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Instruction' label) # toConstr :: Instruction' label -> Constr # dataTypeOf :: Instruction' label -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Instruction' label)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Instruction' label)) # gmapT :: (forall b. Data b => b -> b) -> Instruction' label -> Instruction' label # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Instruction' label -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Instruction' label -> r # gmapQ :: (forall d. Data d => d -> u) -> Instruction' label -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Instruction' label -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Instruction' label -> m (Instruction' label) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Instruction' label -> m (Instruction' label) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Instruction' label -> m (Instruction' label) # | |||||
| Generic (Instruction' label) Source # | |||||
Defined in H2JVM.Instruction Associated Types
Methods from :: Instruction' label -> Rep (Instruction' label) x # to :: Rep (Instruction' label) x -> Instruction' label # | |||||
| Show label => Show (Instruction' label) Source # | |||||
Defined in H2JVM.Instruction Methods showsPrec :: Int -> Instruction' label -> ShowS # show :: Instruction' label -> String # showList :: [Instruction' label] -> ShowS # | |||||
| Eq label => Eq (Instruction' label) Source # | |||||
Defined in H2JVM.Instruction Methods (==) :: Instruction' label -> Instruction' label -> Bool # (/=) :: Instruction' label -> Instruction' label -> Bool # | |||||
| Ord label => Ord (Instruction' label) Source # | |||||
Defined in H2JVM.Instruction Methods compare :: Instruction' label -> Instruction' label -> Ordering # (<) :: Instruction' label -> Instruction' label -> Bool # (<=) :: Instruction' label -> Instruction' label -> Bool # (>) :: Instruction' label -> Instruction' label -> Bool # (>=) :: Instruction' label -> Instruction' label -> Bool # max :: Instruction' label -> Instruction' label -> Instruction' label # min :: Instruction' label -> Instruction' label -> Instruction' label # | |||||
| Pretty label => Pretty (Instruction' label) Source # | |||||
Defined in H2JVM.Instruction Methods pretty :: Instruction' label -> Doc ann Source # prettyList :: [Instruction' label] -> Doc ann Source # | |||||
| type Rep (Instruction' label) Source # | |||||
Defined in H2JVM.Instruction type Rep (Instruction' label) = D1 ('MetaData "Instruction'" "H2JVM.Instruction" "h2jvm-0.1.0.0-LWhbtWHvrTPFtGJV7ONYMS" 'False) (((((C1 ('MetaCons "ALoad" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 U2)) :+: C1 ('MetaCons "AStore" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 U2))) :+: (C1 ('MetaCons "AReturn" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AConstNull" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Dup" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "IAnd" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "If" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (IfCond label))) :+: (C1 ('MetaCons "Instanceof" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ClassInfoType)) :+: C1 ('MetaCons "InvokeStatic" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ClassInfoType) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MethodDescriptor))))))) :+: (((C1 ('MetaCons "InvokeInterface" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ClassInfoType) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MethodDescriptor))) :+: C1 ('MetaCons "InvokeVirtual" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ClassInfoType) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MethodDescriptor)))) :+: (C1 ('MetaCons "InvokeDynamic" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BootstrapMethod) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MethodDescriptor))) :+: C1 ('MetaCons "InvokeSpecial" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ClassInfoType) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MethodDescriptor))))) :+: ((C1 ('MetaCons "IOr" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ILoad" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 U2))) :+: (C1 ('MetaCons "IStore" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 U2)) :+: (C1 ('MetaCons "Label" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 label)) :+: C1 ('MetaCons "LDC" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LDCEntry))))))) :+: ((((C1 ('MetaCons "PutStatic" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ClassInfoType) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FieldType))) :+: C1 ('MetaCons "GetField" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ClassInfoType) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FieldType)))) :+: (C1 ('MetaCons "GetStatic" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ClassInfoType) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FieldType))) :+: C1 ('MetaCons "PutField" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ClassInfoType) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FieldType))))) :+: ((C1 ('MetaCons "Goto" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 label)) :+: C1 ('MetaCons "CheckCast" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ClassInfoType))) :+: (C1 ('MetaCons "Return" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "IReturn" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "IConst0" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "IConst1" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "New" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ClassInfoType))) :+: (C1 ('MetaCons "ArrayLength" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AALoad" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "IfICmp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (IfCond label))) :+: C1 ('MetaCons "IAdd" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ISub" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "IMul" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "IDiv" 'PrefixI 'False) (U1 :: Type -> Type))))))) | |||||
A value that can be loaded by the LDC instruction.
Constructors
| LDCInt JVMInt | Load an integer constant. |
| LDCFloat Float | Load a float constant. |
| LDCString Text | Load a string constant. |
| LDCClass ClassInfoType | Load a Class object. |
Instances
| Data LDCEntry Source # | |||||
Defined in H2JVM.Instruction Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LDCEntry -> c LDCEntry # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c LDCEntry # toConstr :: LDCEntry -> Constr # dataTypeOf :: LDCEntry -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c LDCEntry) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LDCEntry) # gmapT :: (forall b. Data b => b -> b) -> LDCEntry -> LDCEntry # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LDCEntry -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LDCEntry -> r # gmapQ :: (forall d. Data d => d -> u) -> LDCEntry -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> LDCEntry -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> LDCEntry -> m LDCEntry # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LDCEntry -> m LDCEntry # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LDCEntry -> m LDCEntry # | |||||
| Generic LDCEntry Source # | |||||
Defined in H2JVM.Instruction Associated Types
| |||||
| Show LDCEntry Source # | |||||
| Eq LDCEntry Source # | |||||
| Ord LDCEntry Source # | |||||
Defined in H2JVM.Instruction | |||||
| Pretty LDCEntry Source # | |||||
| type Rep LDCEntry Source # | |||||
Defined in H2JVM.Instruction type Rep LDCEntry = D1 ('MetaData "LDCEntry" "H2JVM.Instruction" "h2jvm-0.1.0.0-LWhbtWHvrTPFtGJV7ONYMS" 'False) ((C1 ('MetaCons "LDCInt" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JVMInt)) :+: C1 ('MetaCons "LDCFloat" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Float))) :+: (C1 ('MetaCons "LDCString" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "LDCClass" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ClassInfoType)))) | |||||
High-level Serialisation API
classFileBytes :: ClassFile -> Either CodeConverterError ByteString Source #
Convert and serialise a high-level ClassFile directly to lazy ByteString bytes.
data CodeConverterError Source #
Errors that may be thrown during code conversion.
Instances
| Show CodeConverterError Source # | |
Defined in H2JVM.Internal.Convert.Error Methods showsPrec :: Int -> CodeConverterError -> ShowS # show :: CodeConverterError -> String # showList :: [CodeConverterError] -> ShowS # | |