Copyright | Galois, Inc. 2012-2014 |
---|---|
License | BSD3 |
Maintainer | atomb@galois.com |
Stability | stable |
Portability | non-portable |
Safe Haskell | Safe-Inferred |
Language | Haskell98 |
Basic datatypes and utilities for the JVM parser.
- slashesToDots :: String -> String
- dotsToSlashes :: String -> String
- data Type
- stringTy :: Type
- intArrayTy :: Type
- byteArrayTy :: Type
- charArrayTy :: Type
- isIValue :: Type -> Bool
- isRValue :: Type -> Bool
- isPrimitiveType :: Type -> Bool
- stackWidth :: Type -> Int
- isFloatType :: Type -> Bool
- isRefType :: Type -> Bool
- data FieldId = FieldId {
- fieldIdClass :: !String
- fieldIdName :: !String
- fieldIdType :: !Type
- ppFldId :: FieldId -> String
- data MethodKey = MethodKey {}
- ppMethodKey :: MethodKey -> Doc
- data ConstantPoolValue
- type LocalVariableIndex = Word16
- type PC = Word16
- data Instruction
- = Aaload
- | Aastore
- | Aconst_null
- | Aload LocalVariableIndex
- | Areturn
- | Arraylength
- | Astore LocalVariableIndex
- | Athrow
- | Baload
- | Bastore
- | Caload
- | Castore
- | Checkcast Type
- | D2f
- | D2i
- | D2l
- | Dadd
- | Daload
- | Dastore
- | Dcmpg
- | Dcmpl
- | Ddiv
- | Dload LocalVariableIndex
- | Dmul
- | Dneg
- | Drem
- | Dreturn
- | Dstore LocalVariableIndex
- | Dsub
- | Dup
- | Dup_x1
- | Dup_x2
- | Dup2
- | Dup2_x1
- | Dup2_x2
- | F2d
- | F2i
- | F2l
- | Fadd
- | Faload
- | Fastore
- | Fcmpg
- | Fcmpl
- | Fdiv
- | Fload LocalVariableIndex
- | Fmul
- | Fneg
- | Frem
- | Freturn
- | Fstore LocalVariableIndex
- | Fsub
- | Getfield FieldId
- | Getstatic FieldId
- | Goto PC
- | I2b
- | I2c
- | I2d
- | I2f
- | I2l
- | I2s
- | Iadd
- | Iaload
- | Iand
- | Iastore
- | Idiv
- | If_acmpeq PC
- | If_acmpne PC
- | If_icmpeq PC
- | If_icmpne PC
- | If_icmplt PC
- | If_icmpge PC
- | If_icmpgt PC
- | If_icmple PC
- | Ifeq PC
- | Ifne PC
- | Iflt PC
- | Ifge PC
- | Ifgt PC
- | Ifle PC
- | Ifnonnull PC
- | Ifnull PC
- | Iinc LocalVariableIndex Int16
- | Iload LocalVariableIndex
- | Imul
- | Ineg
- | Instanceof Type
- | Invokeinterface String MethodKey
- | Invokespecial Type MethodKey
- | Invokestatic String MethodKey
- | Invokevirtual Type MethodKey
- | Ior
- | Irem
- | Ireturn
- | Ishl
- | Ishr
- | Istore LocalVariableIndex
- | Isub
- | Iushr
- | Ixor
- | Jsr PC
- | L2d
- | L2f
- | L2i
- | Ladd
- | Laload
- | Land
- | Lastore
- | Lcmp
- | Ldc ConstantPoolValue
- | Ldiv
- | Lload LocalVariableIndex
- | Lmul
- | Lneg
- | Lookupswitch PC [(Int32, PC)]
- | Lor
- | Lrem
- | Lreturn
- | Lshl
- | Lshr
- | Lstore LocalVariableIndex
- | Lsub
- | Lushr
- | Lxor
- | Monitorenter
- | Monitorexit
- | Multianewarray Type Word8
- | New String
- | Newarray Type
- | Nop
- | Pop
- | Pop2
- | Putfield FieldId
- | Putstatic FieldId
- | Ret LocalVariableIndex
- | Return
- | Saload
- | Sastore
- | Swap
- | Tableswitch PC Int32 Int32 [PC]
- ppInstruction :: Instruction -> Doc
- data ExceptionTableEntry = ExceptionTableEntry {}
- type ExceptionTable = [ExceptionTableEntry]
- type InstructionStream = Array PC (Maybe Instruction)
- canThrowException :: Instruction -> Bool
- isArrayLoad :: Instruction -> Bool
- isReturn :: Instruction -> Bool
- breaksControlFlow :: Instruction -> Bool
- nextPcPrim :: InstructionStream -> PC -> PC
- safeNextPcPrim :: InstructionStream -> PC -> Maybe PC
- ppType :: Type -> Doc
Documentation
JVM Type
intArrayTy :: Type Source
isPrimitiveType :: Type -> Bool Source
Returns true if Java type is a primitive type. Primitive types are the Boolean type or numeric types.
stackWidth :: Type -> Int Source
Returns number of bits that a Java type is expected to take on the stack. Type should be a primitive type.
isFloatType :: Type -> Bool Source
Returns true if Java type denotes a floating point.
Unique identifier of field
FieldId | |
|
A unique identifier for looking up a method in a class.
ppMethodKey :: MethodKey -> Doc Source
data ConstantPoolValue Source
A value stored in the constant pool.
type LocalVariableIndex = Word16 Source
A local variable index.
data Instruction Source
A JVM Instruction
ppInstruction :: Instruction -> Doc Source
TODO: improve this
data ExceptionTableEntry Source
An entry in the exception table for a method
ExceptionTableEntry | |
|
type ExceptionTable = [ExceptionTableEntry] Source
type InstructionStream = Array PC (Maybe Instruction) Source
isArrayLoad :: Instruction -> Bool Source
isReturn :: Instruction -> Bool Source
nextPcPrim :: InstructionStream -> PC -> PC Source
safeNextPcPrim :: InstructionStream -> PC -> Maybe PC Source