h2jvm
Safe HaskellNone
LanguageGHC2021

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

Core Types

data ClassFile Source #

High-level representation of a Java class file.

Constructors

ClassFile 

Fields

Instances

Instances details
Show ClassFile Source # 
Instance details

Defined in H2JVM.ClassFile

Pretty ClassFile Source # 
Instance details

Defined in H2JVM.ClassFile

Methods

pretty :: ClassFile -> Doc ann Source #

prettyList :: [ClassFile] -> Doc ann Source #

data ClassFileAttribute Source #

Attributes that can be attached to a class file.

Constructors

InnerClasses [InnerClassInfo]

The InnerClasses attribute, specifying the nested/inner class info.

EnclosingMethod

The EnclosingMethod attribute.

Signature

The Signature attribute for generic type information.

SourceFile Text

The name of the source file this class was compiled from.

SourceDebugExtension

The SourceDebugExtension attribute.

Deprecated

The Deprecated attribute indicating this class is deprecated.

RuntimeVisibleAnnotations

The annotations visible at runtime.

RuntimeInvisibleAnnotations

The annotations invisible at runtime.

BootstrapMethods [BootstrapMethod]

Bootstrap methods for invokedynamic instructions.

Instances

Instances details
Data ClassFileAttribute Source # 
Instance details

Defined in H2JVM.ClassFile

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ClassFileAttribute -> c ClassFileAttribute #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ClassFileAttribute #

toConstr :: ClassFileAttribute -> Constr #

dataTypeOf :: ClassFileAttribute -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ClassFileAttribute) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ClassFileAttribute) #

gmapT :: (forall b. Data b => b -> b) -> ClassFileAttribute -> ClassFileAttribute #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ClassFileAttribute -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ClassFileAttribute -> r #

gmapQ :: (forall d. Data d => d -> u) -> ClassFileAttribute -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ClassFileAttribute -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ClassFileAttribute -> m ClassFileAttribute #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ClassFileAttribute -> m ClassFileAttribute #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ClassFileAttribute -> m ClassFileAttribute #

Show ClassFileAttribute Source # 
Instance details

Defined in H2JVM.ClassFile

Eq ClassFileAttribute Source # 
Instance details

Defined in H2JVM.ClassFile

DataMergeable ClassFileAttribute Source # 
Instance details

Defined in H2JVM.ClassFile

Pretty ClassFileAttribute Source # 
Instance details

Defined in H2JVM.ClassFile

data InnerClassInfo Source #

Information about an inner class.

Constructors

InnerClassInfo 

Fields

Instances

Instances details
Data InnerClassInfo Source # 
Instance details

Defined in H2JVM.ClassFile

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> InnerClassInfo -> c InnerClassInfo #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c InnerClassInfo #

toConstr :: InnerClassInfo -> Constr #

dataTypeOf :: InnerClassInfo -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c InnerClassInfo) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c InnerClassInfo) #

gmapT :: (forall b. Data b => b -> b) -> InnerClassInfo -> InnerClassInfo #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> InnerClassInfo -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> InnerClassInfo -> r #

gmapQ :: (forall d. Data d => d -> u) -> InnerClassInfo -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> InnerClassInfo -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> InnerClassInfo -> m InnerClassInfo #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> InnerClassInfo -> m InnerClassInfo #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> InnerClassInfo -> m InnerClassInfo #

Show InnerClassInfo Source # 
Instance details

Defined in H2JVM.ClassFile

Eq InnerClassInfo Source # 
Instance details

Defined in H2JVM.ClassFile

Pretty InnerClassInfo Source # 
Instance details

Defined in H2JVM.ClassFile

data JVMVersion Source #

A JVM Version Number.

Instances

Instances details
Show JVMVersion Source # 
Instance details

Defined in H2JVM.JVMVersion

Eq JVMVersion Source # 
Instance details

Defined in H2JVM.JVMVersion

Ord JVMVersion Source # 
Instance details

Defined in H2JVM.JVMVersion

Pretty JVMVersion Source # 
Instance details

Defined in H2JVM.JVMVersion

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.

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.

Instances

Instances details
Data ClassAccessFlag Source # 
Instance details

Defined in H2JVM.ClassFile.AccessFlags

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ClassAccessFlag -> c ClassAccessFlag #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ClassAccessFlag #

