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

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Warnings:

A library for reading Java class-files.


[Skip to Readme]

Properties

Versions 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.9.0, 0.10.0
Change log CHANGELOG.md
Dependencies attoparsec, base (>=4.9 && <4.13), 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 2020-04-29T08:09:19Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for jvm-binary-0.9.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

Developing

Use stack to build, test, and benchmark.