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

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