1 | #ifndef ID_KIND_ASDL_H
|
2 | #define ID_KIND_ASDL_H
|
3 |
|
4 | #include <stdint.h> // uint16_t
|
5 |
|
6 | class BigStr;
|
7 |
|
8 | namespace id_kind_asdl {
|
9 |
|
10 | #define ASDL_NAMES struct
|
11 | ASDL_NAMES Id {
|
12 | enum no_name {
|
13 | Word_Compound = 1,
|
14 | Arith_Semi = 2,
|
15 | Arith_Comma = 3,
|
16 | Arith_Plus = 4,
|
17 | Arith_Minus = 5,
|
18 | Arith_Star = 6,
|
19 | Arith_Slash = 7,
|
20 | Arith_Percent = 8,
|
21 | Arith_DPlus = 9,
|
22 | Arith_DMinus = 10,
|
23 | Arith_DStar = 11,
|
24 | Arith_LParen = 12,
|
25 | Arith_RParen = 13,
|
26 | Arith_LBracket = 14,
|
27 | Arith_RBracket = 15,
|
28 | Arith_RBrace = 16,
|
29 | Arith_QMark = 17,
|
30 | Arith_Colon = 18,
|
31 | Arith_LessEqual = 19,
|
32 | Arith_Less = 20,
|
33 | Arith_GreatEqual = 21,
|
34 | Arith_Great = 22,
|
35 | Arith_DEqual = 23,
|
36 | Arith_NEqual = 24,
|
37 | Arith_DAmp = 25,
|
38 | Arith_DPipe = 26,
|
39 | Arith_Bang = 27,
|
40 | Arith_DGreat = 28,
|
41 | Arith_DLess = 29,
|
42 | Arith_Amp = 30,
|
43 | Arith_Pipe = 31,
|
44 | Arith_Caret = 32,
|
45 | Arith_Tilde = 33,
|
46 | Arith_Equal = 34,
|
47 | Arith_PlusEqual = 35,
|
48 | Arith_MinusEqual = 36,
|
49 | Arith_StarEqual = 37,
|
50 | Arith_SlashEqual = 38,
|
51 | Arith_PercentEqual = 39,
|
52 | Arith_DGreatEqual = 40,
|
53 | Arith_DLessEqual = 41,
|
54 | Arith_AmpEqual = 42,
|
55 | Arith_CaretEqual = 43,
|
56 | Arith_PipeEqual = 44,
|
57 | Eof_Real = 45,
|
58 | Eof_RParen = 46,
|
59 | Eof_Backtick = 47,
|
60 | Undefined_Tok = 48,
|
61 | Unknown_Tok = 49,
|
62 | Unknown_Backslash = 50,
|
63 | Unknown_DEqual = 51,
|
64 | Eol_Tok = 52,
|
65 | Ignored_LineCont = 53,
|
66 | Ignored_Space = 54,
|
67 | Ignored_Comment = 55,
|
68 | Ignored_Newline = 56,
|
69 | WS_Space = 57,
|
70 | Lit_Chars = 58,
|
71 | Lit_CharsWithoutPrefix = 59,
|
72 | Lit_VarLike = 60,
|
73 | Lit_ArrayLhsOpen = 61,
|
74 | Lit_ArrayLhsClose = 62,
|
75 | Lit_Splice = 63,
|
76 | Lit_AtLBracket = 64,
|
77 | Lit_AtLBraceDot = 65,
|
78 | Lit_Other = 66,
|
79 | Lit_EscapedChar = 67,
|
80 | Lit_LBracket = 68,
|
81 | Lit_RBracket = 69,
|
82 | Lit_Star = 70,
|
83 | Lit_QMark = 71,
|
84 | Lit_LBrace = 72,
|
85 | Lit_RBrace = 73,
|
86 | Lit_Comma = 74,
|
87 | Lit_Equals = 75,
|
88 | Lit_Dollar = 76,
|
89 | Lit_DRightBracket = 77,
|
90 | Lit_Tilde = 78,
|
91 | Lit_Pound = 79,
|
92 | Lit_TPound = 80,
|
93 | Lit_TDot = 81,
|
94 | Lit_Slash = 82,
|
95 | Lit_Percent = 83,
|
96 | Lit_Colon = 84,
|
97 | Lit_Digits = 85,
|
98 | Lit_At = 86,
|
99 | Lit_ArithVarLike = 87,
|
100 | Lit_BadBackslash = 88,
|
101 | Lit_CompDummy = 89,
|
102 | Backtick_Right = 90,
|
103 | Backtick_Quoted = 91,
|
104 | Backtick_DoubleQuote = 92,
|
105 | Backtick_Other = 93,
|
106 | History_Op = 94,
|
107 | History_Num = 95,
|
108 | History_Search = 96,
|
109 | History_Other = 97,
|
110 | Op_Newline = 98,
|
111 | Op_Amp = 99,
|
112 | Op_Pipe = 100,
|
113 | Op_PipeAmp = 101,
|
114 | Op_DAmp = 102,
|
115 | Op_DPipe = 103,
|
116 | Op_Semi = 104,
|
117 | Op_DSemi = 105,
|
118 | Op_SemiAmp = 106,
|
119 | Op_DSemiAmp = 107,
|
120 | Op_LParen = 108,
|
121 | Op_RParen = 109,
|
122 | Op_DLeftParen = 110,
|
123 | Op_DRightParen = 111,
|
124 | Op_Less = 112,
|
125 | Op_Great = 113,
|
126 | Op_Bang = 114,
|
127 | Op_LBracket = 115,
|
128 | Op_RBracket = 116,
|
129 | Op_LBrace = 117,
|
130 | Op_RBrace = 118,
|
131 | Expr_Reserved = 119,
|
132 | Expr_Symbol = 120,
|
133 | Expr_Name = 121,
|
134 | Expr_DecInt = 122,
|
135 | Expr_BinInt = 123,
|
136 | Expr_OctInt = 124,
|
137 | Expr_HexInt = 125,
|
138 | Expr_Float = 126,
|
139 | Expr_Bang = 127,
|
140 | Expr_Dot = 128,
|
141 | Expr_DDot = 129,
|
142 | Expr_Colon = 130,
|
143 | Expr_RArrow = 131,
|
144 | Expr_RDArrow = 132,
|
145 | Expr_DSlash = 133,
|
146 | Expr_TEqual = 134,
|
147 | Expr_NotDEqual = 135,
|
148 | Expr_TildeDEqual = 136,
|
149 | Expr_At = 137,
|
150 | Expr_DoubleAt = 138,
|
151 | Expr_Ellipsis = 139,
|
152 | Expr_Dollar = 140,
|
153 | Expr_NotTilde = 141,
|
154 | Expr_DTilde = 142,
|
155 | Expr_NotDTilde = 143,
|
156 | Expr_DStarEqual = 144,
|
157 | Expr_DSlashEqual = 145,
|
158 | Expr_CastedDummy = 146,
|
159 | Expr_Null = 147,
|
160 | Expr_True = 148,
|
161 | Expr_False = 149,
|
162 | Expr_And = 150,
|
163 | Expr_Or = 151,
|
164 | Expr_Not = 152,
|
165 | Expr_For = 153,
|
166 | Expr_Is = 154,
|
167 | Expr_In = 155,
|
168 | Expr_If = 156,
|
169 | Expr_Else = 157,
|
170 | Expr_Func = 158,
|
171 | Expr_Capture = 159,
|
172 | Expr_As = 160,
|
173 | Char_OneChar = 161,
|
174 | Char_Stop = 162,
|
175 | Char_Hex = 163,
|
176 | Char_YHex = 164,
|
177 | Char_Octal3 = 165,
|
178 | Char_Octal4 = 166,
|
179 | Char_Unicode4 = 167,
|
180 | Char_SurrogatePair = 168,
|
181 | Char_Unicode8 = 169,
|
182 | Char_UBraced = 170,
|
183 | Char_Pound = 171,
|
184 | Char_AsciiControl = 172,
|
185 | BashRegex_LParen = 173,
|
186 | BashRegex_AllowedInParens = 174,
|
187 | Eggex_Start = 175,
|
188 | Eggex_End = 176,
|
189 | Eggex_Dot = 177,
|
190 | Redir_Less = 178,
|
191 | Redir_Great = 179,
|
192 | Redir_DLess = 180,
|
193 | Redir_TLess = 181,
|
194 | Redir_DGreat = 182,
|
195 | Redir_GreatAnd = 183,
|
196 | Redir_LessAnd = 184,
|
197 | Redir_DLessDash = 185,
|
198 | Redir_LessGreat = 186,
|
199 | Redir_Clobber = 187,
|
200 | Redir_AndGreat = 188,
|
201 | Redir_AndDGreat = 189,
|
202 | Left_DoubleQuote = 190,
|
203 | Left_JDoubleQuote = 191,
|
204 | Left_SingleQuote = 192,
|
205 | Left_DollarSingleQuote = 193,
|
206 | Left_RSingleQuote = 194,
|
207 | Left_USingleQuote = 195,
|
208 | Left_BSingleQuote = 196,
|
209 | Left_TDoubleQuote = 197,
|
210 | Left_DollarTDoubleQuote = 198,
|
211 | Left_TSingleQuote = 199,
|
212 | Left_RTSingleQuote = 200,
|
213 | Left_UTSingleQuote = 201,
|
214 | Left_BTSingleQuote = 202,
|
215 | Left_Backtick = 203,
|
216 | Left_DollarParen = 204,
|
217 | Left_DollarBrace = 205,
|
218 | Left_DollarBraceZsh = 206,
|
219 | Left_DollarDParen = 207,
|
220 | Left_DollarBracket = 208,
|
221 | Left_DollarDoubleQuote = 209,
|
222 | Left_ProcSubIn = 210,
|
223 | Left_ProcSubOut = 211,
|
224 | Left_AtParen = 212,
|
225 | Left_CaretParen = 213,
|
226 | Left_CaretBracket = 214,
|
227 | Left_CaretBrace = 215,
|
228 | Left_CaretDoubleQuote = 216,
|
229 | Left_ColonPipe = 217,
|
230 | Left_PercentParen = 218,
|
231 | Right_DoubleQuote = 219,
|
232 | Right_SingleQuote = 220,
|
233 | Right_Backtick = 221,
|
234 | Right_DollarBrace = 222,
|
235 | Right_DollarDParen = 223,
|
236 | Right_DollarDoubleQuote = 224,
|
237 | Right_DollarSingleQuote = 225,
|
238 | Right_Subshell = 226,
|
239 | Right_ShFunction = 227,
|
240 | Right_CasePat = 228,
|
241 | Right_ShArrayLiteral = 229,
|
242 | Right_ExtGlob = 230,
|
243 | Right_BashRegexGroup = 231,
|
244 | Right_BlockLiteral = 232,
|
245 | ExtGlob_Comma = 233,
|
246 | ExtGlob_At = 234,
|
247 | ExtGlob_Star = 235,
|
248 | ExtGlob_Plus = 236,
|
249 | ExtGlob_QMark = 237,
|
250 | ExtGlob_Bang = 238,
|
251 | VSub_DollarName = 239,
|
252 | VSub_Name = 240,
|
253 | VSub_Number = 241,
|
254 | VSub_Bang = 242,
|
255 | VSub_At = 243,
|
256 | VSub_Pound = 244,
|
257 | VSub_Dollar = 245,
|
258 | VSub_Star = 246,
|
259 | VSub_Hyphen = 247,
|
260 | VSub_QMark = 248,
|
261 | VSub_Dot = 249,
|
262 | VTest_ColonHyphen = 250,
|
263 | VTest_Hyphen = 251,
|
264 | VTest_ColonEquals = 252,
|
265 | VTest_Equals = 253,
|
266 | VTest_ColonQMark = 254,
|
267 | VTest_QMark = 255,
|
268 | VTest_ColonPlus = 256,
|
269 | VTest_Plus = 257,
|
270 | VOp0_Q = 258,
|
271 | VOp0_E = 259,
|
272 | VOp0_P = 260,
|
273 | VOp0_A = 261,
|
274 | VOp0_a = 262,
|
275 | VOp1_Percent = 263,
|
276 | VOp1_DPercent = 264,
|
277 | VOp1_Pound = 265,
|
278 | VOp1_DPound = 266,
|
279 | VOp1_Caret = 267,
|
280 | VOp1_DCaret = 268,
|
281 | VOp1_Comma = 269,
|
282 | VOp1_DComma = 270,
|
283 | VOpYsh_Pipe = 271,
|
284 | VOpYsh_Space = 272,
|
285 | VOp2_Slash = 273,
|
286 | VOp2_Colon = 274,
|
287 | VOp2_LBracket = 275,
|
288 | VOp2_RBracket = 276,
|
289 | VOp3_At = 277,
|
290 | VOp3_Star = 278,
|
291 | Node_PostDPlus = 279,
|
292 | Node_PostDMinus = 280,
|
293 | Node_UnaryPlus = 281,
|
294 | Node_UnaryMinus = 282,
|
295 | Node_NotIn = 283,
|
296 | Node_IsNot = 284,
|
297 | KW_DLeftBracket = 285,
|
298 | KW_Bang = 286,
|
299 | KW_For = 287,
|
300 | KW_While = 288,
|
301 | KW_Until = 289,
|
302 | KW_Do = 290,
|
303 | KW_Done = 291,
|
304 | KW_In = 292,
|
305 | KW_Case = 293,
|
306 | KW_Esac = 294,
|
307 | KW_If = 295,
|
308 | KW_Fi = 296,
|
309 | KW_Then = 297,
|
310 | KW_Else = 298,
|
311 | KW_Elif = 299,
|
312 | KW_Function = 300,
|
313 | KW_Time = 301,
|
314 | KW_Const = 302,
|
315 | KW_Var = 303,
|
316 | KW_SetVar = 304,
|
317 | KW_SetGlobal = 305,
|
318 | KW_Call = 306,
|
319 | KW_Proc = 307,
|
320 | KW_Typed = 308,
|
321 | KW_Func = 309,
|
322 | ControlFlow_Break = 310,
|
323 | ControlFlow_Continue = 311,
|
324 | ControlFlow_Return = 312,
|
325 | ControlFlow_Exit = 313,
|
326 | LookAhead_FuncParens = 314,
|
327 | Glob_LBracket = 315,
|
328 | Glob_RBracket = 316,
|
329 | Glob_Star = 317,
|
330 | Glob_QMark = 318,
|
331 | Glob_Bang = 319,
|
332 | Glob_Caret = 320,
|
333 | Glob_EscapedChar = 321,
|
334 | Glob_BadBackslash = 322,
|
335 | Glob_CleanLiterals = 323,
|
336 | Glob_OtherLiteral = 324,
|
337 | Format_EscapedPercent = 325,
|
338 | Format_Percent = 326,
|
339 | Format_Flag = 327,
|
340 | Format_Num = 328,
|
341 | Format_Dot = 329,
|
342 | Format_Type = 330,
|
343 | Format_Star = 331,
|
344 | Format_Time = 332,
|
345 | Format_Zero = 333,
|
346 | PS_Subst = 334,
|
347 | PS_Octal3 = 335,
|
348 | PS_LBrace = 336,
|
349 | PS_RBrace = 337,
|
350 | PS_Literals = 338,
|
351 | PS_BadBackslash = 339,
|
352 | Range_Int = 340,
|
353 | Range_Char = 341,
|
354 | Range_Dots = 342,
|
355 | Range_Other = 343,
|
356 | J8_LBracket = 344,
|
357 | J8_RBracket = 345,
|
358 | J8_LBrace = 346,
|
359 | J8_RBrace = 347,
|
360 | J8_Comma = 348,
|
361 | J8_Colon = 349,
|
362 | J8_Null = 350,
|
363 | J8_Bool = 351,
|
364 | J8_Int = 352,
|
365 | J8_Float = 353,
|
366 | J8_String = 354,
|
367 | J8_Identifier = 355,
|
368 | J8_Newline = 356,
|
369 | J8_Tab = 357,
|
370 | J8_LParen = 358,
|
371 | J8_RParen = 359,
|
372 | J8_Operator = 360,
|
373 | ShNumber_Dec = 361,
|
374 | ShNumber_Hex = 362,
|
375 | ShNumber_Oct = 363,
|
376 | ShNumber_BaseN = 364,
|
377 | BoolUnary_z = 365,
|
378 | BoolUnary_n = 366,
|
379 | BoolUnary_o = 367,
|
380 | BoolUnary_t = 368,
|
381 | BoolUnary_v = 369,
|
382 | BoolUnary_R = 370,
|
383 | BoolUnary_a = 371,
|
384 | BoolUnary_b = 372,
|
385 | BoolUnary_c = 373,
|
386 | BoolUnary_d = 374,
|
387 | BoolUnary_e = 375,
|
388 | BoolUnary_f = 376,
|
389 | BoolUnary_g = 377,
|
390 | BoolUnary_h = 378,
|
391 | BoolUnary_k = 379,
|
392 | BoolUnary_L = 380,
|
393 | BoolUnary_p = 381,
|
394 | BoolUnary_r = 382,
|
395 | BoolUnary_s = 383,
|
396 | BoolUnary_S = 384,
|
397 | BoolUnary_u = 385,
|
398 | BoolUnary_w = 386,
|
399 | BoolUnary_x = 387,
|
400 | BoolUnary_O = 388,
|
401 | BoolUnary_G = 389,
|
402 | BoolUnary_N = 390,
|
403 | BoolUnary_true = 391,
|
404 | BoolUnary_false = 392,
|
405 | BoolBinary_GlobEqual = 393,
|
406 | BoolBinary_GlobDEqual = 394,
|
407 | BoolBinary_GlobNEqual = 395,
|
408 | BoolBinary_EqualTilde = 396,
|
409 | BoolBinary_ef = 397,
|
410 | BoolBinary_nt = 398,
|
411 | BoolBinary_ot = 399,
|
412 | BoolBinary_eq = 400,
|
413 | BoolBinary_ne = 401,
|
414 | BoolBinary_gt = 402,
|
415 | BoolBinary_ge = 403,
|
416 | BoolBinary_lt = 404,
|
417 | BoolBinary_le = 405,
|
418 | BoolBinary_Equal = 406,
|
419 | BoolBinary_DEqual = 407,
|
420 | BoolBinary_NEqual = 408,
|
421 | ARRAY_SIZE = 409,
|
422 | };
|
423 | };
|
424 |
|
425 | BigStr* Id_str(int tag, bool dot = true);
|
426 |
|
427 | typedef uint16_t Id_t;
|
428 |
|
429 | enum class Kind {
|
430 | Word = 1,
|
431 | Arith = 2,
|
432 | Eof = 3,
|
433 | Undefined = 4,
|
434 | Unknown = 5,
|
435 | Eol = 6,
|
436 | Ignored = 7,
|
437 | WS = 8,
|
438 | Lit = 9,
|
439 | Backtick = 10,
|
440 | History = 11,
|
441 | Op = 12,
|
442 | Expr = 13,
|
443 | Char = 14,
|
444 | BashRegex = 15,
|
445 | Eggex = 16,
|
446 | Redir = 17,
|
447 | Left = 18,
|
448 | Right = 19,
|
449 | ExtGlob = 20,
|
450 | VSub = 21,
|
451 | VTest = 22,
|
452 | VOp0 = 23,
|
453 | VOp1 = 24,
|
454 | VOpYsh = 25,
|
455 | VOp2 = 26,
|
456 | VOp3 = 27,
|
457 | Node = 28,
|
458 | KW = 29,
|
459 | ControlFlow = 30,
|
460 | LookAhead = 31,
|
461 | Glob = 32,
|
462 | Format = 33,
|
463 | PS = 34,
|
464 | Range = 35,
|
465 | J8 = 36,
|
466 | ShNumber = 37,
|
467 | BoolUnary = 38,
|
468 | BoolBinary = 39,
|
469 | };
|
470 | typedef Kind Kind_t;
|
471 |
|
472 | BigStr* Kind_str(Kind tag, bool dot = true);
|
473 |
|
474 |
|
475 | } // namespace id_kind_asdl
|
476 |
|
477 | #endif // ID_KIND_ASDL_H
|