big-code-analysis 2.0.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
// 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 C {
    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,
    Extern = 45,
    Attribute2 = 46,
    Attribute3 = 47,
    COLONCOLON = 48,
    LBRACKLBRACK = 49,
    RBRACKRBRACK = 50,
    Declspec = 51,
    Based = 52,
    Cdecl = 53,
    Clrcall = 54,
    Stdcall = 55,
    Fastcall = 56,
    Thiscall = 57,
    Vectorcall = 58,
    MsRestrictModifier = 59,
    MsUnsignedPtrModifier = 60,
    MsSignedPtrModifier = 61,
    Unaligned = 62,
    Unaligned2 = 63,
    LBRACE = 64,
    RBRACE = 65,
    Signed = 66,
    Unsigned = 67,
    Long = 68,
    Short = 69,
    LBRACK = 70,
    Static = 71,
    RBRACK = 72,
    EQ = 73,
    Auto = 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,
    Alignas = 91,
    Alignas2 = 92,
    PrimitiveType = 93,
    Enum = 94,
    COLON = 95,
    Struct = 96,
    Union = 97,
    If = 98,
    Else = 99,
    Switch = 100,
    Case = 101,
    Default = 102,
    While = 103,
    Do = 104,
    For = 105,
    Return = 106,
    Break = 107,
    Continue = 108,
    Goto = 109,
    Try = 110,
    Except = 111,
    Finally = 112,
    Leave = 113,
    QMARK = 114,
    STAREQ = 115,
    SLASHEQ = 116,
    PERCENTEQ = 117,
    PLUSEQ = 118,
    DASHEQ = 119,
    LTLTEQ = 120,
    GTGTEQ = 121,
    AMPEQ = 122,
    CARETEQ = 123,
    PIPEEQ = 124,
    DASHDASH = 125,
    PLUSPLUS = 126,
    Sizeof = 127,
    Alignof = 128,
    Alignof2 = 129,
    Alignof3 = 130,
    Alignof4 = 131,
    Alignof5 = 132,
    Offsetof = 133,
    Generic = 134,
    Asm = 135,
    Asm2 = 136,
    Asm3 = 137,
    Volatile2 = 138,
    DOT = 139,
    DASHGT = 140,
    NumberLiteral = 141,
    LSQUOTE = 142,
    USQUOTE = 143,
    USQUOTE2 = 144,
    U8SQUOTE = 145,
    SQUOTE = 146,
    Character = 147,
    LDQUOTE = 148,
    UDQUOTE = 149,
    UDQUOTE2 = 150,
    U8DQUOTE = 151,
    DQUOTE = 152,
    StringContent = 153,
    EscapeSequence = 154,
    SystemLibString = 155,
    True = 156,
    False = 157,
    NULL = 158,
    Nullptr = 159,
    Comment = 160,
    TranslationUnit = 161,
    TopLevelItem = 162,
    BlockItem = 163,
    PreprocInclude = 164,
    PreprocDef = 165,
    PreprocFunctionDef = 166,
    PreprocParams = 167,
    PreprocCall = 168,
    PreprocIf = 169,
    PreprocIfdef = 170,
    PreprocElse = 171,
    PreprocElif = 172,
    PreprocElifdef = 173,
    PreprocIf2 = 174,
    PreprocIfdef2 = 175,
    PreprocElse2 = 176,
    PreprocElif2 = 177,
    PreprocElifdef2 = 178,
    PreprocIf3 = 179,
    PreprocIfdef3 = 180,
    PreprocElse3 = 181,
    PreprocElif3 = 182,
    PreprocElifdef3 = 183,
    PreprocIf4 = 184,
    PreprocIfdef4 = 185,
    PreprocElse4 = 186,
    PreprocElif4 = 187,
    PreprocElifdef4 = 188,
    PreprocExpression = 189,
    ParenthesizedExpression = 190,
    PreprocDefined = 191,
    UnaryExpression = 192,
    CallExpression = 193,
    ArgumentList = 194,
    BinaryExpression = 195,
    FunctionDefinition = 196,
    FunctionDefinition2 = 197,
    Declaration = 198,
    TypeDefinition = 199,
    TypeDefinitionType = 200,
    TypeDefinitionDeclarators = 201,
    DeclarationModifiers = 202,
    DeclarationSpecifiers = 203,
    LinkageSpecification = 204,
    AttributeSpecifier = 205,
    Attribute = 206,
    AttributeDeclaration = 207,
    MsDeclspecModifier = 208,
    MsBasedModifier = 209,
    MsCallModifier = 210,
    MsUnalignedPtrModifier = 211,
    MsPointerModifier = 212,
    DeclarationList = 213,
    Declarator = 214,
    DeclarationDeclarator = 215,
    FieldDeclarator = 216,
    TypeDeclarator = 217,
    AbstractDeclarator = 218,
    ParenthesizedDeclarator = 219,
    ParenthesizedDeclarator2 = 220,
    ParenthesizedDeclarator3 = 221,
    AbstractParenthesizedDeclarator = 222,
    AttributedDeclarator = 223,
    AttributedDeclarator2 = 224,
    AttributedDeclarator3 = 225,
    PointerDeclarator = 226,
    PointerDeclarator2 = 227,
    PointerDeclarator3 = 228,
    AbstractPointerDeclarator = 229,
    FunctionDeclarator = 230,
    FunctionDeclarator2 = 231,
    FunctionDeclarator3 = 232,
    FunctionDeclarator4 = 233,
    AbstractFunctionDeclarator = 234,
    FunctionDeclarator5 = 235,
    ArrayDeclarator = 236,
    ArrayDeclarator2 = 237,
    ArrayDeclarator3 = 238,
    AbstractArrayDeclarator = 239,
    InitDeclarator = 240,
    CompoundStatement = 241,
    StorageClassSpecifier = 242,
    TypeQualifier = 243,
    AlignasQualifier = 244,
    TypeSpecifier = 245,
    SizedTypeSpecifier = 246,
    EnumSpecifier = 247,
    EnumeratorList = 248,
    StructSpecifier = 249,
    UnionSpecifier = 250,
    FieldDeclarationList = 251,
    FieldDeclarationListItem = 252,
    FieldDeclaration = 253,
    FieldDeclarationDeclarator = 254,
    BitfieldClause = 255,
    Enumerator = 256,
    VariadicParameter = 257,
    ParameterList = 258,
    ParameterList2 = 259,
    ParameterDeclaration = 260,
    AttributedStatement = 261,
    Statement = 262,
    TopLevelStatement = 263,
    LabeledStatement = 264,
    ExpressionStatement = 265,
    ExpressionStatement2 = 266,
    IfStatement = 267,
    ElseClause = 268,
    SwitchStatement = 269,
    CaseStatement = 270,
    WhileStatement = 271,
    DoStatement = 272,
    ForStatement = 273,
    ForStatementBody = 274,
    ReturnStatement = 275,
    BreakStatement = 276,
    ContinueStatement = 277,
    GotoStatement = 278,
    SehTryStatement = 279,
    SehExceptClause = 280,
    SehFinallyClause = 281,
    SehLeaveStatement = 282,
    Expression = 283,
    String = 284,
    CommaExpression = 285,
    ConditionalExpression = 286,
    AssignmentExpression = 287,
    PointerExpression = 288,
    UnaryExpression2 = 289,
    BinaryExpression2 = 290,
    UpdateExpression = 291,
    CastExpression = 292,
    TypeDescriptor = 293,
    SizeofExpression = 294,
    AlignofExpression = 295,
    OffsetofExpression = 296,
    GenericExpression = 297,
    SubscriptExpression = 298,
    CallExpression2 = 299,
    GnuAsmExpression = 300,
    GnuAsmQualifier = 301,
    GnuAsmOutputOperandList = 302,
    GnuAsmOutputOperand = 303,
    GnuAsmInputOperandList = 304,
    GnuAsmInputOperand = 305,
    GnuAsmClobberList = 306,
    GnuAsmGotoList = 307,
    ExtensionExpression = 308,
    ArgumentList2 = 309,
    FieldExpression = 310,
    CompoundLiteralExpression = 311,
    ParenthesizedExpression2 = 312,
    InitializerList = 313,
    InitializerPair = 314,
    SubscriptDesignator = 315,
    SubscriptRangeDesignator = 316,
    FieldDesignator = 317,
    CharLiteral = 318,
    ConcatenatedString = 319,
    StringLiteral = 320,
    Null = 321,
    EmptyDeclaration = 322,
    MacroTypeSpecifier = 323,
    TranslationUnitRepeat1 = 324,
    PreprocParamsRepeat1 = 325,
    PreprocIfRepeat1 = 326,
    PreprocIfInFieldDeclarationListRepeat1 = 327,
    PreprocIfInEnumeratorListRepeat1 = 328,
    PreprocIfInEnumeratorListNoCommaRepeat1 = 329,
    PreprocArgumentListRepeat1 = 330,
    OldStyleFunctionDefinitionRepeat1 = 331,
    DeclarationRepeat1 = 332,
    TypeDefinitionRepeat1 = 333,
    TypeDefinitionTypeRepeat1 = 334,
    TypeDefinitionDeclaratorsRepeat1 = 335,
    DeclarationSpecifiersRepeat1 = 336,
    AttributeDeclarationRepeat1 = 337,
    AttributedDeclaratorRepeat1 = 338,
    PointerDeclaratorRepeat1 = 339,
    FunctionDeclaratorRepeat1 = 340,
    ArrayDeclaratorRepeat1 = 341,
    SizedTypeSpecifierRepeat1 = 342,
    EnumeratorListRepeat1 = 343,
    FieldDeclarationDeclaratorRepeat1 = 344,
    ParameterListRepeat1 = 345,
    OldStyleParameterListRepeat1 = 346,
    CaseStatementRepeat1 = 347,
    GenericExpressionRepeat1 = 348,
    GnuAsmExpressionRepeat1 = 349,
    GnuAsmOutputOperandListRepeat1 = 350,
    GnuAsmInputOperandListRepeat1 = 351,
    GnuAsmClobberListRepeat1 = 352,
    GnuAsmGotoListRepeat1 = 353,
    ArgumentListRepeat1 = 354,
    InitializerListRepeat1 = 355,
    InitializerPairRepeat1 = 356,
    CharLiteralRepeat1 = 357,
    ConcatenatedStringRepeat1 = 358,
    StringLiteralRepeat1 = 359,
    FieldIdentifier = 360,
    StatementIdentifier = 361,
    TypeIdentifier = 362,
    Error = 363,
}

