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

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