1#![doc = include_str!("readme.md")]
2
3use serde::{Deserialize, Serialize};
4use std::{string::String, vec::Vec};
5
6#[derive(Clone, Debug, Serialize, Deserialize)]
8pub struct JasmRoot {
9 pub class: JasmClass,
10}
11
12#[derive(Clone, Debug, Serialize, Deserialize)]
14pub struct JasmClass {
15 pub modifiers: Vec<String>,
17 pub name: String,
19 pub version: Option<String>,
21 pub methods: Vec<JasmMethod>,
23 pub fields: Vec<JasmField>,
25 pub source_file: Option<String>,
27}
28
29#[derive(Clone, Debug, Serialize, Deserialize)]
31pub struct JasmMethod {
32 pub modifiers: Vec<String>,
34 pub name_and_descriptor: String,
36 pub stack_size: Option<u32>,
38 pub locals_count: Option<u32>,
40 pub instructions: Vec<JasmInstruction>,
42}
43
44#[derive(Clone, Debug, Serialize, Deserialize)]
46pub struct JasmField {
47 pub modifiers: Vec<String>,
49 pub name_and_descriptor: String,
51}
52
53#[derive(Clone, Debug, Serialize, Deserialize)]
55pub enum JasmInstruction {
56 Simple(String),
58 WithArgument { instruction: String, argument: String },
60 MethodCall { instruction: String, method_ref: String },
62 FieldAccess { instruction: String, field_ref: String },
64}