#![allow(clippy::match_same_arms, clippy::too_many_lines)]
use num_derive::FromPrimitive;
#[derive(Clone, Debug, PartialEq, Eq, FromPrimitive)]
pub enum Groovy {
End = 0,
Identifier = 1,
Shebang = 2,
COMMA = 3,
COLON = 4,
LBRACE = 5,
RBRACE = 6,
If = 7,
LPAREN = 8,
RPAREN = 9,
Else = 10,
While = 11,
For = 12,
SEMI = 13,
Do = 14,
Return = 15,
Break = 16,
Continue = 17,
Throw = 18,
Yield = 19,
Assert = 20,
Try = 21,
EQ = 22,
Catch = 23,
PIPE = 24,
Finally = 25,
Sealed = 26,
NonDASHsealed = 27,
Class = 28,
Trait = 29,
Interface = 30,
LT = 31,
GT = 32,
Extends = 33,
AMP = 34,
Implements = 35,
Public = 36,
Private = 37,
Protected = 38,
Static = 39,
Final = 40,
Abstract = 41,
Synchronized = 42,
Native = 43,
Transient = 44,
Volatile = 45,
Strictfp = 46,
Permits = 47,
AT = 48,
Def = 49,
LT2 = 50,
Throws = 51,
DOTDOTDOT = 52,
Enum = 53,
Record = 54,
Package = 55,
Import = 56,
DOTSTAR = 57,
As = 58,
DOT = 59,
Var = 60,
Pipeline = 61,
In = 62,
Switch = 63,
Case = 64,
DASHGT = 65,
Default = 66,
MembershipExpressionToken1 = 67,
Instanceof = 68,
InstanceofExpressionToken1 = 69,
New = 70,
LBRACK = 71,
RBRACK = 72,
QMARK = 73,
Super = 74,
QMARKDOT = 75,
QMARKQMARKDOT = 76,
STARDOT = 77,
DOTAMP = 78,
DOTAT = 79,
COLONCOLON = 80,
PLUSPLUS = 81,
DASHDASH = 82,
STAR = 83,
QMARKLBRACK = 84,
STARSTAR = 85,
EQEQGT = 86,
PLUSEQ = 87,
DASHEQ = 88,
STAREQ = 89,
SLASHEQ = 90,
PERCENTEQ = 91,
STARSTAREQ = 92,
LTLTEQ = 93,
GTGTEQ = 94,
GTGTGTEQ = 95,
AMPEQ = 96,
CARETEQ = 97,
PIPEEQ = 98,
QMARKEQ = 99,
QMARKCOLON = 100,
DOTDOT = 101,
DOTDOTLT = 102,
LTDOTDOT = 103,
LTDOTDOTLT = 104,
EQEQEQ = 105,
BANGEQEQ = 106,
LTEQGT = 107,
EQTILDE = 108,
EQEQTILDE = 109,
PLUS = 110,
DASH = 111,
SLASH = 112,
PERCENT = 113,
LTLT = 114,
GTGT = 115,
GTGTGT = 116,
LTEQ = 117,
GTEQ = 118,
EQEQ = 119,
BANGEQ = 120,
CARET = 121,
AMPAMP = 122,
PIPEPIPE = 123,
STARCOLON = 124,
BANG = 125,
TILDE = 126,
True = 127,
False = 128,
NullLiteral = 129,
SLASH2 = 130,
StringFragment = 131,
SingleQuotedString = 132,
TripleSingleQuotedString = 133,
DQUOTE = 134,
DQUOTE2 = 135,
StringFragment2 = 136,
StringFragment3 = 137,
DQUOTEDQUOTEDQUOTE = 138,
DQUOTEDQUOTEDQUOTE2 = 139,
StringFragment4 = 140,
Identifier2 = 141,
DOLLARLBRACE = 142,
DOLLARSLASH = 143,
SLASHDOLLAR = 144,
StringFragment5 = 145,
NumberLiteral = 146,
SlashyStringStart = 147,
LineComment = 148,
BlockComment = 149,
GroovydocComment = 150,
SourceFile = 151,
Statement = 152,
CommandChain = 153,
CommandArgument = 154,
LabeledStatement = 155,
Block = 156,
IfStatement = 157,
WhileStatement = 158,
ForStatement = 159,
DoWhileStatement = 160,
ReturnStatement = 161,
BreakStatement = 162,
ContinueStatement = 163,
ThrowStatement = 164,
YieldStatement = 165,
AssertStatement = 166,
TryStatement = 167,
ResourceSpecification = 168,
Resource = 169,
CatchClause = 170,
CatchFormalParameter = 171,
MultiType = 172,
FinallyClause = 173,
ClassDeclaration = 174,
TraitDeclaration = 175,
InterfaceDeclaration = 176,
TypeParameters = 177,
TypeParameter = 178,
Superclass = 179,
SuperInterfaces = 180,
ExtendsInterfaces = 181,
Modifier = 182,
PermitsClause = 183,
AnnotationTypeDeclaration = 184,
ClassBody = 185,
ClassMember = 186,
ConstructorDeclaration = 187,
StaticInitializer = 188,
FieldDeclaration = 189,
MethodDeclaration = 190,
MethodTypeParameters = 191,
ThrowsClause = 192,
FormalParameters = 193,
FormalParameter = 194,
VarargsType = 195,
EnumDeclaration = 196,
EnumBody = 197,
EnumConstant = 198,
RecordDeclaration = 199,
RecordComponents = 200,
RecordComponent = 201,
PackageDeclaration = 202,
ImportDeclaration = 203,
QualifiedName = 204,
LocalVariableDeclaration = 205,
InitializedDeclarator = 206,
VariableDeclarator = 207,
MultiAssignmentDeclaration = 208,
PipelineStatement = 209,
Annotation = 210,
ForInStatement = 211,
ExpressionStatement = 212,
Expression = 213,
SwitchExpression = 214,
SwitchBlock = 215,
SwitchCase = 216,
SwitchArrowCase = 217,
SwitchDefault = 218,
CastExpression = 219,
CastType = 220,
QualifiedType = 221,
DottedTypeTail = 222,
MembershipExpression = 223,
InstanceofExpression = 224,
ObjectCreationExpression = 225,
ParenthesizedTypeCast = 226,
Type = 227,
QualifiedType2 = 228,
ArrayType = 229,
GenericType = 230,
TypeArguments = 231,
TypeArgument = 232,
Wildcard = 233,
FieldAccess = 234,
SafeNavigationExpression = 235,
SafeChainDotExpression = 236,
SpreadDotExpression = 237,
MethodPointerExpression = 238,
DirectFieldAccessExpression = 239,
PropertyName = 240,
MethodReferenceExpression = 241,
UpdateExpression = 242,
UnaryUpdateExpression = 243,
MethodInvocation = 244,
ArgumentList = 245,
Argument = 246,
SpreadArguments = 247,
SubscriptExpression = 248,
SafeSubscriptExpression = 249,
PowerExpression = 250,
LogicalImplicationExpression = 251,
AssignmentExpression = 252,
TernaryExpression = 253,
ElvisExpression = 254,
RangeExpression = 255,
IdentityExpression = 256,
SpaceshipExpression = 257,
RegexFindExpression = 258,
RegexMatchExpression = 259,
BinaryExpression = 260,
Closure = 261,
ClosureParameters = 262,
ClosureParameter = 263,
ListLiteral = 264,
MapLiteral = 265,
MapEntry = 266,
SpreadMapEntry = 267,
ParenthesizedExpression = 268,
UnaryExpression = 269,
BooleanLiteral = 270,
StringLiteral = 271,
SlashyString = 272,
DoubleQuotedString = 273,
TripleDoubleQuotedString = 274,
GstringDollarInterpolation = 275,
GstringBraceInterpolation = 276,
DollarSlashyString = 277,
SourceFileRepeat1 = 278,
CommandChainRepeat1 = 279,
TryStatementRepeat1 = 280,
ResourceSpecificationRepeat1 = 281,
MultiTypeRepeat1 = 282,
ClassDeclarationRepeat1 = 283,
ClassDeclarationRepeat2 = 284,
TypeParametersRepeat1 = 285,
TypeParameterRepeat1 = 286,
SuperInterfacesRepeat1 = 287,
ClassBodyRepeat1 = 288,
FieldDeclarationRepeat1 = 289,
FormalParametersRepeat1 = 290,
EnumBodyRepeat1 = 291,
RecordComponentsRepeat1 = 292,
QualifiedNameRepeat1 = 293,
LocalVariableDeclarationRepeat1 = 294,
SwitchBlockRepeat1 = 295,
QualifiedTypeRepeat1 = 296,
TypeArgumentsRepeat1 = 297,
ArgumentListRepeat1 = 298,
ClosureParametersRepeat1 = 299,
ListLiteralRepeat1 = 300,
MapLiteralRepeat1 = 301,
SlashyStringRepeat1 = 302,
DoubleQuotedStringRepeat1 = 303,
TripleDoubleQuotedStringRepeat1 = 304,
DollarSlashyStringRepeat1 = 305,
NamedArgument = 306,
QuotedIdentifier = 307,
TypeIdentifier = 308,
Error = 309,
}
impl From<Groovy> for &'static str {
#[inline]
fn from(tok: Groovy) -> Self {
match tok {
Groovy::End => "end",
Groovy::Identifier => "identifier",
Groovy::Shebang => "shebang",
Groovy::COMMA => ",",
Groovy::COLON => ":",
Groovy::LBRACE => "{",
Groovy::RBRACE => "}",
Groovy::If => "if",
Groovy::LPAREN => "(",
Groovy::RPAREN => ")",
Groovy::Else => "else",
Groovy::While => "while",
Groovy::For => "for",
Groovy::SEMI => ";",
Groovy::Do => "do",
Groovy::Return => "return",
Groovy::Break => "break",
Groovy::Continue => "continue",
Groovy::Throw => "throw",
Groovy::Yield => "yield",
Groovy::Assert => "assert",
Groovy::Try => "try",
Groovy::EQ => "=",
Groovy::Catch => "catch",
Groovy::PIPE => "|",
Groovy::Finally => "finally",
Groovy::Sealed => "sealed",
Groovy::NonDASHsealed => "non-sealed",
Groovy::Class => "class",
Groovy::Trait => "trait",
Groovy::Interface => "interface",
Groovy::LT => "<",
Groovy::GT => ">",
Groovy::Extends => "extends",
Groovy::AMP => "&",
Groovy::Implements => "implements",
Groovy::Public => "public",
Groovy::Private => "private",
Groovy::Protected => "protected",
Groovy::Static => "static",
Groovy::Final => "final",
Groovy::Abstract => "abstract",
Groovy::Synchronized => "synchronized",
Groovy::Native => "native",
Groovy::Transient => "transient",
Groovy::Volatile => "volatile",
Groovy::Strictfp => "strictfp",
Groovy::Permits => "permits",
Groovy::AT => "@",
Groovy::Def => "def",
Groovy::LT2 => "<",
Groovy::Throws => "throws",
Groovy::DOTDOTDOT => "...",
Groovy::Enum => "enum",
Groovy::Record => "record",
Groovy::Package => "package",
Groovy::Import => "import",
Groovy::DOTSTAR => ".*",
Groovy::As => "as",
Groovy::DOT => ".",
Groovy::Var => "var",
Groovy::Pipeline => "pipeline",
Groovy::In => "in",
Groovy::Switch => "switch",
Groovy::Case => "case",
Groovy::DASHGT => "->",
Groovy::Default => "default",
Groovy::MembershipExpressionToken1 => "membership_expression_token1",
Groovy::Instanceof => "instanceof",
Groovy::InstanceofExpressionToken1 => "instanceof_expression_token1",
Groovy::New => "new",
Groovy::LBRACK => "[",
Groovy::RBRACK => "]",
Groovy::QMARK => "?",
Groovy::Super => "super",
Groovy::QMARKDOT => "?.",
Groovy::QMARKQMARKDOT => "??.",
Groovy::STARDOT => "*.",
Groovy::DOTAMP => ".&",
Groovy::DOTAT => ".@",
Groovy::COLONCOLON => "::",
Groovy::PLUSPLUS => "++",
Groovy::DASHDASH => "--",
Groovy::STAR => "*",
Groovy::QMARKLBRACK => "?[",
Groovy::STARSTAR => "**",
Groovy::EQEQGT => "==>",
Groovy::PLUSEQ => "+=",
Groovy::DASHEQ => "-=",
Groovy::STAREQ => "*=",
Groovy::SLASHEQ => "/=",
Groovy::PERCENTEQ => "%=",
Groovy::STARSTAREQ => "**=",
Groovy::LTLTEQ => "<<=",
Groovy::GTGTEQ => ">>=",
Groovy::GTGTGTEQ => ">>>=",
Groovy::AMPEQ => "&=",
Groovy::CARETEQ => "^=",
Groovy::PIPEEQ => "|=",
Groovy::QMARKEQ => "?=",
Groovy::QMARKCOLON => "?:",
Groovy::DOTDOT => "..",
Groovy::DOTDOTLT => "..<",
Groovy::LTDOTDOT => "<..",
Groovy::LTDOTDOTLT => "<..<",
Groovy::EQEQEQ => "===",
Groovy::BANGEQEQ => "!==",
Groovy::LTEQGT => "<=>",
Groovy::EQTILDE => "=~",
Groovy::EQEQTILDE => "==~",
Groovy::PLUS => "+",
Groovy::DASH => "-",
Groovy::SLASH => "/",
Groovy::PERCENT => "%",
Groovy::LTLT => "<<",
Groovy::GTGT => ">>",
Groovy::GTGTGT => ">>>",
Groovy::LTEQ => "<=",
Groovy::GTEQ => ">=",
Groovy::EQEQ => "==",
Groovy::BANGEQ => "!=",
Groovy::CARET => "^",
Groovy::AMPAMP => "&&",
Groovy::PIPEPIPE => "||",
Groovy::STARCOLON => "*:",
Groovy::BANG => "!",
Groovy::TILDE => "~",
Groovy::True => "true",
Groovy::False => "false",
Groovy::NullLiteral => "null_literal",
Groovy::SLASH2 => "/",
Groovy::StringFragment => "string_fragment",
Groovy::SingleQuotedString => "_single_quoted_string",
Groovy::TripleSingleQuotedString => "_triple_single_quoted_string",
Groovy::DQUOTE => "\"",
Groovy::DQUOTE2 => "\"",
Groovy::StringFragment2 => "string_fragment",
Groovy::StringFragment3 => "string_fragment",
Groovy::DQUOTEDQUOTEDQUOTE => "\"\"\"",
Groovy::DQUOTEDQUOTEDQUOTE2 => "\"\"\"",
Groovy::StringFragment4 => "string_fragment",
Groovy::Identifier2 => "identifier",
Groovy::DOLLARLBRACE => "${",
Groovy::DOLLARSLASH => "$/",
Groovy::SLASHDOLLAR => "/$",
Groovy::StringFragment5 => "string_fragment",
Groovy::NumberLiteral => "number_literal",
Groovy::SlashyStringStart => "_slashy_string_start",
Groovy::LineComment => "line_comment",
Groovy::BlockComment => "block_comment",
Groovy::GroovydocComment => "groovydoc_comment",
Groovy::SourceFile => "source_file",
Groovy::Statement => "_statement",
Groovy::CommandChain => "command_chain",
Groovy::CommandArgument => "_command_argument",
Groovy::LabeledStatement => "labeled_statement",
Groovy::Block => "block",
Groovy::IfStatement => "if_statement",
Groovy::WhileStatement => "while_statement",
Groovy::ForStatement => "for_statement",
Groovy::DoWhileStatement => "do_while_statement",
Groovy::ReturnStatement => "return_statement",
Groovy::BreakStatement => "break_statement",
Groovy::ContinueStatement => "continue_statement",
Groovy::ThrowStatement => "throw_statement",
Groovy::YieldStatement => "yield_statement",
Groovy::AssertStatement => "assert_statement",
Groovy::TryStatement => "try_statement",
Groovy::ResourceSpecification => "resource_specification",
Groovy::Resource => "resource",
Groovy::CatchClause => "catch_clause",
Groovy::CatchFormalParameter => "catch_formal_parameter",
Groovy::MultiType => "multi_type",
Groovy::FinallyClause => "finally_clause",
Groovy::ClassDeclaration => "class_declaration",
Groovy::TraitDeclaration => "trait_declaration",
Groovy::InterfaceDeclaration => "interface_declaration",
Groovy::TypeParameters => "type_parameters",
Groovy::TypeParameter => "type_parameter",
Groovy::Superclass => "superclass",
Groovy::SuperInterfaces => "super_interfaces",
Groovy::ExtendsInterfaces => "extends_interfaces",
Groovy::Modifier => "_modifier",
Groovy::PermitsClause => "permits_clause",
Groovy::AnnotationTypeDeclaration => "annotation_type_declaration",
Groovy::ClassBody => "class_body",
Groovy::ClassMember => "_class_member",
Groovy::ConstructorDeclaration => "constructor_declaration",
Groovy::StaticInitializer => "static_initializer",
Groovy::FieldDeclaration => "field_declaration",
Groovy::MethodDeclaration => "method_declaration",
Groovy::MethodTypeParameters => "method_type_parameters",
Groovy::ThrowsClause => "throws_clause",
Groovy::FormalParameters => "formal_parameters",
Groovy::FormalParameter => "formal_parameter",
Groovy::VarargsType => "varargs_type",
Groovy::EnumDeclaration => "enum_declaration",
Groovy::EnumBody => "enum_body",
Groovy::EnumConstant => "enum_constant",
Groovy::RecordDeclaration => "record_declaration",
Groovy::RecordComponents => "record_components",
Groovy::RecordComponent => "record_component",
Groovy::PackageDeclaration => "package_declaration",
Groovy::ImportDeclaration => "import_declaration",
Groovy::QualifiedName => "qualified_name",
Groovy::LocalVariableDeclaration => "local_variable_declaration",
Groovy::InitializedDeclarator => "_initialized_declarator",
Groovy::VariableDeclarator => "variable_declarator",
Groovy::MultiAssignmentDeclaration => "multi_assignment_declaration",
Groovy::PipelineStatement => "pipeline_statement",
Groovy::Annotation => "annotation",
Groovy::ForInStatement => "for_in_statement",
Groovy::ExpressionStatement => "expression_statement",
Groovy::Expression => "_expression",
Groovy::SwitchExpression => "switch_expression",
Groovy::SwitchBlock => "switch_block",
Groovy::SwitchCase => "switch_case",
Groovy::SwitchArrowCase => "switch_arrow_case",
Groovy::SwitchDefault => "switch_default",
Groovy::CastExpression => "cast_expression",
Groovy::CastType => "_cast_type",
Groovy::QualifiedType => "qualified_type",
Groovy::DottedTypeTail => "_dotted_type_tail",
Groovy::MembershipExpression => "membership_expression",
Groovy::InstanceofExpression => "instanceof_expression",
Groovy::ObjectCreationExpression => "object_creation_expression",
Groovy::ParenthesizedTypeCast => "parenthesized_type_cast",
Groovy::Type => "_type",
Groovy::QualifiedType2 => "qualified_type",
Groovy::ArrayType => "array_type",
Groovy::GenericType => "generic_type",
Groovy::TypeArguments => "type_arguments",
Groovy::TypeArgument => "_type_argument",
Groovy::Wildcard => "wildcard",
Groovy::FieldAccess => "field_access",
Groovy::SafeNavigationExpression => "safe_navigation_expression",
Groovy::SafeChainDotExpression => "safe_chain_dot_expression",
Groovy::SpreadDotExpression => "spread_dot_expression",
Groovy::MethodPointerExpression => "method_pointer_expression",
Groovy::DirectFieldAccessExpression => "direct_field_access_expression",
Groovy::PropertyName => "_property_name",
Groovy::MethodReferenceExpression => "method_reference_expression",
Groovy::UpdateExpression => "update_expression",
Groovy::UnaryUpdateExpression => "unary_update_expression",
Groovy::MethodInvocation => "method_invocation",
Groovy::ArgumentList => "argument_list",
Groovy::Argument => "_argument",
Groovy::SpreadArguments => "spread_arguments",
Groovy::SubscriptExpression => "subscript_expression",
Groovy::SafeSubscriptExpression => "safe_subscript_expression",
Groovy::PowerExpression => "power_expression",
Groovy::LogicalImplicationExpression => "logical_implication_expression",
Groovy::AssignmentExpression => "assignment_expression",
Groovy::TernaryExpression => "ternary_expression",
Groovy::ElvisExpression => "elvis_expression",
Groovy::RangeExpression => "range_expression",
Groovy::IdentityExpression => "identity_expression",
Groovy::SpaceshipExpression => "spaceship_expression",
Groovy::RegexFindExpression => "regex_find_expression",
Groovy::RegexMatchExpression => "regex_match_expression",
Groovy::BinaryExpression => "binary_expression",
Groovy::Closure => "closure",
Groovy::ClosureParameters => "closure_parameters",
Groovy::ClosureParameter => "closure_parameter",
Groovy::ListLiteral => "list_literal",
Groovy::MapLiteral => "map_literal",
Groovy::MapEntry => "map_entry",
Groovy::SpreadMapEntry => "spread_map_entry",
Groovy::ParenthesizedExpression => "parenthesized_expression",
Groovy::UnaryExpression => "unary_expression",
Groovy::BooleanLiteral => "boolean_literal",
Groovy::StringLiteral => "string_literal",
Groovy::SlashyString => "_slashy_string",
Groovy::DoubleQuotedString => "_double_quoted_string",
Groovy::TripleDoubleQuotedString => "_triple_double_quoted_string",
Groovy::GstringDollarInterpolation => "gstring_dollar_interpolation",
Groovy::GstringBraceInterpolation => "gstring_brace_interpolation",
Groovy::DollarSlashyString => "_dollar_slashy_string",
Groovy::SourceFileRepeat1 => "source_file_repeat1",
Groovy::CommandChainRepeat1 => "command_chain_repeat1",
Groovy::TryStatementRepeat1 => "try_statement_repeat1",
Groovy::ResourceSpecificationRepeat1 => "resource_specification_repeat1",
Groovy::MultiTypeRepeat1 => "multi_type_repeat1",
Groovy::ClassDeclarationRepeat1 => "class_declaration_repeat1",
Groovy::ClassDeclarationRepeat2 => "class_declaration_repeat2",
Groovy::TypeParametersRepeat1 => "type_parameters_repeat1",
Groovy::TypeParameterRepeat1 => "type_parameter_repeat1",
Groovy::SuperInterfacesRepeat1 => "super_interfaces_repeat1",
Groovy::ClassBodyRepeat1 => "class_body_repeat1",
Groovy::FieldDeclarationRepeat1 => "field_declaration_repeat1",
Groovy::FormalParametersRepeat1 => "formal_parameters_repeat1",
Groovy::EnumBodyRepeat1 => "enum_body_repeat1",
Groovy::RecordComponentsRepeat1 => "record_components_repeat1",
Groovy::QualifiedNameRepeat1 => "qualified_name_repeat1",
Groovy::LocalVariableDeclarationRepeat1 => "local_variable_declaration_repeat1",
Groovy::SwitchBlockRepeat1 => "switch_block_repeat1",
Groovy::QualifiedTypeRepeat1 => "qualified_type_repeat1",
Groovy::TypeArgumentsRepeat1 => "type_arguments_repeat1",
Groovy::ArgumentListRepeat1 => "argument_list_repeat1",
Groovy::ClosureParametersRepeat1 => "closure_parameters_repeat1",
Groovy::ListLiteralRepeat1 => "list_literal_repeat1",
Groovy::MapLiteralRepeat1 => "map_literal_repeat1",
Groovy::SlashyStringRepeat1 => "_slashy_string_repeat1",
Groovy::DoubleQuotedStringRepeat1 => "_double_quoted_string_repeat1",
Groovy::TripleDoubleQuotedStringRepeat1 => "_triple_double_quoted_string_repeat1",
Groovy::DollarSlashyStringRepeat1 => "_dollar_slashy_string_repeat1",
Groovy::NamedArgument => "named_argument",
Groovy::QuotedIdentifier => "quoted_identifier",
Groovy::TypeIdentifier => "type_identifier",
Groovy::Error => "ERROR",
}
}
}
impl From<u16> for Groovy {
#[inline]
fn from(x: u16) -> Self {
num::FromPrimitive::from_u16(x).unwrap_or(Self::Error)
}
}
impl PartialEq<u16> for Groovy {
#[inline]
fn eq(&self, x: &u16) -> bool {
*self == Into::<Self>::into(*x)
}
}
impl PartialEq<Groovy> for u16 {
#[inline]
fn eq(&self, x: &Groovy) -> bool {
*x == *self
}
}