Copyright | (c) Christian Gram Kalhauge 2017 |
---|---|
License | MIT |
Maintainer | kalhuage@cs.ucla.edu |
Safe Haskell | None |
Language | Haskell2010 |
This is the main module for accessing all kinds of Attributes.
- data Attribute = Attribute {}
- aInfo :: Attribute -> ByteString
- aName :: ConstantPool -> Attribute -> Maybe Text
- class IsAttribute a where
- type Code = Code Attribute
- codeStackMapTable :: ConstantPool -> Code -> Maybe (Either String BootstrapMethods)
- data ConstantValue
- data Exceptions
- data StackMapTable
- data BootstrapMethods
- data Const a b
Documentation
An Attribute, simply contains of a reference to a name and contains info.
aInfo :: Attribute -> ByteString Source #
A small helper function to extract the info as a
lazy ByteString
.
aName :: ConstantPool -> Attribute -> Maybe Text Source #
Extracts the name from the attribute, if it exists in the ConstantPool.
class IsAttribute a where Source #
A class-type that describes a data-type a
as an Attribute. Most notable
it provides the fromAttribute'
method that enables converting an Attribute
to a data-type a
.
attrName :: Const Text a Source #
The name of the attribute.
fromAttribute :: Attribute -> Either String a Source #
Generate a a
from an Attribute.
fromAttribute' :: ConstantPool -> Attribute -> Maybe (Either String a) Source #
IsAttribute StackMapTable Source # |
|
IsAttribute Exceptions Source # |
|
IsAttribute ConstantValue Source # |
|
IsAttribute BootstrapMethods Source # |
|
IsAttribute Code Source # |
|
SubAttributes
type Code = Code Attribute Source #
Code is redefined with Attribute, as it is recursively containing
Attribute
. This is a small hack to fix it.
codeStackMapTable :: ConstantPool -> Code -> Maybe (Either String BootstrapMethods) Source #
The a attribute of the code is the StackMapTable. There can be at most one. If the version number of the file is more than 50, and there is no StackMapTable. there is an implicit empty StackMapTable.
data ConstantValue Source #
A constant value is just a index into the constant pool.
Eq ConstantValue Source # | |
Show ConstantValue Source # | |
Generic ConstantValue Source # | |
Binary ConstantValue Source # | |
IsAttribute ConstantValue Source # |
|
type Rep ConstantValue Source # | |
data Exceptions Source #
An Exceptions attribute is a list of references into the constant pool.
Eq Exceptions Source # | |
Show Exceptions Source # | |
Generic Exceptions Source # | |
Binary Exceptions Source # | |
IsAttribute Exceptions Source # |
|
type Rep Exceptions Source # | |
data StackMapTable Source #
An Exceptions attribute is a list of references into the constant pool.
Eq StackMapTable Source # | |
Show StackMapTable Source # | |
Generic StackMapTable Source # | |
Binary StackMapTable Source # | |
IsAttribute StackMapTable Source # |
|
type Rep StackMapTable Source # | |
data BootstrapMethods Source #
Is a list of bootstrapped methods.
Helpers
Create a type dependent on another type b
,
used for accessing the correct attrName
in IsAttribute
.