big-code-analysis 1.1.0

Tool to compute and export code metrics
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
// See `src/languages/mod.rs` for the rationale behind the per-file
// pedantic carve-outs below.
#![allow(clippy::match_same_arms, clippy::too_many_lines)]

// Code generated; DO NOT EDIT.

use num_derive::FromPrimitive;

#[derive(Clone, Debug, PartialEq, Eq, FromPrimitive)]
pub enum Php {
    End = 0,
    Name = 1,
    PhpTag = 2,
    PhpEndTag = 3,
    TextToken1 = 4,
    TextToken2 = 5,
    SEMI = 6,
    AMP = 7,
    Static = 8,
    COMMA = 9,
    EQ = 10,
    Global = 11,
    Namespace = 12,
    Use = 13,
    As = 14,
    Function = 15,
    Const = 16,
    BSLASH = 17,
    LBRACE = 18,
    RBRACE = 19,
    Trait = 20,
    Interface = 21,
    Extends = 22,
    Enum = 23,
    COLON = 24,
    String2 = 25,
    Int = 26,
    Case = 27,
    Class = 28,
    Final = 29,
    Abstract = 30,
    Readonly = 31,
    Implements = 32,
    EQGT = 33,
    VarModifier = 34,
    Insteadof = 35,
    Public = 36,
    Protected = 37,
    Private = 38,
    LPAREN = 39,
    RPAREN = 40,
    LPAREN2 = 41,
    RPAREN2 = 42,
    Fn = 43,
    DOTDOTDOT = 44,
    QMARK = 45,
    BottomType = 46,
    PIPE = 47,
    Array = 48,
    Bool = 49,
    PrimitiveTypeToken1 = 50,
    PrimitiveTypeToken2 = 51,
    Float2 = 52,
    PrimitiveTypeToken3 = 53,
    PrimitiveTypeToken4 = 54,
    Null2 = 55,
    Object = 56,
    PrimitiveTypeToken5 = 57,
    PrimitiveTypeToken6 = 58,
    CastTypeToken1 = 59,
    CastTypeToken2 = 60,
    CastTypeToken3 = 61,
    CastTypeToken4 = 62,
    CastTypeToken5 = 63,
    CastTypeToken6 = 64,
    CastTypeToken7 = 65,
    CastTypeToken8 = 66,
    CastTypeToken9 = 67,
    CastTypeToken10 = 68,
    CastTypeToken11 = 69,
    CastTypeToken12 = 70,
    Echo = 71,
    Exit = 72,
    Unset = 73,
    Declare = 74,
    Enddeclare = 75,
    Ticks = 76,
    Encoding = 77,
    StrictTypes = 78,
    Float = 79,
    Try = 80,
    Catch = 81,
    Finally = 82,
    Goto = 83,
    Continue = 84,
    Break = 85,
    Integer = 86,
    Return = 87,
    Throw = 88,
    While = 89,
    Endwhile = 90,
    Do = 91,
    For = 92,
    Endfor = 93,
    Foreach = 94,
    Endforeach = 95,
    If = 96,
    Endif = 97,
    Elseif = 98,
    Else = 99,
    Match = 100,
    Default = 101,
    Switch = 102,
    Endswitch = 103,
    PLUS = 104,
    DASH = 105,
    TILDE = 106,
    BANG = 107,
    AT = 108,
    Clone = 109,
    COLONCOLON = 110,
    Print = 111,
    New = 112,
    DASHDASH = 113,
    PLUSPLUS = 114,
    STARSTAREQ = 115,
    STAREQ = 116,
    SLASHEQ = 117,
    PERCENTEQ = 118,
    PLUSEQ = 119,
    DASHEQ = 120,
    DOTEQ = 121,
    LTLTEQ = 122,
    GTGTEQ = 123,
    AMPEQ = 124,
    CARETEQ = 125,
    PIPEEQ = 126,
    QMARKQMARKEQ = 127,
    DASHGT = 128,
    QMARKDASHGT = 129,
    List = 130,
    LBRACK = 131,
    RBRACK = 132,
    Zelf = 133,
    Parent = 134,
    ArgumentNameToken1 = 135,
    ArgumentNameToken2 = 136,
    HASHLBRACK = 137,
    EscapeSequence = 138,
    StringContent = 139,
    EncapsedStringToken1 = 140,
    DQUOTE = 141,
    StringToken1 = 142,
    SQUOTE = 143,
    EscapeSequence2 = 144,
    StringContentToken1 = 145,
    LTLTLT = 146,
    DQUOTE2 = 147,
    NewLine = 148,
    SQUOTE2 = 149,
    BQUOTE = 150,
    DOLLAR = 151,
    Yield = 152,
    Yieldfrom = 153,
    Instanceof = 154,
    QMARKQMARK = 155,
    STARSTAR = 156,
    And = 157,
    Or = 158,
    Xor = 159,
    PIPEPIPE = 160,
    AMPAMP = 161,
    CARET = 162,
    EQEQ = 163,
    BANGEQ = 164,
    LTGT = 165,
    EQEQEQ = 166,
    BANGEQEQ = 167,
    LT = 168,
    GT = 169,
    LTEQ = 170,
    GTEQ = 171,
    LTEQGT = 172,
    PIPEGT = 173,
    DOT = 174,
    LTLT = 175,
    GTGT = 176,
    STAR = 177,
    SLASH = 178,
    PERCENT = 179,
    Include = 180,
    IncludeOnce = 181,
    Require = 182,
    RequireOnce = 183,
    Comment = 184,
    AutomaticSemicolon = 185,
    StringContent2 = 186,
    StringContent3 = 187,
    StringContent4 = 188,
    StringContent5 = 189,
    StringContent6 = 190,
    StringContent7 = 191,
    Eof = 192,
    HeredocStart = 193,
    HeredocEnd = 194,
    NowdocString = 195,
    SentinelError = 196,
    Program = 197,
    TextInterpolation = 198,
    Text = 199,
    Statement = 200,
    EmptyStatement = 201,
    ReferenceModifier = 202,
    FunctionStaticDeclaration = 203,
    StaticVariableDeclaration = 204,
    GlobalDeclaration = 205,
    NamespaceDefinition = 206,
    NamespaceUseDeclaration = 207,
    NamespaceUseClause = 208,
    QualifiedName = 209,
    RelativeName = 210,
    Name2 = 211,
    NamespaceName = 212,
    NamespaceUseGroup2 = 213,
    NamespaceUseGroup = 214,
    TraitDeclaration = 215,
    InterfaceDeclaration = 216,
    BaseClause = 217,
    EnumDeclaration = 218,
    EnumDeclarationList = 219,
    EnumMemberDeclaration = 220,
    EnumCase = 221,
    ClassDeclaration = 222,
    DeclarationList = 223,
    FinalModifier = 224,
    AbstractModifier = 225,
    ReadonlyModifier = 226,
    ClassInterfaceClause = 227,
    MemberDeclaration = 228,
    ConstDeclaration = 229,
    ConstDeclaration2 = 230,
    PropertyDeclaration = 231,
    Modifier = 232,
    PropertyElement = 233,
    PropertyHookList = 234,
    PropertyHook = 235,
    PropertyHookBody = 236,
    MethodDeclaration = 237,
    StaticModifier = 238,
    UseDeclaration = 239,
    UseList = 240,
    UseInsteadOfClause = 241,
    UseAsClause = 242,
    VisibilityModifier = 243,
    FunctionDefinition = 244,
    AnonymousFunction = 245,
    AnonymousFunctionUseClause = 246,
    AnonymousFunctionHeader = 247,
    ArrowFunctionHeader = 248,
    ArrowFunction = 249,
    FormalParameters = 250,
    PropertyPromotionParameter = 251,
    SimpleParameter = 252,
    VariadicParameter = 253,
    Type = 254,
    Types = 255,
    NamedType = 256,
    OptionalType = 257,
    UnionType = 258,
    IntersectionType = 259,
    DisjunctiveNormalFormType = 260,
    PrimitiveType = 261,
    CastType = 262,
    ReturnType = 263,
    ConstElement = 264,
    ConstElement2 = 265,
    EchoStatement = 266,
    ExitStatement = 267,
    UnsetStatement = 268,
    DeclareStatement = 269,
    DeclareDirective = 270,
    Literal = 271,
    TryStatement = 272,
    CatchClause = 273,
    TypeList = 274,
    FinallyClause = 275,
    GotoStatement = 276,
    ContinueStatement = 277,
    BreakStatement = 278,
    ReturnStatement = 279,
    ThrowExpression = 280,
    WhileStatement = 281,
    DoStatement = 282,
    ForStatement = 283,
    Expressions = 284,
    SequenceExpression = 285,
    ForeachStatement = 286,
    Pair = 287,
    ForeachValue = 288,
    IfStatement = 289,
    ColonBlock = 290,
    ElseIfClause = 291,
    ElseClause = 292,
    ElseIfClause2 = 293,
    ElseClause2 = 294,
    MatchExpression = 295,
    MatchBlock = 296,
    MatchConditionList = 297,
    MatchConditionalExpression = 298,
    MatchDefaultExpression = 299,
    SwitchStatement = 300,
    SwitchBlock = 301,
    CaseStatement = 302,
    DefaultStatement = 303,
    CompoundStatement = 304,
    NamedLabelStatement = 305,
    ExpressionStatement = 306,
    Expression = 307,
    UnaryExpression = 308,
    UnaryOpExpression = 309,
    ErrorSuppressionExpression = 310,
    CloneExpression = 311,
    PrimaryExpression = 312,
    ParenthesizedExpression = 313,
    ClassConstantAccessExpression = 314,
    PrintIntrinsic = 315,
    ObjectCreationExpression = 316,
    NewNonDereferencableExpression = 317,
    NewDereferencableExpression = 318,
    ClassNameReference = 319,
    AnonymousClass = 320,
    UpdateExpression = 321,
    CastExpression = 322,
    CastExpression2 = 323,
    AssignmentExpression = 324,
    ReferenceAssignmentExpression = 325,
    ConditionalExpression = 326,
    AugmentedAssignmentExpression = 327,
    MemberAccessExpression = 328,
    MemberAccessExpression2 = 329,
    NullsafeMemberAccessExpression = 330,
    NullsafeMemberAccessExpression2 = 331,
    ScopedPropertyAccessExpression = 332,
    ScopedPropertyAccessExpression2 = 333,
    ListLiteral = 334,
    ListDestructing = 335,
    ArrayDestructing = 336,
    ArrayDestructingElement = 337,
    FunctionCallExpression = 338,
    CallableExpression = 339,
    ScopedCallExpression = 340,
    ScopeResolutionQualifier = 341,
    RelativeScope = 342,
    VariadicPlaceholder = 343,
    Arguments = 344,
    Argument = 345,
    ArgumentName = 346,
    MemberCallExpression = 347,
    NullsafeMemberCallExpression = 348,
    VariadicUnpacking = 349,
    MemberName = 350,
    SubscriptExpression = 351,
    SubscriptExpression2 = 352,
    DereferencableExpression = 353,
    DereferencableScalar = 354,
    ArrayCreationExpression = 355,
    AttributeGroup = 356,
    AttributeList = 357,
    Attribute = 358,
    ComplexStringPart = 359,
    MemberAccessExpression3 = 360,
    UnaryOpExpression2 = 361,
    SimpleStringArrayAccessArgument = 362,
    SubscriptExpression3 = 363,
    SimpleStringPart = 364,
    InterpolatedStringBody = 365,
    InterpolatedStringBodyHeredoc = 366,
    EncapsedString = 367,
    String = 368,
    StringContent8 = 369,
    HeredocBody = 370,
    Heredoc = 371,
    NowdocBody = 372,
    Nowdoc = 373,
    InterpolatedExecutionOperatorBody = 374,
    ShellCommandExpression = 375,
    Boolean = 376,
    Null = 377,
    String3 = 378,
    DynamicVariableName = 379,
    SimpleVariable = 380,
    NewVariable = 381,
    CallableVariable = 382,
    VariableName = 383,
    ByRef = 384,
    YieldExpression = 385,
    ArrayElementInitializer = 386,
    BinaryExpression = 387,
    IncludeExpression = 388,
    IncludeOnceExpression = 389,
    RequireExpression = 390,
    RequireOnceExpression = 391,
    Semicolon = 392,
    ProgramRepeat1 = 393,
    TextRepeat1 = 394,
    FunctionStaticDeclarationRepeat1 = 395,
    GlobalDeclarationRepeat1 = 396,
    NamespaceUseDeclarationRepeat1 = 397,
    NamespaceNameRepeat1 = 398,
    BaseClauseRepeat1 = 399,
    EnumDeclarationListRepeat1 = 400,
    ClassDeclarationRepeat1 = 401,
    DeclarationListRepeat1 = 402,
    ConstDeclarationRepeat1 = 403,
    ClassConstDeclarationRepeat1 = 404,
    PropertyDeclarationRepeat1 = 405,
    PropertyHookListRepeat1 = 406,
    UseListRepeat1 = 407,
    AnonymousFunctionUseClauseRepeat1 = 408,
    FormalParametersRepeat1 = 409,
    UnionTypeRepeat1 = 410,
    IntersectionTypeRepeat1 = 411,
    DisjunctiveNormalFormTypeRepeat1 = 412,
    UnsetStatementRepeat1 = 413,
    TryStatementRepeat1 = 414,
    TypeListRepeat1 = 415,
    IfStatementRepeat1 = 416,
    IfStatementRepeat2 = 417,
    MatchBlockRepeat1 = 418,
    MatchConditionListRepeat1 = 419,
    SwitchBlockRepeat1 = 420,
    ListDestructingRepeat1 = 421,
    ArrayDestructingRepeat1 = 422,
    ArgumentsRepeat1 = 423,
    ArrayCreationExpressionRepeat1 = 424,
    AttributeGroupRepeat1 = 425,
    AttributeListRepeat1 = 426,
    StringRepeat1 = 427,
    StringContentRepeat1 = 428,
    HeredocBodyRepeat1 = 429,
    NowdocBodyRepeat1 = 430,
    Operation = 431,
    Error = 432,
}

