| Copyright | (c) Christian Gram Kalhauge 2018 |
|---|---|
| License | MIT |
| Maintainer | kalhuage@cs.ucla.edu |
| Safe Haskell | None |
| Language | Haskell2010 |
Language.JVM.ConstantPool
Contents
Description
This module contains the ConstantPool data structure and multiple
other types, and classes.
Synopsis
- newtype ConstantPool r = ConstantPool {
- unConstantPool :: IntMap (Constant r)
- access :: Index -> ConstantPool r -> Either PoolAccessError (Constant r)
- append :: Constant r -> ConstantPool r -> (Index, ConstantPool r)
- empty :: ConstantPool r
- data PoolAccessError = PoolAccessError {
- paErrorRef :: !Word16
- paErrorMsg :: String
Constant Pool
The ConstantPool contains all the constants, and is accessible using the
Lookup methods.
newtype ConstantPool r Source #
A ConstantPool is just an IntMap. A IntMap is used, because constants are
accessed using their byte-offset, and sometimes the offset depends on the constant
size. See constantSize.
Constructors
| ConstantPool | |
Fields
| |
Instances
access :: Index -> ConstantPool r -> Either PoolAccessError (Constant r) Source #
Access a constant in the constant pool
append :: Constant r -> ConstantPool r -> (Index, ConstantPool r) Source #
Append a constant to the constant pool, and get the offset.
empty :: ConstantPool r Source #
Creates an empty constant pool
data PoolAccessError Source #
A pool access error
Constructors
| PoolAccessError | |
Fields
| |