Copyright | (c) Christian Gram Kalhauge 2018 |
---|---|
License | MIT |
Maintainer | kalhuage@cs.ucla.edu |
Safe Haskell | None |
Language | Haskell2010 |
This module contains the ConstantPool
data structure and multiple
other types, and classes.
- 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
.
ConstantPool | |
|
Eq (ConstantPool High) Source # | |
Eq (ConstantPool Low) Source # | |
Ord (ConstantPool Low) Source # | |
Show (ConstantPool High) Source # | |
Show (ConstantPool Low) Source # | |
Generic (ConstantPool High) Source # | |
Generic (ConstantPool Low) Source # | |
Binary (ConstantPool Low) Source # | |
NFData (ConstantPool High) Source # | |
NFData (ConstantPool Low) Source # | |
MonadReader (String, ConstantPool High) Evolve # | |
type Rep (ConstantPool High) Source # | |
type Rep (ConstantPool Low) Source # | |
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