OILS / _gen / frontend / id_kind.asdl.h View on Github | oilshell.org

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