Skip to main content

Crate jvm_assembler

Crate jvm_assembler 

Source
Expand description

§JVM Assembler Library

jvm-assembler is a Rust library for processing Java Virtual Machine (JVM) bytecode and JASM (Java ASseMbler) assembly language. It provides a set of tools for parsing, generating, and manipulating JVM Class files as well as JASM assembly code.

§Main Features

  • JASM Assembler: Converts JASM assembly code into JVM bytecode.
  • Class File Parser: Reads and parses JVM Class files, converting them into a structured program representation.
  • Class File Writer: Serializes program representations into JVM Class files.
  • Helper Tools: Provides practical utilities for byte manipulation, string processing, numerical conversion, etc.

§Module Structure

  • formats: Contains parsers and writers for various file formats (such as Class files and JASM).
    • class: Handles reading, writing, and views for JVM Class files.
    • jasm: Handles lexical analysis, parsing, and writing for the JASM assembly language.
  • helpers: Provides general helper functions and utilities.
  • program: Defines the abstract representation of JVM programs, used for conversion between different formats.

§Usage Example

§Assembling JASM into a Class File

§Reading a Class File

§Error Handling

All operations in the library use gaia_types::Result and gaia_types::GaiaError for error handling, providing detailed error information and context.

§Contribution

Contributions are welcome! Please refer to the project’s CONTRIBUTING.md file for more information.

Re-exports§

pub use crate::program::opcodes;
pub use crate::program::JvmConstantPoolEntry;
pub use crate::program::JvmField;
pub use crate::program::JvmInstruction;
pub use crate::program::JvmMethod;

Modules§

analyzer
builder
formats
Formats Module
helpers
optimizer
program
Main Program Module

Structs§

GaiaError
Gaia error type, wrapping a specific error kind GaiaErrorKind

Type Aliases§

Result
Result type for this crate, using GaiaError as the error type