OILS / _gen / core / value.asdl.h View on Github | oilshell.org

1046 lines, 687 significant
1// _gen/core/value.asdl.h is generated by asdl_main.py
2
3#ifndef VALUE_ASDL
4#define VALUE_ASDL
5
6#include <cstdint>
7
8#include "mycpp/runtime.h"
9#include "_gen/asdl/hnode.asdl.h"
10using hnode_asdl::hnode_t;
11
12namespace syntax_asdl { class loc_t; class Token; class expr_t; class command_t; class DoubleQuoted; class re_t; class proc_sig_t; class LiteralBlock; class Func; class NameType; class EggexFlag; }
13
14namespace runtime_asdl { class Cell; }
15
16namespace value_asdl {
17
18// use struct instead of namespace so 'using' works consistently
19#define ASDL_NAMES struct
20
21class IntBox;
22class ProcDefaults;
23class LeftName;
24class y_lvalue_t;
25class sh_lvalue_t;
26class eggex_ops_t;
27class RegexMatch;
28class regex_match_t;
29class Obj;
30class value_t;
31
32ASDL_NAMES y_lvalue_e {
33 enum no_name {
34 Local = 66,
35 Container = 2,
36 };
37};
38
39BigStr* y_lvalue_str(int tag, bool dot = true);
40
41class y_lvalue_t {
42 protected:
43 y_lvalue_t() {
44 }
45 public:
46 int tag() const {
47 return ObjHeader::FromObject(this)->type_tag;
48 }
49 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
50 DISALLOW_COPY_AND_ASSIGN(y_lvalue_t)
51};
52
53class y_lvalue__Container : public y_lvalue_t {
54 public:
55 y_lvalue__Container(value_t* obj, value_t* index)
56 : obj(obj),
57 index(index) {
58 }
59
60 static y_lvalue__Container* CreateNull(bool alloc_lists = false) {
61 return Alloc<y_lvalue__Container>(nullptr, nullptr);
62 }
63
64 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
65
66 static constexpr ObjHeader obj_header() {
67 return ObjHeader::AsdlClass(static_cast<uint16_t>(y_lvalue_e::Container),
68 2);
69 }
70
71 value_t* obj;
72 value_t* index;
73
74 DISALLOW_COPY_AND_ASSIGN(y_lvalue__Container)
75};
76
77ASDL_NAMES y_lvalue {
78 typedef y_lvalue__Container Container;
79};
80
81ASDL_NAMES sh_lvalue_e {
82 enum no_name {
83 Var = 66,
84 Indexed = 2,
85 Keyed = 3,
86 };
87};
88
89BigStr* sh_lvalue_str(int tag, bool dot = true);
90
91class sh_lvalue_t {
92 protected:
93 sh_lvalue_t() {
94 }
95 public:
96 int tag() const {
97 return ObjHeader::FromObject(this)->type_tag;
98 }
99 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
100 DISALLOW_COPY_AND_ASSIGN(sh_lvalue_t)
101};
102
103class sh_lvalue__Indexed : public sh_lvalue_t {
104 public:
105 sh_lvalue__Indexed(BigStr* name, int index, syntax_asdl::loc_t* blame_loc)
106 : name(name),
107 blame_loc(blame_loc),
108 index(index) {
109 }
110
111 static sh_lvalue__Indexed* CreateNull(bool alloc_lists = false) {
112 return Alloc<sh_lvalue__Indexed>(kEmptyString, -1, nullptr);
113 }
114
115 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
116
117 static constexpr ObjHeader obj_header() {
118 return ObjHeader::AsdlClass(static_cast<uint16_t>(sh_lvalue_e::Indexed), 2);
119 }
120
121 BigStr* name;
122 syntax_asdl::loc_t* blame_loc;
123 int index;
124
125 DISALLOW_COPY_AND_ASSIGN(sh_lvalue__Indexed)
126};
127
128class sh_lvalue__Keyed : public sh_lvalue_t {
129 public:
130 sh_lvalue__Keyed(BigStr* name, BigStr* key, syntax_asdl::loc_t* blame_loc)
131 : name(name),
132 key(key),
133 blame_loc(blame_loc) {
134 }
135
136 static sh_lvalue__Keyed* CreateNull(bool alloc_lists = false) {
137 return Alloc<sh_lvalue__Keyed>(kEmptyString, kEmptyString, nullptr);
138 }
139
140 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
141
142 static constexpr ObjHeader obj_header() {
143 return ObjHeader::AsdlClass(static_cast<uint16_t>(sh_lvalue_e::Keyed), 3);
144 }
145
146 BigStr* name;
147 BigStr* key;
148 syntax_asdl::loc_t* blame_loc;
149
150 DISALLOW_COPY_AND_ASSIGN(sh_lvalue__Keyed)
151};
152
153ASDL_NAMES sh_lvalue {
154 typedef sh_lvalue__Indexed Indexed;
155 typedef sh_lvalue__Keyed Keyed;
156};
157
158ASDL_NAMES eggex_ops_e {
159 enum no_name {
160 No = 1,
161 Yes = 2,
162 };
163};
164
165BigStr* eggex_ops_str(int tag, bool dot = true);
166
167class eggex_ops_t {
168 protected:
169 eggex_ops_t() {
170 }
171 public:
172 int tag() const {
173 return ObjHeader::FromObject(this)->type_tag;
174 }
175 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
176 DISALLOW_COPY_AND_ASSIGN(eggex_ops_t)
177};
178
179class eggex_ops__No : public eggex_ops_t {
180 public:
181 eggex_ops__No() {}
182
183 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
184
185 static constexpr ObjHeader obj_header() {
186 return ObjHeader::AsdlClass(static_cast<uint16_t>(eggex_ops_e::No), 0);
187 }
188
189
190 DISALLOW_COPY_AND_ASSIGN(eggex_ops__No)
191};
192
193class eggex_ops__Yes : public eggex_ops_t {
194 public:
195 eggex_ops__Yes(List<value_t*>* convert_funcs, List<syntax_asdl::Token*>*
196 convert_toks, List<BigStr*>* capture_names)
197 : convert_funcs(convert_funcs),
198 convert_toks(convert_toks),
199 capture_names(capture_names) {
200 }
201
202 static eggex_ops__Yes* CreateNull(bool alloc_lists = false) {
203 return Alloc<eggex_ops__Yes>(alloc_lists ? Alloc<List<value_t*>>() :
204 nullptr, alloc_lists ?
205 Alloc<List<syntax_asdl::Token*>>() : nullptr,
206 alloc_lists ? Alloc<List<BigStr*>>() :
207 nullptr);
208 }
209
210 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
211
212 static constexpr ObjHeader obj_header() {
213 return ObjHeader::AsdlClass(static_cast<uint16_t>(eggex_ops_e::Yes), 3);
214 }
215
216 List<value_t*>* convert_funcs;
217 List<syntax_asdl::Token*>* convert_toks;
218 List<BigStr*>* capture_names;
219
220 DISALLOW_COPY_AND_ASSIGN(eggex_ops__Yes)
221};
222
223extern GcGlobal<eggex_ops__No> geggex_ops__No;
224ASDL_NAMES eggex_ops {
225 static eggex_ops__No* No;
226 typedef eggex_ops__Yes Yes;
227};
228
229ASDL_NAMES regex_match_e {
230 enum no_name {
231 No = 1,
232 Yes = 67,
233 };
234};
235
236BigStr* regex_match_str(int tag, bool dot = true);
237
238class regex_match_t {
239 protected:
240 regex_match_t() {
241 }
242 public:
243 int tag() const {
244 return ObjHeader::FromObject(this)->type_tag;
245 }
246 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
247 DISALLOW_COPY_AND_ASSIGN(regex_match_t)
248};
249
250class regex_match__No : public regex_match_t {
251 public:
252 regex_match__No() {}
253
254 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
255
256 static constexpr ObjHeader obj_header() {
257 return ObjHeader::AsdlClass(static_cast<uint16_t>(regex_match_e::No), 0);
258 }
259
260
261 DISALLOW_COPY_AND_ASSIGN(regex_match__No)
262};
263
264extern GcGlobal<regex_match__No> gregex_match__No;
265ASDL_NAMES regex_match {
266 static regex_match__No* No;
267};
268
269ASDL_NAMES value_e {
270 enum no_name {
271 Interrupted = 1,
272 Stdin = 2,
273 Undef = 3,
274 Str = 4,
275 BashArray = 5,
276 SparseArray = 6,
277 BashAssoc = 7,
278 Null = 8,
279 Bool = 9,
280 Int = 10,
281 Float = 11,
282 List = 12,
283 Dict = 13,
284 Obj = 68,
285 Eggex = 15,
286 Match = 67,
287 Expr = 17,
288 Command = 18,
289 Block = 19,
290 Place = 20,
291 Frame = 21,
292 BuiltinFunc = 22,
293 BoundFunc = 23,
294 Func = 24,
295 BuiltinProc = 25,
296 Proc = 26,
297 Range = 27,
298 Slice = 28,
299 };
300};
301
302BigStr* value_str(int tag, bool dot = true);
303
304class value_t {
305 protected:
306 value_t() {
307 }
308 public:
309 int tag() const {
310 return ObjHeader::FromObject(this)->type_tag;
311 }
312 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
313 DISALLOW_COPY_AND_ASSIGN(value_t)
314};
315
316class value__Interrupted : public value_t {
317 public:
318 value__Interrupted() {}
319
320 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
321
322 static constexpr ObjHeader obj_header() {
323 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Interrupted), 0);
324 }
325
326
327 DISALLOW_COPY_AND_ASSIGN(value__Interrupted)
328};
329
330class value__Stdin : public value_t {
331 public:
332 value__Stdin() {}
333
334 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
335
336 static constexpr ObjHeader obj_header() {
337 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Stdin), 0);
338 }
339
340
341 DISALLOW_COPY_AND_ASSIGN(value__Stdin)
342};
343
344class value__Undef : public value_t {
345 public:
346 value__Undef() {}
347
348 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
349
350 static constexpr ObjHeader obj_header() {
351 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Undef), 0);
352 }
353
354
355 DISALLOW_COPY_AND_ASSIGN(value__Undef)
356};
357
358class value__Str : public value_t {
359 public:
360 value__Str(BigStr* s)
361 : s(s) {
362 }
363
364 static value__Str* CreateNull(bool alloc_lists = false) {
365 return Alloc<value__Str>(kEmptyString);
366 }
367
368 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
369
370 static constexpr ObjHeader obj_header() {
371 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Str), 1);
372 }
373
374 BigStr* s;
375
376 DISALLOW_COPY_AND_ASSIGN(value__Str)
377};
378
379class value__BashArray : public value_t {
380 public:
381 value__BashArray(List<BigStr*>* strs)
382 : strs(strs) {
383 }
384
385 static value__BashArray* CreateNull(bool alloc_lists = false) {
386 return Alloc<value__BashArray>(alloc_lists ? Alloc<List<BigStr*>>() :
387 nullptr);
388 }
389
390 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
391
392 static constexpr ObjHeader obj_header() {
393 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::BashArray), 1);
394 }
395
396 List<BigStr*>* strs;
397
398 DISALLOW_COPY_AND_ASSIGN(value__BashArray)
399};
400
401class value__SparseArray : public value_t {
402 public:
403 value__SparseArray(Dict<mops::BigInt, BigStr*>* d, mops::BigInt max_index)
404 : d(d),
405 max_index(max_index) {
406 }
407
408 static value__SparseArray* CreateNull(bool alloc_lists = false) {
409 return Alloc<value__SparseArray>(nullptr, -1);
410 }
411
412 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
413
414 static constexpr ObjHeader obj_header() {
415 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::SparseArray), 1);
416 }
417
418 Dict<mops::BigInt, BigStr*>* d;
419 mops::BigInt max_index;
420
421 DISALLOW_COPY_AND_ASSIGN(value__SparseArray)
422};
423
424class value__BashAssoc : public value_t {
425 public:
426 value__BashAssoc(Dict<BigStr*, BigStr*>* d)
427 : d(d) {
428 }
429
430 static value__BashAssoc* CreateNull(bool alloc_lists = false) {
431 return Alloc<value__BashAssoc>(nullptr);
432 }
433
434 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
435
436 static constexpr ObjHeader obj_header() {
437 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::BashAssoc), 1);
438 }
439
440 Dict<BigStr*, BigStr*>* d;
441
442 DISALLOW_COPY_AND_ASSIGN(value__BashAssoc)
443};
444
445class value__Null : public value_t {
446 public:
447 value__Null() {}
448
449 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
450
451 static constexpr ObjHeader obj_header() {
452 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Null), 0);
453 }
454
455
456 DISALLOW_COPY_AND_ASSIGN(value__Null)
457};
458
459class value__Bool : public value_t {
460 public:
461 value__Bool(bool b)
462 : b(b) {
463 }
464
465 static value__Bool* CreateNull(bool alloc_lists = false) {
466 return Alloc<value__Bool>(false);
467 }
468
469 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
470
471 static constexpr ObjHeader obj_header() {
472 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Bool), 0);
473 }
474
475 bool b;
476
477 DISALLOW_COPY_AND_ASSIGN(value__Bool)
478};
479
480class value__Int : public value_t {
481 public:
482 value__Int(mops::BigInt i)
483 : i(i) {
484 }
485
486 static value__Int* CreateNull(bool alloc_lists = false) {
487 return Alloc<value__Int>(-1);
488 }
489
490 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
491
492 static constexpr ObjHeader obj_header() {
493 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Int), 0);
494 }
495
496 mops::BigInt i;
497
498 DISALLOW_COPY_AND_ASSIGN(value__Int)
499};
500
501class value__Float : public value_t {
502 public:
503 value__Float(double f)
504 : f(f) {
505 }
506
507 static value__Float* CreateNull(bool alloc_lists = false) {
508 return Alloc<value__Float>(0.0);
509 }
510
511 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
512
513 static constexpr ObjHeader obj_header() {
514 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Float), 0);
515 }
516
517 double f;
518
519 DISALLOW_COPY_AND_ASSIGN(value__Float)
520};
521
522class value__List : public value_t {
523 public:
524 value__List(List<value_t*>* items)
525 : items(items) {
526 }
527
528 static value__List* CreateNull(bool alloc_lists = false) {
529 return Alloc<value__List>(alloc_lists ? Alloc<List<value_t*>>() : nullptr);
530 }
531
532 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
533
534 static constexpr ObjHeader obj_header() {
535 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::List), 1);
536 }
537
538 List<value_t*>* items;
539
540 DISALLOW_COPY_AND_ASSIGN(value__List)
541};
542
543class value__Dict : public value_t {
544 public:
545 value__Dict(Dict<BigStr*, value_t*>* d)
546 : d(d) {
547 }
548
549 static value__Dict* CreateNull(bool alloc_lists = false) {
550 return Alloc<value__Dict>(nullptr);
551 }
552
553 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
554
555 static constexpr ObjHeader obj_header() {
556 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Dict), 1);
557 }
558
559 Dict<BigStr*, value_t*>* d;
560
561 DISALLOW_COPY_AND_ASSIGN(value__Dict)
562};
563
564class value__Eggex : public value_t {
565 public:
566 value__Eggex(syntax_asdl::re_t* spliced, BigStr* canonical_flags,
567 List<value_t*>* convert_funcs, List<syntax_asdl::Token*>*
568 convert_toks, BigStr* as_ere, List<BigStr*>* capture_names)
569 : spliced(spliced),
570 canonical_flags(canonical_flags),
571 convert_funcs(convert_funcs),
572 convert_toks(convert_toks),
573 as_ere(as_ere),
574 capture_names(capture_names) {
575 }
576
577 static value__Eggex* CreateNull(bool alloc_lists = false) {
578 return Alloc<value__Eggex>(nullptr, kEmptyString, alloc_lists ?
579 Alloc<List<value_t*>>() : nullptr, alloc_lists ?
580 Alloc<List<syntax_asdl::Token*>>() : nullptr,
581 nullptr, alloc_lists ? Alloc<List<BigStr*>>() :
582 nullptr);
583 }
584
585 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
586
587 static constexpr ObjHeader obj_header() {
588 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Eggex), 6);
589 }
590
591 syntax_asdl::re_t* spliced;
592 BigStr* canonical_flags;
593 List<value_t*>* convert_funcs;
594 List<syntax_asdl::Token*>* convert_toks;
595 BigStr* as_ere;
596 List<BigStr*>* capture_names;
597
598 DISALLOW_COPY_AND_ASSIGN(value__Eggex)
599};
600
601class value__Expr : public value_t {
602 public:
603 value__Expr(syntax_asdl::expr_t* e)
604 : e(e) {
605 }
606
607 static value__Expr* CreateNull(bool alloc_lists = false) {
608 return Alloc<value__Expr>(nullptr);
609 }
610
611 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
612
613 static constexpr ObjHeader obj_header() {
614 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Expr), 1);
615 }
616
617 syntax_asdl::expr_t* e;
618
619 DISALLOW_COPY_AND_ASSIGN(value__Expr)
620};
621
622class value__Command : public value_t {
623 public:
624 value__Command(syntax_asdl::command_t* c)
625 : c(c) {
626 }
627
628 static value__Command* CreateNull(bool alloc_lists = false) {
629 return Alloc<value__Command>(nullptr);
630 }
631
632 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
633
634 static constexpr ObjHeader obj_header() {
635 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Command), 1);
636 }
637
638 syntax_asdl::command_t* c;
639
640 DISALLOW_COPY_AND_ASSIGN(value__Command)
641};
642
643class value__Block : public value_t {
644 public:
645 value__Block(syntax_asdl::LiteralBlock* block)
646 : block(block) {
647 }
648
649 static value__Block* CreateNull(bool alloc_lists = false) {
650 return Alloc<value__Block>(nullptr);
651 }
652
653 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
654
655 static constexpr ObjHeader obj_header() {
656 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Block), 1);
657 }
658
659 syntax_asdl::LiteralBlock* block;
660
661 DISALLOW_COPY_AND_ASSIGN(value__Block)
662};
663
664class value__Place : public value_t {
665 public:
666 value__Place(y_lvalue_t* lval, Dict<BigStr*, runtime_asdl::Cell*>* frame)
667 : lval(lval),
668 frame(frame) {
669 }
670
671 static value__Place* CreateNull(bool alloc_lists = false) {
672 return Alloc<value__Place>(nullptr, nullptr);
673 }
674
675 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
676
677 static constexpr ObjHeader obj_header() {
678 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Place), 2);
679 }
680
681 y_lvalue_t* lval;
682 Dict<BigStr*, runtime_asdl::Cell*>* frame;
683
684 DISALLOW_COPY_AND_ASSIGN(value__Place)
685};
686
687class value__Frame : public value_t {
688 public:
689 value__Frame(Dict<BigStr*, runtime_asdl::Cell*>* frame)
690 : frame(frame) {
691 }
692
693 static value__Frame* CreateNull(bool alloc_lists = false) {
694 return Alloc<value__Frame>(nullptr);
695 }
696
697 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
698
699 static constexpr ObjHeader obj_header() {
700 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Frame), 1);
701 }
702
703 Dict<BigStr*, runtime_asdl::Cell*>* frame;
704
705 DISALLOW_COPY_AND_ASSIGN(value__Frame)
706};
707
708class value__BuiltinFunc : public value_t {
709 public:
710 value__BuiltinFunc(void* callable)
711 : callable(callable) {
712 }
713
714 static value__BuiltinFunc* CreateNull(bool alloc_lists = false) {
715 return Alloc<value__BuiltinFunc>(nullptr);
716 }
717
718 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
719
720 static constexpr ObjHeader obj_header() {
721 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::BuiltinFunc), 1);
722 }
723
724 void* callable;
725
726 DISALLOW_COPY_AND_ASSIGN(value__BuiltinFunc)
727};
728
729class value__BoundFunc : public value_t {
730 public:
731 value__BoundFunc(value_t* me, value_t* func)
732 : me(me),
733 func(func) {
734 }
735
736 static value__BoundFunc* CreateNull(bool alloc_lists = false) {
737 return Alloc<value__BoundFunc>(nullptr, nullptr);
738 }
739
740 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
741
742 static constexpr ObjHeader obj_header() {
743 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::BoundFunc), 2);
744 }
745
746 value_t* me;
747 value_t* func;
748
749 DISALLOW_COPY_AND_ASSIGN(value__BoundFunc)
750};
751
752class value__Func : public value_t {
753 public:
754 value__Func(BigStr* name, syntax_asdl::Func* parsed, List<value_t*>*
755 pos_defaults, Dict<BigStr*, value_t*>* named_defaults,
756 Dict<BigStr*, runtime_asdl::Cell*>* module_frame)
757 : name(name),
758 parsed(parsed),
759 pos_defaults(pos_defaults),
760 named_defaults(named_defaults),
761 module_frame(module_frame) {
762 }
763
764 static value__Func* CreateNull(bool alloc_lists = false) {
765 return Alloc<value__Func>(kEmptyString, nullptr, alloc_lists ?
766 Alloc<List<value_t*>>() : nullptr, nullptr,
767 nullptr);
768 }
769
770 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
771
772 static constexpr ObjHeader obj_header() {
773 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Func), 5);
774 }
775
776 BigStr* name;
777 syntax_asdl::Func* parsed;
778 List<value_t*>* pos_defaults;
779 Dict<BigStr*, value_t*>* named_defaults;
780 Dict<BigStr*, runtime_asdl::Cell*>* module_frame;
781
782 DISALLOW_COPY_AND_ASSIGN(value__Func)
783};
784
785class value__BuiltinProc : public value_t {
786 public:
787 value__BuiltinProc(void* builtin)
788 : builtin(builtin) {
789 }
790
791 static value__BuiltinProc* CreateNull(bool alloc_lists = false) {
792 return Alloc<value__BuiltinProc>(nullptr);
793 }
794
795 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
796
797 static constexpr ObjHeader obj_header() {
798 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::BuiltinProc), 1);
799 }
800
801 void* builtin;
802
803 DISALLOW_COPY_AND_ASSIGN(value__BuiltinProc)
804};
805
806class value__Proc : public value_t {
807 public:
808 value__Proc(BigStr* name, syntax_asdl::Token* name_tok,
809 syntax_asdl::proc_sig_t* sig, syntax_asdl::command_t* body,
810 ProcDefaults* defaults, bool sh_compat, Dict<BigStr*,
811 runtime_asdl::Cell*>* module_frame)
812 : name(name),
813 name_tok(name_tok),
814 sig(sig),
815 body(body),
816 defaults(defaults),
817 module_frame(module_frame),
818 sh_compat(sh_compat) {
819 }
820
821 static value__Proc* CreateNull(bool alloc_lists = false) {
822 return Alloc<value__Proc>(kEmptyString, nullptr, nullptr, nullptr, nullptr,
823 false, nullptr);
824 }
825
826 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
827
828 static constexpr ObjHeader obj_header() {
829 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Proc), 6);
830 }
831
832 BigStr* name;
833 syntax_asdl::Token* name_tok;
834 syntax_asdl::proc_sig_t* sig;
835 syntax_asdl::command_t* body;
836 ProcDefaults* defaults;
837 Dict<BigStr*, runtime_asdl::Cell*>* module_frame;
838 bool sh_compat;
839
840 DISALLOW_COPY_AND_ASSIGN(value__Proc)
841};
842
843class value__Range : public value_t {
844 public:
845 value__Range(int lower, int upper)
846 : lower(lower),
847 upper(upper) {
848 }
849
850 static value__Range* CreateNull(bool alloc_lists = false) {
851 return Alloc<value__Range>(-1, -1);
852 }
853
854 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
855
856 static constexpr ObjHeader obj_header() {
857 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Range), 0);
858 }
859
860 int lower;
861 int upper;
862
863 DISALLOW_COPY_AND_ASSIGN(value__Range)
864};
865
866class value__Slice : public value_t {
867 public:
868 value__Slice(IntBox* lower, IntBox* upper)
869 : lower(lower),
870 upper(upper) {
871 }
872
873 static value__Slice* CreateNull(bool alloc_lists = false) {
874 return Alloc<value__Slice>(nullptr, nullptr);
875 }
876
877 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
878
879 static constexpr ObjHeader obj_header() {
880 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Slice), 2);
881 }
882
883 IntBox* lower;
884 IntBox* upper;
885
886 DISALLOW_COPY_AND_ASSIGN(value__Slice)
887};
888
889extern GcGlobal<value__Interrupted> gvalue__Interrupted;
890extern GcGlobal<value__Stdin> gvalue__Stdin;
891extern GcGlobal<value__Undef> gvalue__Undef;
892extern GcGlobal<value__Null> gvalue__Null;
893ASDL_NAMES value {
894 static value__Interrupted* Interrupted;
895 static value__Stdin* Stdin;
896 static value__Undef* Undef;
897 typedef value__Str Str;
898 typedef value__BashArray BashArray;
899 typedef value__SparseArray SparseArray;
900 typedef value__BashAssoc BashAssoc;
901 static value__Null* Null;
902 typedef value__Bool Bool;
903 typedef value__Int Int;
904 typedef value__Float Float;
905 typedef value__List List;
906 typedef value__Dict Dict;
907 typedef value__Eggex Eggex;
908 typedef value__Expr Expr;
909 typedef value__Command Command;
910 typedef value__Block Block;
911 typedef value__Place Place;
912 typedef value__Frame Frame;
913 typedef value__BuiltinFunc BuiltinFunc;
914 typedef value__BoundFunc BoundFunc;
915 typedef value__Func Func;
916 typedef value__BuiltinProc BuiltinProc;
917 typedef value__Proc Proc;
918 typedef value__Range Range;
919 typedef value__Slice Slice;
920};
921
922class IntBox {
923 public:
924 IntBox(int i)
925 : i(i) {
926 }
927
928 static IntBox* CreateNull(bool alloc_lists = false) {
929 return Alloc<IntBox>(-1);
930 }
931
932 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
933
934 static constexpr ObjHeader obj_header() {
935 return ObjHeader::AsdlClass(64, 0);
936 }
937
938 int i;
939
940 DISALLOW_COPY_AND_ASSIGN(IntBox)
941};
942
943class ProcDefaults {
944 public:
945 ProcDefaults(List<value_t*>* for_word, List<value_t*>* for_typed,
946 Dict<BigStr*, value_t*>* for_named, value_t* for_block)
947 : for_word(for_word),
948 for_typed(for_typed),
949 for_named(for_named),
950 for_block(for_block) {
951 }
952
953 static ProcDefaults* CreateNull(bool alloc_lists = false) {
954 return Alloc<ProcDefaults>(nullptr, nullptr, nullptr, nullptr);
955 }
956
957 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
958
959 static constexpr ObjHeader obj_header() {
960 return ObjHeader::AsdlClass(65, 4);
961 }
962
963 List<value_t*>* for_word;
964 List<value_t*>* for_typed;
965 Dict<BigStr*, value_t*>* for_named;
966 value_t* for_block;
967
968 DISALLOW_COPY_AND_ASSIGN(ProcDefaults)
969};
970
971class LeftName : public y_lvalue_t, public sh_lvalue_t {
972 public:
973 LeftName(BigStr* name, syntax_asdl::loc_t* blame_loc)
974 : name(name),
975 blame_loc(blame_loc) {
976 }
977
978 static LeftName* CreateNull(bool alloc_lists = false) {
979 return Alloc<LeftName>(kEmptyString, nullptr);
980 }
981
982 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
983
984 static constexpr ObjHeader obj_header() {
985 return ObjHeader::AsdlClass(66, 2);
986 }
987
988 BigStr* name;
989 syntax_asdl::loc_t* blame_loc;
990
991 DISALLOW_COPY_AND_ASSIGN(LeftName)
992};
993
994class RegexMatch : public regex_match_t, public value_t {
995 public:
996 RegexMatch(BigStr* s, List<int>* indices, eggex_ops_t* ops)
997 : s(s),
998 indices(indices),
999 ops(ops) {
1000 }
1001
1002 static RegexMatch* CreateNull(bool alloc_lists = false) {
1003 return Alloc<RegexMatch>(kEmptyString, alloc_lists ? Alloc<List<int>>() :
1004 nullptr, nullptr);
1005 }
1006
1007 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
1008
1009 static constexpr ObjHeader obj_header() {
1010 return ObjHeader::AsdlClass(67, 3);
1011 }
1012
1013 BigStr* s;
1014 List<int>* indices;
1015 eggex_ops_t* ops;
1016
1017 DISALLOW_COPY_AND_ASSIGN(RegexMatch)
1018};
1019
1020class Obj : public value_t {
1021 public:
1022 Obj(Obj* prototype, Dict<BigStr*, value_t*>* d)
1023 : prototype(prototype),
1024 d(d) {
1025 }
1026
1027 static Obj* CreateNull(bool alloc_lists = false) {
1028 return Alloc<Obj>(nullptr, nullptr);
1029 }
1030
1031 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
1032
1033 static constexpr ObjHeader obj_header() {
1034 return ObjHeader::AsdlClass(68, 2);
1035 }
1036
1037 Obj* prototype;
1038 Dict<BigStr*, value_t*>* d;
1039
1040 DISALLOW_COPY_AND_ASSIGN(Obj)
1041};
1042
1043
1044} // namespace value_asdl
1045
1046#endif // VALUE_ASDL