javalib

Javalib is a library written in OCaml with the aim to provide a high level representation of Java .class files
IN THIS PACKAGE
Module Javalib_pack . JCode
type jconst = [
| `ANull
| `Byte of int
| `Class of JBasics.object_type
| `Double of float
| `Float of float
| `Int of int32
| `Long of int64
| `MethodHandle of JBasics.method_handle
| `MethodType of JBasics.method_descriptor
| `Short of int
| `String of JBasics.jstr
]
type jinterface_or_class = [
| `Class
| `Interface
]
type jopcode =
| OpLoad of JBasics.jvm_type * int
| OpStore of JBasics.jvm_type * int
| OpIInc of int * int
| OpPop
| OpPop2
| OpDup
| OpDupX1
| OpDupX2
| OpDup2
| OpDup2X1
| OpDup2X2
| OpSwap
| OpConst of jconst
| OpAdd of JBasics.jvm_basic_type
| OpSub of JBasics.jvm_basic_type
| OpMult of JBasics.jvm_basic_type
| OpDiv of JBasics.jvm_basic_type
| OpRem of JBasics.jvm_basic_type
| OpNeg of JBasics.jvm_basic_type
| OpIShl
| OpLShl
| OpIShr
| OpLShr
| OpIUShr
| OpLUShr
| OpIAnd
| OpLAnd
| OpIOr
| OpLOr
| OpIXor
| OpLXor
| OpI2L
| OpI2F
| OpI2D
| OpL2I
| OpL2F
| OpL2D
| OpF2I
| OpF2L
| OpF2D
| OpD2I
| OpD2L
| OpD2F
| OpI2B
| OpI2C
| OpI2S
| OpCmp of [ `DG | `DL | `FG | `FL | `L ]
| OpIf of [ `Eq | `Ge | `Gt | `Le | `Lt | `Ne | `NonNull | `Null ] * int
| OpIfCmp of [ `AEq | `ANe | `IEq | `IGe | `IGt | `ILe | `ILt | `INe ] * int
| OpGoto of int
| OpJsr of int
| OpRet of int
| OpTableSwitch of int * int32 * int32 * int array
| OpLookupSwitch of int * (int32 * int) list
| OpNew of JBasics.class_name
| OpNewArray of JBasics.value_type
| OpAMultiNewArray of JBasics.object_type * int
| OpCheckCast of JBasics.object_type
| OpInstanceOf of JBasics.object_type
| OpGetStatic of JBasics.class_name * JBasics.field_signature
| OpPutStatic of JBasics.class_name * JBasics.field_signature
| OpGetField of JBasics.class_name * JBasics.field_signature
| OpPutField of JBasics.class_name * JBasics.field_signature
| OpArrayLength
| OpArrayLoad of JBasics.jvm_array_type
| OpArrayStore of JBasics.jvm_array_type
| OpInvoke of [ `Dynamic of JBasics.bootstrap_method | `Interface of JBasics.class_name | `Special of jinterface_or_class * JBasics.class_name | `Static of jinterface_or_class * JBasics.class_name | `Virtual of JBasics.object_type ] * JBasics.method_signature
| OpReturn of JBasics.jvm_return_type
| OpThrow
| OpMonitorEnter
| OpMonitorExit
| OpNop
| OpBreakpoint
| OpInvalid
type jopcodes = jopcode array
type exception_handler = {
e_start : int;
e_end : int;
e_handler : int;
e_catch_type : JBasics.class_name option;
}
type jcode = {
c_max_stack : int;
c_max_locals : int;
c_code : jopcodes;
c_exc_tbl : exception_handler list;
c_line_number_table : (int * int) list option;
c_local_variable_table : (int * int * string * JBasics.value_type * int) list option;
c_local_variable_type_table : (int * int * string * JSignature.fieldTypeSignature * int) list option;
c_stack_map : JBasics.stackmap list option;
c_attributes : (string * string) list;
}
val empty : jcode
val get_source_line_number : int -> jcode -> int option
val get_source_line_number' : int -> (int * int) list -> int option
val get_local_variable_info : int -> int -> jcode -> (string * JBasics.value_type) option