use crate::node::element::{AnnotationNode, LabelNode};
use crate::*;
use std::sync::Arc;
#[derive(Clone, Debug)]
pub enum ConstValue {
Invalid,
Class(InternalNameRef),
Member {
class: InternalNameRef,
name: StrRef,
desc: DescriptorRef,
},
String(StrRef),
Integer(i32),
Float(f32),
Long(i64),
Double(f64),
NameAndType {
name: StrRef,
desc: DescriptorRef,
},
MethodHandle(Handle),
MethodType(DescriptorRef),
Dynamic {
bootstrap_method_attr_index: u16,
name: StrRef,
desc: DescriptorRef,
},
Module(StrRef),
Package(StrRef),
}
#[derive(Clone, Debug)]
pub enum AnnotationValue {
Const(Arc<ConstValue>),
Enum(StrRef, StrRef),
Class(InternalNameRef),
Annotation(AnnotationNode),
Array(Vec<AnnotationValue>),
}
#[derive(Clone, Debug)]
pub enum FieldInitialValue {
Integer(i32),
Float(f32),
Long(i64),
Double(f64),
String(StrRef),
}
#[derive(Clone, Debug)]
pub enum FrameAttributeValue {
SameFrame {
offset_delta: u8,
},
SameFrameExtended {
offset_delta: u16,
},
SameLocals1StackItemFrame {
offset_delta: u8,
stack: FrameValue,
},
SameLocals1StackItemFrameExtended {
offset_delta: u16,
stack: FrameValue,
},
ChopFrame {
chop_count: u8,
offset_delta: u16,
},
AppendFrame {
offset_delta: u16,
append_locals: Vec<FrameValue>,
},
FullFrame {
offset_delta: u16,
locals: Vec<FrameValue>,
stack: Vec<FrameValue>,
},
}
#[derive(Clone, Debug)]
pub enum FrameValue {
Top,
Integer,
Float,
Long,
Double,
Null,
UninitializedThis,
Object(StrRef),
Uninitialized(u16),
}
#[derive(Clone, Debug)]
pub enum BootstrapMethodArgument {
Integer(i32),
Float(f32),
Long(i64),
Double(f64),
String(StrRef),
Class(InternalNameRef),
Handle(Handle),
}
#[derive(Clone, Debug)]
pub struct Handle {
pub reference_kind: u8,
pub owner: StrRef,
pub name: StrRef,
pub desc: StrRef,
}
#[derive(Clone, Debug)]
pub struct ConstDynamic {
pub name: StrRef,
pub desc: StrRef,
pub bsm: Handle, pub bsm_args: Vec<BootstrapMethodArgument>,
}
#[derive(Clone, Debug)]
pub struct LocalVariableInfo {
pub start: LabelNode,
pub length: u16,
pub name: StrRef,
pub desc: DescriptorRef,
pub index: u16,
}
#[derive(Clone, Debug)]
pub struct LocalVariableTypeInfo {
pub start: LabelNode,
pub length: u16,
pub name: StrRef,
pub signature: StrRef,
pub index: u16,
}
#[derive(Clone, Debug)]
pub struct ModuleAttrValue {
pub name: StrRef,
pub access: u16,
pub version: Option<StrRef>,
pub requires: Vec<ModuleRequireValue>,
pub exports: Vec<ModuleExportValue>,
pub opens: Vec<ModuleOpenValue>,
pub uses: Vec<InternalNameRef>,
pub provides: Vec<ModuleProvidesValue>,
}
#[derive(Clone, Debug)]
pub struct ModuleRequireValue {
pub module: QualifiedNameRef,
pub access: u16,
pub version: Option<StrRef>,
}
#[derive(Clone, Debug)]
pub struct ModuleExportValue {
pub package: InternalNameRef,
pub access: u16,
pub modules: Vec<QualifiedNameRef>,
}
#[derive(Clone, Debug)]
pub struct ModuleOpenValue {
pub package: InternalNameRef,
pub access: u16,
pub modules: Vec<QualifiedNameRef>,
}
#[derive(Clone, Debug)]
pub struct ModuleProvidesValue {
pub service: InternalNameRef,
pub providers: Vec<InternalNameRef>,
}