toConstr :: ClassAccessFlag -> Constr #

dataTypeOf :: ClassAccessFlag -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ClassAccessFlag) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ClassAccessFlag) #

gmapT :: (forall b. Data b => b -> b) -> ClassAccessFlag -> ClassAccessFlag #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ClassAccessFlag -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ClassAccessFlag -> r #

gmapQ :: (forall d. Data d => d -> u) -> ClassAccessFlag -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ClassAccessFlag -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ClassAccessFlag -> m ClassAccessFlag #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ClassAccessFlag -> m ClassAccessFlag #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ClassAccessFlag -> m ClassAccessFlag #

Show ClassAccessFlag Source # 
Instance details

Defined in H2JVM.ClassFile.AccessFlags

Eq ClassAccessFlag Source # 
Instance details

Defined in H2JVM.ClassFile.AccessFlags

Pretty ClassAccessFlag Source # 
Instance details

Defined in H2JVM.ClassFile.AccessFlags

data MethodAccessFlag Source #

Access flags for a method.

Instances

Instances details
Data MethodAccessFlag Source # 
Instance details

Defined in H2JVM.ClassFile.AccessFlags

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MethodAccessFlag -> c MethodAccessFlag #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c MethodAccessFlag #

toConstr :: MethodAccessFlag -> Constr #

dataTypeOf :: MethodAccessFlag -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c MethodAccessFlag) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MethodAccessFlag) #

gmapT :: (forall b. Data b => b -> b) -> MethodAccessFlag -> MethodAccessFlag #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MethodAccessFlag -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MethodAccessFlag -> r #

gmapQ :: (forall d. Data d => d -> u) -> MethodAccessFlag -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> MethodAccessFlag -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> MethodAccessFlag -> m MethodAccessFlag #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MethodAccessFlag -> m MethodAccessFlag #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MethodAccessFlag -> m MethodAccessFlag #

Show MethodAccessFlag Source # 
Instance details

Defined in H2JVM.ClassFile.AccessFlags

Eq MethodAccessFlag Source # 
Instance details

Defined in H2JVM.ClassFile.AccessFlags

Pretty MethodAccessFlag Source # 
Instance details

Defined in H2JVM.ClassFile.AccessFlags

data ClassFileField Source #

A field in a Java class file.

Constructors

ClassFileField 

Fields

Instances

Instances details
Show ClassFileField Source # 
Instance details

Defined in H2JVM.ClassFile.Field

Pretty ClassFileField Source # 
Instance details

Defined in H2JVM.ClassFile.Field

data ClassFileMethod Source #

A high level representation of a method in a class file.

Constructors

ClassFileMethod 

Fields

Instances

Instances details
Show ClassFileMethod Source # 
Instance details

Defined in H2JVM.ClassFile.Method

Pretty ClassFileMethod Source # 
Instance details

Defined in H2JVM.ClassFile.Method

newtype MethodAttribute Source #

An attribute of a method.

Constructors

Code CodeAttributeData

The bytecode instructions and execution context of the method body.

Instances

Instances details
Data MethodAttribute Source # 
Instance details

Defined in H2JVM.ClassFile.Method

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MethodAttribute -> c MethodAttribute #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c MethodAttribute #

toConstr :: MethodAttribute -> Constr #

dataTypeOf :: MethodAttribute -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c MethodAttribute) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MethodAttribute) #

gmapT :: (forall b. Data b => b -> b) -> MethodAttribute -> MethodAttribute #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MethodAttribute -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MethodAttribute -> r #

gmapQ :: (forall d. Data d => d -> u) -> MethodAttribute -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> MethodAttribute -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> MethodAttribute -> m MethodAttribute #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MethodAttribute -> m MethodAttribute #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MethodAttribute -> m MethodAttribute #

Generic MethodAttribute Source # 
Instance details

Defined in H2JVM.ClassFile.Method

Associated Types

type Rep MethodAttribute 
Instance details

Defined in H2JVM.ClassFile.Method

