jvm_assembler/formats/jasm/ast/
mod.rs1pub mod to_jasm;
2pub mod to_program;
3
4#[derive(Clone, Debug)]
5pub struct JasmClass {
6 pub modifiers: Vec<String>,
8 pub name: String,
10 pub version: Option<String>,
12 pub methods: Vec<JasmMethod>,
14 pub fields: Vec<JasmField>,
16 pub source_file: Option<String>,
18}
19
20#[derive(Clone, Debug)]
22pub struct JasmMethod {
23 pub modifiers: Vec<String>,
25 pub name_and_descriptor: String,
27 pub stack_size: Option<u32>,
29 pub locals_count: Option<u32>,
31 pub instructions: Vec<JasmInstruction>,
33}
34
35#[derive(Clone, Debug)]
37pub struct JasmField {
38 pub modifiers: Vec<String>,
40 pub name_and_descriptor: String,
42}
43
44#[derive(Clone, Debug)]
46pub enum JasmInstruction {
47 Simple(String),
49 WithArgument { instruction: String, argument: String },
51 MethodCall { instruction: String, method_ref: String },
53 FieldAccess { instruction: String, field_ref: String },
55}
56
57#[derive(Clone, Debug)]
59pub struct JasmRoot {
60 pub class: JasmClass,
62}