impl From<Php> for &'static str {
    #[inline]
    fn from(tok: Php) -> Self {
        match tok {
            Php::End => "end",
            Php::Name => "name",
            Php::PhpTag => "php_tag",
            Php::PhpEndTag => "php_end_tag",
            Php::TextToken1 => "text_token1",
            Php::TextToken2 => "text_token2",
            Php::SEMI => ";",
            Php::AMP => "&",
            Php::Static => "static",
            Php::COMMA => ",",
            Php::EQ => "=",
            Php::Global => "global",
            Php::Namespace => "namespace",
            Php::Use => "use",
            Php::As => "as",
            Php::Function => "function",
            Php::Const => "const",
            Php::BSLASH => "\\",
            Php::LBRACE => "{",
            Php::RBRACE => "}",
            Php::Trait => "trait",
            Php::Interface => "interface",
            Php::Extends => "extends",
            Php::Enum => "enum",
            Php::COLON => ":",
            Php::String2 => "string",
            Php::Int => "int",
            Php::Case => "case",
            Php::Class => "class",
            Php::Final => "final",
            Php::Abstract => "abstract",
            Php::Readonly => "readonly",
            Php::Implements => "implements",
            Php::EQGT => "=>",
            Php::VarModifier => "var_modifier",
            Php::Insteadof => "insteadof",
            Php::Public => "public",
            Php::Protected => "protected",
            Php::Private => "private",
            Php::LPAREN => "(",
            Php::RPAREN => ")",
            Php::LPAREN2 => "(",
            Php::RPAREN2 => ")",
            Php::Fn => "fn",
            Php::DOTDOTDOT => "...",
            Php::QMARK => "?",
            Php::BottomType => "bottom_type",
            Php::PIPE => "|",
            Php::Array => "array",
            Php::Bool => "bool",
            Php::PrimitiveTypeToken1 => "primitive_type_token1",
            Php::PrimitiveTypeToken2 => "primitive_type_token2",
            Php::Float2 => "float",
            Php::PrimitiveTypeToken3 => "primitive_type_token3",
            Php::PrimitiveTypeToken4 => "primitive_type_token4",
            Php::Null2 => "null",
            Php::Object => "object",
            Php::PrimitiveTypeToken5 => "primitive_type_token5",
            Php::PrimitiveTypeToken6 => "primitive_type_token6",
            Php::CastTypeToken1 => "cast_type_token1",
            Php::CastTypeToken2 => "cast_type_token2",
            Php::CastTypeToken3 => "cast_type_token3",
            Php::CastTypeToken4 => "cast_type_token4",
            Php::CastTypeToken5 => "cast_type_token5",
            Php::CastTypeToken6 => "cast_type_token6",
            Php::CastTypeToken7 => "cast_type_token7",
            Php::CastTypeToken8 => "cast_type_token8",
            Php::CastTypeToken9 => "cast_type_token9",
            Php::CastTypeToken10 => "cast_type_token10",
            Php::CastTypeToken11 => "cast_type_token11",
            Php::CastTypeToken12 => "cast_type_token12",
            Php::Echo => "echo",
            Php::Exit => "exit",
            Php::Unset => "unset",
            Php::Declare => "declare",
            Php::Enddeclare => "enddeclare",
            Php::Ticks => "ticks",
            Php::Encoding => "encoding",
            Php::StrictTypes => "strict_types",
            Php::Float => "float",
            Php::Try => "try",
            Php::Catch => "catch",
            Php::Finally => "finally",
            Php::Goto => "goto",
            Php::Continue => "continue",
            Php::Break => "break",
            Php::Integer => "integer",
            Php::Return => "return",
            Php::Throw => "throw",
            Php::While => "while",
            Php::Endwhile => "endwhile",
            Php::Do => "do",
            Php::For => "for",
            Php::Endfor => "endfor",
            Php::Foreach => "foreach",
            Php::Endforeach => "endforeach",
            Php::If => "if",
            Php::Endif => "endif",
            Php::Elseif => "elseif",
            Php::Else => "else",
            Php::Match => "match",
            Php::Default => "default",
            Php::Switch => "switch",
            Php::Endswitch => "endswitch",
            Php::PLUS => "+",
            Php::DASH => "-",
            Php::TILDE => "~",
            Php::BANG => "!",
            Php::AT => "@",
            Php::Clone => "clone",
            Php::COLONCOLON => "::",
            Php::Print => "print",
            Php::New => "new",
            Php::DASHDASH => "--",
            Php::PLUSPLUS => "++",
            Php::STARSTAREQ => "**=",
            Php::STAREQ => "*=",
            Php::SLASHEQ => "/=",
            Php::PERCENTEQ => "%=",
            Php::PLUSEQ => "+=",
            Php::DASHEQ => "-=",
            Php::DOTEQ => ".=",
            Php::LTLTEQ => "<<=",
            Php::GTGTEQ => ">>=",
            Php::AMPEQ => "&=",
            Php::CARETEQ => "^=",
            Php::PIPEEQ => "|=",
            Php::QMARKQMARKEQ => "??=",
            Php::DASHGT => "->",
            Php::QMARKDASHGT => "?->",
            Php::List => "list",
            Php::LBRACK => "[",
            Php::RBRACK => "]",
            Php::Zelf => "self",
            Php::Parent => "parent",
            Php::ArgumentNameToken1 => "_argument_name_token1",
            Php::ArgumentNameToken2 => "_argument_name_token2",
            Php::HASHLBRACK => "#[",
            Php::EscapeSequence => "escape_sequence",
            Php::StringContent => "string_content",
            Php::EncapsedStringToken1 => "encapsed_string_token1",
            Php::DQUOTE => "\"",
            Php::StringToken1 => "string_token1",
            Php::SQUOTE => "'",
            Php::EscapeSequence2 => "escape_sequence",
            Php::StringContentToken1 => "string_content_token1",
            Php::LTLTLT => "<<<",
            Php::DQUOTE2 => "\"",
            Php::NewLine => "_new_line",
            Php::SQUOTE2 => "'",
            Php::BQUOTE => "`",
            Php::DOLLAR => "$",
            Php::Yield => "yield",
            Php::Yieldfrom => "yield from",
            Php::Instanceof => "instanceof",
            Php::QMARKQMARK => "??",
            Php::STARSTAR => "**",
            Php::And => "and",
            Php::Or => "or",
            Php::Xor => "xor",
            Php::PIPEPIPE => "||",
            Php::AMPAMP => "&&",
            Php::CARET => "^",
            Php::EQEQ => "==",
            Php::BANGEQ => "!=",
            Php::LTGT => "<>",
            Php::EQEQEQ => "===",
            Php::BANGEQEQ => "!==",
            Php::LT => "<",
            Php::GT => ">",
            Php::LTEQ => "<=",
            Php::GTEQ => ">=",
            Php::LTEQGT => "<=>",
            Php::PIPEGT => "|>",
            Php::DOT => ".",
            Php::LTLT => "<<",
            Php::GTGT => ">>",
            Php::STAR => "*",
            Php::SLASH => "/",
            Php::PERCENT => "%",
            Php::Include => "include",
            Php::IncludeOnce => "include_once",
            Php::Require => "require",
            Php::RequireOnce => "require_once",
            Php::Comment => "comment",
            Php::AutomaticSemicolon => "_automatic_semicolon",
            Php::StringContent2 => "string_content",
            Php::StringContent3 => "string_content",
            Php::StringContent4 => "string_content",
            Php::StringContent5 => "string_content",
            Php::StringContent6 => "string_content",
            Php::StringContent7 => "string_content",
            Php::Eof => "_eof",
            Php::HeredocStart => "heredoc_start",
            Php::HeredocEnd => "heredoc_end",
            Php::NowdocString => "nowdoc_string",
            Php::SentinelError => "sentinel_error",
            Php::Program => "program",
            Php::TextInterpolation => "text_interpolation",
            Php::Text => "text",
            Php::Statement => "statement",
            Php::EmptyStatement => "empty_statement",
            Php::ReferenceModifier => "reference_modifier",
            Php::FunctionStaticDeclaration => "function_static_declaration",
            Php::StaticVariableDeclaration => "static_variable_declaration",
            Php::GlobalDeclaration => "global_declaration",
            Php::NamespaceDefinition => "namespace_definition",
            Php::NamespaceUseDeclaration => "namespace_use_declaration",
            Php::NamespaceUseClause => "namespace_use_clause",
            Php::QualifiedName => "qualified_name",
            Php::RelativeName => "relative_name",
            Php::Name2 => "_name",
            Php::NamespaceName => "namespace_name",
            Php::NamespaceUseGroup2 => "_namespace_use_group",
            Php::NamespaceUseGroup => "namespace_use_group",
            Php::TraitDeclaration => "trait_declaration",
            Php::InterfaceDeclaration => "interface_declaration",
            Php::BaseClause => "base_clause",
            Php::EnumDeclaration => "enum_declaration",
            Php::EnumDeclarationList => "enum_declaration_list",
            Php::EnumMemberDeclaration => "_enum_member_declaration",
            Php::EnumCase => "enum_case",
            Php::ClassDeclaration => "class_declaration",
            Php::DeclarationList => "declaration_list",
            Php::FinalModifier => "final_modifier",
            Php::AbstractModifier => "abstract_modifier",
            Php::ReadonlyModifier => "readonly_modifier",
            Php::ClassInterfaceClause => "class_interface_clause",
            Php::MemberDeclaration => "_member_declaration",
            Php::ConstDeclaration => "const_declaration",
            Php::ConstDeclaration2 => "const_declaration",
            Php::PropertyDeclaration => "property_declaration",
            Php::Modifier => "_modifier",
            Php::PropertyElement => "property_element",
            Php::PropertyHookList => "property_hook_list",
            Php::PropertyHook => "property_hook",
            Php::PropertyHookBody => "_property_hook_body",
            Php::MethodDeclaration => "method_declaration",
            Php::StaticModifier => "static_modifier",
            Php::UseDeclaration => "use_declaration",
            Php::UseList => "use_list",
            Php::UseInsteadOfClause => "use_instead_of_clause",
            Php::UseAsClause => "use_as_clause",
            Php::VisibilityModifier => "visibility_modifier",
            Php::FunctionDefinition => "function_definition",
            Php::AnonymousFunction => "anonymous_function",
            Php::AnonymousFunctionUseClause => "anonymous_function_use_clause",
            Php::AnonymousFunctionHeader => "_anonymous_function_header",
            Php::ArrowFunctionHeader => "_arrow_function_header",
            Php::ArrowFunction => "arrow_function",
            Php::FormalParameters => "formal_parameters",
            Php::PropertyPromotionParameter => "property_promotion_parameter",
            Php::SimpleParameter => "simple_parameter",
            Php::VariadicParameter => "variadic_parameter",
            Php::Type => "type",
            Php::Types => "_types",
            Php::NamedType => "named_type",
            Php::OptionalType => "optional_type",
            Php::UnionType => "union_type",
            Php::IntersectionType => "intersection_type",
            Php::DisjunctiveNormalFormType => "disjunctive_normal_form_type",
            Php::PrimitiveType => "primitive_type",
            Php::CastType => "cast_type",
            Php::ReturnType => "_return_type",
            Php::ConstElement => "const_element",
            Php::ConstElement2 => "const_element",
            Php::EchoStatement => "echo_statement",
            Php::ExitStatement => "exit_statement",
            Php::UnsetStatement => "unset_statement",
            Php::DeclareStatement => "declare_statement",
            Php::DeclareDirective => "declare_directive",
            Php::Literal => "literal",
            Php::TryStatement => "try_statement",
            Php::CatchClause => "catch_clause",
            Php::TypeList => "type_list",
            Php::FinallyClause => "finally_clause",
            Php::GotoStatement => "goto_statement",
            Php::ContinueStatement => "continue_statement",
            Php::BreakStatement => "break_statement",
            Php::ReturnStatement => "return_statement",
            Php::ThrowExpression => "throw_expression",
            Php::WhileStatement => "while_statement",
            Php::DoStatement => "do_statement",
            Php::ForStatement => "for_statement",
            Php::Expressions => "_expressions",
            Php::SequenceExpression => "sequence_expression",
            Php::ForeachStatement => "foreach_statement",
            Php::Pair => "pair",
            Php::ForeachValue => "_foreach_value",
            Php::IfStatement => "if_statement",
            Php::ColonBlock => "colon_block",
            Php::ElseIfClause => "else_if_clause",
            Php::ElseClause => "else_clause",
            Php::ElseIfClause2 => "else_if_clause",
            Php::ElseClause2 => "else_clause",
            Php::MatchExpression => "match_expression",
            Php::MatchBlock => "match_block",
            Php::MatchConditionList => "match_condition_list",
            Php::MatchConditionalExpression => "match_conditional_expression",
            Php::MatchDefaultExpression => "match_default_expression",
            Php::SwitchStatement => "switch_statement",
            Php::SwitchBlock => "switch_block",
            Php::CaseStatement => "case_statement",
            Php::DefaultStatement => "default_statement",
            Php::CompoundStatement => "compound_statement",
            Php::NamedLabelStatement => "named_label_statement",
            Php::ExpressionStatement => "expression_statement",
            Php::Expression => "expression",
            Php::UnaryExpression => "_unary_expression",
            Php::UnaryOpExpression => "unary_op_expression",
            Php::ErrorSuppressionExpression => "error_suppression_expression",
            Php::CloneExpression => "clone_expression",
            Php::PrimaryExpression => "primary_expression",
            Php::ParenthesizedExpression => "parenthesized_expression",
            Php::ClassConstantAccessExpression => "class_constant_access_expression",
            Php::PrintIntrinsic => "print_intrinsic",
            Php::ObjectCreationExpression => "object_creation_expression",
            Php::NewNonDereferencableExpression => "_new_non_dereferencable_expression",
            Php::NewDereferencableExpression => "_new_dereferencable_expression",
            Php::ClassNameReference => "_class_name_reference",
            Php::AnonymousClass => "anonymous_class",
            Php::UpdateExpression => "update_expression",
            Php::CastExpression => "cast_expression",
            Php::CastExpression2 => "cast_expression",
            Php::AssignmentExpression => "assignment_expression",
            Php::ReferenceAssignmentExpression => "reference_assignment_expression",
            Php::ConditionalExpression => "conditional_expression",
            Php::AugmentedAssignmentExpression => "augmented_assignment_expression",
            Php::MemberAccessExpression => "member_access_expression",
            Php::MemberAccessExpression2 => "member_access_expression",
            Php::NullsafeMemberAccessExpression => "nullsafe_member_access_expression",
            Php::NullsafeMemberAccessExpression2 => "nullsafe_member_access_expression",
            Php::ScopedPropertyAccessExpression => "scoped_property_access_expression",
            Php::ScopedPropertyAccessExpression2 => "scoped_property_access_expression",
            Php::ListLiteral => "list_literal",
            Php::ListDestructing => "_list_destructing",
            Php::ArrayDestructing => "_array_destructing",
            Php::ArrayDestructingElement => "_array_destructing_element",
            Php::FunctionCallExpression => "function_call_expression",
            Php::CallableExpression => "_callable_expression",
            Php::ScopedCallExpression => "scoped_call_expression",
            Php::ScopeResolutionQualifier => "_scope_resolution_qualifier",
            Php::RelativeScope => "relative_scope",
            Php::VariadicPlaceholder => "variadic_placeholder",
            Php::Arguments => "arguments",
            Php::Argument => "argument",
            Php::ArgumentName => "_argument_name",
            Php::MemberCallExpression => "member_call_expression",
            Php::NullsafeMemberCallExpression => "nullsafe_member_call_expression",
            Php::VariadicUnpacking => "variadic_unpacking",
            Php::MemberName => "_member_name",
            Php::SubscriptExpression => "subscript_expression",
            Php::SubscriptExpression2 => "subscript_expression",
            Php::DereferencableExpression => "_dereferencable_expression",
            Php::DereferencableScalar => "_dereferencable_scalar",
            Php::ArrayCreationExpression => "array_creation_expression",
            Php::AttributeGroup => "attribute_group",
            Php::AttributeList => "attribute_list",
            Php::Attribute => "attribute",
            Php::ComplexStringPart => "_complex_string_part",
            Php::MemberAccessExpression3 => "member_access_expression",
            Php::UnaryOpExpression2 => "unary_op_expression",
            Php::SimpleStringArrayAccessArgument => "_simple_string_array_access_argument",
            Php::SubscriptExpression3 => "subscript_expression",
            Php::SimpleStringPart => "_simple_string_part",
            Php::InterpolatedStringBody => "_interpolated_string_body",
            Php::InterpolatedStringBodyHeredoc => "_interpolated_string_body_heredoc",
            Php::EncapsedString => "encapsed_string",
            Php::String => "string",
            Php::StringContent8 => "string_content",
            Php::HeredocBody => "heredoc_body",
            Php::Heredoc => "heredoc",
            Php::NowdocBody => "nowdoc_body",
            Php::Nowdoc => "nowdoc",
            Php::InterpolatedExecutionOperatorBody => "_interpolated_execution_operator_body",
            Php::ShellCommandExpression => "shell_command_expression",
            Php::Boolean => "boolean",
            Php::Null => "null",
            Php::String3 => "_string",
            Php::DynamicVariableName => "dynamic_variable_name",
            Php::SimpleVariable => "_simple_variable",
            Php::NewVariable => "_new_variable",
            Php::CallableVariable => "_callable_variable",
            Php::VariableName => "variable_name",
            Php::ByRef => "by_ref",
            Php::YieldExpression => "yield_expression",
            Php::ArrayElementInitializer => "array_element_initializer",
            Php::BinaryExpression => "binary_expression",
            Php::IncludeExpression => "include_expression",
            Php::IncludeOnceExpression => "include_once_expression",
            Php::RequireExpression => "require_expression",
            Php::RequireOnceExpression => "require_once_expression",
            Php::Semicolon => "_semicolon",
            Php::ProgramRepeat1 => "program_repeat1",
            Php::TextRepeat1 => "text_repeat1",
            Php::FunctionStaticDeclarationRepeat1 => "function_static_declaration_repeat1",
            Php::GlobalDeclarationRepeat1 => "global_declaration_repeat1",
            Php::NamespaceUseDeclarationRepeat1 => "namespace_use_declaration_repeat1",
            Php::NamespaceNameRepeat1 => "namespace_name_repeat1",
            Php::BaseClauseRepeat1 => "base_clause_repeat1",
            Php::EnumDeclarationListRepeat1 => "enum_declaration_list_repeat1",
            Php::ClassDeclarationRepeat1 => "class_declaration_repeat1",
            Php::DeclarationListRepeat1 => "declaration_list_repeat1",
            Php::ConstDeclarationRepeat1 => "const_declaration_repeat1",
            Php::ClassConstDeclarationRepeat1 => "_class_const_declaration_repeat1",
            Php::PropertyDeclarationRepeat1 => "property_declaration_repeat1",
            Php::PropertyHookListRepeat1 => "property_hook_list_repeat1",
            Php::UseListRepeat1 => "use_list_repeat1",
            Php::AnonymousFunctionUseClauseRepeat1 => "anonymous_function_use_clause_repeat1",
            Php::FormalParametersRepeat1 => "formal_parameters_repeat1",
            Php::UnionTypeRepeat1 => "union_type_repeat1",
            Php::IntersectionTypeRepeat1 => "intersection_type_repeat1",
            Php::DisjunctiveNormalFormTypeRepeat1 => "disjunctive_normal_form_type_repeat1",
            Php::UnsetStatementRepeat1 => "unset_statement_repeat1",
            Php::TryStatementRepeat1 => "try_statement_repeat1",
            Php::TypeListRepeat1 => "type_list_repeat1",
            Php::IfStatementRepeat1 => "if_statement_repeat1",
            Php::IfStatementRepeat2 => "if_statement_repeat2",
            Php::MatchBlockRepeat1 => "match_block_repeat1",
            Php::MatchConditionListRepeat1 => "match_condition_list_repeat1",
            Php::SwitchBlockRepeat1 => "switch_block_repeat1",
            Php::ListDestructingRepeat1 => "_list_destructing_repeat1",
            Php::ArrayDestructingRepeat1 => "_array_destructing_repeat1",
            Php::ArgumentsRepeat1 => "arguments_repeat1",
            Php::ArrayCreationExpressionRepeat1 => "array_creation_expression_repeat1",
            Php::AttributeGroupRepeat1 => "attribute_group_repeat1",
            Php::AttributeListRepeat1 => "attribute_list_repeat1",
            Php::StringRepeat1 => "string_repeat1",
            Php::StringContentRepeat1 => "string_content_repeat1",
            Php::HeredocBodyRepeat1 => "heredoc_body_repeat1",
            Php::NowdocBodyRepeat1 => "nowdoc_body_repeat1",
            Php::Operation => "operation",
            Php::Error => "ERROR",
        }
    }
}

impl From<u16> for Php {
    #[inline]
    fn from(x: u16) -> Self {
        num::FromPrimitive::from_u16(x).unwrap_or(Self::Error)
    }
}

// Php == u16
impl PartialEq<u16> for Php {
    #[inline]
    fn eq(&self, x: &u16) -> bool {
        *self == Into::<Self>::into(*x)
    }
}

// u16 == Php
impl PartialEq<Php> for u16 {
    #[inline]
    fn eq(&self, x: &Php) -> bool {
        *x == *self
    }
}