use oak_core::{ElementType, UniversalElementRole};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum JasminElementType {
Root,
Class,
Method,
Field,
Instruction,
IdentifierNode,
StringNode,
NumberNode,
ErrorNode,
ClassKw,
VersionKw,
MethodKw,
FieldKw,
StringKw,
SourceFileKw,
StackKw,
LocalsKw,
EndKw,
CompiledKw,
FromKw,
InnerClassKw,
NestMembersKw,
BootstrapMethodKw,
Public,
Private,
Protected,
Static,
Super,
Final,
Abstract,
Synchronized,
Native,
Synthetic,
Deprecated,
Varargs,
Bridge,
Enum,
Annotation,
Strictfp,
Interface,
Volatile,
Transient,
ALoad0,
ALoad1,
ALoad2,
ALoad3,
ILoad0,
ILoad1,
ILoad2,
ILoad3,
Ldc,
LdcW,
Ldc2W,
InvokeSpecial,
InvokeVirtual,
InvokeStatic,
InvokeInterface,
InvokeDynamic,
GetStatic,
PutStatic,
GetField,
PutField,
Return,
IReturn,
AReturn,
LReturn,
FReturn,
DReturn,
Nop,
Dup,
Pop,
New,
LeftBrace,
RightBrace,
LeftParen,
RightParen,
LeftBracket,
RightBracket,
Colon,
Semicolon,
Dot,
Comma,
Slash,
StringLiteral,
Number,
TypeDescriptor,
IdentifierToken,
Whitespace,
Newline,
Comment,
Eof,
Error,
}
impl ElementType for JasminElementType {
type Role = UniversalElementRole;
fn role(&self) -> Self::Role {
match self {
_ => UniversalElementRole::None,
}
}
}
impl From<crate::lexer::token_type::JasminTokenType> for JasminElementType {
fn from(token: crate::lexer::token_type::JasminTokenType) -> Self {
match token {
crate::lexer::token_type::JasminTokenType::Root => JasminElementType::Root,
crate::lexer::token_type::JasminTokenType::Class => JasminElementType::Class,
crate::lexer::token_type::JasminTokenType::Method => JasminElementType::Method,
crate::lexer::token_type::JasminTokenType::Field => JasminElementType::Field,
crate::lexer::token_type::JasminTokenType::Instruction => JasminElementType::Instruction,
crate::lexer::token_type::JasminTokenType::IdentifierNode => JasminElementType::IdentifierNode,
crate::lexer::token_type::JasminTokenType::StringNode => JasminElementType::StringNode,
crate::lexer::token_type::JasminTokenType::NumberNode => JasminElementType::NumberNode,
crate::lexer::token_type::JasminTokenType::ErrorNode => JasminElementType::ErrorNode,
crate::lexer::token_type::JasminTokenType::ClassKw => JasminElementType::ClassKw,
crate::lexer::token_type::JasminTokenType::VersionKw => JasminElementType::VersionKw,
crate::lexer::token_type::JasminTokenType::MethodKw => JasminElementType::MethodKw,
crate::lexer::token_type::JasminTokenType::FieldKw => JasminElementType::FieldKw,
crate::lexer::token_type::JasminTokenType::StringKw => JasminElementType::StringKw,
crate::lexer::token_type::JasminTokenType::SourceFileKw => JasminElementType::SourceFileKw,
crate::lexer::token_type::JasminTokenType::StackKw => JasminElementType::StackKw,
crate::lexer::token_type::JasminTokenType::LocalsKw => JasminElementType::LocalsKw,
crate::lexer::token_type::JasminTokenType::EndKw => JasminElementType::EndKw,
crate::lexer::token_type::JasminTokenType::CompiledKw => JasminElementType::CompiledKw,
crate::lexer::token_type::JasminTokenType::FromKw => JasminElementType::FromKw,
crate::lexer::token_type::JasminTokenType::InnerClassKw => JasminElementType::InnerClassKw,
crate::lexer::token_type::JasminTokenType::NestMembersKw => JasminElementType::NestMembersKw,
crate::lexer::token_type::JasminTokenType::BootstrapMethodKw => JasminElementType::BootstrapMethodKw,
crate::lexer::token_type::JasminTokenType::Public => JasminElementType::Public,
crate::lexer::token_type::JasminTokenType::Private => JasminElementType::Private,
crate::lexer::token_type::JasminTokenType::Protected => JasminElementType::Protected,
crate::lexer::token_type::JasminTokenType::Static => JasminElementType::Static,
crate::lexer::token_type::JasminTokenType::Super => JasminElementType::Super,
crate::lexer::token_type::JasminTokenType::Final => JasminElementType::Final,
crate::lexer::token_type::JasminTokenType::Abstract => JasminElementType::Abstract,
crate::lexer::token_type::JasminTokenType::Synchronized => JasminElementType::Synchronized,
crate::lexer::token_type::JasminTokenType::Native => JasminElementType::Native,
crate::lexer::token_type::JasminTokenType::Synthetic => JasminElementType::Synthetic,
crate::lexer::token_type::JasminTokenType::Deprecated => JasminElementType::Deprecated,
crate::lexer::token_type::JasminTokenType::Varargs => JasminElementType::Varargs,
crate::lexer::token_type::JasminTokenType::Bridge => JasminElementType::Bridge,
crate::lexer::token_type::JasminTokenType::Enum => JasminElementType::Enum,
crate::lexer::token_type::JasminTokenType::Annotation => JasminElementType::Annotation,
crate::lexer::token_type::JasminTokenType::Strictfp => JasminElementType::Strictfp,
crate::lexer::token_type::JasminTokenType::Interface => JasminElementType::Interface,
crate::lexer::token_type::JasminTokenType::Volatile => JasminElementType::Volatile,
crate::lexer::token_type::JasminTokenType::Transient => JasminElementType::Transient,
crate::lexer::token_type::JasminTokenType::ALoad0 => JasminElementType::ALoad0,
crate::lexer::token_type::JasminTokenType::ALoad1 => JasminElementType::ALoad1,
crate::lexer::token_type::JasminTokenType::ALoad2 => JasminElementType::ALoad2,
crate::lexer::token_type::JasminTokenType::ALoad3 => JasminElementType::ALoad3,
crate::lexer::token_type::JasminTokenType::ILoad0 => JasminElementType::ILoad0,
crate::lexer::token_type::JasminTokenType::ILoad1 => JasminElementType::ILoad1,
crate::lexer::token_type::JasminTokenType::ILoad2 => JasminElementType::ILoad2,
crate::lexer::token_type::JasminTokenType::ILoad3 => JasminElementType::ILoad3,
crate::lexer::token_type::JasminTokenType::Ldc => JasminElementType::Ldc,
crate::lexer::token_type::JasminTokenType::LdcW => JasminElementType::LdcW,
crate::lexer::token_type::JasminTokenType::Ldc2W => JasminElementType::Ldc2W,
crate::lexer::token_type::JasminTokenType::InvokeSpecial => JasminElementType::InvokeSpecial,
crate::lexer::token_type::JasminTokenType::InvokeVirtual => JasminElementType::InvokeVirtual,
crate::lexer::token_type::JasminTokenType::InvokeStatic => JasminElementType::InvokeStatic,
crate::lexer::token_type::JasminTokenType::InvokeInterface => JasminElementType::InvokeInterface,
crate::lexer::token_type::JasminTokenType::InvokeDynamic => JasminElementType::InvokeDynamic,
crate::lexer::token_type::JasminTokenType::GetStatic => JasminElementType::GetStatic,
crate::lexer::token_type::JasminTokenType::PutStatic => JasminElementType::PutStatic,
crate::lexer::token_type::JasminTokenType::GetField => JasminElementType::GetField,
crate::lexer::token_type::JasminTokenType::PutField => JasminElementType::PutField,
crate::lexer::token_type::JasminTokenType::Return => JasminElementType::Return,
crate::lexer::token_type::JasminTokenType::IReturn => JasminElementType::IReturn,
crate::lexer::token_type::JasminTokenType::AReturn => JasminElementType::AReturn,
crate::lexer::token_type::JasminTokenType::LReturn => JasminElementType::LReturn,
crate::lexer::token_type::JasminTokenType::FReturn => JasminElementType::FReturn,
crate::lexer::token_type::JasminTokenType::DReturn => JasminElementType::DReturn,
crate::lexer::token_type::JasminTokenType::Nop => JasminElementType::Nop,
crate::lexer::token_type::JasminTokenType::Dup => JasminElementType::Dup,
crate::lexer::token_type::JasminTokenType::Pop => JasminElementType::Pop,
crate::lexer::token_type::JasminTokenType::New => JasminElementType::New,
crate::lexer::token_type::JasminTokenType::LeftBrace => JasminElementType::LeftBrace,
crate::lexer::token_type::JasminTokenType::RightBrace => JasminElementType::RightBrace,
crate::lexer::token_type::JasminTokenType::LeftParen => JasminElementType::LeftParen,
crate::lexer::token_type::JasminTokenType::RightParen => JasminElementType::RightParen,
crate::lexer::token_type::JasminTokenType::LeftBracket => JasminElementType::LeftBracket,
crate::lexer::token_type::JasminTokenType::RightBracket => JasminElementType::RightBracket,
crate::lexer::token_type::JasminTokenType::Colon => JasminElementType::Colon,
crate::lexer::token_type::JasminTokenType::Semicolon => JasminElementType::Semicolon,
crate::lexer::token_type::JasminTokenType::Dot => JasminElementType::Dot,
crate::lexer::token_type::JasminTokenType::Comma => JasminElementType::Comma,
crate::lexer::token_type::JasminTokenType::Slash => JasminElementType::Slash,
crate::lexer::token_type::JasminTokenType::StringLiteral => JasminElementType::StringLiteral,
crate::lexer::token_type::JasminTokenType::Number => JasminElementType::Number,
crate::lexer::token_type::JasminTokenType::TypeDescriptor => JasminElementType::TypeDescriptor,
crate::lexer::token_type::JasminTokenType::IdentifierToken => JasminElementType::IdentifierToken,
crate::lexer::token_type::JasminTokenType::Whitespace => JasminElementType::Whitespace,
crate::lexer::token_type::JasminTokenType::Newline => JasminElementType::Newline,
crate::lexer::token_type::JasminTokenType::Comment => JasminElementType::Comment,
crate::lexer::token_type::JasminTokenType::Eof => JasminElementType::Eof,
crate::lexer::token_type::JasminTokenType::Error => JasminElementType::Error,
}
}
}