type Rep MethodAttribute = D1 ('MetaData "MethodAttribute" "H2JVM.ClassFile.Method" "h2jvm-0.1.0.0-LWhbtWHvrTPFtGJV7ONYMS" 'True) (C1 ('MetaCons "Code" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CodeAttributeData)))
Show MethodAttribute Source # 
Instance details

Defined in H2JVM.ClassFile.Method

DataMergeable MethodAttribute Source # 
Instance details

Defined in H2JVM.ClassFile.Method

Pretty MethodAttribute Source # 
Instance details

Defined in H2JVM.ClassFile.Method

type Rep MethodAttribute Source # 
Instance details

Defined in H2JVM.ClassFile.Method

type Rep MethodAttribute = D1 ('MetaData "MethodAttribute" "H2JVM.ClassFile.Method" "h2jvm-0.1.0.0-LWhbtWHvrTPFtGJV7ONYMS" 'True) (C1 ('MetaCons "Code" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CodeAttributeData)))

data CodeAttributeData Source #

The data contained in a Code attribute.

Constructors

CodeAttributeData 

Fields

Instances

Instances details
Data CodeAttributeData Source # 
Instance details

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 # 
Instance details

Defined in H2JVM.ClassFile.Method

Associated Types

type Rep CodeAttributeData 
Instance details

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])))))
Show CodeAttributeData Source # 
Instance details

Defined in H2JVM.ClassFile.Method

DataMergeable CodeAttributeData Source # 
Instance details

Defined in H2JVM.ClassFile.Method

Pretty CodeAttributeData Source # 
Instance details

Defined in H2JVM.ClassFile.Method

type Rep CodeAttributeData Source # 
Instance details

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

  • startPc :: Int

    The start of the instruction range protected by this handler.

  • endPc :: Int

    The end of the instruction range protected by this handler.

  • handlerPc :: Int

    The instruction address to branch to when an exception is caught.

  • catchType :: Maybe ClassInfoType

    The class type of the exception caught (or Nothing for all/finally).

Instances

Instances details
Data ExceptionTableEntry Source # 
Instance details

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 # 
Instance details

Defined in H2JVM.ClassFile.Method

Associated Types

type Rep ExceptionTableEntry 
Instance details

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)))))
Show ExceptionTableEntry Source # 
Instance details

Defined in H2JVM.ClassFile.Method

Pretty ExceptionTableEntry Source # 
Instance details

Defined in H2JVM.ClassFile.Method

type Rep ExceptionTableEntry Source # 
Instance details

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

Instances details
Data CodeAttribute Source # 
Instance details

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 # 
Instance details

Defined in H2JVM.ClassFile.Method

Associated Types

type Rep CodeAttribute 
Instance details

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])))
Show CodeAttribute Source # 
Instance details

Defined in H2JVM.ClassFile.Method

Eq CodeAttribute Source # 
Instance details

Defined in H2JVM.ClassFile.Method

DataMergeable CodeAttribute Source # 
Instance details

Defined in H2JVM.ClassFile.Method

Pretty CodeAttribute Source # 
Instance details

Defined in H2JVM.ClassFile.Method

type Rep CodeAttribute Source # 
Instance details

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

Instances details
Data QualifiedClassName Source # 
Instance details

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 # 
Instance details

Defined in H2JVM.Name

Show QualifiedClassName Source # 
Instance details

Defined in H2JVM.Name

Eq QualifiedClassName Source # 
Instance details

Defined in H2JVM.Name

Ord QualifiedClassName Source # 
Instance details

Defined in H2JVM.Name

Pretty QualifiedClassName Source # 
Instance details

Defined in H2JVM.Name

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

Instances details
Data PackageName Source # 
Instance details

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 # 
Instance details

Defined in H2JVM.Name

Eq PackageName Source # 
Instance details

Defined in H2JVM.Name

Ord PackageName Source # 
Instance details

Defined in H2JVM.Name

data ClassName Source #

A JVM class name, in its public, simple form, e.g. Object or ArrayList.

Instances

Instances details
Data ClassName Source # 
Instance details

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 # 
Instance details

Defined in H2JVM.Name

Eq ClassName Source # 
Instance details

Defined in H2JVM.Name

Ord ClassName Source # 
Instance details

Defined in H2JVM.Name

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 #

Parse a ClassName from a Text. This function is lenient, but this behaviour should not be relied on, and in future this may throw an error if the input is not a valid class name.

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

Instances details
Data MethodDescriptor Source # 
Instance details

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 # 
Instance details

