use oak_core::{ElementType, UniversalElementRole};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum PhpElementType {
Whitespace,
Newline,
Comment,
StringLiteral,
NumberLiteral,
BooleanLiteral,
NullLiteral,
Identifier,
Variable,
Abstract,
And,
Array,
As,
Break,
Callable,
Case,
Catch,
Class,
Clone,
Const,
Continue,
Declare,
Default,
Do,
Echo,
Else,
Elseif,
Empty,
Enddeclare,
Endfor,
Endforeach,
Endif,
Endswitch,
Endwhile,
Eval,
Exit,
Extends,
Final,
Finally,
For,
Foreach,
Function,
Global,
Goto,
If,
Implements,
Include,
IncludeOnce,
Instanceof,
Insteadof,
Interface,
Isset,
List,
Namespace,
New,
Or,
Print,
Private,
Protected,
Public,
Require,
RequireOnce,
Return,
Static,
Switch,
Throw,
Trait,
Try,
Unset,
Use,
Var,
While,
Xor,
Yield,
YieldFrom,
Plus,
Minus,
Multiply,
Divide,
Modulo,
Power,
Concat,
Equal,
Identical,
NotEqual,
NotIdentical,
Less,
Greater,
LessEqual,
GreaterEqual,
Spaceship,
LogicalAnd,
LogicalOr,
LogicalXor,
LogicalNot,
BitwiseAnd,
BitwiseOr,
BitwiseXor,
BitwiseNot,
LeftShift,
RightShift,
Assign,
PlusAssign,
MinusAssign,
MultiplyAssign,
DivideAssign,
ModuloAssign,
PowerAssign,
ConcatAssign,
BitwiseAndAssign,
BitwiseOrAssign,
BitwiseXorAssign,
LeftShiftAssign,
RightShiftAssign,
Increment,
Decrement,
Arrow,
DoubleArrow,
NullCoalesce,
NullCoalesceAssign,
Ellipsis,
LeftParen,
RightParen,
LeftBracket,
RightBracket,
LeftBrace,
RightBrace,
Semicolon,
Comma,
Dot,
Question,
Colon,
DoubleColon,
Backslash,
At,
Dollar,
OpenTag,
CloseTag,
EchoTag,
Eof,
Error,
Root,
ClassDef,
FunctionDef,
MethodDef,
PropertyDef,
ConstDef,
TraitDef,
InterfaceDef,
NamespaceDef,
UseStatement,
IfStatement,
WhileStatement,
DoWhileStatement,
ForStatement,
ForeachStatement,
SwitchStatement,
TryStatement,
CatchBlock,
FinallyBlock,
ExpressionStatement,
ReturnStatement,
ThrowStatement,
BreakStatement,
ContinueStatement,
EchoStatement,
GlobalStatement,
StaticStatement,
UnsetStatement,
CompoundStatement,
Literal,
ParenthesizedExpression,
CallExpression,
ArrayAccessExpression,
MemberAccessExpression,
BinaryExpression,
}
impl ElementType for PhpElementType {
type Role = UniversalElementRole;
fn role(&self) -> Self::Role {
match self {
_ => UniversalElementRole::None,
}
}
}
impl From<crate::lexer::token_type::PhpTokenType> for PhpElementType {
fn from(token: crate::lexer::token_type::PhpTokenType) -> Self {
match token {
crate::lexer::token_type::PhpTokenType::Whitespace => PhpElementType::Whitespace,
crate::lexer::token_type::PhpTokenType::Newline => PhpElementType::Newline,
crate::lexer::token_type::PhpTokenType::Comment => PhpElementType::Comment,
crate::lexer::token_type::PhpTokenType::StringLiteral => PhpElementType::StringLiteral,
crate::lexer::token_type::PhpTokenType::NumberLiteral => PhpElementType::NumberLiteral,
crate::lexer::token_type::PhpTokenType::BooleanLiteral => PhpElementType::BooleanLiteral,
crate::lexer::token_type::PhpTokenType::NullLiteral => PhpElementType::NullLiteral,
crate::lexer::token_type::PhpTokenType::Identifier => PhpElementType::Identifier,
crate::lexer::token_type::PhpTokenType::Variable => PhpElementType::Variable,
crate::lexer::token_type::PhpTokenType::Abstract => PhpElementType::Abstract,
crate::lexer::token_type::PhpTokenType::And => PhpElementType::And,
crate::lexer::token_type::PhpTokenType::Array => PhpElementType::Array,
crate::lexer::token_type::PhpTokenType::As => PhpElementType::As,
crate::lexer::token_type::PhpTokenType::Break => PhpElementType::Break,
crate::lexer::token_type::PhpTokenType::Callable => PhpElementType::Callable,
crate::lexer::token_type::PhpTokenType::Case => PhpElementType::Case,
crate::lexer::token_type::PhpTokenType::Catch => PhpElementType::Catch,
crate::lexer::token_type::PhpTokenType::Class => PhpElementType::Class,
crate::lexer::token_type::PhpTokenType::Clone => PhpElementType::Clone,
crate::lexer::token_type::PhpTokenType::Const => PhpElementType::Const,
crate::lexer::token_type::PhpTokenType::Continue => PhpElementType::Continue,
crate::lexer::token_type::PhpTokenType::Declare => PhpElementType::Declare,
crate::lexer::token_type::PhpTokenType::Default => PhpElementType::Default,
crate::lexer::token_type::PhpTokenType::Do => PhpElementType::Do,
crate::lexer::token_type::PhpTokenType::Echo => PhpElementType::Echo,
crate::lexer::token_type::PhpTokenType::Else => PhpElementType::Else,
crate::lexer::token_type::PhpTokenType::Elseif => PhpElementType::Elseif,
crate::lexer::token_type::PhpTokenType::Empty => PhpElementType::Empty,
crate::lexer::token_type::PhpTokenType::Enddeclare => PhpElementType::Enddeclare,
crate::lexer::token_type::PhpTokenType::Endfor => PhpElementType::Endfor,
crate::lexer::token_type::PhpTokenType::Endforeach => PhpElementType::Endforeach,
crate::lexer::token_type::PhpTokenType::Endif => PhpElementType::Endif,
crate::lexer::token_type::PhpTokenType::Endswitch => PhpElementType::Endswitch,
crate::lexer::token_type::PhpTokenType::Endwhile => PhpElementType::Endwhile,
crate::lexer::token_type::PhpTokenType::Eval => PhpElementType::Eval,
crate::lexer::token_type::PhpTokenType::Exit => PhpElementType::Exit,
crate::lexer::token_type::PhpTokenType::Extends => PhpElementType::Extends,
crate::lexer::token_type::PhpTokenType::Final => PhpElementType::Final,
crate::lexer::token_type::PhpTokenType::Finally => PhpElementType::Finally,
crate::lexer::token_type::PhpTokenType::For => PhpElementType::For,
crate::lexer::token_type::PhpTokenType::Foreach => PhpElementType::Foreach,
crate::lexer::token_type::PhpTokenType::Function => PhpElementType::Function,
crate::lexer::token_type::PhpTokenType::Global => PhpElementType::Global,
crate::lexer::token_type::PhpTokenType::Goto => PhpElementType::Goto,
crate::lexer::token_type::PhpTokenType::If => PhpElementType::If,
crate::lexer::token_type::PhpTokenType::Implements => PhpElementType::Implements,
crate::lexer::token_type::PhpTokenType::Include => PhpElementType::Include,
crate::lexer::token_type::PhpTokenType::IncludeOnce => PhpElementType::IncludeOnce,
crate::lexer::token_type::PhpTokenType::Instanceof => PhpElementType::Instanceof,
crate::lexer::token_type::PhpTokenType::Insteadof => PhpElementType::Insteadof,
crate::lexer::token_type::PhpTokenType::Interface => PhpElementType::Interface,
crate::lexer::token_type::PhpTokenType::Isset => PhpElementType::Isset,
crate::lexer::token_type::PhpTokenType::List => PhpElementType::List,
crate::lexer::token_type::PhpTokenType::Namespace => PhpElementType::Namespace,
crate::lexer::token_type::PhpTokenType::New => PhpElementType::New,
crate::lexer::token_type::PhpTokenType::Or => PhpElementType::Or,
crate::lexer::token_type::PhpTokenType::Print => PhpElementType::Print,
crate::lexer::token_type::PhpTokenType::Private => PhpElementType::Private,
crate::lexer::token_type::PhpTokenType::Protected => PhpElementType::Protected,
crate::lexer::token_type::PhpTokenType::Public => PhpElementType::Public,
crate::lexer::token_type::PhpTokenType::Require => PhpElementType::Require,
crate::lexer::token_type::PhpTokenType::RequireOnce => PhpElementType::RequireOnce,
crate::lexer::token_type::PhpTokenType::Return => PhpElementType::Return,
crate::lexer::token_type::PhpTokenType::Static => PhpElementType::Static,
crate::lexer::token_type::PhpTokenType::Switch => PhpElementType::Switch,
crate::lexer::token_type::PhpTokenType::Throw => PhpElementType::Throw,
crate::lexer::token_type::PhpTokenType::Trait => PhpElementType::Trait,
crate::lexer::token_type::PhpTokenType::Try => PhpElementType::Try,
crate::lexer::token_type::PhpTokenType::Unset => PhpElementType::Unset,
crate::lexer::token_type::PhpTokenType::Use => PhpElementType::Use,
crate::lexer::token_type::PhpTokenType::Var => PhpElementType::Var,
crate::lexer::token_type::PhpTokenType::While => PhpElementType::While,
crate::lexer::token_type::PhpTokenType::Xor => PhpElementType::Xor,
crate::lexer::token_type::PhpTokenType::Yield => PhpElementType::Yield,
crate::lexer::token_type::PhpTokenType::YieldFrom => PhpElementType::YieldFrom,
crate::lexer::token_type::PhpTokenType::Plus => PhpElementType::Plus,
crate::lexer::token_type::PhpTokenType::Minus => PhpElementType::Minus,
crate::lexer::token_type::PhpTokenType::Multiply => PhpElementType::Multiply,
crate::lexer::token_type::PhpTokenType::Divide => PhpElementType::Divide,
crate::lexer::token_type::PhpTokenType::Modulo => PhpElementType::Modulo,
crate::lexer::token_type::PhpTokenType::Power => PhpElementType::Power,
crate::lexer::token_type::PhpTokenType::Concat => PhpElementType::Concat,
crate::lexer::token_type::PhpTokenType::Equal => PhpElementType::Equal,
crate::lexer::token_type::PhpTokenType::Identical => PhpElementType::Identical,
crate::lexer::token_type::PhpTokenType::NotEqual => PhpElementType::NotEqual,
crate::lexer::token_type::PhpTokenType::NotIdentical => PhpElementType::NotIdentical,
crate::lexer::token_type::PhpTokenType::Less => PhpElementType::Less,
crate::lexer::token_type::PhpTokenType::Greater => PhpElementType::Greater,
crate::lexer::token_type::PhpTokenType::LessEqual => PhpElementType::LessEqual,
crate::lexer::token_type::PhpTokenType::GreaterEqual => PhpElementType::GreaterEqual,
crate::lexer::token_type::PhpTokenType::Spaceship => PhpElementType::Spaceship,
crate::lexer::token_type::PhpTokenType::LogicalAnd => PhpElementType::LogicalAnd,
crate::lexer::token_type::PhpTokenType::LogicalOr => PhpElementType::LogicalOr,
crate::lexer::token_type::PhpTokenType::LogicalXor => PhpElementType::LogicalXor,
crate::lexer::token_type::PhpTokenType::LogicalNot => PhpElementType::LogicalNot,
crate::lexer::token_type::PhpTokenType::BitwiseAnd => PhpElementType::BitwiseAnd,
crate::lexer::token_type::PhpTokenType::BitwiseOr => PhpElementType::BitwiseOr,
crate::lexer::token_type::PhpTokenType::BitwiseXor => PhpElementType::BitwiseXor,
crate::lexer::token_type::PhpTokenType::BitwiseNot => PhpElementType::BitwiseNot,
crate::lexer::token_type::PhpTokenType::LeftShift => PhpElementType::LeftShift,
crate::lexer::token_type::PhpTokenType::RightShift => PhpElementType::RightShift,
crate::lexer::token_type::PhpTokenType::Assign => PhpElementType::Assign,
crate::lexer::token_type::PhpTokenType::PlusAssign => PhpElementType::PlusAssign,
crate::lexer::token_type::PhpTokenType::MinusAssign => PhpElementType::MinusAssign,
crate::lexer::token_type::PhpTokenType::MultiplyAssign => PhpElementType::MultiplyAssign,
crate::lexer::token_type::PhpTokenType::DivideAssign => PhpElementType::DivideAssign,
crate::lexer::token_type::PhpTokenType::ModuloAssign => PhpElementType::ModuloAssign,
crate::lexer::token_type::PhpTokenType::PowerAssign => PhpElementType::PowerAssign,
crate::lexer::token_type::PhpTokenType::ConcatAssign => PhpElementType::ConcatAssign,
crate::lexer::token_type::PhpTokenType::BitwiseAndAssign => PhpElementType::BitwiseAndAssign,
crate::lexer::token_type::PhpTokenType::BitwiseOrAssign => PhpElementType::BitwiseOrAssign,
crate::lexer::token_type::PhpTokenType::BitwiseXorAssign => PhpElementType::BitwiseXorAssign,
crate::lexer::token_type::PhpTokenType::LeftShiftAssign => PhpElementType::LeftShiftAssign,
crate::lexer::token_type::PhpTokenType::RightShiftAssign => PhpElementType::RightShiftAssign,
crate::lexer::token_type::PhpTokenType::Increment => PhpElementType::Increment,
crate::lexer::token_type::PhpTokenType::Decrement => PhpElementType::Decrement,
crate::lexer::token_type::PhpTokenType::Arrow => PhpElementType::Arrow,
crate::lexer::token_type::PhpTokenType::DoubleArrow => PhpElementType::DoubleArrow,
crate::lexer::token_type::PhpTokenType::NullCoalesce => PhpElementType::NullCoalesce,
crate::lexer::token_type::PhpTokenType::NullCoalesceAssign => PhpElementType::NullCoalesceAssign,
crate::lexer::token_type::PhpTokenType::Ellipsis => PhpElementType::Ellipsis,
crate::lexer::token_type::PhpTokenType::LeftParen => PhpElementType::LeftParen,
crate::lexer::token_type::PhpTokenType::RightParen => PhpElementType::RightParen,
crate::lexer::token_type::PhpTokenType::LeftBracket => PhpElementType::LeftBracket,
crate::lexer::token_type::PhpTokenType::RightBracket => PhpElementType::RightBracket,
crate::lexer::token_type::PhpTokenType::LeftBrace => PhpElementType::LeftBrace,
crate::lexer::token_type::PhpTokenType::RightBrace => PhpElementType::RightBrace,
crate::lexer::token_type::PhpTokenType::Semicolon => PhpElementType::Semicolon,
crate::lexer::token_type::PhpTokenType::Comma => PhpElementType::Comma,
crate::lexer::token_type::PhpTokenType::Dot => PhpElementType::Dot,
crate::lexer::token_type::PhpTokenType::Question => PhpElementType::Question,
crate::lexer::token_type::PhpTokenType::Colon => PhpElementType::Colon,
crate::lexer::token_type::PhpTokenType::DoubleColon => PhpElementType::DoubleColon,
crate::lexer::token_type::PhpTokenType::Backslash => PhpElementType::Backslash,
crate::lexer::token_type::PhpTokenType::At => PhpElementType::At,
crate::lexer::token_type::PhpTokenType::Dollar => PhpElementType::Dollar,
crate::lexer::token_type::PhpTokenType::OpenTag => PhpElementType::OpenTag,
crate::lexer::token_type::PhpTokenType::CloseTag => PhpElementType::CloseTag,
crate::lexer::token_type::PhpTokenType::EchoTag => PhpElementType::EchoTag,
crate::lexer::token_type::PhpTokenType::Eof => PhpElementType::Eof,
crate::lexer::token_type::PhpTokenType::Error => PhpElementType::Error,
crate::lexer::token_type::PhpTokenType::Root => PhpElementType::Root,
crate::lexer::token_type::PhpTokenType::ClassDef => PhpElementType::ClassDef,
crate::lexer::token_type::PhpTokenType::FunctionDef => PhpElementType::FunctionDef,
crate::lexer::token_type::PhpTokenType::MethodDef => PhpElementType::MethodDef,
crate::lexer::token_type::PhpTokenType::PropertyDef => PhpElementType::PropertyDef,
crate::lexer::token_type::PhpTokenType::ConstDef => PhpElementType::ConstDef,
crate::lexer::token_type::PhpTokenType::TraitDef => PhpElementType::TraitDef,
crate::lexer::token_type::PhpTokenType::InterfaceDef => PhpElementType::InterfaceDef,
crate::lexer::token_type::PhpTokenType::NamespaceDef => PhpElementType::NamespaceDef,
crate::lexer::token_type::PhpTokenType::UseStatement => PhpElementType::UseStatement,
crate::lexer::token_type::PhpTokenType::IfStatement => PhpElementType::IfStatement,
crate::lexer::token_type::PhpTokenType::WhileStatement => PhpElementType::WhileStatement,
crate::lexer::token_type::PhpTokenType::DoWhileStatement => PhpElementType::DoWhileStatement,
crate::lexer::token_type::PhpTokenType::ForStatement => PhpElementType::ForStatement,
crate::lexer::token_type::PhpTokenType::ForeachStatement => PhpElementType::ForeachStatement,
crate::lexer::token_type::PhpTokenType::SwitchStatement => PhpElementType::SwitchStatement,
crate::lexer::token_type::PhpTokenType::TryStatement => PhpElementType::TryStatement,
crate::lexer::token_type::PhpTokenType::CatchBlock => PhpElementType::CatchBlock,
crate::lexer::token_type::PhpTokenType::FinallyBlock => PhpElementType::FinallyBlock,
crate::lexer::token_type::PhpTokenType::ExpressionStatement => PhpElementType::ExpressionStatement,
crate::lexer::token_type::PhpTokenType::ReturnStatement => PhpElementType::ReturnStatement,
crate::lexer::token_type::PhpTokenType::ThrowStatement => PhpElementType::ThrowStatement,
crate::lexer::token_type::PhpTokenType::BreakStatement => PhpElementType::BreakStatement,
crate::lexer::token_type::PhpTokenType::ContinueStatement => PhpElementType::ContinueStatement,
crate::lexer::token_type::PhpTokenType::EchoStatement => PhpElementType::EchoStatement,
crate::lexer::token_type::PhpTokenType::GlobalStatement => PhpElementType::GlobalStatement,
crate::lexer::token_type::PhpTokenType::StaticStatement => PhpElementType::StaticStatement,
crate::lexer::token_type::PhpTokenType::UnsetStatement => PhpElementType::UnsetStatement,
crate::lexer::token_type::PhpTokenType::CompoundStatement => PhpElementType::CompoundStatement,
crate::lexer::token_type::PhpTokenType::Literal => PhpElementType::Literal,
crate::lexer::token_type::PhpTokenType::ParenthesizedExpression => PhpElementType::ParenthesizedExpression,
crate::lexer::token_type::PhpTokenType::CallExpression => PhpElementType::CallExpression,
crate::lexer::token_type::PhpTokenType::ArrayAccessExpression => PhpElementType::ArrayAccessExpression,
crate::lexer::token_type::PhpTokenType::MemberAccessExpression => PhpElementType::MemberAccessExpression,
crate::lexer::token_type::PhpTokenType::BinaryExpression => PhpElementType::BinaryExpression,
}
}
}