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

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