OILS / _devbuild / gen / id_kind_asdl.py View on Github | oils.pub

952 lines, 940 significant
1from asdl import pybase
2from mycpp import mops
3from typing import Optional, List, Tuple, Dict, Any, cast, TYPE_CHECKING
4
5from asdl import runtime # For runtime.NO_SPID
6from asdl.runtime import NewRecord, NewLeaf, TraversalState
7from _devbuild.gen.hnode_asdl import color_e, hnode, hnode_e, hnode_t, Field
8
9Id_t = int # type alias for integer
10
11class Id(object):
12 Word_Compound = 1
13 Arith_Semi = 2
14 Arith_Comma = 3
15 Arith_Plus = 4
16 Arith_Minus = 5
17 Arith_Star = 6
18 Arith_Slash = 7
19 Arith_Percent = 8
20 Arith_DPlus = 9
21 Arith_DMinus = 10
22 Arith_DStar = 11
23 Arith_LParen = 12
24 Arith_RParen = 13
25 Arith_LBracket = 14
26 Arith_RBracket = 15
27 Arith_RBrace = 16
28 Arith_QMark = 17
29 Arith_Colon = 18
30 Arith_LessEqual = 19
31 Arith_Less = 20
32 Arith_GreatEqual = 21
33 Arith_Great = 22
34 Arith_DEqual = 23
35 Arith_NEqual = 24
36 Arith_DAmp = 25
37 Arith_DPipe = 26
38 Arith_Bang = 27
39 Arith_DGreat = 28
40 Arith_DLess = 29
41 Arith_Amp = 30
42 Arith_Pipe = 31
43 Arith_Caret = 32
44 Arith_Tilde = 33
45 Arith_Equal = 34
46 Arith_PlusEqual = 35
47 Arith_MinusEqual = 36
48 Arith_StarEqual = 37
49 Arith_SlashEqual = 38
50 Arith_PercentEqual = 39
51 Arith_DGreatEqual = 40
52 Arith_DLessEqual = 41
53 Arith_AmpEqual = 42
54 Arith_CaretEqual = 43
55 Arith_PipeEqual = 44
56 Eof_Real = 45
57 Eof_RParen = 46
58 Eof_Backtick = 47
59 Undefined_Tok = 48
60 Unknown_Tok = 49
61 Unknown_Backslash = 50
62 Unknown_DEqual = 51
63 Unknown_DAmp = 52
64 Unknown_DPipe = 53
65 Unknown_DDot = 54
66 Eol_Tok = 55
67 Ignored_LineCont = 56
68 Ignored_Space = 57
69 Ignored_Comment = 58
70 Ignored_Newline = 59
71 WS_Space = 60
72 Lit_Chars = 61
73 Lit_CharsWithoutPrefix = 62
74 Lit_VarLike = 63
75 Lit_ArrayLhsOpen = 64
76 Lit_ArrayLhsClose = 65
77 Lit_Splice = 66
78 Lit_AtLBracket = 67
79 Lit_AtLBraceDot = 68
80 Lit_Other = 69
81 Lit_EscapedChar = 70
82 Lit_BackslashDoubleQuote = 71
83 Lit_LBracket = 72
84 Lit_RBracket = 73
85 Lit_Star = 74
86 Lit_QMark = 75
87 Lit_LBrace = 76
88 Lit_RBrace = 77
89 Lit_Comma = 78
90 Lit_Equals = 79
91 Lit_Dollar = 80
92 Lit_DRightBracket = 81
93 Lit_Tilde = 82
94 Lit_Pound = 83
95 Lit_TPound = 84
96 Lit_TDot = 85
97 Lit_Slash = 86
98 Lit_Percent = 87
99 Lit_Colon = 88
100 Lit_Digits = 89
101 Lit_At = 90
102 Lit_ArithVarLike = 91
103 Lit_BadBackslash = 92
104 Lit_CompDummy = 93
105 Lit_Number = 94
106 Lit_RedirVarName = 95
107 Backtick_Right = 96
108 Backtick_Quoted = 97
109 Backtick_DoubleQuote = 98
110 Backtick_Other = 99
111 History_Op = 100
112 History_Num = 101
113 History_Search = 102
114 History_Other = 103
115 Op_Newline = 104
116 Op_Amp = 105
117 Op_Pipe = 106
118 Op_PipeAmp = 107
119 Op_DAmp = 108
120 Op_DPipe = 109
121 Op_Semi = 110
122 Op_DSemi = 111
123 Op_SemiAmp = 112
124 Op_DSemiAmp = 113
125 Op_LParen = 114
126 Op_RParen = 115
127 Op_DLeftParen = 116
128 Op_DRightParen = 117
129 Op_Less = 118
130 Op_Great = 119
131 Op_Bang = 120
132 Op_LBracket = 121
133 Op_RBracket = 122
134 Op_LBrace = 123
135 Op_RBrace = 124
136 Expr_Reserved = 125
137 Expr_Symbol = 126
138 Expr_Name = 127
139 Expr_DecInt = 128
140 Expr_BinInt = 129
141 Expr_OctInt = 130
142 Expr_HexInt = 131
143 Expr_Float = 132
144 Expr_Bang = 133
145 Expr_Dot = 134
146 Expr_DDotLessThan = 135
147 Expr_DDotEqual = 136
148 Expr_Colon = 137
149 Expr_RArrow = 138
150 Expr_RDArrow = 139
151 Expr_DSlash = 140
152 Expr_TEqual = 141
153 Expr_NotDEqual = 142
154 Expr_TildeDEqual = 143
155 Expr_At = 144
156 Expr_DoubleAt = 145
157 Expr_Ellipsis = 146
158 Expr_Dollar = 147
159 Expr_NotTilde = 148
160 Expr_DTilde = 149
161 Expr_NotDTilde = 150
162 Expr_DStarEqual = 151
163 Expr_DSlashEqual = 152
164 Expr_CastedDummy = 153
165 Expr_Null = 154
166 Expr_True = 155
167 Expr_False = 156
168 Expr_And = 157
169 Expr_Or = 158
170 Expr_Not = 159
171 Expr_For = 160
172 Expr_Is = 161
173 Expr_In = 162
174 Expr_If = 163
175 Expr_Else = 164
176 Expr_Capture = 165
177 Expr_As = 166
178 Expr_Func = 167
179 Expr_Proc = 168
180 Char_OneChar = 169
181 Char_Stop = 170
182 Char_Hex = 171
183 Char_YHex = 172
184 Char_Octal3 = 173
185 Char_Octal4 = 174
186 Char_Unicode4 = 175
187 Char_SurrogatePair = 176
188 Char_Unicode8 = 177
189 Char_UBraced = 178
190 Char_Pound = 179
191 Char_AsciiControl = 180
192 BashRegex_LParen = 181
193 BashRegex_AllowedInParens = 182
194 Eggex_Start = 183
195 Eggex_End = 184
196 Eggex_Dot = 185
197 Redir_Less = 186
198 Redir_Great = 187
199 Redir_DLess = 188
200 Redir_TLess = 189
201 Redir_DGreat = 190
202 Redir_GreatAnd = 191
203 Redir_LessAnd = 192
204 Redir_DLessDash = 193
205 Redir_LessGreat = 194
206 Redir_Clobber = 195
207 Redir_AndGreat = 196
208 Redir_AndDGreat = 197
209 Left_DoubleQuote = 198
210 Left_JDoubleQuote = 199
211 Left_SingleQuote = 200
212 Left_DollarSingleQuote = 201
213 Left_RSingleQuote = 202
214 Left_USingleQuote = 203
215 Left_BSingleQuote = 204
216 Left_TDoubleQuote = 205
217 Left_DollarTDoubleQuote = 206
218 Left_TSingleQuote = 207
219 Left_RTSingleQuote = 208
220 Left_UTSingleQuote = 209
221 Left_BTSingleQuote = 210
222 Left_Backtick = 211
223 Left_DollarParen = 212
224 Left_DollarBrace = 213
225 Left_DollarBraceZsh = 214
226 Left_DollarDParen = 215
227 Left_DollarBracket = 216
228 Left_AtBracket = 217
229 Left_DollarDoubleQuote = 218
230 Left_ProcSubIn = 219
231 Left_ProcSubOut = 220
232 Left_AtParen = 221
233 Left_CaretParen = 222
234 Left_CaretBracket = 223
235 Left_CaretBrace = 224
236 Left_CaretDoubleQuote = 225
237 Left_ColonPipe = 226
238 Left_PercentParen = 227
239 Right_DoubleQuote = 228
240 Right_SingleQuote = 229
241 Right_Backtick = 230
242 Right_DollarBrace = 231
243 Right_DollarDParen = 232
244 Right_DollarDoubleQuote = 233
245 Right_DollarSingleQuote = 234
246 Right_Subshell = 235
247 Right_ShFunction = 236
248 Right_CasePat = 237
249 Right_Initializer = 238
250 Right_ExtGlob = 239
251 Right_BashRegexGroup = 240
252 Right_BlockLiteral = 241
253 ExtGlob_Comma = 242
254 ExtGlob_At = 243
255 ExtGlob_Star = 244
256 ExtGlob_Plus = 245
257 ExtGlob_QMark = 246
258 ExtGlob_Bang = 247
259 VSub_DollarName = 248
260 VSub_Name = 249
261 VSub_Number = 250
262 VSub_Bang = 251
263 VSub_At = 252
264 VSub_Pound = 253
265 VSub_Dollar = 254
266 VSub_Star = 255
267 VSub_Hyphen = 256
268 VSub_QMark = 257
269 VSub_Dot = 258
270 VTest_ColonHyphen = 259
271 VTest_Hyphen = 260
272 VTest_ColonEquals = 261
273 VTest_Equals = 262
274 VTest_ColonQMark = 263
275 VTest_QMark = 264
276 VTest_ColonPlus = 265
277 VTest_Plus = 266
278 VOp0_Q = 267
279 VOp0_E = 268
280 VOp0_P = 269
281 VOp0_A = 270
282 VOp0_a = 271
283 VOp1_Percent = 272
284 VOp1_DPercent = 273
285 VOp1_Pound = 274
286 VOp1_DPound = 275
287 VOp1_Caret = 276
288 VOp1_DCaret = 277
289 VOp1_Comma = 278
290 VOp1_DComma = 279
291 VOpYsh_Pipe = 280
292 VOpYsh_Space = 281
293 VOp2_Slash = 282
294 VOp2_Colon = 283
295 VOp2_LBracket = 284
296 VOp2_RBracket = 285
297 VOp3_At = 286
298 VOp3_Star = 287
299 Node_PostDPlus = 288
300 Node_PostDMinus = 289
301 Node_UnaryPlus = 290
302 Node_UnaryMinus = 291
303 Node_NotIn = 292
304 Node_IsNot = 293
305 KW_DLeftBracket = 294
306 KW_Bang = 295
307 KW_For = 296
308 KW_While = 297
309 KW_Until = 298
310 KW_Do = 299
311 KW_Done = 300
312 KW_In = 301
313 KW_Case = 302
314 KW_Esac = 303
315 KW_If = 304
316 KW_Fi = 305
317 KW_Then = 306
318 KW_Else = 307
319 KW_Elif = 308
320 KW_Function = 309
321 KW_Time = 310
322 KW_Const = 311
323 KW_Var = 312
324 KW_SetVar = 313
325 KW_SetGlobal = 314
326 KW_Call = 315
327 KW_Proc = 316
328 KW_Typed = 317
329 KW_Func = 318
330 ControlFlow_Break = 319
331 ControlFlow_Continue = 320
332 ControlFlow_Return = 321
333 ControlFlow_Exit = 322
334 LookAhead_FuncParens = 323
335 Glob_LBracket = 324
336 Glob_RBracket = 325
337 Glob_Star = 326
338 Glob_QMark = 327
339 Glob_Bang = 328
340 Glob_Caret = 329
341 Glob_EscapedChar = 330
342 Glob_BadBackslash = 331
343 Glob_CleanLiterals = 332
344 Glob_OtherLiteral = 333
345 Format_EscapedPercent = 334
346 Format_Percent = 335
347 Format_Flag = 336
348 Format_Num = 337
349 Format_Dot = 338
350 Format_Type = 339
351 Format_Star = 340
352 Format_Time = 341
353 Format_Zero = 342
354 PS_Subst = 343
355 PS_Octal3 = 344
356 PS_LBrace = 345
357 PS_RBrace = 346
358 PS_Literals = 347
359 PS_BadBackslash = 348
360 Range_Int = 349
361 Range_Char = 350
362 Range_Dots = 351
363 Range_Other = 352
364 J8_LBracket = 353
365 J8_RBracket = 354
366 J8_LBrace = 355
367 J8_RBrace = 356
368 J8_Comma = 357
369 J8_Colon = 358
370 J8_Null = 359
371 J8_Bool = 360
372 J8_Int = 361
373 J8_Float = 362
374 J8_String = 363
375 J8_Identifier = 364
376 J8_Newline = 365
377 J8_Tab = 366
378 J8_LParen = 367
379 J8_RParen = 368
380 J8_Operator = 369
381 ShNumber_Dec = 370
382 ShNumber_Hex = 371
383 ShNumber_Oct = 372
384 ShNumber_BaseN = 373
385 BoolUnary_z = 374
386 BoolUnary_n = 375
387 BoolUnary_o = 376
388 BoolUnary_t = 377
389 BoolUnary_v = 378
390 BoolUnary_R = 379
391 BoolUnary_a = 380
392 BoolUnary_b = 381
393 BoolUnary_c = 382
394 BoolUnary_d = 383
395 BoolUnary_e = 384
396 BoolUnary_f = 385
397 BoolUnary_g = 386
398 BoolUnary_h = 387
399 BoolUnary_k = 388
400 BoolUnary_L = 389
401 BoolUnary_p = 390
402 BoolUnary_r = 391
403 BoolUnary_s = 392
404 BoolUnary_S = 393
405 BoolUnary_u = 394
406 BoolUnary_w = 395
407 BoolUnary_x = 396
408 BoolUnary_O = 397
409 BoolUnary_G = 398
410 BoolUnary_N = 399
411 BoolUnary_true = 400
412 BoolUnary_false = 401
413 BoolBinary_GlobEqual = 402
414 BoolBinary_GlobDEqual = 403
415 BoolBinary_GlobNEqual = 404
416 BoolBinary_EqualTilde = 405
417 BoolBinary_ef = 406
418 BoolBinary_nt = 407
419 BoolBinary_ot = 408
420 BoolBinary_eq = 409
421 BoolBinary_ne = 410
422 BoolBinary_gt = 411
423 BoolBinary_ge = 412
424 BoolBinary_lt = 413
425 BoolBinary_le = 414
426 BoolBinary_Equal = 415
427 BoolBinary_DEqual = 416
428 BoolBinary_NEqual = 417
429 ARRAY_SIZE = 418
430
431_Id_str = {
432 1: 'Word_Compound',
433 2: 'Arith_Semi',
434 3: 'Arith_Comma',
435 4: 'Arith_Plus',
436 5: 'Arith_Minus',
437 6: 'Arith_Star',
438 7: 'Arith_Slash',
439 8: 'Arith_Percent',
440 9: 'Arith_DPlus',
441 10: 'Arith_DMinus',
442 11: 'Arith_DStar',
443 12: 'Arith_LParen',
444 13: 'Arith_RParen',
445 14: 'Arith_LBracket',
446 15: 'Arith_RBracket',
447 16: 'Arith_RBrace',
448 17: 'Arith_QMark',
449 18: 'Arith_Colon',
450 19: 'Arith_LessEqual',
451 20: 'Arith_Less',
452 21: 'Arith_GreatEqual',
453 22: 'Arith_Great',
454 23: 'Arith_DEqual',
455 24: 'Arith_NEqual',
456 25: 'Arith_DAmp',
457 26: 'Arith_DPipe',
458 27: 'Arith_Bang',
459 28: 'Arith_DGreat',
460 29: 'Arith_DLess',
461 30: 'Arith_Amp',
462 31: 'Arith_Pipe',
463 32: 'Arith_Caret',
464 33: 'Arith_Tilde',
465 34: 'Arith_Equal',
466 35: 'Arith_PlusEqual',
467 36: 'Arith_MinusEqual',
468 37: 'Arith_StarEqual',
469 38: 'Arith_SlashEqual',
470 39: 'Arith_PercentEqual',
471 40: 'Arith_DGreatEqual',
472 41: 'Arith_DLessEqual',
473 42: 'Arith_AmpEqual',
474 43: 'Arith_CaretEqual',
475 44: 'Arith_PipeEqual',
476 45: 'Eof_Real',
477 46: 'Eof_RParen',
478 47: 'Eof_Backtick',
479 48: 'Undefined_Tok',
480 49: 'Unknown_Tok',
481 50: 'Unknown_Backslash',
482 51: 'Unknown_DEqual',
483 52: 'Unknown_DAmp',
484 53: 'Unknown_DPipe',
485 54: 'Unknown_DDot',
486 55: 'Eol_Tok',
487 56: 'Ignored_LineCont',
488 57: 'Ignored_Space',
489 58: 'Ignored_Comment',
490 59: 'Ignored_Newline',
491 60: 'WS_Space',
492 61: 'Lit_Chars',
493 62: 'Lit_CharsWithoutPrefix',
494 63: 'Lit_VarLike',
495 64: 'Lit_ArrayLhsOpen',
496 65: 'Lit_ArrayLhsClose',
497 66: 'Lit_Splice',
498 67: 'Lit_AtLBracket',
499 68: 'Lit_AtLBraceDot',
500 69: 'Lit_Other',
501 70: 'Lit_EscapedChar',
502 71: 'Lit_BackslashDoubleQuote',
503 72: 'Lit_LBracket',
504 73: 'Lit_RBracket',
505 74: 'Lit_Star',
506 75: 'Lit_QMark',
507 76: 'Lit_LBrace',
508 77: 'Lit_RBrace',
509 78: 'Lit_Comma',
510 79: 'Lit_Equals',
511 80: 'Lit_Dollar',
512 81: 'Lit_DRightBracket',
513 82: 'Lit_Tilde',
514 83: 'Lit_Pound',
515 84: 'Lit_TPound',
516 85: 'Lit_TDot',
517 86: 'Lit_Slash',
518 87: 'Lit_Percent',
519 88: 'Lit_Colon',
520 89: 'Lit_Digits',
521 90: 'Lit_At',
522 91: 'Lit_ArithVarLike',
523 92: 'Lit_BadBackslash',
524 93: 'Lit_CompDummy',
525 94: 'Lit_Number',
526 95: 'Lit_RedirVarName',
527 96: 'Backtick_Right',
528 97: 'Backtick_Quoted',
529 98: 'Backtick_DoubleQuote',
530 99: 'Backtick_Other',
531 100: 'History_Op',
532 101: 'History_Num',
533 102: 'History_Search',
534 103: 'History_Other',
535 104: 'Op_Newline',
536 105: 'Op_Amp',
537 106: 'Op_Pipe',
538 107: 'Op_PipeAmp',
539 108: 'Op_DAmp',
540 109: 'Op_DPipe',
541 110: 'Op_Semi',
542 111: 'Op_DSemi',
543 112: 'Op_SemiAmp',
544 113: 'Op_DSemiAmp',
545 114: 'Op_LParen',
546 115: 'Op_RParen',
547 116: 'Op_DLeftParen',
548 117: 'Op_DRightParen',
549 118: 'Op_Less',
550 119: 'Op_Great',
551 120: 'Op_Bang',
552 121: 'Op_LBracket',
553 122: 'Op_RBracket',
554 123: 'Op_LBrace',
555 124: 'Op_RBrace',
556 125: 'Expr_Reserved',
557 126: 'Expr_Symbol',
558 127: 'Expr_Name',
559 128: 'Expr_DecInt',
560 129: 'Expr_BinInt',
561 130: 'Expr_OctInt',
562 131: 'Expr_HexInt',
563 132: 'Expr_Float',
564 133: 'Expr_Bang',
565 134: 'Expr_Dot',
566 135: 'Expr_DDotLessThan',
567 136: 'Expr_DDotEqual',
568 137: 'Expr_Colon',
569 138: 'Expr_RArrow',
570 139: 'Expr_RDArrow',
571 140: 'Expr_DSlash',
572 141: 'Expr_TEqual',
573 142: 'Expr_NotDEqual',
574 143: 'Expr_TildeDEqual',
575 144: 'Expr_At',
576 145: 'Expr_DoubleAt',
577 146: 'Expr_Ellipsis',
578 147: 'Expr_Dollar',
579 148: 'Expr_NotTilde',
580 149: 'Expr_DTilde',
581 150: 'Expr_NotDTilde',
582 151: 'Expr_DStarEqual',
583 152: 'Expr_DSlashEqual',
584 153: 'Expr_CastedDummy',
585 154: 'Expr_Null',
586 155: 'Expr_True',
587 156: 'Expr_False',
588 157: 'Expr_And',
589 158: 'Expr_Or',
590 159: 'Expr_Not',
591 160: 'Expr_For',
592 161: 'Expr_Is',
593 162: 'Expr_In',
594 163: 'Expr_If',
595 164: 'Expr_Else',
596 165: 'Expr_Capture',
597 166: 'Expr_As',
598 167: 'Expr_Func',
599 168: 'Expr_Proc',
600 169: 'Char_OneChar',
601 170: 'Char_Stop',
602 171: 'Char_Hex',
603 172: 'Char_YHex',
604 173: 'Char_Octal3',
605 174: 'Char_Octal4',
606 175: 'Char_Unicode4',
607 176: 'Char_SurrogatePair',
608 177: 'Char_Unicode8',
609 178: 'Char_UBraced',
610 179: 'Char_Pound',
611 180: 'Char_AsciiControl',
612 181: 'BashRegex_LParen',
613 182: 'BashRegex_AllowedInParens',
614 183: 'Eggex_Start',
615 184: 'Eggex_End',
616 185: 'Eggex_Dot',
617 186: 'Redir_Less',
618 187: 'Redir_Great',
619 188: 'Redir_DLess',
620 189: 'Redir_TLess',
621 190: 'Redir_DGreat',
622 191: 'Redir_GreatAnd',
623 192: 'Redir_LessAnd',
624 193: 'Redir_DLessDash',
625 194: 'Redir_LessGreat',
626 195: 'Redir_Clobber',
627 196: 'Redir_AndGreat',
628 197: 'Redir_AndDGreat',
629 198: 'Left_DoubleQuote',
630 199: 'Left_JDoubleQuote',
631 200: 'Left_SingleQuote',
632 201: 'Left_DollarSingleQuote',
633 202: 'Left_RSingleQuote',
634 203: 'Left_USingleQuote',
635 204: 'Left_BSingleQuote',
636 205: 'Left_TDoubleQuote',
637 206: 'Left_DollarTDoubleQuote',
638 207: 'Left_TSingleQuote',
639 208: 'Left_RTSingleQuote',
640 209: 'Left_UTSingleQuote',
641 210: 'Left_BTSingleQuote',
642 211: 'Left_Backtick',
643 212: 'Left_DollarParen',
644 213: 'Left_DollarBrace',
645 214: 'Left_DollarBraceZsh',
646 215: 'Left_DollarDParen',
647 216: 'Left_DollarBracket',
648 217: 'Left_AtBracket',
649 218: 'Left_DollarDoubleQuote',
650 219: 'Left_ProcSubIn',
651 220: 'Left_ProcSubOut',
652 221: 'Left_AtParen',
653 222: 'Left_CaretParen',
654 223: 'Left_CaretBracket',
655 224: 'Left_CaretBrace',
656 225: 'Left_CaretDoubleQuote',
657 226: 'Left_ColonPipe',
658 227: 'Left_PercentParen',
659 228: 'Right_DoubleQuote',
660 229: 'Right_SingleQuote',
661 230: 'Right_Backtick',
662 231: 'Right_DollarBrace',
663 232: 'Right_DollarDParen',
664 233: 'Right_DollarDoubleQuote',
665 234: 'Right_DollarSingleQuote',
666 235: 'Right_Subshell',
667 236: 'Right_ShFunction',
668 237: 'Right_CasePat',
669 238: 'Right_Initializer',
670 239: 'Right_ExtGlob',
671 240: 'Right_BashRegexGroup',
672 241: 'Right_BlockLiteral',
673 242: 'ExtGlob_Comma',
674 243: 'ExtGlob_At',
675 244: 'ExtGlob_Star',
676 245: 'ExtGlob_Plus',
677 246: 'ExtGlob_QMark',
678 247: 'ExtGlob_Bang',
679 248: 'VSub_DollarName',
680 249: 'VSub_Name',
681 250: 'VSub_Number',
682 251: 'VSub_Bang',
683 252: 'VSub_At',
684 253: 'VSub_Pound',
685 254: 'VSub_Dollar',
686 255: 'VSub_Star',
687 256: 'VSub_Hyphen',
688 257: 'VSub_QMark',
689 258: 'VSub_Dot',
690 259: 'VTest_ColonHyphen',
691 260: 'VTest_Hyphen',
692 261: 'VTest_ColonEquals',
693 262: 'VTest_Equals',
694 263: 'VTest_ColonQMark',
695 264: 'VTest_QMark',
696 265: 'VTest_ColonPlus',
697 266: 'VTest_Plus',
698 267: 'VOp0_Q',
699 268: 'VOp0_E',
700 269: 'VOp0_P',
701 270: 'VOp0_A',
702 271: 'VOp0_a',
703 272: 'VOp1_Percent',
704 273: 'VOp1_DPercent',
705 274: 'VOp1_Pound',
706 275: 'VOp1_DPound',
707 276: 'VOp1_Caret',
708 277: 'VOp1_DCaret',
709 278: 'VOp1_Comma',
710 279: 'VOp1_DComma',
711 280: 'VOpYsh_Pipe',
712 281: 'VOpYsh_Space',
713 282: 'VOp2_Slash',
714 283: 'VOp2_Colon',
715 284: 'VOp2_LBracket',
716 285: 'VOp2_RBracket',
717 286: 'VOp3_At',
718 287: 'VOp3_Star',
719 288: 'Node_PostDPlus',
720 289: 'Node_PostDMinus',
721 290: 'Node_UnaryPlus',
722 291: 'Node_UnaryMinus',
723 292: 'Node_NotIn',
724 293: 'Node_IsNot',
725 294: 'KW_DLeftBracket',
726 295: 'KW_Bang',
727 296: 'KW_For',
728 297: 'KW_While',
729 298: 'KW_Until',
730 299: 'KW_Do',
731 300: 'KW_Done',
732 301: 'KW_In',
733 302: 'KW_Case',
734 303: 'KW_Esac',
735 304: 'KW_If',
736 305: 'KW_Fi',
737 306: 'KW_Then',
738 307: 'KW_Else',
739 308: 'KW_Elif',
740 309: 'KW_Function',
741 310: 'KW_Time',
742 311: 'KW_Const',
743 312: 'KW_Var',
744 313: 'KW_SetVar',
745 314: 'KW_SetGlobal',
746 315: 'KW_Call',
747 316: 'KW_Proc',
748 317: 'KW_Typed',
749 318: 'KW_Func',
750 319: 'ControlFlow_Break',
751 320: 'ControlFlow_Continue',
752 321: 'ControlFlow_Return',
753 322: 'ControlFlow_Exit',
754 323: 'LookAhead_FuncParens',
755 324: 'Glob_LBracket',
756 325: 'Glob_RBracket',
757 326: 'Glob_Star',
758 327: 'Glob_QMark',
759 328: 'Glob_Bang',
760 329: 'Glob_Caret',
761 330: 'Glob_EscapedChar',
762 331: 'Glob_BadBackslash',
763 332: 'Glob_CleanLiterals',
764 333: 'Glob_OtherLiteral',
765 334: 'Format_EscapedPercent',
766 335: 'Format_Percent',
767 336: 'Format_Flag',
768 337: 'Format_Num',
769 338: 'Format_Dot',
770 339: 'Format_Type',
771 340: 'Format_Star',
772 341: 'Format_Time',
773 342: 'Format_Zero',
774 343: 'PS_Subst',
775 344: 'PS_Octal3',
776 345: 'PS_LBrace',
777 346: 'PS_RBrace',
778 347: 'PS_Literals',
779 348: 'PS_BadBackslash',
780 349: 'Range_Int',
781 350: 'Range_Char',
782 351: 'Range_Dots',
783 352: 'Range_Other',
784 353: 'J8_LBracket',
785 354: 'J8_RBracket',
786 355: 'J8_LBrace',
787 356: 'J8_RBrace',
788 357: 'J8_Comma',
789 358: 'J8_Colon',
790 359: 'J8_Null',
791 360: 'J8_Bool',
792 361: 'J8_Int',
793 362: 'J8_Float',
794 363: 'J8_String',
795 364: 'J8_Identifier',
796 365: 'J8_Newline',
797 366: 'J8_Tab',
798 367: 'J8_LParen',
799 368: 'J8_RParen',
800 369: 'J8_Operator',
801 370: 'ShNumber_Dec',
802 371: 'ShNumber_Hex',
803 372: 'ShNumber_Oct',
804 373: 'ShNumber_BaseN',
805 374: 'BoolUnary_z',
806 375: 'BoolUnary_n',
807 376: 'BoolUnary_o',
808 377: 'BoolUnary_t',
809 378: 'BoolUnary_v',
810 379: 'BoolUnary_R',
811 380: 'BoolUnary_a',
812 381: 'BoolUnary_b',
813 382: 'BoolUnary_c',
814 383: 'BoolUnary_d',
815 384: 'BoolUnary_e',
816 385: 'BoolUnary_f',
817 386: 'BoolUnary_g',
818 387: 'BoolUnary_h',
819 388: 'BoolUnary_k',
820 389: 'BoolUnary_L',
821 390: 'BoolUnary_p',
822 391: 'BoolUnary_r',
823 392: 'BoolUnary_s',
824 393: 'BoolUnary_S',
825 394: 'BoolUnary_u',
826 395: 'BoolUnary_w',
827 396: 'BoolUnary_x',
828 397: 'BoolUnary_O',
829 398: 'BoolUnary_G',
830 399: 'BoolUnary_N',
831 400: 'BoolUnary_true',
832 401: 'BoolUnary_false',
833 402: 'BoolBinary_GlobEqual',
834 403: 'BoolBinary_GlobDEqual',
835 404: 'BoolBinary_GlobNEqual',
836 405: 'BoolBinary_EqualTilde',
837 406: 'BoolBinary_ef',
838 407: 'BoolBinary_nt',
839 408: 'BoolBinary_ot',
840 409: 'BoolBinary_eq',
841 410: 'BoolBinary_ne',
842 411: 'BoolBinary_gt',
843 412: 'BoolBinary_ge',
844 413: 'BoolBinary_lt',
845 414: 'BoolBinary_le',
846 415: 'BoolBinary_Equal',
847 416: 'BoolBinary_DEqual',
848 417: 'BoolBinary_NEqual',
849}
850
851def Id_str(val, dot=True):
852 # type: (Id_t, bool) -> str
853 v = _Id_str[val]
854 if dot:
855 return "Id.%s" % v
856 else:
857 return v
858
859class Kind_t(pybase.SimpleObj):
860 pass
861
862class Kind(object):
863 Word = Kind_t(1)
864 Arith = Kind_t(2)
865 Eof = Kind_t(3)
866 Undefined = Kind_t(4)
867 Unknown = Kind_t(5)
868 Eol = Kind_t(6)
869 Ignored = Kind_t(7)
870 WS = Kind_t(8)
871 Lit = Kind_t(9)
872 Backtick = Kind_t(10)
873 History = Kind_t(11)
874 Op = Kind_t(12)
875 Expr = Kind_t(13)
876 Char = Kind_t(14)
877 BashRegex = Kind_t(15)
878 Eggex = Kind_t(16)
879 Redir = Kind_t(17)
880 Left = Kind_t(18)
881 Right = Kind_t(19)
882 ExtGlob = Kind_t(20)
883 VSub = Kind_t(21)
884 VTest = Kind_t(22)
885 VOp0 = Kind_t(23)
886 VOp1 = Kind_t(24)
887 VOpYsh = Kind_t(25)
888 VOp2 = Kind_t(26)
889 VOp3 = Kind_t(27)
890 Node = Kind_t(28)
891 KW = Kind_t(29)
892 ControlFlow = Kind_t(30)
893 LookAhead = Kind_t(31)
894 Glob = Kind_t(32)
895 Format = Kind_t(33)
896 PS = Kind_t(34)
897 Range = Kind_t(35)
898 J8 = Kind_t(36)
899 ShNumber = Kind_t(37)
900 BoolUnary = Kind_t(38)
901 BoolBinary = Kind_t(39)
902
903_Kind_str = {
904 1: 'Word',
905 2: 'Arith',
906 3: 'Eof',
907 4: 'Undefined',
908 5: 'Unknown',
909 6: 'Eol',
910 7: 'Ignored',
911 8: 'WS',
912 9: 'Lit',
913 10: 'Backtick',
914 11: 'History',
915 12: 'Op',
916 13: 'Expr',
917 14: 'Char',
918 15: 'BashRegex',
919 16: 'Eggex',
920 17: 'Redir',
921 18: 'Left',
922 19: 'Right',
923 20: 'ExtGlob',
924 21: 'VSub',
925 22: 'VTest',
926 23: 'VOp0',
927 24: 'VOp1',
928 25: 'VOpYsh',
929 26: 'VOp2',
930 27: 'VOp3',
931 28: 'Node',
932 29: 'KW',
933 30: 'ControlFlow',
934 31: 'LookAhead',
935 32: 'Glob',
936 33: 'Format',
937 34: 'PS',
938 35: 'Range',
939 36: 'J8',
940 37: 'ShNumber',
941 38: 'BoolUnary',
942 39: 'BoolBinary',
943}
944
945def Kind_str(val, dot=True):
946 # type: (Kind_t, bool) -> str
947 v = _Kind_str[val]
948 if dot:
949 return "Kind.%s" % v
950 else:
951 return v
952