impl From<C> for &'static str {
    #[inline]
    fn from(tok: C) -> Self {
        match tok {
            C::End => "end",
            C::Identifier => "identifier",
            C::HASHinclude => "#include",
            C::PreprocIncludeToken2 => "preproc_include_token2",
            C::HASHdefine => "#define",
            C::LPAREN => "(",
            C::DOTDOTDOT => "...",
            C::COMMA => ",",
            C::RPAREN => ")",
            C::HASHif => "#if",
            C::LF => "\n",
            C::HASHendif => "#endif",
            C::HASHifdef => "#ifdef",
            C::HASHifndef => "#ifndef",
            C::HASHelse => "#else",
            C::HASHelif => "#elif",
            C::HASHelifdef => "#elifdef",
            C::HASHelifndef => "#elifndef",
            C::PreprocArg => "preproc_arg",
            C::PreprocDirective => "preproc_directive",
            C::LPAREN2 => "(",
            C::Defined => "defined",
            C::BANG => "!",
            C::TILDE => "~",
            C::DASH => "-",
            C::PLUS => "+",
            C::STAR => "*",
            C::SLASH => "/",
            C::PERCENT => "%",
            C::PIPEPIPE => "||",
            C::AMPAMP => "&&",
            C::PIPE => "|",
            C::CARET => "^",
            C::AMP => "&",
            C::EQEQ => "==",
            C::BANGEQ => "!=",
            C::GT => ">",
            C::GTEQ => ">=",
            C::LTEQ => "<=",
            C::LT => "<",
            C::LTLT => "<<",
            C::GTGT => ">>",
            C::SEMI => ";",
            C::Extension => "__extension__",
            C::Typedef => "typedef",
            C::Extern => "extern",
            C::Attribute2 => "__attribute__",
            C::Attribute3 => "__attribute",
            C::COLONCOLON => "::",
            C::LBRACKLBRACK => "[[",
            C::RBRACKRBRACK => "]]",
            C::Declspec => "__declspec",
            C::Based => "__based",
            C::Cdecl => "__cdecl",
            C::Clrcall => "__clrcall",
            C::Stdcall => "__stdcall",
            C::Fastcall => "__fastcall",
            C::Thiscall => "__thiscall",
            C::Vectorcall => "__vectorcall",
            C::MsRestrictModifier => "ms_restrict_modifier",
            C::MsUnsignedPtrModifier => "ms_unsigned_ptr_modifier",
            C::MsSignedPtrModifier => "ms_signed_ptr_modifier",
            C::Unaligned => "_unaligned",
            C::Unaligned2 => "__unaligned",
            C::LBRACE => "{",
            C::RBRACE => "}",
            C::Signed => "signed",
            C::Unsigned => "unsigned",
            C::Long => "long",
            C::Short => "short",
            C::LBRACK => "[",
            C::Static => "static",
            C::RBRACK => "]",
            C::EQ => "=",
            C::Auto => "auto",
            C::Register => "register",
            C::Inline => "inline",
            C::Inline2 => "__inline",
            C::Inline3 => "__inline__",
            C::Forceinline => "__forceinline",
            C::ThreadLocal => "thread_local",
            C::Thread => "__thread",
            C::Const => "const",
            C::Constexpr => "constexpr",
            C::Volatile => "volatile",
            C::Restrict => "restrict",
            C::Restrict2 => "__restrict__",
            C::Atomic => "_Atomic",
            C::Noreturn => "_Noreturn",
            C::Noreturn2 => "noreturn",
            C::Nonnull => "_Nonnull",
            C::Alignas => "alignas",
            C::Alignas2 => "_Alignas",
            C::PrimitiveType => "primitive_type",
            C::Enum => "enum",
            C::COLON => ":",
            C::Struct => "struct",
            C::Union => "union",
            C::If => "if",
            C::Else => "else",
            C::Switch => "switch",
            C::Case => "case",
            C::Default => "default",
            C::While => "while",
            C::Do => "do",
            C::For => "for",
            C::Return => "return",
            C::Break => "break",
            C::Continue => "continue",
            C::Goto => "goto",
            C::Try => "__try",
            C::Except => "__except",
            C::Finally => "__finally",
            C::Leave => "__leave",
            C::QMARK => "?",
            C::STAREQ => "*=",
            C::SLASHEQ => "/=",
            C::PERCENTEQ => "%=",
            C::PLUSEQ => "+=",
            C::DASHEQ => "-=",
            C::LTLTEQ => "<<=",
            C::GTGTEQ => ">>=",
            C::AMPEQ => "&=",
            C::CARETEQ => "^=",
            C::PIPEEQ => "|=",
            C::DASHDASH => "--",
            C::PLUSPLUS => "++",
            C::Sizeof => "sizeof",
            C::Alignof => "__alignof__",
            C::Alignof2 => "__alignof",
            C::Alignof3 => "_alignof",
            C::Alignof4 => "alignof",
            C::Alignof5 => "_Alignof",
            C::Offsetof => "offsetof",
            C::Generic => "_Generic",
            C::Asm => "asm",
            C::Asm2 => "__asm__",
            C::Asm3 => "__asm",
            C::Volatile2 => "__volatile__",
            C::DOT => ".",
            C::DASHGT => "->",
            C::NumberLiteral => "number_literal",
            C::LSQUOTE => "L'",
            C::USQUOTE => "u'",
            C::USQUOTE2 => "U'",
            C::U8SQUOTE => "u8'",
            C::SQUOTE => "'",
            C::Character => "character",
            C::LDQUOTE => "L\"",
            C::UDQUOTE => "u\"",
            C::UDQUOTE2 => "U\"",
            C::U8DQUOTE => "u8\"",
            C::DQUOTE => "\"",
            C::StringContent => "string_content",
            C::EscapeSequence => "escape_sequence",
            C::SystemLibString => "system_lib_string",
            C::True => "true",
            C::False => "false",
            C::NULL => "NULL",
            C::Nullptr => "nullptr",
            C::Comment => "comment",
            C::TranslationUnit => "translation_unit",
            C::TopLevelItem => "_top_level_item",
            C::BlockItem => "_block_item",
            C::PreprocInclude => "preproc_include",
            C::PreprocDef => "preproc_def",
            C::PreprocFunctionDef => "preproc_function_def",
            C::PreprocParams => "preproc_params",
            C::PreprocCall => "preproc_call",
            C::PreprocIf => "preproc_if",
            C::PreprocIfdef => "preproc_ifdef",
            C::PreprocElse => "preproc_else",
            C::PreprocElif => "preproc_elif",
            C::PreprocElifdef => "preproc_elifdef",
            C::PreprocIf2 => "preproc_if",
            C::PreprocIfdef2 => "preproc_ifdef",
            C::PreprocElse2 => "preproc_else",
            C::PreprocElif2 => "preproc_elif",
            C::PreprocElifdef2 => "preproc_elifdef",
            C::PreprocIf3 => "preproc_if",
            C::PreprocIfdef3 => "preproc_ifdef",
            C::PreprocElse3 => "preproc_else",
            C::PreprocElif3 => "preproc_elif",
            C::PreprocElifdef3 => "preproc_elifdef",
            C::PreprocIf4 => "preproc_if",
            C::PreprocIfdef4 => "preproc_ifdef",
            C::PreprocElse4 => "preproc_else",
            C::PreprocElif4 => "preproc_elif",
            C::PreprocElifdef4 => "preproc_elifdef",
            C::PreprocExpression => "_preproc_expression",
            C::ParenthesizedExpression => "parenthesized_expression",
            C::PreprocDefined => "preproc_defined",
            C::UnaryExpression => "unary_expression",
            C::CallExpression => "call_expression",
            C::ArgumentList => "argument_list",
            C::BinaryExpression => "binary_expression",
            C::FunctionDefinition => "function_definition",
            C::FunctionDefinition2 => "function_definition",
            C::Declaration => "declaration",
            C::TypeDefinition => "type_definition",
            C::TypeDefinitionType => "_type_definition_type",
            C::TypeDefinitionDeclarators => "_type_definition_declarators",
            C::DeclarationModifiers => "_declaration_modifiers",
            C::DeclarationSpecifiers => "_declaration_specifiers",
            C::LinkageSpecification => "linkage_specification",
            C::AttributeSpecifier => "attribute_specifier",
            C::Attribute => "attribute",
            C::AttributeDeclaration => "attribute_declaration",
            C::MsDeclspecModifier => "ms_declspec_modifier",
            C::MsBasedModifier => "ms_based_modifier",
            C::MsCallModifier => "ms_call_modifier",
            C::MsUnalignedPtrModifier => "ms_unaligned_ptr_modifier",
            C::MsPointerModifier => "ms_pointer_modifier",
            C::DeclarationList => "declaration_list",
            C::Declarator => "_declarator",
            C::DeclarationDeclarator => "_declaration_declarator",
            C::FieldDeclarator => "_field_declarator",
            C::TypeDeclarator => "_type_declarator",
            C::AbstractDeclarator => "_abstract_declarator",
            C::ParenthesizedDeclarator => "parenthesized_declarator",
            C::ParenthesizedDeclarator2 => "parenthesized_declarator",
            C::ParenthesizedDeclarator3 => "parenthesized_declarator",
            C::AbstractParenthesizedDeclarator => "abstract_parenthesized_declarator",
            C::AttributedDeclarator => "attributed_declarator",
            C::AttributedDeclarator2 => "attributed_declarator",
            C::AttributedDeclarator3 => "attributed_declarator",
            C::PointerDeclarator => "pointer_declarator",
            C::PointerDeclarator2 => "pointer_declarator",
            C::PointerDeclarator3 => "pointer_declarator",
            C::AbstractPointerDeclarator => "abstract_pointer_declarator",
            C::FunctionDeclarator => "function_declarator",
            C::FunctionDeclarator2 => "function_declarator",
            C::FunctionDeclarator3 => "function_declarator",
            C::FunctionDeclarator4 => "function_declarator",
            C::AbstractFunctionDeclarator => "abstract_function_declarator",
            C::FunctionDeclarator5 => "function_declarator",
            C::ArrayDeclarator => "array_declarator",
            C::ArrayDeclarator2 => "array_declarator",
            C::ArrayDeclarator3 => "array_declarator",
            C::AbstractArrayDeclarator => "abstract_array_declarator",
            C::InitDeclarator => "init_declarator",
            C::CompoundStatement => "compound_statement",
            C::StorageClassSpecifier => "storage_class_specifier",
            C::TypeQualifier => "type_qualifier",
            C::AlignasQualifier => "alignas_qualifier",
            C::TypeSpecifier => "type_specifier",
            C::SizedTypeSpecifier => "sized_type_specifier",
            C::EnumSpecifier => "enum_specifier",
            C::EnumeratorList => "enumerator_list",
            C::StructSpecifier => "struct_specifier",
            C::UnionSpecifier => "union_specifier",
            C::FieldDeclarationList => "field_declaration_list",
            C::FieldDeclarationListItem => "_field_declaration_list_item",
            C::FieldDeclaration => "field_declaration",
            C::FieldDeclarationDeclarator => "_field_declaration_declarator",
            C::BitfieldClause => "bitfield_clause",
            C::Enumerator => "enumerator",
            C::VariadicParameter => "variadic_parameter",
            C::ParameterList => "parameter_list",
            C::ParameterList2 => "parameter_list",
            C::ParameterDeclaration => "parameter_declaration",
            C::AttributedStatement => "attributed_statement",
            C::Statement => "statement",
            C::TopLevelStatement => "_top_level_statement",
            C::LabeledStatement => "labeled_statement",
            C::ExpressionStatement => "expression_statement",
            C::ExpressionStatement2 => "expression_statement",
            C::IfStatement => "if_statement",
            C::ElseClause => "else_clause",
            C::SwitchStatement => "switch_statement",
            C::CaseStatement => "case_statement",
            C::WhileStatement => "while_statement",
            C::DoStatement => "do_statement",
            C::ForStatement => "for_statement",
            C::ForStatementBody => "_for_statement_body",
            C::ReturnStatement => "return_statement",
            C::BreakStatement => "break_statement",
            C::ContinueStatement => "continue_statement",
            C::GotoStatement => "goto_statement",
            C::SehTryStatement => "seh_try_statement",
            C::SehExceptClause => "seh_except_clause",
            C::SehFinallyClause => "seh_finally_clause",
            C::SehLeaveStatement => "seh_leave_statement",
            C::Expression => "expression",
            C::String => "_string",
            C::CommaExpression => "comma_expression",
            C::ConditionalExpression => "conditional_expression",
            C::AssignmentExpression => "assignment_expression",
            C::PointerExpression => "pointer_expression",
            C::UnaryExpression2 => "unary_expression",
            C::BinaryExpression2 => "binary_expression",
            C::UpdateExpression => "update_expression",
            C::CastExpression => "cast_expression",
            C::TypeDescriptor => "type_descriptor",
            C::SizeofExpression => "sizeof_expression",
            C::AlignofExpression => "alignof_expression",
            C::OffsetofExpression => "offsetof_expression",
            C::GenericExpression => "generic_expression",
            C::SubscriptExpression => "subscript_expression",
            C::CallExpression2 => "call_expression",
            C::GnuAsmExpression => "gnu_asm_expression",
            C::GnuAsmQualifier => "gnu_asm_qualifier",
            C::GnuAsmOutputOperandList => "gnu_asm_output_operand_list",
            C::GnuAsmOutputOperand => "gnu_asm_output_operand",
            C::GnuAsmInputOperandList => "gnu_asm_input_operand_list",
            C::GnuAsmInputOperand => "gnu_asm_input_operand",
            C::GnuAsmClobberList => "gnu_asm_clobber_list",
            C::GnuAsmGotoList => "gnu_asm_goto_list",
            C::ExtensionExpression => "extension_expression",
            C::ArgumentList2 => "argument_list",
            C::FieldExpression => "field_expression",
            C::CompoundLiteralExpression => "compound_literal_expression",
            C::ParenthesizedExpression2 => "parenthesized_expression",
            C::InitializerList => "initializer_list",
            C::InitializerPair => "initializer_pair",
            C::SubscriptDesignator => "subscript_designator",
            C::SubscriptRangeDesignator => "subscript_range_designator",
            C::FieldDesignator => "field_designator",
            C::CharLiteral => "char_literal",
            C::ConcatenatedString => "concatenated_string",
            C::StringLiteral => "string_literal",
            C::Null => "null",
            C::EmptyDeclaration => "_empty_declaration",
            C::MacroTypeSpecifier => "macro_type_specifier",
            C::TranslationUnitRepeat1 => "translation_unit_repeat1",
            C::PreprocParamsRepeat1 => "preproc_params_repeat1",
            C::PreprocIfRepeat1 => "preproc_if_repeat1",
            C::PreprocIfInFieldDeclarationListRepeat1 => {
                "preproc_if_in_field_declaration_list_repeat1"
            }
            C::PreprocIfInEnumeratorListRepeat1 => "preproc_if_in_enumerator_list_repeat1",
            C::PreprocIfInEnumeratorListNoCommaRepeat1 => {
                "preproc_if_in_enumerator_list_no_comma_repeat1"
            }
            C::PreprocArgumentListRepeat1 => "preproc_argument_list_repeat1",
            C::OldStyleFunctionDefinitionRepeat1 => "_old_style_function_definition_repeat1",
            C::DeclarationRepeat1 => "declaration_repeat1",
            C::TypeDefinitionRepeat1 => "type_definition_repeat1",
            C::TypeDefinitionTypeRepeat1 => "_type_definition_type_repeat1",
            C::TypeDefinitionDeclaratorsRepeat1 => "_type_definition_declarators_repeat1",
            C::DeclarationSpecifiersRepeat1 => "_declaration_specifiers_repeat1",
            C::AttributeDeclarationRepeat1 => "attribute_declaration_repeat1",
            C::AttributedDeclaratorRepeat1 => "attributed_declarator_repeat1",
            C::PointerDeclaratorRepeat1 => "pointer_declarator_repeat1",
            C::FunctionDeclaratorRepeat1 => "function_declarator_repeat1",
            C::ArrayDeclaratorRepeat1 => "array_declarator_repeat1",
            C::SizedTypeSpecifierRepeat1 => "sized_type_specifier_repeat1",
            C::EnumeratorListRepeat1 => "enumerator_list_repeat1",
            C::FieldDeclarationDeclaratorRepeat1 => "_field_declaration_declarator_repeat1",
            C::ParameterListRepeat1 => "parameter_list_repeat1",
            C::OldStyleParameterListRepeat1 => "_old_style_parameter_list_repeat1",
            C::CaseStatementRepeat1 => "case_statement_repeat1",
            C::GenericExpressionRepeat1 => "generic_expression_repeat1",
            C::GnuAsmExpressionRepeat1 => "gnu_asm_expression_repeat1",
            C::GnuAsmOutputOperandListRepeat1 => "gnu_asm_output_operand_list_repeat1",
            C::GnuAsmInputOperandListRepeat1 => "gnu_asm_input_operand_list_repeat1",
            C::GnuAsmClobberListRepeat1 => "gnu_asm_clobber_list_repeat1",
            C::GnuAsmGotoListRepeat1 => "gnu_asm_goto_list_repeat1",
            C::ArgumentListRepeat1 => "argument_list_repeat1",
            C::InitializerListRepeat1 => "initializer_list_repeat1",
            C::InitializerPairRepeat1 => "initializer_pair_repeat1",
            C::CharLiteralRepeat1 => "char_literal_repeat1",
            C::ConcatenatedStringRepeat1 => "concatenated_string_repeat1",
            C::StringLiteralRepeat1 => "string_literal_repeat1",
            C::FieldIdentifier => "field_identifier",
            C::StatementIdentifier => "statement_identifier",
            C::TypeIdentifier => "type_identifier",
            C::Error => "ERROR",
        }
    }
}

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

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

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