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

[ java, jvm, language, library, mit ] [ Propose Tags ]

A library for reading Java class-files.


[Skip to Readme]

Modules

[Last Documentation]

  • Language
    • Language.JVM
      • Language.JVM.AccessFlag
      • Language.JVM.Attribute
        • Language.JVM.Attribute.Base
        • Language.JVM.Attribute.BootstrapMethods
        • Language.JVM.Attribute.Code
        • Language.JVM.Attribute.ConstantValue
        • Language.JVM.Attribute.EnclosingMethod
        • Language.JVM.Attribute.Exceptions
        • Language.JVM.Attribute.InnerClasses
        • Language.JVM.Attribute.LineNumberTable
        • Language.JVM.Attribute.Signature
        • Language.JVM.Attribute.StackMapTable
      • Language.JVM.ByteCode
      • Language.JVM.ClassFile
      • Language.JVM.ClassFileReader
      • Language.JVM.Constant
      • Language.JVM.ConstantPool
      • Language.JVM.Field
      • Language.JVM.Method
      • Language.JVM.Stage
      • Language.JVM.Staged
      • Language.JVM.TH
      • Language.JVM.Type
      • Language.JVM.Utils

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.0.1, 0.0.2, 0.1.0, 0.2.0, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.6.1, 0.7.0, 0.8.0, 0.9.0, 0.10.0
Change log CHANGELOG.md
Dependencies attoparsec, base (>=4.9 && <4.12), binary, bytestring, containers, data-binary-ieee754, deepseq (>=1.4.3.0), deriving-compat, mtl, template-haskell, text, vector [details]
License MIT
Author Christian Gram Kalhauge
Maintainer Christian Gram Kalhauge <kalhauge@cs.ucla.edu>
Category Language, Java, JVM
Home page https://github.com/ucla-pls/jvm-binary#readme
Bug tracker https://github.com/ucla-pls/jvm-binary/issues
Source repo head: git clone https://github.com/ucla-pls/jvm-binary
Uploaded by kalhauge at 2019-02-14T22:36:36Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 5850 total (30 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2019-02-14 [all 3 reports]

Readme for jvm-binary-0.3.0

[back to package description]

jvm-binary

A library for reading and writing Java class-files. To get started importing the Language.JVM file should be sufficient for most uses.

If you want to access Code elements of methods it is recommended to import Language.JVM.Attribute.Code qualified, like this:

import           Language.JVM
import qualified Language.JVM.Attribute.Code as Code

import qualified Data.ByteString.Lazy as BL

main :: IO ()
main = 
  ecfl <- readClassFile <$> BL.readFile "test/data/project/Main.class" 
  case ecfl of 
    Right clf -> do
      print (cThisClass clf)
      print (cSuperClass clf)
    Left msg -> 
      print msg

Stages

There are two stages in the current state of the repository. Low is closer to the class-file, while the High stage is easier to work with. The reason that we have the two stages is that the class-file representation has indices into the Constant Pool. The High stage eliminates all these problems.

Todo's

  • Add more Attributes as to the docs.
  • Add documentation for Code
  • Setup regular benchmarks

Developing

Use stack to build, test, and benchmark.