Defined in H2JVM.Descriptor

Eq MethodDescriptor Source # 
Instance details

Defined in H2JVM.Descriptor

Ord MethodDescriptor Source # 
Instance details

Defined in H2JVM.Descriptor

Pretty MethodDescriptor Source # 
Instance details

Defined in H2JVM.Descriptor

data ReturnDescriptor Source #

Represents a method return type descriptor.

Constructors

VoidReturn

A void return (V).

TypeReturn FieldType

A return of some FieldType.

Instances

Instances details
Data ReturnDescriptor Source # 
Instance details

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 # 
Instance details

Defined in H2JVM.Descriptor

Eq ReturnDescriptor Source # 
Instance details

Defined in H2JVM.Descriptor

Ord ReturnDescriptor Source # 
Instance details

Defined in H2JVM.Descriptor

Pretty ReturnDescriptor Source # 
Instance details

Defined in H2JVM.Descriptor

data FieldType Source #

JVM field type, corresponding to the FieldType production in the JVM specification. Used in places such as method descriptors and field descriptors.

Instances

Instances details
Data FieldType Source # 
Instance details

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 # 
Instance details

Defined in H2JVM.Type

Eq FieldType Source # 
Instance details

Defined in H2JVM.Type

Ord FieldType Source # 
Instance details

Defined in H2JVM.Type

Pretty FieldType Source # 
Instance details

Defined in H2JVM.Type

Methods

pretty :: FieldType -> Doc ann Source #

prettyList :: [FieldType] -> Doc ann Source #

data PrimitiveType Source #

JVM primitive types. Corresponds to the BaseType production in the JVM specification.

Instances

Instances details
Data PrimitiveType Source # 
Instance details

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 # 
Instance details

Defined in H2JVM.Type

Enum PrimitiveType Source # 
Instance details

Defined in H2JVM.Type

Show PrimitiveType Source # 
Instance details

Defined in H2JVM.Type

Eq PrimitiveType Source # 
Instance details

Defined in H2JVM.Type

Ord PrimitiveType Source # 
Instance details

Defined in H2JVM.Type

Pretty PrimitiveType Source # 
Instance details

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.

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. init)

MHInvokeStatic MethodRef

invoke static method

MHInvokeSpecial MethodRef

invoke private/super method

MHInvokeInterface MethodRef

invoke interface method

Instances

Instances details
Data MethodHandleEntry Source # 
Instance details

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 # 
Instance details

Defined in H2JVM.ConstantPool

Eq MethodHandleEntry Source # 
Instance details

Defined in H2JVM.ConstantPool

Ord MethodHandleEntry Source # 
Instance details

Defined in H2JVM.ConstantPool

Pretty MethodHandleEntry Source # 
Instance details

Defined in H2JVM.ConstantPool

data FieldRef Source #

A reference to a field, consisting of the containing class type, field name, and field type.

Instances

Instances details
Data FieldRef Source # 
Instance details

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 # 
Instance details

Defined in H2JVM.ConstantPool

Eq FieldRef Source # 
Instance details

Defined in H2JVM.ConstantPool

Ord FieldRef Source # 
Instance details

Defined in H2JVM.ConstantPool

Pretty FieldRef Source # 
Instance details

Defined in H2JVM.ConstantPool

Methods

pretty :: FieldRef -> Doc ann Source #

prettyList :: [FieldRef] -> Doc ann Source #

data MethodRef Source #

A reference to a method, consisting of the containing class type, method name, and descriptor signature.

Constructors

MethodRef 

Fields

Instances

Instances details
Data MethodRef Source # 
Instance details

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 # 
Instance details

Defined in H2JVM.ConstantPool

Eq MethodRef Source # 
Instance details

Defined in H2JVM.ConstantPool

Ord MethodRef Source # 
Instance details

Defined in H2JVM.ConstantPool

Pretty MethodRef Source # 
Instance details

Defined in H2JVM.ConstantPool

Methods

pretty :: MethodRef -> Doc ann Source #

prettyList :: [MethodRef] -> Doc ann 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

Instances details
Data BootstrapMethod Source # 
Instance details

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 # 
Instance details

Defined in H2JVM.ConstantPool

Eq BootstrapMethod Source # 
Instance details

Defined in H2JVM.ConstantPool

