Skip to main content

big_code_analysis_ast/languages/
language_c.rs

1// See `src/languages/mod.rs` for the rationale behind the per-file
2// pedantic carve-outs below.
3#![allow(clippy::match_same_arms, clippy::too_many_lines)]
4// One variant per grammar kind id, named after the rule; the name is
5// the documentation and there is nothing per-variant to add.
6#![allow(missing_docs)]
7
8// Code generated; DO NOT EDIT.
9
10use num_derive::FromPrimitive;
11
12#[derive(Clone, Debug, PartialEq, Eq, FromPrimitive)]
13pub enum C {
14    End = 0,
15    Identifier = 1,
16    HASHinclude = 2,
17    PreprocIncludeToken2 = 3,
18    HASHdefine = 4,
19    LPAREN = 5,
20    DOTDOTDOT = 6,
21    COMMA = 7,
22    RPAREN = 8,
23    HASHif = 9,
24    LF = 10,
25    HASHendif = 11,
26    HASHifdef = 12,
27    HASHifndef = 13,
28    HASHelse = 14,
29    HASHelif = 15,
30    HASHelifdef = 16,
31    HASHelifndef = 17,
32    PreprocArg = 18,
33    PreprocDirective = 19,
34    LPAREN2 = 20,
35    Defined = 21,
36    BANG = 22,
37    TILDE = 23,
38    DASH = 24,
39    PLUS = 25,
40    STAR = 26,
41    SLASH = 27,
42    PERCENT = 28,
43    PIPEPIPE = 29,
44    AMPAMP = 30,
45    PIPE = 31,
46    CARET = 32,
47    AMP = 33,
48    EQEQ = 34,
49    BANGEQ = 35,
50    GT = 36,
51    GTEQ = 37,
52    LTEQ = 38,
53    LT = 39,
54    LTLT = 40,
55    GTGT = 41,
56    SEMI = 42,
57    Extension = 43,
58    Typedef = 44,
59    Extern = 45,
60    Attribute2 = 46,
61    Attribute3 = 47,
62    COLONCOLON = 48,
63    LBRACKLBRACK = 49,
64    RBRACKRBRACK = 50,
65    Declspec = 51,
66    Based = 52,
67    Cdecl = 53,
68    Clrcall = 54,
69    Stdcall = 55,
70    Fastcall = 56,
71    Thiscall = 57,
72    Vectorcall = 58,
73    MsRestrictModifier = 59,
74    MsUnsignedPtrModifier = 60,
75    MsSignedPtrModifier = 61,
76    Unaligned = 62,
77    Unaligned2 = 63,
78    LBRACE = 64,
79    RBRACE = 65,
80    Signed = 66,
81    Unsigned = 67,
82    Long = 68,
83    Short = 69,
84    LBRACK = 70,
85    Static = 71,
86    RBRACK = 72,
87    EQ = 73,
88    Auto = 74,
89    Register = 75,
90    Inline = 76,
91    Inline2 = 77,
92    Inline3 = 78,
93    Forceinline = 79,
94    ThreadLocal = 80,
95    Thread = 81,
96    Const = 82,
97    Constexpr = 83,
98    Volatile = 84,
99    Restrict = 85,
100    Restrict2 = 86,
101    Atomic = 87,
102    Noreturn = 88,
103    Noreturn2 = 89,
104    Nonnull = 90,
105    Alignas = 91,
106    Alignas2 = 92,
107    PrimitiveType = 93,
108    Enum = 94,
109    COLON = 95,
110    Struct = 96,
111    Union = 97,
112    If = 98,
113    Else = 99,
114    Switch = 100,
115    Case = 101,
116    Default = 102,
117    While = 103,
118    Do = 104,
119    For = 105,
120    Return = 106,
121    Break = 107,
122    Continue = 108,
123    Goto = 109,
124    Try = 110,
125    Except = 111,
126    Finally = 112,
127    Leave = 113,
128    QMARK = 114,
129    STAREQ = 115,
130    SLASHEQ = 116,
131    PERCENTEQ = 117,
132    PLUSEQ = 118,
133    DASHEQ = 119,
134    LTLTEQ = 120,
135    GTGTEQ = 121,
136    AMPEQ = 122,
137    CARETEQ = 123,
138    PIPEEQ = 124,
139    DASHDASH = 125,
140    PLUSPLUS = 126,
141    Sizeof = 127,
142    Alignof = 128,
143    Alignof2 = 129,
144    Alignof3 = 130,
145    Alignof4 = 131,
146    Alignof5 = 132,
147    Offsetof = 133,
148    Generic = 134,
149    Asm = 135,
150    Asm2 = 136,
151    Asm3 = 137,
152    Volatile2 = 138,
153    DOT = 139,
154    DASHGT = 140,
155    NumberLiteral = 141,
156    LSQUOTE = 142,
157    USQUOTE = 143,
158    USQUOTE2 = 144,
159    U8SQUOTE = 145,
160    SQUOTE = 146,
161    Character = 147,
162    LDQUOTE = 148,
163    UDQUOTE = 149,
164    UDQUOTE2 = 150,
165    U8DQUOTE = 151,
166    DQUOTE = 152,
167    StringContent = 153,
168    EscapeSequence = 154,
169    SystemLibString = 155,
170    True = 156,
171    False = 157,
172    NULL = 158,
173    Nullptr = 159,
174    Comment = 160,
175    TranslationUnit = 161,
176    TopLevelItem = 162,
177    BlockItem = 163,
178    PreprocInclude = 164,
179    PreprocDef = 165,
180    PreprocFunctionDef = 166,
181    PreprocParams = 167,
182    PreprocCall = 168,
183    PreprocIf = 169,
184    PreprocIfdef = 170,
185    PreprocElse = 171,
186    PreprocElif = 172,
187    PreprocElifdef = 173,
188    PreprocIf2 = 174,
189    PreprocIfdef2 = 175,
190    PreprocElse2 = 176,
191    PreprocElif2 = 177,
192    PreprocElifdef2 = 178,
193    PreprocIf3 = 179,
194    PreprocIfdef3 = 180,
195    PreprocElse3 = 181,
196    PreprocElif3 = 182,
197    PreprocElifdef3 = 183,
198    PreprocIf4 = 184,
199    PreprocIfdef4 = 185,
200    PreprocElse4 = 186,
201    PreprocElif4 = 187,
202    PreprocElifdef4 = 188,
203    PreprocExpression = 189,
204    ParenthesizedExpression = 190,
205    PreprocDefined = 191,
206    UnaryExpression = 192,
207    CallExpression = 193,
208    ArgumentList = 194,
209    BinaryExpression = 195,
210    FunctionDefinition = 196,
211    FunctionDefinition2 = 197,
212    Declaration = 198,
213    TypeDefinition = 199,
214    TypeDefinitionType = 200,
215    TypeDefinitionDeclarators = 201,
216    DeclarationModifiers = 202,
217    DeclarationSpecifiers = 203,
218    LinkageSpecification = 204,
219    AttributeSpecifier = 205,
220    Attribute = 206,
221    AttributeDeclaration = 207,
222    MsDeclspecModifier = 208,
223    MsBasedModifier = 209,
224    MsCallModifier = 210,
225    MsUnalignedPtrModifier = 211,
226    MsPointerModifier = 212,
227    DeclarationList = 213,
228    Declarator = 214,
229    DeclarationDeclarator = 215,
230    FieldDeclarator = 216,
231    TypeDeclarator = 217,
232    AbstractDeclarator = 218,
233    ParenthesizedDeclarator = 219,
234    ParenthesizedDeclarator2 = 220,
235    ParenthesizedDeclarator3 = 221,
236    AbstractParenthesizedDeclarator = 222,
237    AttributedDeclarator = 223,
238    AttributedDeclarator2 = 224,
239    AttributedDeclarator3 = 225,
240    PointerDeclarator = 226,
241    PointerDeclarator2 = 227,
242    PointerDeclarator3 = 228,
243    AbstractPointerDeclarator = 229,
244    FunctionDeclarator = 230,
245    FunctionDeclarator2 = 231,
246    FunctionDeclarator3 = 232,
247    FunctionDeclarator4 = 233,
248    AbstractFunctionDeclarator = 234,
249    FunctionDeclarator5 = 235,
250    ArrayDeclarator = 236,
251    ArrayDeclarator2 = 237,
252    ArrayDeclarator3 = 238,
253    AbstractArrayDeclarator = 239,
254    InitDeclarator = 240,
255    CompoundStatement = 241,
256    StorageClassSpecifier = 242,
257    TypeQualifier = 243,
258    AlignasQualifier = 244,
259    TypeSpecifier = 245,
260    SizedTypeSpecifier = 246,
261    EnumSpecifier = 247,
262    EnumeratorList = 248,
263    StructSpecifier = 249,
264    UnionSpecifier = 250,
265    FieldDeclarationList = 251,
266    FieldDeclarationListItem = 252,
267    FieldDeclaration = 253,
268    FieldDeclarationDeclarator = 254,
269    BitfieldClause = 255,
270    Enumerator = 256,
271    VariadicParameter = 257,
272    ParameterList = 258,
273    ParameterList2 = 259,
274    ParameterDeclaration = 260,
275    AttributedStatement = 261,
276    Statement = 262,
277    TopLevelStatement = 263,
278    LabeledStatement = 264,
279    ExpressionStatement = 265,
280    ExpressionStatement2 = 266,
281    IfStatement = 267,
282    ElseClause = 268,
283    SwitchStatement = 269,
284    CaseStatement = 270,
285    WhileStatement = 271,
286    DoStatement = 272,
287    ForStatement = 273,
288    ForStatementBody = 274,
289    ReturnStatement = 275,
290    BreakStatement = 276,
291    ContinueStatement = 277,
292    GotoStatement = 278,
293    SehTryStatement = 279,
294    SehExceptClause = 280,
295    SehFinallyClause = 281,
296    SehLeaveStatement = 282,
297    Expression = 283,
298    String = 284,
299    CommaExpression = 285,
300    ConditionalExpression = 286,
301    AssignmentExpression = 287,
302    PointerExpression = 288,
303    UnaryExpression2 = 289,
304    BinaryExpression2 = 290,
305    UpdateExpression = 291,
306    CastExpression = 292,
307    TypeDescriptor = 293,
308    SizeofExpression = 294,
309    AlignofExpression = 295,
310    OffsetofExpression = 296,
311    GenericExpression = 297,
312    SubscriptExpression = 298,
313    CallExpression2 = 299,
314    GnuAsmExpression = 300,
315    GnuAsmQualifier = 301,
316    GnuAsmOutputOperandList = 302,
317    GnuAsmOutputOperand = 303,
318    GnuAsmInputOperandList = 304,
319    GnuAsmInputOperand = 305,
320    GnuAsmClobberList = 306,
321    GnuAsmGotoList = 307,
322    ExtensionExpression = 308,
323    ArgumentList2 = 309,
324    FieldExpression = 310,
325    CompoundLiteralExpression = 311,
326    ParenthesizedExpression2 = 312,
327    InitializerList = 313,
328    InitializerPair = 314,
329    SubscriptDesignator = 315,
330    SubscriptRangeDesignator = 316,
331    FieldDesignator = 317,
332    CharLiteral = 318,
333    ConcatenatedString = 319,
334    StringLiteral = 320,
335    Null = 321,
336    EmptyDeclaration = 322,
337    MacroTypeSpecifier = 323,
338    TranslationUnitRepeat1 = 324,
339    PreprocParamsRepeat1 = 325,
340    PreprocIfRepeat1 = 326,
341    PreprocIfInFieldDeclarationListRepeat1 = 327,
342    PreprocIfInEnumeratorListRepeat1 = 328,
343    PreprocIfInEnumeratorListNoCommaRepeat1 = 329,
344    PreprocArgumentListRepeat1 = 330,
345    OldStyleFunctionDefinitionRepeat1 = 331,
346    DeclarationRepeat1 = 332,
347    TypeDefinitionRepeat1 = 333,
348    TypeDefinitionTypeRepeat1 = 334,
349    TypeDefinitionDeclaratorsRepeat1 = 335,
350    DeclarationSpecifiersRepeat1 = 336,
351    AttributeDeclarationRepeat1 = 337,
352    AttributedDeclaratorRepeat1 = 338,
353    PointerDeclaratorRepeat1 = 339,
354    FunctionDeclaratorRepeat1 = 340,
355    ArrayDeclaratorRepeat1 = 341,
356    SizedTypeSpecifierRepeat1 = 342,
357    EnumeratorListRepeat1 = 343,
358    FieldDeclarationDeclaratorRepeat1 = 344,
359    ParameterListRepeat1 = 345,
360    OldStyleParameterListRepeat1 = 346,
361    CaseStatementRepeat1 = 347,
362    GenericExpressionRepeat1 = 348,
363    GnuAsmExpressionRepeat1 = 349,
364    GnuAsmOutputOperandListRepeat1 = 350,
365    GnuAsmInputOperandListRepeat1 = 351,
366    GnuAsmClobberListRepeat1 = 352,
367    GnuAsmGotoListRepeat1 = 353,
368    ArgumentListRepeat1 = 354,
369    InitializerListRepeat1 = 355,
370    InitializerPairRepeat1 = 356,
371    CharLiteralRepeat1 = 357,
372    ConcatenatedStringRepeat1 = 358,
373    StringLiteralRepeat1 = 359,
374    FieldIdentifier = 360,
375    StatementIdentifier = 361,
376    TypeIdentifier = 362,
377    Error = 363,
378}
379
380/// Each runtime kind id of `C` with tree-sitter's `named` and
381/// `visible` flags, in id order. A label for the id the enum identifies,
382/// read by the role-coverage gate; the generator's ERROR sentinel has no
383/// entry.
384pub const C_KIND_FLAGS: &[(u16, bool, bool)] = &[
385    (0, false, false),
386    (1, true, true),
387    (2, false, true),
388    (3, false, false),
389    (4, false, true),
390    (5, false, true),
391    (6, false, true),
392    (7, false, true),
393    (8, false, true),
394    (9, false, true),
395    (10, false, true),
396    (11, false, true),
397    (12, false, true),
398    (13, false, true),
399    (14, false, true),
400    (15, false, true),
401    (16, false, true),
402    (17, false, true),
403    (18, true, true),
404    (19, true, true),
405    (20, false, true),
406    (21, false, true),
407    (22, false, true),
408    (23, false, true),
409    (24, false, true),
410    (25, false, true),
411    (26, false, true),
412    (27, false, true),
413    (28, false, true),
414    (29, false, true),
415    (30, false, true),
416    (31, false, true),
417    (32, false, true),
418    (33, false, true),
419    (34, false, true),
420    (35, false, true),
421    (36, false, true),
422    (37, false, true),
423    (38, false, true),
424    (39, false, true),
425    (40, false, true),
426    (41, false, true),
427    (42, false, true),
428    (43, false, true),
429    (44, false, true),
430    (45, false, true),
431    (46, false, true),
432    (47, false, true),
433    (48, false, true),
434    (49, false, true),
435    (50, false, true),
436    (51, false, true),
437    (52, false, true),
438    (53, false, true),
439    (54, false, true),
440    (55, false, true),
441    (56, false, true),
442    (57, false, true),
443    (58, false, true),
444    (59, true, true),
445    (60, true, true),
446    (61, true, true),
447    (62, false, true),
448    (63, false, true),
449    (64, false, true),
450    (65, false, true),
451    (66, false, true),
452    (67, false, true),
453    (68, false, true),
454    (69, false, true),
455    (70, false, true),
456    (71, false, true),
457    (72, false, true),
458    (73, false, true),
459    (74, false, true),
460    (75, false, true),
461    (76, false, true),
462    (77, false, true),
463    (78, false, true),
464    (79, false, true),
465    (80, false, true),
466    (81, false, true),
467    (82, false, true),
468    (83, false, true),
469    (84, false, true),
470    (85, false, true),
471    (86, false, true),
472    (87, false, true),
473    (88, false, true),
474    (89, false, true),
475    (90, false, true),
476    (91, false, true),
477    (92, false, true),
478    (93, true, true),
479    (94, false, true),
480    (95, false, true),
481    (96, false, true),
482    (97, false, true),
483    (98, false, true),
484    (99, false, true),
485    (100, false, true),
486    (101, false, true),
487    (102, false, true),
488    (103, false, true),
489    (104, false, true),
490    (105, false, true),
491    (106, false, true),
492    (107, false, true),
493    (108, false, true),
494    (109, false, true),
495    (110, false, true),
496    (111, false, true),
497    (112, false, true),
498    (113, false, true),
499    (114, false, true),
500    (115, false, true),
501    (116, false, true),
502    (117, false, true),
503    (118, false, true),
504    (119, false, true),
505    (120, false, true),
506    (121, false, true),
507    (122, false, true),
508    (123, false, true),
509    (124, false, true),
510    (125, false, true),
511    (126, false, true),
512    (127, false, true),
513    (128, false, true),
514    (129, false, true),
515    (130, false, true),
516    (131, false, true),
517    (132, false, true),
518    (133, false, true),
519    (134, false, true),
520    (135, false, true),
521    (136, false, true),
522    (137, false, true),
523    (138, false, true),
524    (139, false, true),
525    (140, false, true),
526    (141, true, true),
527    (142, false, true),
528    (143, false, true),
529    (144, false, true),
530    (145, false, true),
531    (146, false, true),
532    (147, true, true),
533    (148, false, true),
534    (149, false, true),
535    (150, false, true),
536    (151, false, true),
537    (152, false, true),
538    (153, true, true),
539    (154, true, true),
540    (155, true, true),
541    (156, true, true),
542    (157, true, true),
543    (158, false, true),
544    (159, false, true),
545    (160, true, true),
546    (161, true, true),
547    (162, false, false),
548    (163, false, false),
549    (164, true, true),
550    (165, true, true),
551    (166, true, true),
552    (167, true, true),
553    (168, true, true),
554    (169, true, true),
555    (170, true, true),
556    (171, true, true),
557    (172, true, true),
558    (173, true, true),
559    (174, true, true),
560    (175, true, true),
561    (176, true, true),
562    (177, true, true),
563    (178, true, true),
564    (179, true, true),
565    (180, true, true),
566    (181, true, true),
567    (182, true, true),
568    (183, true, true),
569    (184, true, true),
570    (185, true, true),
571    (186, true, true),
572    (187, true, true),
573    (188, true, true),
574    (189, false, false),
575    (190, true, true),
576    (191, true, true),
577    (192, true, true),
578    (193, true, true),
579    (194, true, true),
580    (195, true, true),
581    (196, true, true),
582    (197, true, true),
583    (198, true, true),
584    (199, true, true),
585    (200, false, false),
586    (201, false, false),
587    (202, false, false),
588    (203, false, false),
589    (204, true, true),
590    (205, true, true),
591    (206, true, true),
592    (207, true, true),
593    (208, true, true),
594    (209, true, true),
595    (210, true, true),
596    (211, true, true),
597    (212, true, true),
598    (213, true, true),
599    (214, false, false),
600    (215, false, false),
601    (216, false, false),
602    (217, false, false),
603    (218, false, false),
604    (219, true, true),
605    (220, true, true),
606    (221, true, true),
607    (222, true, true),
608    (223, true, true),
609    (224, true, true),
610    (225, true, true),
611    (226, true, true),
612    (227, true, true),
613    (228, true, true),
614    (229, true, true),
615    (230, true, true),
616    (231, true, true),
617    (232, true, true),
618    (233, true, true),
619    (234, true, true),
620    (235, true, true),
621    (236, true, true),
622    (237, true, true),
623    (238, true, true),
624    (239, true, true),
625    (240, true, true),
626    (241, true, true),
627    (242, true, true),
628    (243, true, true),
629    (244, true, true),
630    (245, false, false),
631    (246, true, true),
632    (247, true, true),
633    (248, true, true),
634    (249, true, true),
635    (250, true, true),
636    (251, true, true),
637    (252, false, false),
638    (253, true, true),
639    (254, false, false),
640    (255, true, true),
641    (256, true, true),
642    (257, true, true),
643    (258, true, true),
644    (259, true, true),
645    (260, true, true),
646    (261, true, true),
647    (262, false, false),
648    (263, false, false),
649    (264, true, true),
650    (265, true, true),
651    (266, true, true),
652    (267, true, true),
653    (268, true, true),
654    (269, true, true),
655    (270, true, true),
656    (271, true, true),
657    (272, true, true),
658    (273, true, true),
659    (274, false, false),
660    (275, true, true),
661    (276, true, true),
662    (277, true, true),
663    (278, true, true),
664    (279, true, true),
665    (280, true, true),
666    (281, true, true),
667    (282, true, true),
668    (283, false, false),
669    (284, false, false),
670    (285, true, true),
671    (286, true, true),
672    (287, true, true),
673    (288, true, true),
674    (289, true, true),
675    (290, true, true),
676    (291, true, true),
677    (292, true, true),
678    (293, true, true),
679    (294, true, true),
680    (295, true, true),
681    (296, true, true),
682    (297, true, true),
683    (298, true, true),
684    (299, true, true),
685    (300, true, true),
686    (301, true, true),
687    (302, true, true),
688    (303, true, true),
689    (304, true, true),
690    (305, true, true),
691    (306, true, true),
692    (307, true, true),
693    (308, true, true),
694    (309, true, true),
695    (310, true, true),
696    (311, true, true),
697    (312, true, true),
698    (313, true, true),
699    (314, true, true),
700    (315, true, true),
701    (316, true, true),
702    (317, true, true),
703    (318, true, true),
704    (319, true, true),
705    (320, true, true),
706    (321, true, true),
707    (322, false, false),
708    (323, true, true),
709    (324, false, false),
710    (325, false, false),
711    (326, false, false),
712    (327, false, false),
713    (328, false, false),
714    (329, false, false),
715    (330, false, false),
716    (331, false, false),
717    (332, false, false),
718    (333, false, false),
719    (334, false, false),
720    (335, false, false),
721    (336, false, false),
722    (337, false, false),
723    (338, false, false),
724    (339, false, false),
725    (340, false, false),
726    (341, false, false),
727    (342, false, false),
728    (343, false, false),
729    (344, false, false),
730    (345, false, false),
731    (346, false, false),
732    (347, false, false),
733    (348, false, false),
734    (349, false, false),
735    (350, false, false),
736    (351, false, false),
737    (352, false, false),
738    (353, false, false),
739    (354, false, false),
740    (355, false, false),
741    (356, false, false),
742    (357, false, false),
743    (358, false, false),
744    (359, false, false),
745    (360, true, true),
746    (361, true, true),
747    (362, true, true),
748];
749
750impl From<C> for &'static str {
751    #[inline]
752    fn from(tok: C) -> Self {
753        match tok {
754            C::End => "end",
755            C::Identifier => "identifier",
756            C::HASHinclude => "#include",
757            C::PreprocIncludeToken2 => "preproc_include_token2",
758            C::HASHdefine => "#define",
759            C::LPAREN => "(",
760            C::DOTDOTDOT => "...",
761            C::COMMA => ",",
762            C::RPAREN => ")",
763            C::HASHif => "#if",
764            C::LF => "\n",
765            C::HASHendif => "#endif",
766            C::HASHifdef => "#ifdef",
767            C::HASHifndef => "#ifndef",
768            C::HASHelse => "#else",
769            C::HASHelif => "#elif",
770            C::HASHelifdef => "#elifdef",
771            C::HASHelifndef => "#elifndef",
772            C::PreprocArg => "preproc_arg",
773            C::PreprocDirective => "preproc_directive",
774            C::LPAREN2 => "(",
775            C::Defined => "defined",
776            C::BANG => "!",
777            C::TILDE => "~",
778            C::DASH => "-",
779            C::PLUS => "+",
780            C::STAR => "*",
781            C::SLASH => "/",
782            C::PERCENT => "%",
783            C::PIPEPIPE => "||",
784            C::AMPAMP => "&&",
785            C::PIPE => "|",
786            C::CARET => "^",
787            C::AMP => "&",
788            C::EQEQ => "==",
789            C::BANGEQ => "!=",
790            C::GT => ">",
791            C::GTEQ => ">=",
792            C::LTEQ => "<=",
793            C::LT => "<",
794            C::LTLT => "<<",
795            C::GTGT => ">>",
796            C::SEMI => ";",
797            C::Extension => "__extension__",
798            C::Typedef => "typedef",
799            C::Extern => "extern",
800            C::Attribute2 => "__attribute__",
801            C::Attribute3 => "__attribute",
802            C::COLONCOLON => "::",
803            C::LBRACKLBRACK => "[[",
804            C::RBRACKRBRACK => "]]",
805            C::Declspec => "__declspec",
806            C::Based => "__based",
807            C::Cdecl => "__cdecl",
808            C::Clrcall => "__clrcall",
809            C::Stdcall => "__stdcall",
810            C::Fastcall => "__fastcall",
811            C::Thiscall => "__thiscall",
812            C::Vectorcall => "__vectorcall",
813            C::MsRestrictModifier => "ms_restrict_modifier",
814            C::MsUnsignedPtrModifier => "ms_unsigned_ptr_modifier",
815            C::MsSignedPtrModifier => "ms_signed_ptr_modifier",
816            C::Unaligned => "_unaligned",
817            C::Unaligned2 => "__unaligned",
818            C::LBRACE => "{",
819            C::RBRACE => "}",
820            C::Signed => "signed",
821            C::Unsigned => "unsigned",
822            C::Long => "long",
823            C::Short => "short",
824            C::LBRACK => "[",
825            C::Static => "static",
826            C::RBRACK => "]",
827            C::EQ => "=",
828            C::Auto => "auto",
829            C::Register => "register",
830            C::Inline => "inline",
831            C::Inline2 => "__inline",
832            C::Inline3 => "__inline__",
833            C::Forceinline => "__forceinline",
834            C::ThreadLocal => "thread_local",
835            C::Thread => "__thread",
836            C::Const => "const",
837            C::Constexpr => "constexpr",
838            C::Volatile => "volatile",
839            C::Restrict => "restrict",
840            C::Restrict2 => "__restrict__",
841            C::Atomic => "_Atomic",
842            C::Noreturn => "_Noreturn",
843            C::Noreturn2 => "noreturn",
844            C::Nonnull => "_Nonnull",
845            C::Alignas => "alignas",
846            C::Alignas2 => "_Alignas",
847            C::PrimitiveType => "primitive_type",
848            C::Enum => "enum",
849            C::COLON => ":",
850            C::Struct => "struct",
851            C::Union => "union",
852            C::If => "if",
853            C::Else => "else",
854            C::Switch => "switch",
855            C::Case => "case",
856            C::Default => "default",
857            C::While => "while",
858            C::Do => "do",
859            C::For => "for",
860            C::Return => "return",
861            C::Break => "break",
862            C::Continue => "continue",
863            C::Goto => "goto",
864            C::Try => "__try",
865            C::Except => "__except",
866            C::Finally => "__finally",
867            C::Leave => "__leave",
868            C::QMARK => "?",
869            C::STAREQ => "*=",
870            C::SLASHEQ => "/=",
871            C::PERCENTEQ => "%=",
872            C::PLUSEQ => "+=",
873            C::DASHEQ => "-=",
874            C::LTLTEQ => "<<=",
875            C::GTGTEQ => ">>=",
876            C::AMPEQ => "&=",
877            C::CARETEQ => "^=",
878            C::PIPEEQ => "|=",
879            C::DASHDASH => "--",
880            C::PLUSPLUS => "++",
881            C::Sizeof => "sizeof",
882            C::Alignof => "__alignof__",
883            C::Alignof2 => "__alignof",
884            C::Alignof3 => "_alignof",
885            C::Alignof4 => "alignof",
886            C::Alignof5 => "_Alignof",
887            C::Offsetof => "offsetof",
888            C::Generic => "_Generic",
889            C::Asm => "asm",
890            C::Asm2 => "__asm__",
891            C::Asm3 => "__asm",
892            C::Volatile2 => "__volatile__",
893            C::DOT => ".",
894            C::DASHGT => "->",
895            C::NumberLiteral => "number_literal",
896            C::LSQUOTE => "L'",
897            C::USQUOTE => "u'",
898            C::USQUOTE2 => "U'",
899            C::U8SQUOTE => "u8'",
900            C::SQUOTE => "'",
901            C::Character => "character",
902            C::LDQUOTE => "L\"",
903            C::UDQUOTE => "u\"",
904            C::UDQUOTE2 => "U\"",
905            C::U8DQUOTE => "u8\"",
906            C::DQUOTE => "\"",
907            C::StringContent => "string_content",
908            C::EscapeSequence => "escape_sequence",
909            C::SystemLibString => "system_lib_string",
910            C::True => "true",
911            C::False => "false",
912            C::NULL => "NULL",
913            C::Nullptr => "nullptr",
914            C::Comment => "comment",
915            C::TranslationUnit => "translation_unit",
916            C::TopLevelItem => "_top_level_item",
917            C::BlockItem => "_block_item",
918            C::PreprocInclude => "preproc_include",
919            C::PreprocDef => "preproc_def",
920            C::PreprocFunctionDef => "preproc_function_def",
921            C::PreprocParams => "preproc_params",
922            C::PreprocCall => "preproc_call",
923            C::PreprocIf => "preproc_if",
924            C::PreprocIfdef => "preproc_ifdef",
925            C::PreprocElse => "preproc_else",
926            C::PreprocElif => "preproc_elif",
927            C::PreprocElifdef => "preproc_elifdef",
928            C::PreprocIf2 => "preproc_if",
929            C::PreprocIfdef2 => "preproc_ifdef",
930            C::PreprocElse2 => "preproc_else",
931            C::PreprocElif2 => "preproc_elif",
932            C::PreprocElifdef2 => "preproc_elifdef",
933            C::PreprocIf3 => "preproc_if",
934            C::PreprocIfdef3 => "preproc_ifdef",
935            C::PreprocElse3 => "preproc_else",
936            C::PreprocElif3 => "preproc_elif",
937            C::PreprocElifdef3 => "preproc_elifdef",
938            C::PreprocIf4 => "preproc_if",
939            C::PreprocIfdef4 => "preproc_ifdef",
940            C::PreprocElse4 => "preproc_else",
941            C::PreprocElif4 => "preproc_elif",
942            C::PreprocElifdef4 => "preproc_elifdef",
943            C::PreprocExpression => "_preproc_expression",
944            C::ParenthesizedExpression => "parenthesized_expression",
945            C::PreprocDefined => "preproc_defined",
946            C::UnaryExpression => "unary_expression",
947            C::CallExpression => "call_expression",
948            C::ArgumentList => "argument_list",
949            C::BinaryExpression => "binary_expression",
950            C::FunctionDefinition => "function_definition",
951            C::FunctionDefinition2 => "function_definition",
952            C::Declaration => "declaration",
953            C::TypeDefinition => "type_definition",
954            C::TypeDefinitionType => "_type_definition_type",
955            C::TypeDefinitionDeclarators => "_type_definition_declarators",
956            C::DeclarationModifiers => "_declaration_modifiers",
957            C::DeclarationSpecifiers => "_declaration_specifiers",
958            C::LinkageSpecification => "linkage_specification",
959            C::AttributeSpecifier => "attribute_specifier",
960            C::Attribute => "attribute",
961            C::AttributeDeclaration => "attribute_declaration",
962            C::MsDeclspecModifier => "ms_declspec_modifier",
963            C::MsBasedModifier => "ms_based_modifier",
964            C::MsCallModifier => "ms_call_modifier",
965            C::MsUnalignedPtrModifier => "ms_unaligned_ptr_modifier",
966            C::MsPointerModifier => "ms_pointer_modifier",
967            C::DeclarationList => "declaration_list",
968            C::Declarator => "_declarator",
969            C::DeclarationDeclarator => "_declaration_declarator",
970            C::FieldDeclarator => "_field_declarator",
971            C::TypeDeclarator => "_type_declarator",
972            C::AbstractDeclarator => "_abstract_declarator",
973            C::ParenthesizedDeclarator => "parenthesized_declarator",
974            C::ParenthesizedDeclarator2 => "parenthesized_declarator",
975            C::ParenthesizedDeclarator3 => "parenthesized_declarator",
976            C::AbstractParenthesizedDeclarator => "abstract_parenthesized_declarator",
977            C::AttributedDeclarator => "attributed_declarator",
978            C::AttributedDeclarator2 => "attributed_declarator",
979            C::AttributedDeclarator3 => "attributed_declarator",
980            C::PointerDeclarator => "pointer_declarator",
981            C::PointerDeclarator2 => "pointer_declarator",
982            C::PointerDeclarator3 => "pointer_declarator",
983            C::AbstractPointerDeclarator => "abstract_pointer_declarator",
984            C::FunctionDeclarator => "function_declarator",
985            C::FunctionDeclarator2 => "function_declarator",
986            C::FunctionDeclarator3 => "function_declarator",
987            C::FunctionDeclarator4 => "function_declarator",
988            C::AbstractFunctionDeclarator => "abstract_function_declarator",
989            C::FunctionDeclarator5 => "function_declarator",
990            C::ArrayDeclarator => "array_declarator",
991            C::ArrayDeclarator2 => "array_declarator",
992            C::ArrayDeclarator3 => "array_declarator",
993            C::AbstractArrayDeclarator => "abstract_array_declarator",
994            C::InitDeclarator => "init_declarator",
995            C::CompoundStatement => "compound_statement",
996            C::StorageClassSpecifier => "storage_class_specifier",
997            C::TypeQualifier => "type_qualifier",
998            C::AlignasQualifier => "alignas_qualifier",
999            C::TypeSpecifier => "type_specifier",
1000            C::SizedTypeSpecifier => "sized_type_specifier",
1001            C::EnumSpecifier => "enum_specifier",
1002            C::EnumeratorList => "enumerator_list",
1003            C::StructSpecifier => "struct_specifier",
1004            C::UnionSpecifier => "union_specifier",
1005            C::FieldDeclarationList => "field_declaration_list",
1006            C::FieldDeclarationListItem => "_field_declaration_list_item",
1007            C::FieldDeclaration => "field_declaration",
1008            C::FieldDeclarationDeclarator => "_field_declaration_declarator",
1009            C::BitfieldClause => "bitfield_clause",
1010            C::Enumerator => "enumerator",
1011            C::VariadicParameter => "variadic_parameter",
1012            C::ParameterList => "parameter_list",
1013            C::ParameterList2 => "parameter_list",
1014            C::ParameterDeclaration => "parameter_declaration",
1015            C::AttributedStatement => "attributed_statement",
1016            C::Statement => "statement",
1017            C::TopLevelStatement => "_top_level_statement",
1018            C::LabeledStatement => "labeled_statement",
1019            C::ExpressionStatement => "expression_statement",
1020            C::ExpressionStatement2 => "expression_statement",
1021            C::IfStatement => "if_statement",
1022            C::ElseClause => "else_clause",
1023            C::SwitchStatement => "switch_statement",
1024            C::CaseStatement => "case_statement",
1025            C::WhileStatement => "while_statement",
1026            C::DoStatement => "do_statement",
1027            C::ForStatement => "for_statement",
1028            C::ForStatementBody => "_for_statement_body",
1029            C::ReturnStatement => "return_statement",
1030            C::BreakStatement => "break_statement",
1031            C::ContinueStatement => "continue_statement",
1032            C::GotoStatement => "goto_statement",
1033            C::SehTryStatement => "seh_try_statement",
1034            C::SehExceptClause => "seh_except_clause",
1035            C::SehFinallyClause => "seh_finally_clause",
1036            C::SehLeaveStatement => "seh_leave_statement",
1037            C::Expression => "expression",
1038            C::String => "_string",
1039            C::CommaExpression => "comma_expression",
1040            C::ConditionalExpression => "conditional_expression",
1041            C::AssignmentExpression => "assignment_expression",
1042            C::PointerExpression => "pointer_expression",
1043            C::UnaryExpression2 => "unary_expression",
1044            C::BinaryExpression2 => "binary_expression",
1045            C::UpdateExpression => "update_expression",
1046            C::CastExpression => "cast_expression",
1047            C::TypeDescriptor => "type_descriptor",
1048            C::SizeofExpression => "sizeof_expression",
1049            C::AlignofExpression => "alignof_expression",
1050            C::OffsetofExpression => "offsetof_expression",
1051            C::GenericExpression => "generic_expression",
1052            C::SubscriptExpression => "subscript_expression",
1053            C::CallExpression2 => "call_expression",
1054            C::GnuAsmExpression => "gnu_asm_expression",
1055            C::GnuAsmQualifier => "gnu_asm_qualifier",
1056            C::GnuAsmOutputOperandList => "gnu_asm_output_operand_list",
1057            C::GnuAsmOutputOperand => "gnu_asm_output_operand",
1058            C::GnuAsmInputOperandList => "gnu_asm_input_operand_list",
1059            C::GnuAsmInputOperand => "gnu_asm_input_operand",
1060            C::GnuAsmClobberList => "gnu_asm_clobber_list",
1061            C::GnuAsmGotoList => "gnu_asm_goto_list",
1062            C::ExtensionExpression => "extension_expression",
1063            C::ArgumentList2 => "argument_list",
1064            C::FieldExpression => "field_expression",
1065            C::CompoundLiteralExpression => "compound_literal_expression",
1066            C::ParenthesizedExpression2 => "parenthesized_expression",
1067            C::InitializerList => "initializer_list",
1068            C::InitializerPair => "initializer_pair",
1069            C::SubscriptDesignator => "subscript_designator",
1070            C::SubscriptRangeDesignator => "subscript_range_designator",
1071            C::FieldDesignator => "field_designator",
1072            C::CharLiteral => "char_literal",
1073            C::ConcatenatedString => "concatenated_string",
1074            C::StringLiteral => "string_literal",
1075            C::Null => "null",
1076            C::EmptyDeclaration => "_empty_declaration",
1077            C::MacroTypeSpecifier => "macro_type_specifier",
1078            C::TranslationUnitRepeat1 => "translation_unit_repeat1",
1079            C::PreprocParamsRepeat1 => "preproc_params_repeat1",
1080            C::PreprocIfRepeat1 => "preproc_if_repeat1",
1081            C::PreprocIfInFieldDeclarationListRepeat1 => {
1082                "preproc_if_in_field_declaration_list_repeat1"
1083            }
1084            C::PreprocIfInEnumeratorListRepeat1 => "preproc_if_in_enumerator_list_repeat1",
1085            C::PreprocIfInEnumeratorListNoCommaRepeat1 => {
1086                "preproc_if_in_enumerator_list_no_comma_repeat1"
1087            }
1088            C::PreprocArgumentListRepeat1 => "preproc_argument_list_repeat1",
1089            C::OldStyleFunctionDefinitionRepeat1 => "_old_style_function_definition_repeat1",
1090            C::DeclarationRepeat1 => "declaration_repeat1",
1091            C::TypeDefinitionRepeat1 => "type_definition_repeat1",
1092            C::TypeDefinitionTypeRepeat1 => "_type_definition_type_repeat1",
1093            C::TypeDefinitionDeclaratorsRepeat1 => "_type_definition_declarators_repeat1",
1094            C::DeclarationSpecifiersRepeat1 => "_declaration_specifiers_repeat1",
1095            C::AttributeDeclarationRepeat1 => "attribute_declaration_repeat1",
1096            C::AttributedDeclaratorRepeat1 => "attributed_declarator_repeat1",
1097            C::PointerDeclaratorRepeat1 => "pointer_declarator_repeat1",
1098            C::FunctionDeclaratorRepeat1 => "function_declarator_repeat1",
1099            C::ArrayDeclaratorRepeat1 => "array_declarator_repeat1",
1100            C::SizedTypeSpecifierRepeat1 => "sized_type_specifier_repeat1",
1101            C::EnumeratorListRepeat1 => "enumerator_list_repeat1",
1102            C::FieldDeclarationDeclaratorRepeat1 => "_field_declaration_declarator_repeat1",
1103            C::ParameterListRepeat1 => "parameter_list_repeat1",
1104            C::OldStyleParameterListRepeat1 => "_old_style_parameter_list_repeat1",
1105            C::CaseStatementRepeat1 => "case_statement_repeat1",
1106            C::GenericExpressionRepeat1 => "generic_expression_repeat1",
1107            C::GnuAsmExpressionRepeat1 => "gnu_asm_expression_repeat1",
1108            C::GnuAsmOutputOperandListRepeat1 => "gnu_asm_output_operand_list_repeat1",
1109            C::GnuAsmInputOperandListRepeat1 => "gnu_asm_input_operand_list_repeat1",
1110            C::GnuAsmClobberListRepeat1 => "gnu_asm_clobber_list_repeat1",
1111            C::GnuAsmGotoListRepeat1 => "gnu_asm_goto_list_repeat1",
1112            C::ArgumentListRepeat1 => "argument_list_repeat1",
1113            C::InitializerListRepeat1 => "initializer_list_repeat1",
1114            C::InitializerPairRepeat1 => "initializer_pair_repeat1",
1115            C::CharLiteralRepeat1 => "char_literal_repeat1",
1116            C::ConcatenatedStringRepeat1 => "concatenated_string_repeat1",
1117            C::StringLiteralRepeat1 => "string_literal_repeat1",
1118            C::FieldIdentifier => "field_identifier",
1119            C::StatementIdentifier => "statement_identifier",
1120            C::TypeIdentifier => "type_identifier",
1121            C::Error => "ERROR",
1122        }
1123    }
1124}
1125
1126impl From<u16> for C {
1127    #[inline]
1128    fn from(x: u16) -> Self {
1129        num_traits::FromPrimitive::from_u16(x).unwrap_or(Self::Error)
1130    }
1131}
1132
1133// C == u16
1134impl PartialEq<u16> for C {
1135    #[inline]
1136    fn eq(&self, x: &u16) -> bool {
1137        *self == Into::<Self>::into(*x)
1138    }
1139}
1140
1141// u16 == C
1142impl PartialEq<C> for u16 {
1143    #[inline]
1144    fn eq(&self, x: &C) -> bool {
1145        *x == *self
1146    }
1147}