jvm-binary-0.1.0: A library for reading Java class-files

Copyright(c) Christian Gram Kalhauge 2018
LicenseMIT
Maintainerkalhuage@cs.ucla.edu
Safe HaskellNone
LanguageHaskell2010

Language.JVM.ConstantPool

Contents

Description

This module contains the ConstantPool data structure and multiple other types, and classes.

Synopsis

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 

Instances

Eq (ConstantPool High) Source # 
Eq (ConstantPool Low) Source # 
Ord (ConstantPool Low) Source # 
Show (ConstantPool High) Source # 
Show (ConstantPool Low) Source # 
Generic (ConstantPool High) Source # 

Associated Types

type Rep (ConstantPool High) :: * -> * #

Generic (ConstantPool Low) Source # 

Associated Types

type Rep (ConstantPool Low) :: * -> * #

Binary (ConstantPool Low) Source # 
NFData (ConstantPool High) Source # 

Methods

rnf :: ConstantPool High -> () #

NFData (ConstantPool Low) Source # 

Methods

rnf :: ConstantPool Low -> () #

MonadReader (String, ConstantPool High) Evolve # 
type Rep (ConstantPool High) Source # 
type Rep (ConstantPool High) = D1 * (MetaData "ConstantPool" "Language.JVM.ConstantPool" "jvm-binary-0.1.0-JJ8Rr7ERir79pQaBJvdiXV" True) (C1 * (MetaCons "ConstantPool" PrefixI True) (S1 * (MetaSel (Just Symbol "unConstantPool") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (IntMap (Constant High)))))
type Rep (ConstantPool Low) Source # 
type Rep (ConstantPool Low) = D1 * (MetaData "ConstantPool" "Language.JVM.ConstantPool" "jvm-binary-0.1.0-JJ8Rr7ERir79pQaBJvdiXV" True) (C1 * (MetaCons "ConstantPool" PrefixI True) (S1 * (MetaSel (Just Symbol "unConstantPool") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (IntMap (Constant Low)))))

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