Ord BootstrapMethod Source # 
Instance details

Defined in H2JVM.ConstantPool

Pretty BootstrapMethod Source # 
Instance details

Defined in H2JVM.ConstantPool

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

Instances details
Data BootstrapArgument Source # 
Instance details

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 # 
Instance details

Defined in H2JVM.ConstantPool

Eq BootstrapArgument Source # 
Instance details

Defined in H2JVM.ConstantPool

Ord BootstrapArgument Source # 
Instance details

Defined in H2JVM.ConstantPool

Pretty BootstrapArgument Source # 
Instance details

Defined in H2JVM.ConstantPool

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

Instances details
type DispatchOf (CodeBuilder :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in H2JVM.Builder.Code

type DispatchOf (CodeBuilder :: (Type -> Type) -> Type -> Type) = 'Dynamic

runCodeBuilder Source #

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.

data Label Source #

A unique label for an instruction.

Instances

Instances details
Data Label Source # 
Instance details

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 #

toConstr :: Label -> Constr #

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 # 
Instance details

Defined in H2JVM.Builder.Label

Methods

showsPrec :: Int -> Label -> ShowS #

show :: Label -> String #

showList :: [Label] -> ShowS #

Eq Label Source # 
Instance details

Defined in H2JVM.Builder.Label

Methods

(==) :: Label -> Label -> Bool #

(/=) :: Label -> Label -> Bool #

Ord Label Source # 
Instance details

Defined in H2JVM.Builder.Label

Methods

compare :: Label -> Label -> Ordering #

(<) :: Label -> Label -> Bool #

(<=) :: Label -> Label -> Bool #

(>) :: Label -> Label -> Bool #

(>=) :: Label -> Label -> Bool #

max :: Label -> Label -> Label #

min :: Label -> Label -> Label #

Pretty Label Source # 
Instance details

Defined in H2JVM.Builder.Label

Methods

pretty :: Label -> Doc ann Source #

prettyList :: [Label] -> Doc ann 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.

Instances

Instances details
Functor Instruction' Source # 
Instance details

Defined in H2JVM.Instruction

Methods

fmap :: (a -> b) -> Instruction' a -> Instruction' b #

(<$) :: a -> Instruction' b -> Instruction' a #

Data label => Data (Instruction' label) Source # 
Instance details

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 # 
Instance details

Defined in H2JVM.Instruction

Associated Types

type Rep (Instruction' label) 
Instance details

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)))))))

Methods

from :: Instruction' label -> Rep (Instruction' label) x #

to :: Rep (Instruction' label) x -> Instruction' label #

Show label => Show (Instruction' label) Source # 
Instance details

Defined in H2JVM.Instruction

Methods

showsPrec :: Int -> Instruction' label -> ShowS #

show :: Instruction' label -> String #

showList :: [Instruction' label] -> ShowS #

Eq label => Eq (Instruction' label) Source # 
Instance details

Defined in H2JVM.Instruction

Methods

(==) :: Instruction' label -> Instruction' label -> Bool #

(/=) :: Instruction' label -> Instruction' label -> Bool #

Ord label => Ord (Instruction' label) Source # 
Instance details

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 # 
Instance details

Defined in H2JVM.Instruction

Methods

pretty :: Instruction' label -> Doc ann Source #

prettyList :: [Instruction' label] -> Doc ann Source #

type Rep (Instruction' label) Source # 
Instance details

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)))))))

data LDCEntry Source #

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

Instances details
Data LDCEntry Source # 
Instance details

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 # 
Instance details

Defined in H2JVM.Instruction

Methods

from :: LDCEntry -> Rep LDCEntry x #

to :: Rep LDCEntry x -> LDCEntry #

Show LDCEntry Source # 
Instance details

Defined in H2JVM.Instruction

Eq LDCEntry Source # 
Instance details

Defined in H2JVM.Instruction

Ord LDCEntry Source # 
Instance details

Defined in H2JVM.Instruction

Pretty LDCEntry Source # 
Instance details

Defined in H2JVM.Instruction

Methods

pretty :: LDCEntry -> Doc ann Source #

prettyList :: [LDCEntry] -> Doc ann Source #

type Rep LDCEntry Source # 
Instance details

Defined in H2JVM.Instruction

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.