#![allow(clippy::match_same_arms, clippy::too_many_lines)]
use num_derive::FromPrimitive;
#[derive(Clone, Debug, PartialEq, Eq, FromPrimitive)]
pub enum Cpp {
End = 0,
Identifier = 1,
HASHinclude = 2,
PreprocIncludeToken2 = 3,
HASHdefine = 4,
LPAREN = 5,
DOTDOTDOT = 6,
COMMA = 7,
RPAREN = 8,
HASHif = 9,
LF = 10,
HASHendif = 11,
HASHifdef = 12,
HASHifndef = 13,
HASHelse = 14,
HASHelif = 15,
HASHelifdef = 16,
HASHelifndef = 17,
PreprocArg = 18,
PreprocDirective = 19,
LPAREN2 = 20,
Defined = 21,
BANG = 22,
TILDE = 23,
DASH = 24,
PLUS = 25,
STAR = 26,
SLASH = 27,
PERCENT = 28,
PIPEPIPE = 29,
AMPAMP = 30,
PIPE = 31,
CARET = 32,
AMP = 33,
EQEQ = 34,
BANGEQ = 35,
GT = 36,
GTEQ = 37,
LTEQ = 38,
LT = 39,
LTLT = 40,
GTGT = 41,
SEMI = 42,
Extension = 43,
Typedef = 44,
Virtual = 45,
Extern = 46,
Attribute2 = 47,
Attribute3 = 48,
COLONCOLON = 49,
LBRACKLBRACK = 50,
RBRACKRBRACK = 51,
Declspec = 52,
Based = 53,
Cdecl = 54,
Clrcall = 55,
Stdcall = 56,
Fastcall = 57,
Thiscall = 58,
Vectorcall = 59,
MsRestrictModifier = 60,
MsUnsignedPtrModifier = 61,
MsSignedPtrModifier = 62,
Unaligned = 63,
Unaligned2 = 64,
LBRACE = 65,
RBRACE = 66,
Signed = 67,
Unsigned = 68,
Long = 69,
Short = 70,
LBRACK = 71,
Static = 72,
RBRACK = 73,
EQ = 74,
Register = 75,
Inline = 76,
Inline2 = 77,
Inline3 = 78,
Forceinline = 79,
ThreadLocal = 80,
Thread = 81,
Const = 82,
Constexpr = 83,
Volatile = 84,
Restrict = 85,
Restrict2 = 86,
Atomic = 87,
Noreturn = 88,
Noreturn2 = 89,
Nonnull = 90,
Mutable = 91,
Constinit = 92,
Consteval = 93,
Alignas = 94,
Alignas2 = 95,
PrimitiveType = 96,
Enum = 97,
Class = 98,
Struct = 99,
Union = 100,
COLON = 101,
If = 102,
Else = 103,
Switch = 104,
Case = 105,
Default = 106,
While = 107,
Do = 108,
For = 109,
Return = 110,
Break = 111,
Continue = 112,
Goto = 113,
Try = 114,
Except = 115,
Finally = 116,
Leave = 117,
QMARK = 118,
STAREQ = 119,
SLASHEQ = 120,
PERCENTEQ = 121,
PLUSEQ = 122,
DASHEQ = 123,
LTLTEQ = 124,
GTGTEQ = 125,
AMPEQ = 126,
CARETEQ = 127,
PIPEEQ = 128,
AndEq = 129,
OrEq = 130,
XorEq = 131,
Not = 132,
Compl = 133,
LTEQGT = 134,
Or = 135,
And = 136,
Bitor = 137,
Xor = 138,
Bitand = 139,
NotEq = 140,
DASHDASH = 141,
PLUSPLUS = 142,
Sizeof = 143,
Alignof = 144,
Alignof2 = 145,
Alignof3 = 146,
Alignof4 = 147,
Alignof5 = 148,
Offsetof = 149,
Generic = 150,
Asm = 151,
Asm2 = 152,
Asm3 = 153,
Volatile2 = 154,
DOT = 155,
DOTSTAR = 156,
DASHGT = 157,
NumberLiteral = 158,
LSQUOTE = 159,
USQUOTE = 160,
USQUOTE2 = 161,
U8SQUOTE = 162,
SQUOTE = 163,
Character = 164,
LDQUOTE = 165,
UDQUOTE = 166,
UDQUOTE2 = 167,
U8DQUOTE = 168,
DQUOTE = 169,
StringContent = 170,
EscapeSequence = 171,
SystemLibString = 172,
True = 173,
False = 174,
NULL = 175,
Nullptr = 176,
Comment = 177,
Auto = 178,
Decltype3 = 179,
Final = 180,
Override = 181,
Explicit = 182,
Typename = 183,
Template = 184,
GT2 = 185,
Operator = 186,
Try2 = 187,
Delete = 188,
PureVirtualClauseToken1 = 189,
Friend = 190,
Public = 191,
Private = 192,
Protected = 193,
Noexcept2 = 194,
Throw = 195,
Namespace = 196,
Using = 197,
StaticAssert = 198,
Concept = 199,
CoReturn = 200,
CoYield = 201,
Catch = 202,
RDQUOTE = 203,
LRDQUOTE = 204,
URDQUOTE = 205,
URDQUOTE2 = 206,
U8RDQUOTE = 207,
CoAwait = 208,
New = 209,
Requires = 210,
DASHGTSTAR = 211,
LPARENRPAREN = 212,
LBRACKRBRACK = 213,
DQUOTEDQUOTE = 214,
This = 215,
LiteralSuffix = 216,
RawStringDelimiter = 217,
RawStringContent = 218,
TranslationUnit = 219,
TopLevelItem = 220,
BlockItem = 221,
PreprocInclude = 222,
PreprocDef = 223,
PreprocFunctionDef = 224,
PreprocParams = 225,
PreprocCall = 226,
PreprocIf = 227,
PreprocIfdef = 228,
PreprocElse = 229,
PreprocElif = 230,
PreprocElifdef = 231,
PreprocIf2 = 232,
PreprocIfdef2 = 233,
PreprocElse2 = 234,
PreprocElif2 = 235,
PreprocElifdef2 = 236,
PreprocIf3 = 237,
PreprocIfdef3 = 238,
PreprocElse3 = 239,
PreprocElif3 = 240,
PreprocElifdef3 = 241,
PreprocIf4 = 242,
PreprocIfdef4 = 243,
PreprocElse4 = 244,
PreprocElif4 = 245,
PreprocElifdef4 = 246,
PreprocExpression = 247,
ParenthesizedExpression = 248,
PreprocDefined = 249,
UnaryExpression = 250,
CallExpression = 251,
ArgumentList = 252,
BinaryExpression = 253,
FunctionDefinition = 254,
Declaration = 255,
TypeDefinition = 256,
TypeDefinitionType = 257,
TypeDefinitionDeclarators = 258,
DeclarationModifiers = 259,
DeclarationSpecifiers = 260,
LinkageSpecification = 261,
AttributeSpecifier = 262,
Attribute = 263,
AttributeDeclaration = 264,
MsDeclspecModifier = 265,
MsBasedModifier = 266,
MsCallModifier = 267,
MsUnalignedPtrModifier = 268,
MsPointerModifier = 269,
DeclarationList = 270,
Declarator = 271,
FieldDeclarator = 272,
TypeDeclarator = 273,
AbstractDeclarator = 274,
ParenthesizedDeclarator = 275,
ParenthesizedDeclarator2 = 276,
ParenthesizedDeclarator3 = 277,
AbstractParenthesizedDeclarator = 278,
AttributedDeclarator = 279,
AttributedDeclarator2 = 280,
AttributedDeclarator3 = 281,
PointerDeclarator = 282,
PointerDeclarator2 = 283,
PointerTypeDeclarator = 284,
AbstractPointerDeclarator = 285,
FunctionDeclarator = 286,
FunctionDeclarator2 = 287,
FunctionDeclarator3 = 288,
AbstractFunctionDeclarator = 289,
ArrayDeclarator = 290,
ArrayDeclarator2 = 291,
ArrayDeclarator3 = 292,
AbstractArrayDeclarator = 293,
InitDeclarator = 294,
CompoundStatement = 295,
StorageClassSpecifier = 296,
TypeQualifier = 297,
AlignasQualifier = 298,
TypeSpecifier = 299,
SizedTypeSpecifier = 300,
EnumSpecifier = 301,
EnumeratorList = 302,
StructSpecifier = 303,
UnionSpecifier = 304,
FieldDeclarationList = 305,
FieldDeclarationListItem = 306,
FieldDeclaration = 307,
BitfieldClause = 308,
Enumerator = 309,
ParameterList = 310,
ParameterDeclaration = 311,
AttributedStatement = 312,
Statement = 313,
TopLevelStatement = 314,
LabeledStatement = 315,
ExpressionStatement = 316,
ExpressionStatement2 = 317,
IfStatement = 318,
ElseClause = 319,
SwitchStatement = 320,
CaseStatement = 321,
WhileStatement = 322,
DoStatement = 323,
ForStatement = 324,
ForStatementBody = 325,
ReturnStatement = 326,
BreakStatement = 327,
ContinueStatement = 328,
GotoStatement = 329,
SehTryStatement = 330,
SehExceptClause = 331,
SehFinallyClause = 332,
SehLeaveStatement = 333,
Expression = 334,
String = 335,
CommaExpression = 336,
ConditionalExpression = 337,
AssignmentExpression = 338,
PointerExpression = 339,
UnaryExpression2 = 340,
BinaryExpression2 = 341,
UpdateExpression = 342,
CastExpression = 343,
TypeDescriptor = 344,
SizeofExpression = 345,
AlignofExpression = 346,
OffsetofExpression = 347,
GenericExpression = 348,
SubscriptExpression = 349,
CallExpression2 = 350,
GnuAsmExpression = 351,
GnuAsmQualifier = 352,
GnuAsmOutputOperandList = 353,
GnuAsmOutputOperand = 354,
GnuAsmInputOperandList = 355,
GnuAsmInputOperand = 356,
GnuAsmClobberList = 357,
GnuAsmGotoList = 358,
ExtensionExpression = 359,
ArgumentList2 = 360,
FieldExpression = 361,
CompoundLiteralExpression = 362,
ParenthesizedExpression2 = 363,
InitializerList = 364,
InitializerPair = 365,
SubscriptDesignator = 366,
SubscriptRangeDesignator = 367,
FieldDesignator = 368,
CharLiteral = 369,
ConcatenatedString = 370,
StringLiteral = 371,
Null = 372,
EmptyDeclaration = 373,
PlaceholderTypeSpecifier = 374,
Decltype = 375,
Decltype2 = 376,
ClassDeclaration = 377,
ClassDeclarationItem = 378,
ClassSpecifier = 379,
ClassName = 380,
VirtualSpecifier = 381,
ExplicitFunctionSpecifier = 382,
BaseClassClause = 383,
EnumBaseClause = 384,
DependentType = 385,
TemplateDeclaration = 386,
TemplateInstantiation = 387,
TemplateParameterList = 388,
TypeParameterDeclaration = 389,
VariadicTypeParameterDeclaration = 390,
OptionalTypeParameterDeclaration = 391,
TemplateTemplateParameterDeclaration = 392,
OptionalParameterDeclaration = 393,
VariadicParameterDeclaration = 394,
VariadicDeclarator = 395,
ReferenceDeclarator = 396,
OperatorCast = 397,
FieldInitializerList = 398,
FieldInitializer = 399,
FunctionDefinition2 = 400,
ConstructorSpecifiers = 401,
FunctionDefinition3 = 402,
Declaration2 = 403,
TryStatement = 404,
FunctionDefinition4 = 405,
Declaration3 = 406,
DefaultMethodClause = 407,
DeleteMethodClause = 408,
PureVirtualClause = 409,
FriendDeclaration = 410,
AccessSpecifier = 411,
ReferenceDeclarator2 = 412,
ReferenceDeclarator3 = 413,
ReferenceDeclarator4 = 414,
AbstractReferenceDeclarator = 415,
StructuredBindingDeclarator = 416,
RefQualifier = 417,
FunctionDeclaratorSeq = 418,
FunctionAttributesStart = 419,
FunctionExceptionSpecification = 420,
FunctionAttributesEnd = 421,
FunctionPostfix = 422,
TrailingReturnType = 423,
Noexcept = 424,
ThrowSpecifier = 425,
TemplateType = 426,
TemplateMethod = 427,
TemplateFunction = 428,
TemplateArgumentList = 429,
NamespaceDefinition = 430,
NamespaceAliasDefinition = 431,
NamespaceSpecifier = 432,
NestedNamespaceSpecifier = 433,
UsingDeclaration = 434,
AliasDeclaration = 435,
StaticAssertDeclaration = 436,
ConceptDefinition = 437,
ForRangeLoop = 438,
ForRangeLoopBody = 439,
InitStatement = 440,
ConditionClause = 441,
Declaration4 = 442,
CoReturnStatement = 443,
CoYieldStatement = 444,
ThrowStatement = 445,
TryStatement2 = 446,
CatchClause = 447,
RawStringLiteral = 448,
SubscriptArgumentList = 449,
CoAwaitExpression = 450,
NewExpression = 451,
NewDeclarator = 452,
DeleteExpression = 453,
TypeRequirement = 454,
CompoundRequirement = 455,
Requirement = 456,
RequirementSeq = 457,
ConstraintConjunction = 458,
ConstraintDisjunction = 459,
RequirementClauseConstraint = 460,
RequiresClause = 461,
ParameterList2 = 462,
RequiresExpression = 463,
LambdaExpression = 464,
LambdaCaptureSpecifier = 465,
LambdaDefaultCapture = 466,
LambdaCaptureIdentifier = 467,
LambdaCaptureInitializer = 468,
LambdaCapture = 469,
FoldOperator = 470,
BinaryFoldOperator = 471,
UnaryLeftFold = 472,
UnaryRightFold = 473,
BinaryFold = 474,
FoldExpression = 475,
ParameterPackExpansion = 476,
ParameterPackExpansion2 = 477,
ParameterPackExpansion3 = 478,
DestructorName = 479,
DependentName = 480,
DependentName2 = 481,
DependentName3 = 482,
ScopeResolution = 483,
QualifiedIdentifier = 484,
QualifiedIdentifier2 = 485,
QualifiedIdentifier3 = 486,
QualifiedIdentifier4 = 487,
AssignmentExpression2 = 488,
OperatorName = 489,
UserDefinedLiteral = 490,
TranslationUnitRepeat1 = 491,
PreprocParamsRepeat1 = 492,
PreprocIfRepeat1 = 493,
PreprocIfInFieldDeclarationListRepeat1 = 494,
PreprocIfInEnumeratorListRepeat1 = 495,
PreprocIfInEnumeratorListNoCommaRepeat1 = 496,
PreprocArgumentListRepeat1 = 497,
DeclarationRepeat1 = 498,
TypeDefinitionRepeat1 = 499,
TypeDefinitionTypeRepeat1 = 500,
TypeDefinitionDeclaratorsRepeat1 = 501,
DeclarationSpecifiersRepeat1 = 502,
AttributeDeclarationRepeat1 = 503,
AttributedDeclaratorRepeat1 = 504,
PointerDeclaratorRepeat1 = 505,
ArrayDeclaratorRepeat1 = 506,
SizedTypeSpecifierRepeat1 = 507,
EnumeratorListRepeat1 = 508,
FieldDeclarationRepeat1 = 509,
ParameterListRepeat1 = 510,
CaseStatementRepeat1 = 511,
GenericExpressionRepeat1 = 512,
GnuAsmExpressionRepeat1 = 513,
GnuAsmOutputOperandListRepeat1 = 514,
GnuAsmInputOperandListRepeat1 = 515,
GnuAsmClobberListRepeat1 = 516,
GnuAsmGotoListRepeat1 = 517,
ArgumentListRepeat1 = 518,
InitializerListRepeat1 = 519,
InitializerPairRepeat1 = 520,
CharLiteralRepeat1 = 521,
ConcatenatedStringRepeat1 = 522,
StringLiteralRepeat1 = 523,
ClassDeclarationRepeat1 = 524,
BaseClassClauseRepeat1 = 525,
TemplateParameterListRepeat1 = 526,
FieldInitializerListRepeat1 = 527,
OperatorCastDefinitionRepeat1 = 528,
ConstructorTryStatementRepeat1 = 529,
StructuredBindingDeclaratorRepeat1 = 530,
FunctionPostfixRepeat1 = 531,
ThrowSpecifierRepeat1 = 532,
TemplateArgumentListRepeat1 = 533,
SubscriptArgumentListRepeat1 = 534,
RequirementSeqRepeat1 = 535,
RequiresParameterListRepeat1 = 536,
LambdaCaptureSpecifierRepeat1 = 537,
FieldIdentifier = 538,
NamespaceIdentifier = 539,
SimpleRequirement = 540,
StatementIdentifier = 541,
TypeIdentifier = 542,
Error = 543,
}
impl From<Cpp> for &'static str {
#[inline]
fn from(tok: Cpp) -> Self {
match tok {
Cpp::End => "end",
Cpp::Identifier => "identifier",
Cpp::HASHinclude => "#include",
Cpp::PreprocIncludeToken2 => "preproc_include_token2",
Cpp::HASHdefine => "#define",
Cpp::LPAREN => "(",
Cpp::DOTDOTDOT => "...",
Cpp::COMMA => ",",
Cpp::RPAREN => ")",
Cpp::HASHif => "#if",
Cpp::LF => "\n",
Cpp::HASHendif => "#endif",
Cpp::HASHifdef => "#ifdef",
Cpp::HASHifndef => "#ifndef",
Cpp::HASHelse => "#else",
Cpp::HASHelif => "#elif",
Cpp::HASHelifdef => "#elifdef",
Cpp::HASHelifndef => "#elifndef",
Cpp::PreprocArg => "preproc_arg",
Cpp::PreprocDirective => "preproc_directive",
Cpp::LPAREN2 => "(",
Cpp::Defined => "defined",
Cpp::BANG => "!",
Cpp::TILDE => "~",
Cpp::DASH => "-",
Cpp::PLUS => "+",
Cpp::STAR => "*",
Cpp::SLASH => "/",
Cpp::PERCENT => "%",
Cpp::PIPEPIPE => "||",
Cpp::AMPAMP => "&&",
Cpp::PIPE => "|",
Cpp::CARET => "^",
Cpp::AMP => "&",
Cpp::EQEQ => "==",
Cpp::BANGEQ => "!=",
Cpp::GT => ">",
Cpp::GTEQ => ">=",
Cpp::LTEQ => "<=",
Cpp::LT => "<",
Cpp::LTLT => "<<",
Cpp::GTGT => ">>",
Cpp::SEMI => ";",
Cpp::Extension => "__extension__",
Cpp::Typedef => "typedef",
Cpp::Virtual => "virtual",
Cpp::Extern => "extern",
Cpp::Attribute2 => "__attribute__",
Cpp::Attribute3 => "__attribute",
Cpp::COLONCOLON => "::",
Cpp::LBRACKLBRACK => "[[",
Cpp::RBRACKRBRACK => "]]",
Cpp::Declspec => "__declspec",
Cpp::Based => "__based",
Cpp::Cdecl => "__cdecl",
Cpp::Clrcall => "__clrcall",
Cpp::Stdcall => "__stdcall",
Cpp::Fastcall => "__fastcall",
Cpp::Thiscall => "__thiscall",
Cpp::Vectorcall => "__vectorcall",
Cpp::MsRestrictModifier => "ms_restrict_modifier",
Cpp::MsUnsignedPtrModifier => "ms_unsigned_ptr_modifier",
Cpp::MsSignedPtrModifier => "ms_signed_ptr_modifier",
Cpp::Unaligned => "_unaligned",
Cpp::Unaligned2 => "__unaligned",
Cpp::LBRACE => "{",
Cpp::RBRACE => "}",
Cpp::Signed => "signed",
Cpp::Unsigned => "unsigned",
Cpp::Long => "long",
Cpp::Short => "short",
Cpp::LBRACK => "[",
Cpp::Static => "static",
Cpp::RBRACK => "]",
Cpp::EQ => "=",
Cpp::Register => "register",
Cpp::Inline => "inline",
Cpp::Inline2 => "__inline",
Cpp::Inline3 => "__inline__",
Cpp::Forceinline => "__forceinline",
Cpp::ThreadLocal => "thread_local",
Cpp::Thread => "__thread",
Cpp::Const => "const",
Cpp::Constexpr => "constexpr",
Cpp::Volatile => "volatile",
Cpp::Restrict => "restrict",
Cpp::Restrict2 => "__restrict__",
Cpp::Atomic => "_Atomic",
Cpp::Noreturn => "_Noreturn",
Cpp::Noreturn2 => "noreturn",
Cpp::Nonnull => "_Nonnull",
Cpp::Mutable => "mutable",
Cpp::Constinit => "constinit",
Cpp::Consteval => "consteval",
Cpp::Alignas => "alignas",
Cpp::Alignas2 => "_Alignas",
Cpp::PrimitiveType => "primitive_type",
Cpp::Enum => "enum",
Cpp::Class => "class",
Cpp::Struct => "struct",
Cpp::Union => "union",
Cpp::COLON => ":",
Cpp::If => "if",
Cpp::Else => "else",
Cpp::Switch => "switch",
Cpp::Case => "case",
Cpp::Default => "default",
Cpp::While => "while",
Cpp::Do => "do",
Cpp::For => "for",
Cpp::Return => "return",
Cpp::Break => "break",
Cpp::Continue => "continue",
Cpp::Goto => "goto",
Cpp::Try => "__try",
Cpp::Except => "__except",
Cpp::Finally => "__finally",
Cpp::Leave => "__leave",
Cpp::QMARK => "?",
Cpp::STAREQ => "*=",
Cpp::SLASHEQ => "/=",
Cpp::PERCENTEQ => "%=",
Cpp::PLUSEQ => "+=",
Cpp::DASHEQ => "-=",
Cpp::LTLTEQ => "<<=",
Cpp::GTGTEQ => ">>=",
Cpp::AMPEQ => "&=",
Cpp::CARETEQ => "^=",
Cpp::PIPEEQ => "|=",
Cpp::AndEq => "and_eq",
Cpp::OrEq => "or_eq",
Cpp::XorEq => "xor_eq",
Cpp::Not => "not",
Cpp::Compl => "compl",
Cpp::LTEQGT => "<=>",
Cpp::Or => "or",
Cpp::And => "and",
Cpp::Bitor => "bitor",
Cpp::Xor => "xor",
Cpp::Bitand => "bitand",
Cpp::NotEq => "not_eq",
Cpp::DASHDASH => "--",
Cpp::PLUSPLUS => "++",
Cpp::Sizeof => "sizeof",
Cpp::Alignof => "__alignof__",
Cpp::Alignof2 => "__alignof",
Cpp::Alignof3 => "_alignof",
Cpp::Alignof4 => "alignof",
Cpp::Alignof5 => "_Alignof",
Cpp::Offsetof => "offsetof",
Cpp::Generic => "_Generic",
Cpp::Asm => "asm",
Cpp::Asm2 => "__asm__",
Cpp::Asm3 => "__asm",
Cpp::Volatile2 => "__volatile__",
Cpp::DOT => ".",
Cpp::DOTSTAR => ".*",
Cpp::DASHGT => "->",
Cpp::NumberLiteral => "number_literal",
Cpp::LSQUOTE => "L'",
Cpp::USQUOTE => "u'",
Cpp::USQUOTE2 => "U'",
Cpp::U8SQUOTE => "u8'",
Cpp::SQUOTE => "'",
Cpp::Character => "character",
Cpp::LDQUOTE => "L\"",
Cpp::UDQUOTE => "u\"",
Cpp::UDQUOTE2 => "U\"",
Cpp::U8DQUOTE => "u8\"",
Cpp::DQUOTE => "\"",
Cpp::StringContent => "string_content",
Cpp::EscapeSequence => "escape_sequence",
Cpp::SystemLibString => "system_lib_string",
Cpp::True => "true",
Cpp::False => "false",
Cpp::NULL => "NULL",
Cpp::Nullptr => "nullptr",
Cpp::Comment => "comment",
Cpp::Auto => "auto",
Cpp::Decltype3 => "decltype",
Cpp::Final => "final",
Cpp::Override => "override",
Cpp::Explicit => "explicit",
Cpp::Typename => "typename",
Cpp::Template => "template",
Cpp::GT2 => ">",
Cpp::Operator => "operator",
Cpp::Try2 => "try",
Cpp::Delete => "delete",
Cpp::PureVirtualClauseToken1 => "pure_virtual_clause_token1",
Cpp::Friend => "friend",
Cpp::Public => "public",
Cpp::Private => "private",
Cpp::Protected => "protected",
Cpp::Noexcept2 => "noexcept",
Cpp::Throw => "throw",
Cpp::Namespace => "namespace",
Cpp::Using => "using",
Cpp::StaticAssert => "static_assert",
Cpp::Concept => "concept",
Cpp::CoReturn => "co_return",
Cpp::CoYield => "co_yield",
Cpp::Catch => "catch",
Cpp::RDQUOTE => "R\"",
Cpp::LRDQUOTE => "LR\"",
Cpp::URDQUOTE => "uR\"",
Cpp::URDQUOTE2 => "UR\"",
Cpp::U8RDQUOTE => "u8R\"",
Cpp::CoAwait => "co_await",
Cpp::New => "new",
Cpp::Requires => "requires",
Cpp::DASHGTSTAR => "->*",
Cpp::LPARENRPAREN => "()",
Cpp::LBRACKRBRACK => "[]",
Cpp::DQUOTEDQUOTE => "\"\"",
Cpp::This => "this",
Cpp::LiteralSuffix => "literal_suffix",
Cpp::RawStringDelimiter => "raw_string_delimiter",
Cpp::RawStringContent => "raw_string_content",
Cpp::TranslationUnit => "translation_unit",
Cpp::TopLevelItem => "_top_level_item",
Cpp::BlockItem => "_block_item",
Cpp::PreprocInclude => "preproc_include",
Cpp::PreprocDef => "preproc_def",
Cpp::PreprocFunctionDef => "preproc_function_def",
Cpp::PreprocParams => "preproc_params",
Cpp::PreprocCall => "preproc_call",
Cpp::PreprocIf => "preproc_if",
Cpp::PreprocIfdef => "preproc_ifdef",
Cpp::PreprocElse => "preproc_else",
Cpp::PreprocElif => "preproc_elif",
Cpp::PreprocElifdef => "preproc_elifdef",
Cpp::PreprocIf2 => "preproc_if",
Cpp::PreprocIfdef2 => "preproc_ifdef",
Cpp::PreprocElse2 => "preproc_else",
Cpp::PreprocElif2 => "preproc_elif",
Cpp::PreprocElifdef2 => "preproc_elifdef",
Cpp::PreprocIf3 => "preproc_if",
Cpp::PreprocIfdef3 => "preproc_ifdef",
Cpp::PreprocElse3 => "preproc_else",
Cpp::PreprocElif3 => "preproc_elif",
Cpp::PreprocElifdef3 => "preproc_elifdef",
Cpp::PreprocIf4 => "preproc_if",
Cpp::PreprocIfdef4 => "preproc_ifdef",
Cpp::PreprocElse4 => "preproc_else",
Cpp::PreprocElif4 => "preproc_elif",
Cpp::PreprocElifdef4 => "preproc_elifdef",
Cpp::PreprocExpression => "_preproc_expression",
Cpp::ParenthesizedExpression => "parenthesized_expression",
Cpp::PreprocDefined => "preproc_defined",
Cpp::UnaryExpression => "unary_expression",
Cpp::CallExpression => "call_expression",
Cpp::ArgumentList => "argument_list",
Cpp::BinaryExpression => "binary_expression",
Cpp::FunctionDefinition => "function_definition",
Cpp::Declaration => "declaration",
Cpp::TypeDefinition => "type_definition",
Cpp::TypeDefinitionType => "_type_definition_type",
Cpp::TypeDefinitionDeclarators => "_type_definition_declarators",
Cpp::DeclarationModifiers => "_declaration_modifiers",
Cpp::DeclarationSpecifiers => "_declaration_specifiers",
Cpp::LinkageSpecification => "linkage_specification",
Cpp::AttributeSpecifier => "attribute_specifier",
Cpp::Attribute => "attribute",
Cpp::AttributeDeclaration => "attribute_declaration",
Cpp::MsDeclspecModifier => "ms_declspec_modifier",
Cpp::MsBasedModifier => "ms_based_modifier",
Cpp::MsCallModifier => "ms_call_modifier",
Cpp::MsUnalignedPtrModifier => "ms_unaligned_ptr_modifier",
Cpp::MsPointerModifier => "ms_pointer_modifier",
Cpp::DeclarationList => "declaration_list",
Cpp::Declarator => "_declarator",
Cpp::FieldDeclarator => "_field_declarator",
Cpp::TypeDeclarator => "_type_declarator",
Cpp::AbstractDeclarator => "_abstract_declarator",
Cpp::ParenthesizedDeclarator => "parenthesized_declarator",
Cpp::ParenthesizedDeclarator2 => "parenthesized_declarator",
Cpp::ParenthesizedDeclarator3 => "parenthesized_declarator",
Cpp::AbstractParenthesizedDeclarator => "abstract_parenthesized_declarator",
Cpp::AttributedDeclarator => "attributed_declarator",
Cpp::AttributedDeclarator2 => "attributed_declarator",
Cpp::AttributedDeclarator3 => "attributed_declarator",
Cpp::PointerDeclarator => "pointer_declarator",
Cpp::PointerDeclarator2 => "pointer_declarator",
Cpp::PointerTypeDeclarator => "pointer_type_declarator",
Cpp::AbstractPointerDeclarator => "abstract_pointer_declarator",
Cpp::FunctionDeclarator => "function_declarator",
Cpp::FunctionDeclarator2 => "function_declarator",
Cpp::FunctionDeclarator3 => "function_declarator",
Cpp::AbstractFunctionDeclarator => "abstract_function_declarator",
Cpp::ArrayDeclarator => "array_declarator",
Cpp::ArrayDeclarator2 => "array_declarator",
Cpp::ArrayDeclarator3 => "array_declarator",
Cpp::AbstractArrayDeclarator => "abstract_array_declarator",
Cpp::InitDeclarator => "init_declarator",
Cpp::CompoundStatement => "compound_statement",
Cpp::StorageClassSpecifier => "storage_class_specifier",
Cpp::TypeQualifier => "type_qualifier",
Cpp::AlignasQualifier => "alignas_qualifier",
Cpp::TypeSpecifier => "type_specifier",
Cpp::SizedTypeSpecifier => "sized_type_specifier",
Cpp::EnumSpecifier => "enum_specifier",
Cpp::EnumeratorList => "enumerator_list",
Cpp::StructSpecifier => "struct_specifier",
Cpp::UnionSpecifier => "union_specifier",
Cpp::FieldDeclarationList => "field_declaration_list",
Cpp::FieldDeclarationListItem => "_field_declaration_list_item",
Cpp::FieldDeclaration => "field_declaration",
Cpp::BitfieldClause => "bitfield_clause",
Cpp::Enumerator => "enumerator",
Cpp::ParameterList => "parameter_list",
Cpp::ParameterDeclaration => "parameter_declaration",
Cpp::AttributedStatement => "attributed_statement",
Cpp::Statement => "statement",
Cpp::TopLevelStatement => "_top_level_statement",
Cpp::LabeledStatement => "labeled_statement",
Cpp::ExpressionStatement => "expression_statement",
Cpp::ExpressionStatement2 => "expression_statement",
Cpp::IfStatement => "if_statement",
Cpp::ElseClause => "else_clause",
Cpp::SwitchStatement => "switch_statement",
Cpp::CaseStatement => "case_statement",
Cpp::WhileStatement => "while_statement",
Cpp::DoStatement => "do_statement",
Cpp::ForStatement => "for_statement",
Cpp::ForStatementBody => "_for_statement_body",
Cpp::ReturnStatement => "return_statement",
Cpp::BreakStatement => "break_statement",
Cpp::ContinueStatement => "continue_statement",
Cpp::GotoStatement => "goto_statement",
Cpp::SehTryStatement => "seh_try_statement",
Cpp::SehExceptClause => "seh_except_clause",
Cpp::SehFinallyClause => "seh_finally_clause",
Cpp::SehLeaveStatement => "seh_leave_statement",
Cpp::Expression => "expression",
Cpp::String => "_string",
Cpp::CommaExpression => "comma_expression",
Cpp::ConditionalExpression => "conditional_expression",
Cpp::AssignmentExpression => "assignment_expression",
Cpp::PointerExpression => "pointer_expression",
Cpp::UnaryExpression2 => "unary_expression",
Cpp::BinaryExpression2 => "binary_expression",
Cpp::UpdateExpression => "update_expression",
Cpp::CastExpression => "cast_expression",
Cpp::TypeDescriptor => "type_descriptor",
Cpp::SizeofExpression => "sizeof_expression",
Cpp::AlignofExpression => "alignof_expression",
Cpp::OffsetofExpression => "offsetof_expression",
Cpp::GenericExpression => "generic_expression",
Cpp::SubscriptExpression => "subscript_expression",
Cpp::CallExpression2 => "call_expression",
Cpp::GnuAsmExpression => "gnu_asm_expression",
Cpp::GnuAsmQualifier => "gnu_asm_qualifier",
Cpp::GnuAsmOutputOperandList => "gnu_asm_output_operand_list",
Cpp::GnuAsmOutputOperand => "gnu_asm_output_operand",
Cpp::GnuAsmInputOperandList => "gnu_asm_input_operand_list",
Cpp::GnuAsmInputOperand => "gnu_asm_input_operand",
Cpp::GnuAsmClobberList => "gnu_asm_clobber_list",
Cpp::GnuAsmGotoList => "gnu_asm_goto_list",
Cpp::ExtensionExpression => "extension_expression",
Cpp::ArgumentList2 => "argument_list",
Cpp::FieldExpression => "field_expression",
Cpp::CompoundLiteralExpression => "compound_literal_expression",
Cpp::ParenthesizedExpression2 => "parenthesized_expression",
Cpp::InitializerList => "initializer_list",
Cpp::InitializerPair => "initializer_pair",
Cpp::SubscriptDesignator => "subscript_designator",
Cpp::SubscriptRangeDesignator => "subscript_range_designator",
Cpp::FieldDesignator => "field_designator",
Cpp::CharLiteral => "char_literal",
Cpp::ConcatenatedString => "concatenated_string",
Cpp::StringLiteral => "string_literal",
Cpp::Null => "null",
Cpp::EmptyDeclaration => "_empty_declaration",
Cpp::PlaceholderTypeSpecifier => "placeholder_type_specifier",
Cpp::Decltype => "decltype",
Cpp::Decltype2 => "decltype",
Cpp::ClassDeclaration => "_class_declaration",
Cpp::ClassDeclarationItem => "_class_declaration_item",
Cpp::ClassSpecifier => "class_specifier",
Cpp::ClassName => "_class_name",
Cpp::VirtualSpecifier => "virtual_specifier",
Cpp::ExplicitFunctionSpecifier => "explicit_function_specifier",
Cpp::BaseClassClause => "base_class_clause",
Cpp::EnumBaseClause => "_enum_base_clause",
Cpp::DependentType => "dependent_type",
Cpp::TemplateDeclaration => "template_declaration",
Cpp::TemplateInstantiation => "template_instantiation",
Cpp::TemplateParameterList => "template_parameter_list",
Cpp::TypeParameterDeclaration => "type_parameter_declaration",
Cpp::VariadicTypeParameterDeclaration => "variadic_type_parameter_declaration",
Cpp::OptionalTypeParameterDeclaration => "optional_type_parameter_declaration",
Cpp::TemplateTemplateParameterDeclaration => "template_template_parameter_declaration",
Cpp::OptionalParameterDeclaration => "optional_parameter_declaration",
Cpp::VariadicParameterDeclaration => "variadic_parameter_declaration",
Cpp::VariadicDeclarator => "variadic_declarator",
Cpp::ReferenceDeclarator => "reference_declarator",
Cpp::OperatorCast => "operator_cast",
Cpp::FieldInitializerList => "field_initializer_list",
Cpp::FieldInitializer => "field_initializer",
Cpp::FunctionDefinition2 => "function_definition",
Cpp::ConstructorSpecifiers => "_constructor_specifiers",
Cpp::FunctionDefinition3 => "function_definition",
Cpp::Declaration2 => "declaration",
Cpp::TryStatement => "try_statement",
Cpp::FunctionDefinition4 => "function_definition",
Cpp::Declaration3 => "declaration",
Cpp::DefaultMethodClause => "default_method_clause",
Cpp::DeleteMethodClause => "delete_method_clause",
Cpp::PureVirtualClause => "pure_virtual_clause",
Cpp::FriendDeclaration => "friend_declaration",
Cpp::AccessSpecifier => "access_specifier",
Cpp::ReferenceDeclarator2 => "reference_declarator",
Cpp::ReferenceDeclarator3 => "reference_declarator",
Cpp::ReferenceDeclarator4 => "reference_declarator",
Cpp::AbstractReferenceDeclarator => "abstract_reference_declarator",
Cpp::StructuredBindingDeclarator => "structured_binding_declarator",
Cpp::RefQualifier => "ref_qualifier",
Cpp::FunctionDeclaratorSeq => "_function_declarator_seq",
Cpp::FunctionAttributesStart => "_function_attributes_start",
Cpp::FunctionExceptionSpecification => "_function_exception_specification",
Cpp::FunctionAttributesEnd => "_function_attributes_end",
Cpp::FunctionPostfix => "_function_postfix",
Cpp::TrailingReturnType => "trailing_return_type",
Cpp::Noexcept => "noexcept",
Cpp::ThrowSpecifier => "throw_specifier",
Cpp::TemplateType => "template_type",
Cpp::TemplateMethod => "template_method",
Cpp::TemplateFunction => "template_function",
Cpp::TemplateArgumentList => "template_argument_list",
Cpp::NamespaceDefinition => "namespace_definition",
Cpp::NamespaceAliasDefinition => "namespace_alias_definition",
Cpp::NamespaceSpecifier => "_namespace_specifier",
Cpp::NestedNamespaceSpecifier => "nested_namespace_specifier",
Cpp::UsingDeclaration => "using_declaration",
Cpp::AliasDeclaration => "alias_declaration",
Cpp::StaticAssertDeclaration => "static_assert_declaration",
Cpp::ConceptDefinition => "concept_definition",
Cpp::ForRangeLoop => "for_range_loop",
Cpp::ForRangeLoopBody => "_for_range_loop_body",
Cpp::InitStatement => "init_statement",
Cpp::ConditionClause => "condition_clause",
Cpp::Declaration4 => "declaration",
Cpp::CoReturnStatement => "co_return_statement",
Cpp::CoYieldStatement => "co_yield_statement",
Cpp::ThrowStatement => "throw_statement",
Cpp::TryStatement2 => "try_statement",
Cpp::CatchClause => "catch_clause",
Cpp::RawStringLiteral => "raw_string_literal",
Cpp::SubscriptArgumentList => "subscript_argument_list",
Cpp::CoAwaitExpression => "co_await_expression",
Cpp::NewExpression => "new_expression",
Cpp::NewDeclarator => "new_declarator",
Cpp::DeleteExpression => "delete_expression",
Cpp::TypeRequirement => "type_requirement",
Cpp::CompoundRequirement => "compound_requirement",
Cpp::Requirement => "_requirement",
Cpp::RequirementSeq => "requirement_seq",
Cpp::ConstraintConjunction => "constraint_conjunction",
Cpp::ConstraintDisjunction => "constraint_disjunction",
Cpp::RequirementClauseConstraint => "_requirement_clause_constraint",
Cpp::RequiresClause => "requires_clause",
Cpp::ParameterList2 => "parameter_list",
Cpp::RequiresExpression => "requires_expression",
Cpp::LambdaExpression => "lambda_expression",
Cpp::LambdaCaptureSpecifier => "lambda_capture_specifier",
Cpp::LambdaDefaultCapture => "lambda_default_capture",
Cpp::LambdaCaptureIdentifier => "_lambda_capture_identifier",
Cpp::LambdaCaptureInitializer => "lambda_capture_initializer",
Cpp::LambdaCapture => "_lambda_capture",
Cpp::FoldOperator => "_fold_operator",
Cpp::BinaryFoldOperator => "_binary_fold_operator",
Cpp::UnaryLeftFold => "_unary_left_fold",
Cpp::UnaryRightFold => "_unary_right_fold",
Cpp::BinaryFold => "_binary_fold",
Cpp::FoldExpression => "fold_expression",
Cpp::ParameterPackExpansion => "parameter_pack_expansion",
Cpp::ParameterPackExpansion2 => "parameter_pack_expansion",
Cpp::ParameterPackExpansion3 => "parameter_pack_expansion",
Cpp::DestructorName => "destructor_name",
Cpp::DependentName => "dependent_name",
Cpp::DependentName2 => "dependent_name",
Cpp::DependentName3 => "dependent_name",
Cpp::ScopeResolution => "_scope_resolution",
Cpp::QualifiedIdentifier => "qualified_identifier",
Cpp::QualifiedIdentifier2 => "qualified_identifier",
Cpp::QualifiedIdentifier3 => "qualified_identifier",
Cpp::QualifiedIdentifier4 => "qualified_identifier",
Cpp::AssignmentExpression2 => "assignment_expression",
Cpp::OperatorName => "operator_name",
Cpp::UserDefinedLiteral => "user_defined_literal",
Cpp::TranslationUnitRepeat1 => "translation_unit_repeat1",
Cpp::PreprocParamsRepeat1 => "preproc_params_repeat1",
Cpp::PreprocIfRepeat1 => "preproc_if_repeat1",
Cpp::PreprocIfInFieldDeclarationListRepeat1 => {
"preproc_if_in_field_declaration_list_repeat1"
}
Cpp::PreprocIfInEnumeratorListRepeat1 => "preproc_if_in_enumerator_list_repeat1",
Cpp::PreprocIfInEnumeratorListNoCommaRepeat1 => {
"preproc_if_in_enumerator_list_no_comma_repeat1"
}
Cpp::PreprocArgumentListRepeat1 => "preproc_argument_list_repeat1",
Cpp::DeclarationRepeat1 => "declaration_repeat1",
Cpp::TypeDefinitionRepeat1 => "type_definition_repeat1",
Cpp::TypeDefinitionTypeRepeat1 => "_type_definition_type_repeat1",
Cpp::TypeDefinitionDeclaratorsRepeat1 => "_type_definition_declarators_repeat1",
Cpp::DeclarationSpecifiersRepeat1 => "_declaration_specifiers_repeat1",
Cpp::AttributeDeclarationRepeat1 => "attribute_declaration_repeat1",
Cpp::AttributedDeclaratorRepeat1 => "attributed_declarator_repeat1",
Cpp::PointerDeclaratorRepeat1 => "pointer_declarator_repeat1",
Cpp::ArrayDeclaratorRepeat1 => "array_declarator_repeat1",
Cpp::SizedTypeSpecifierRepeat1 => "sized_type_specifier_repeat1",
Cpp::EnumeratorListRepeat1 => "enumerator_list_repeat1",
Cpp::FieldDeclarationRepeat1 => "field_declaration_repeat1",
Cpp::ParameterListRepeat1 => "parameter_list_repeat1",
Cpp::CaseStatementRepeat1 => "case_statement_repeat1",
Cpp::GenericExpressionRepeat1 => "generic_expression_repeat1",
Cpp::GnuAsmExpressionRepeat1 => "gnu_asm_expression_repeat1",
Cpp::GnuAsmOutputOperandListRepeat1 => "gnu_asm_output_operand_list_repeat1",
Cpp::GnuAsmInputOperandListRepeat1 => "gnu_asm_input_operand_list_repeat1",
Cpp::GnuAsmClobberListRepeat1 => "gnu_asm_clobber_list_repeat1",
Cpp::GnuAsmGotoListRepeat1 => "gnu_asm_goto_list_repeat1",
Cpp::ArgumentListRepeat1 => "argument_list_repeat1",
Cpp::InitializerListRepeat1 => "initializer_list_repeat1",
Cpp::InitializerPairRepeat1 => "initializer_pair_repeat1",
Cpp::CharLiteralRepeat1 => "char_literal_repeat1",
Cpp::ConcatenatedStringRepeat1 => "concatenated_string_repeat1",
Cpp::StringLiteralRepeat1 => "string_literal_repeat1",
Cpp::ClassDeclarationRepeat1 => "_class_declaration_repeat1",
Cpp::BaseClassClauseRepeat1 => "base_class_clause_repeat1",
Cpp::TemplateParameterListRepeat1 => "template_parameter_list_repeat1",
Cpp::FieldInitializerListRepeat1 => "field_initializer_list_repeat1",
Cpp::OperatorCastDefinitionRepeat1 => "operator_cast_definition_repeat1",
Cpp::ConstructorTryStatementRepeat1 => "constructor_try_statement_repeat1",
Cpp::StructuredBindingDeclaratorRepeat1 => "structured_binding_declarator_repeat1",
Cpp::FunctionPostfixRepeat1 => "_function_postfix_repeat1",
Cpp::ThrowSpecifierRepeat1 => "throw_specifier_repeat1",
Cpp::TemplateArgumentListRepeat1 => "template_argument_list_repeat1",
Cpp::SubscriptArgumentListRepeat1 => "subscript_argument_list_repeat1",
Cpp::RequirementSeqRepeat1 => "requirement_seq_repeat1",
Cpp::RequiresParameterListRepeat1 => "requires_parameter_list_repeat1",
Cpp::LambdaCaptureSpecifierRepeat1 => "lambda_capture_specifier_repeat1",
Cpp::FieldIdentifier => "field_identifier",
Cpp::NamespaceIdentifier => "namespace_identifier",
Cpp::SimpleRequirement => "simple_requirement",
Cpp::StatementIdentifier => "statement_identifier",
Cpp::TypeIdentifier => "type_identifier",
Cpp::Error => "ERROR",
}
}
}
impl From<u16> for Cpp {
#[inline]
fn from(x: u16) -> Self {
num_traits::FromPrimitive::from_u16(x).unwrap_or(Self::Error)
}
}
impl PartialEq<u16> for Cpp {
#[inline]
fn eq(&self, x: &u16) -> bool {
*self == Into::<Self>::into(*x)
}
}
impl PartialEq<Cpp> for u16 {
#[inline]
fn eq(&self, x: &Cpp) -> bool {
*x == *self
}
}