OILS / _gen / core / value.asdl.h View on Github | oils.pub

1360 lines, 897 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 "asdl/cpp_runtime.h"
10namespace syntax_asdl { class loc_t; class Token; class expr_t; class command_t; class DoubleQuoted; class re_t; class proc_sig_t; class Func; class NameType; class EggexFlag; class BraceGroup; class SourceLine; class debug_frame_t; class ShFunction; }
11
12namespace runtime_asdl { class Cell; }
13
14namespace value_asdl {
15
16// use struct instead of namespace so 'using' works consistently
17#define ASDL_NAMES struct
18
19class IntBox;
20class InitializerValue;
21class ProcDefaults;
22class LeftName;
23class y_lvalue_t;
24class sh_lvalue_t;
25class eggex_ops_t;
26class RegexMatch;
27class regex_match_t;
28class LiteralBlock;
29class cmd_frag_t;
30class Obj;
31class value_t;
32
33ASDL_NAMES y_lvalue_e {
34 enum no_name {
35 Local = 67,
36 Container = 2,
37 };
38};
39
40BigStr* y_lvalue_str(int tag, bool dot = true);
41
42class y_lvalue_t {
43 protected:
44 y_lvalue_t() {
45 }
46 public:
47 int tag() const {
48 return ObjHeader::FromObject(this)->type_tag;
49 }
50 constexpr int sum_type_id() {
51 return 256;
52 }
53 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
54
55 DISALLOW_COPY_AND_ASSIGN(y_lvalue_t)
56};
57
58class y_lvalue__Container : public y_lvalue_t {
59 public:
60 y_lvalue__Container(value_t* obj, value_t* index)
61 : obj(obj),
62 index(index) {
63 }
64
65 static y_lvalue__Container* CreateNull(bool alloc_lists = false) {
66 return Alloc<y_lvalue__Container>(nullptr, nullptr);
67 }
68
69 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
70
71 int type_id() {
72 return this->sum_type_id() + this->tag();
73 }
74
75 static constexpr ObjHeader obj_header() {
76 return ObjHeader::AsdlClass(static_cast<uint16_t>(y_lvalue_e::Container),
77 2);
78 }
79 value_t* obj;
80 value_t* index;
81
82 DISALLOW_COPY_AND_ASSIGN(y_lvalue__Container)
83};
84
85ASDL_NAMES y_lvalue {
86 typedef y_lvalue__Container Container;
87};
88
89ASDL_NAMES sh_lvalue_e {
90 enum no_name {
91 Var = 67,
92 Indexed = 2,
93 Keyed = 3,
94 };
95};
96
97BigStr* sh_lvalue_str(int tag, bool dot = true);
98
99class sh_lvalue_t {
100 protected:
101 sh_lvalue_t() {
102 }
103 public:
104 int tag() const {
105 return ObjHeader::FromObject(this)->type_tag;
106 }
107 constexpr int sum_type_id() {
108 return 320;
109 }
110 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
111
112 DISALLOW_COPY_AND_ASSIGN(sh_lvalue_t)
113};
114
115class sh_lvalue__Indexed : public sh_lvalue_t {
116 public:
117 sh_lvalue__Indexed(BigStr* name, int index, syntax_asdl::loc_t* blame_loc)
118 : name(name),
119 blame_loc(blame_loc),
120 index(index) {
121 }
122
123 static sh_lvalue__Indexed* CreateNull(bool alloc_lists = false) {
124 return Alloc<sh_lvalue__Indexed>(kEmptyString, -1, nullptr);
125 }
126
127 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
128
129 int type_id() {
130 return this->sum_type_id() + this->tag();
131 }
132
133 static constexpr ObjHeader obj_header() {
134 return ObjHeader::AsdlClass(static_cast<uint16_t>(sh_lvalue_e::Indexed), 2);
135 }
136 BigStr* name;
137 syntax_asdl::loc_t* blame_loc;
138 int index;
139
140 DISALLOW_COPY_AND_ASSIGN(sh_lvalue__Indexed)
141};
142
143class sh_lvalue__Keyed : public sh_lvalue_t {
144 public:
145 sh_lvalue__Keyed(BigStr* name, BigStr* key, syntax_asdl::loc_t* blame_loc)
146 : name(name),
147 key(key),
148 blame_loc(blame_loc) {
149 }
150
151 static sh_lvalue__Keyed* CreateNull(bool alloc_lists = false) {
152 return Alloc<sh_lvalue__Keyed>(kEmptyString, kEmptyString, nullptr);
153 }
154
155 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
156
157 int type_id() {
158 return this->sum_type_id() + this->tag();
159 }
160
161 static constexpr ObjHeader obj_header() {
162 return ObjHeader::AsdlClass(static_cast<uint16_t>(sh_lvalue_e::Keyed), 3);
163 }
164 BigStr* name;
165 BigStr* key;
166 syntax_asdl::loc_t* blame_loc;
167
168 DISALLOW_COPY_AND_ASSIGN(sh_lvalue__Keyed)
169};
170
171ASDL_NAMES sh_lvalue {
172 typedef sh_lvalue__Indexed Indexed;
173 typedef sh_lvalue__Keyed Keyed;
174};
175
176ASDL_NAMES eggex_ops_e {
177 enum no_name {
178 No = 1,
179 Yes = 2,
180 };
181};
182
183BigStr* eggex_ops_str(int tag, bool dot = true);
184
185class eggex_ops_t {
186 protected:
187 eggex_ops_t() {
188 }
189 public:
190 int tag() const {
191 return ObjHeader::FromObject(this)->type_tag;
192 }
193 constexpr int sum_type_id() {
194 return 384;
195 }
196 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
197
198 DISALLOW_COPY_AND_ASSIGN(eggex_ops_t)
199};
200
201class eggex_ops__No : public eggex_ops_t {
202 public:
203 eggex_ops__No() {}
204
205 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
206
207 int type_id() {
208 return this->sum_type_id() + this->tag();
209 }
210
211 static constexpr ObjHeader obj_header() {
212 return ObjHeader::AsdlClass(static_cast<uint16_t>(eggex_ops_e::No), 0);
213 }
214
215 DISALLOW_COPY_AND_ASSIGN(eggex_ops__No)
216};
217
218class eggex_ops__Yes : public eggex_ops_t {
219 public:
220 eggex_ops__Yes(List<value_t*>* convert_funcs, List<syntax_asdl::Token*>*
221 convert_toks, List<BigStr*>* capture_names)
222 : convert_funcs(convert_funcs),
223 convert_toks(convert_toks),
224 capture_names(capture_names) {
225 }
226
227 static eggex_ops__Yes* CreateNull(bool alloc_lists = false) {
228 return Alloc<eggex_ops__Yes>(alloc_lists ? Alloc<List<value_t*>>() :
229 nullptr, alloc_lists ?
230 Alloc<List<syntax_asdl::Token*>>() : nullptr,
231 alloc_lists ? Alloc<List<BigStr*>>() :
232 nullptr);
233 }
234
235 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
236
237 int type_id() {
238 return this->sum_type_id() + this->tag();
239 }
240
241 static constexpr ObjHeader obj_header() {
242 return ObjHeader::AsdlClass(static_cast<uint16_t>(eggex_ops_e::Yes), 3);
243 }
244 List<value_t*>* convert_funcs;
245 List<syntax_asdl::Token*>* convert_toks;
246 List<BigStr*>* capture_names;
247
248 DISALLOW_COPY_AND_ASSIGN(eggex_ops__Yes)
249};
250
251extern GcGlobal<eggex_ops__No> geggex_ops__No;
252ASDL_NAMES eggex_ops {
253 static eggex_ops__No* No;
254 typedef eggex_ops__Yes Yes;
255};
256
257ASDL_NAMES regex_match_e {
258 enum no_name {
259 No = 1,
260 Yes = 68,
261 };
262};
263
264BigStr* regex_match_str(int tag, bool dot = true);
265
266class regex_match_t {
267 protected:
268 regex_match_t() {
269 }
270 public:
271 int tag() const {
272 return ObjHeader::FromObject(this)->type_tag;
273 }
274 constexpr int sum_type_id() {
275 return 448;
276 }
277 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
278
279 DISALLOW_COPY_AND_ASSIGN(regex_match_t)
280};
281
282class regex_match__No : public regex_match_t {
283 public:
284 regex_match__No() {}
285
286 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
287
288 int type_id() {
289 return this->sum_type_id() + this->tag();
290 }
291
292 static constexpr ObjHeader obj_header() {
293 return ObjHeader::AsdlClass(static_cast<uint16_t>(regex_match_e::No), 0);
294 }
295
296 DISALLOW_COPY_AND_ASSIGN(regex_match__No)
297};
298
299extern GcGlobal<regex_match__No> gregex_match__No;
300ASDL_NAMES regex_match {
301 static regex_match__No* No;
302};
303
304ASDL_NAMES cmd_frag_e {
305 enum no_name {
306 LiteralBlock = 69,
307 Expr = 2,
308 };
309};
310
311BigStr* cmd_frag_str(int tag, bool dot = true);
312
313class cmd_frag_t {
314 protected:
315 cmd_frag_t() {
316 }
317 public:
318 int tag() const {
319 return ObjHeader::FromObject(this)->type_tag;
320 }
321 constexpr int sum_type_id() {
322 return 512;
323 }
324 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
325
326 DISALLOW_COPY_AND_ASSIGN(cmd_frag_t)
327};
328
329class cmd_frag__Expr : public cmd_frag_t {
330 public:
331 cmd_frag__Expr(syntax_asdl::command_t* c)
332 : c(c) {
333 }
334
335 static cmd_frag__Expr* CreateNull(bool alloc_lists = false) {
336 return Alloc<cmd_frag__Expr>(nullptr);
337 }
338
339 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
340
341 int type_id() {
342 return this->sum_type_id() + this->tag();
343 }
344
345 static constexpr ObjHeader obj_header() {
346 return ObjHeader::AsdlClass(static_cast<uint16_t>(cmd_frag_e::Expr), 1);
347 }
348 syntax_asdl::command_t* c;
349
350 DISALLOW_COPY_AND_ASSIGN(cmd_frag__Expr)
351};
352
353ASDL_NAMES cmd_frag {
354 typedef cmd_frag__Expr Expr;
355};
356
357ASDL_NAMES value_e {
358 enum no_name {
359 Interrupted = 1,
360 Stdin = 2,
361 Slice = 3,
362 Undef = 4,
363 Str = 5,
364 InitializerList = 6,
365 InternalStringArray = 7,
366 BashArray = 8,
367 BashAssoc = 9,
368 Null = 10,
369 Bool = 11,
370 Int = 12,
371 Float = 13,
372 List = 14,
373 Dict = 15,
374 Obj = 70,
375 Range = 17,
376 Eggex = 18,
377 Match = 68,
378 Place = 20,
379 Frame = 21,
380 DebugFrame = 22,
381 BoundFunc = 23,
382 BuiltinFunc = 24,
383 Func = 25,
384 BuiltinProc = 26,
385 Proc = 27,
386 Expr = 28,
387 CommandFrag = 29,
388 Command = 30,
389 };
390};
391
392BigStr* value_str(int tag, bool dot = true);
393
394class value_t {
395 protected:
396 value_t() {
397 }
398 public:
399 int tag() const {
400 return ObjHeader::FromObject(this)->type_tag;
401 }
402 constexpr int sum_type_id() {
403 return 576;
404 }
405 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
406
407 DISALLOW_COPY_AND_ASSIGN(value_t)
408};
409
410class value__Interrupted : public value_t {
411 public:
412 value__Interrupted() {}
413
414 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
415
416 int type_id() {
417 return this->sum_type_id() + this->tag();
418 }
419
420 static constexpr ObjHeader obj_header() {
421 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Interrupted), 0);
422 }
423
424 DISALLOW_COPY_AND_ASSIGN(value__Interrupted)
425};
426
427class value__Stdin : public value_t {
428 public:
429 value__Stdin() {}
430
431 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
432
433 int type_id() {
434 return this->sum_type_id() + this->tag();
435 }
436
437 static constexpr ObjHeader obj_header() {
438 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Stdin), 0);
439 }
440
441 DISALLOW_COPY_AND_ASSIGN(value__Stdin)
442};
443
444class value__Slice : public value_t {
445 public:
446 value__Slice(IntBox* lower, IntBox* upper)
447 : lower(lower),
448 upper(upper) {
449 }
450
451 static value__Slice* CreateNull(bool alloc_lists = false) {
452 return Alloc<value__Slice>(nullptr, nullptr);
453 }
454
455 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
456
457 int type_id() {
458 return this->sum_type_id() + this->tag();
459 }
460
461 static constexpr ObjHeader obj_header() {
462 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Slice), 2);
463 }
464 IntBox* lower;
465 IntBox* upper;
466
467 DISALLOW_COPY_AND_ASSIGN(value__Slice)
468};
469
470class value__Undef : public value_t {
471 public:
472 value__Undef() {}
473
474 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
475
476 int type_id() {
477 return this->sum_type_id() + this->tag();
478 }
479
480 static constexpr ObjHeader obj_header() {
481 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Undef), 0);
482 }
483
484 DISALLOW_COPY_AND_ASSIGN(value__Undef)
485};
486
487class value__Str : public value_t {
488 public:
489 value__Str(BigStr* s)
490 : s(s) {
491 }
492
493 static value__Str* CreateNull(bool alloc_lists = false) {
494 return Alloc<value__Str>(kEmptyString);
495 }
496
497 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
498
499 int type_id() {
500 return this->sum_type_id() + this->tag();
501 }
502
503 static constexpr ObjHeader obj_header() {
504 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Str), 1);
505 }
506 BigStr* s;
507
508 DISALLOW_COPY_AND_ASSIGN(value__Str)
509};
510
511class value__InitializerList : public value_t {
512 public:
513 value__InitializerList(List<InitializerValue*>* assigns)
514 : assigns(assigns) {
515 }
516
517 static value__InitializerList* CreateNull(bool alloc_lists = false) {
518 return Alloc<value__InitializerList>(alloc_lists ?
519 Alloc<List<InitializerValue*>>() :
520 nullptr);
521 }
522
523 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
524
525 int type_id() {
526 return this->sum_type_id() + this->tag();
527 }
528
529 static constexpr ObjHeader obj_header() {
530 return
531 ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::InitializerList), 1);
532 }
533 List<InitializerValue*>* assigns;
534
535 DISALLOW_COPY_AND_ASSIGN(value__InitializerList)
536};
537
538class value__InternalStringArray : public value_t {
539 public:
540 value__InternalStringArray(List<BigStr*>* strs)
541 : strs(strs) {
542 }
543
544 static value__InternalStringArray* CreateNull(bool alloc_lists = false) {
545 return Alloc<value__InternalStringArray>(alloc_lists ?
546 Alloc<List<BigStr*>>() : nullptr);
547 }
548
549 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
550
551 int type_id() {
552 return this->sum_type_id() + this->tag();
553 }
554
555 static constexpr ObjHeader obj_header() {
556 return
557 ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::InternalStringArray), 1);
558 }
559 List<BigStr*>* strs;
560
561 DISALLOW_COPY_AND_ASSIGN(value__InternalStringArray)
562};
563
564class value__BashArray : public value_t {
565 public:
566 value__BashArray(Dict<mops::BigInt, BigStr*>* d, mops::BigInt max_index)
567 : d(d),
568 max_index(max_index) {
569 }
570
571 static value__BashArray* CreateNull(bool alloc_lists = false) {
572 return Alloc<value__BashArray>(nullptr, -1);
573 }
574
575 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
576
577 int type_id() {
578 return this->sum_type_id() + this->tag();
579 }
580
581 static constexpr ObjHeader obj_header() {
582 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::BashArray), 1);
583 }
584 Dict<mops::BigInt, BigStr*>* d;
585 mops::BigInt max_index;
586
587 DISALLOW_COPY_AND_ASSIGN(value__BashArray)
588};
589
590class value__BashAssoc : public value_t {
591 public:
592 value__BashAssoc(Dict<BigStr*, BigStr*>* d)
593 : d(d) {
594 }
595
596 static value__BashAssoc* CreateNull(bool alloc_lists = false) {
597 return Alloc<value__BashAssoc>(nullptr);
598 }
599
600 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
601
602 int type_id() {
603 return this->sum_type_id() + this->tag();
604 }
605
606 static constexpr ObjHeader obj_header() {
607 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::BashAssoc), 1);
608 }
609 Dict<BigStr*, BigStr*>* d;
610
611 DISALLOW_COPY_AND_ASSIGN(value__BashAssoc)
612};
613
614class value__Null : public value_t {
615 public:
616 value__Null() {}
617
618 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
619
620 int type_id() {
621 return this->sum_type_id() + this->tag();
622 }
623
624 static constexpr ObjHeader obj_header() {
625 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Null), 0);
626 }
627
628 DISALLOW_COPY_AND_ASSIGN(value__Null)
629};
630
631class value__Bool : public value_t {
632 public:
633 value__Bool(bool b)
634 : b(b) {
635 }
636
637 static value__Bool* CreateNull(bool alloc_lists = false) {
638 return Alloc<value__Bool>(false);
639 }
640
641 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
642
643 int type_id() {
644 return this->sum_type_id() + this->tag();
645 }
646
647 static constexpr ObjHeader obj_header() {
648 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Bool), 0);
649 }
650 bool b;
651
652 DISALLOW_COPY_AND_ASSIGN(value__Bool)
653};
654
655class value__Int : public value_t {
656 public:
657 value__Int(mops::BigInt i)
658 : i(i) {
659 }
660
661 static value__Int* CreateNull(bool alloc_lists = false) {
662 return Alloc<value__Int>(-1);
663 }
664
665 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
666
667 int type_id() {
668 return this->sum_type_id() + this->tag();
669 }
670
671 static constexpr ObjHeader obj_header() {
672 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Int), 0);
673 }
674 mops::BigInt i;
675
676 DISALLOW_COPY_AND_ASSIGN(value__Int)
677};
678
679class value__Float : public value_t {
680 public:
681 value__Float(double f)
682 : f(f) {
683 }
684
685 static value__Float* CreateNull(bool alloc_lists = false) {
686 return Alloc<value__Float>(0.0);
687 }
688
689 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
690
691 int type_id() {
692 return this->sum_type_id() + this->tag();
693 }
694
695 static constexpr ObjHeader obj_header() {
696 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Float), 0);
697 }
698 double f;
699
700 DISALLOW_COPY_AND_ASSIGN(value__Float)
701};
702
703class value__List : public value_t {
704 public:
705 value__List(List<value_t*>* items)
706 : items(items) {
707 }
708
709 static value__List* CreateNull(bool alloc_lists = false) {
710 return Alloc<value__List>(alloc_lists ? Alloc<List<value_t*>>() : nullptr);
711 }
712
713 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
714
715 int type_id() {
716 return this->sum_type_id() + this->tag();
717 }
718
719 static constexpr ObjHeader obj_header() {
720 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::List), 1);
721 }
722 List<value_t*>* items;
723
724 DISALLOW_COPY_AND_ASSIGN(value__List)
725};
726
727class value__Dict : public value_t {
728 public:
729 value__Dict(Dict<BigStr*, value_t*>* d)
730 : d(d) {
731 }
732
733 static value__Dict* CreateNull(bool alloc_lists = false) {
734 return Alloc<value__Dict>(nullptr);
735 }
736
737 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
738
739 int type_id() {
740 return this->sum_type_id() + this->tag();
741 }
742
743 static constexpr ObjHeader obj_header() {
744 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Dict), 1);
745 }
746 Dict<BigStr*, value_t*>* d;
747
748 DISALLOW_COPY_AND_ASSIGN(value__Dict)
749};
750
751class value__Range : public value_t {
752 public:
753 value__Range(int lower, int upper)
754 : lower(lower),
755 upper(upper) {
756 }
757
758 static value__Range* CreateNull(bool alloc_lists = false) {
759 return Alloc<value__Range>(-1, -1);
760 }
761
762 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
763
764 int type_id() {
765 return this->sum_type_id() + this->tag();
766 }
767
768 static constexpr ObjHeader obj_header() {
769 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Range), 0);
770 }
771 int lower;
772 int upper;
773
774 DISALLOW_COPY_AND_ASSIGN(value__Range)
775};
776
777class value__Eggex : public value_t {
778 public:
779 value__Eggex(syntax_asdl::re_t* spliced, BigStr* canonical_flags,
780 List<value_t*>* convert_funcs, List<syntax_asdl::Token*>*
781 convert_toks, BigStr* as_ere, List<BigStr*>* capture_names)
782 : spliced(spliced),
783 canonical_flags(canonical_flags),
784 convert_funcs(convert_funcs),
785 convert_toks(convert_toks),
786 as_ere(as_ere),
787 capture_names(capture_names) {
788 }
789
790 static value__Eggex* CreateNull(bool alloc_lists = false) {
791 return Alloc<value__Eggex>(nullptr, kEmptyString, alloc_lists ?
792 Alloc<List<value_t*>>() : nullptr, alloc_lists ?
793 Alloc<List<syntax_asdl::Token*>>() : nullptr,
794 nullptr, alloc_lists ? Alloc<List<BigStr*>>() :
795 nullptr);
796 }
797
798 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
799
800 int type_id() {
801 return this->sum_type_id() + this->tag();
802 }
803
804 static constexpr ObjHeader obj_header() {
805 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Eggex), 6);
806 }
807 syntax_asdl::re_t* spliced;
808 BigStr* canonical_flags;
809 List<value_t*>* convert_funcs;
810 List<syntax_asdl::Token*>* convert_toks;
811 BigStr* as_ere;
812 List<BigStr*>* capture_names;
813
814 DISALLOW_COPY_AND_ASSIGN(value__Eggex)
815};
816
817class value__Place : public value_t {
818 public:
819 value__Place(y_lvalue_t* lval, Dict<BigStr*, runtime_asdl::Cell*>* frame)
820 : lval(lval),
821 frame(frame) {
822 }
823
824 static value__Place* CreateNull(bool alloc_lists = false) {
825 return Alloc<value__Place>(nullptr, nullptr);
826 }
827
828 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
829
830 int type_id() {
831 return this->sum_type_id() + this->tag();
832 }
833
834 static constexpr ObjHeader obj_header() {
835 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Place), 2);
836 }
837 y_lvalue_t* lval;
838 Dict<BigStr*, runtime_asdl::Cell*>* frame;
839
840 DISALLOW_COPY_AND_ASSIGN(value__Place)
841};
842
843class value__Frame : public value_t {
844 public:
845 value__Frame(Dict<BigStr*, runtime_asdl::Cell*>* frame)
846 : frame(frame) {
847 }
848
849 static value__Frame* CreateNull(bool alloc_lists = false) {
850 return Alloc<value__Frame>(nullptr);
851 }
852
853 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
854
855 int type_id() {
856 return this->sum_type_id() + this->tag();
857 }
858
859 static constexpr ObjHeader obj_header() {
860 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Frame), 1);
861 }
862 Dict<BigStr*, runtime_asdl::Cell*>* frame;
863
864 DISALLOW_COPY_AND_ASSIGN(value__Frame)
865};
866
867class value__DebugFrame : public value_t {
868 public:
869 value__DebugFrame(syntax_asdl::debug_frame_t* frame)
870 : frame(frame) {
871 }
872
873 static value__DebugFrame* CreateNull(bool alloc_lists = false) {
874 return Alloc<value__DebugFrame>(nullptr);
875 }
876
877 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
878
879 int type_id() {
880 return this->sum_type_id() + this->tag();
881 }
882
883 static constexpr ObjHeader obj_header() {
884 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::DebugFrame), 1);
885 }
886 syntax_asdl::debug_frame_t* frame;
887
888 DISALLOW_COPY_AND_ASSIGN(value__DebugFrame)
889};
890
891class value__BoundFunc : public value_t {
892 public:
893 value__BoundFunc(value_t* me, value_t* func)
894 : me(me),
895 func(func) {
896 }
897
898 static value__BoundFunc* CreateNull(bool alloc_lists = false) {
899 return Alloc<value__BoundFunc>(nullptr, nullptr);
900 }
901
902 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
903
904 int type_id() {
905 return this->sum_type_id() + this->tag();
906 }
907
908 static constexpr ObjHeader obj_header() {
909 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::BoundFunc), 2);
910 }
911 value_t* me;
912 value_t* func;
913
914 DISALLOW_COPY_AND_ASSIGN(value__BoundFunc)
915};
916
917class value__BuiltinFunc : public value_t {
918 public:
919 value__BuiltinFunc(void* callable)
920 : callable(callable) {
921 }
922
923 static value__BuiltinFunc* CreateNull(bool alloc_lists = false) {
924 return Alloc<value__BuiltinFunc>(nullptr);
925 }
926
927 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
928
929 int type_id() {
930 return this->sum_type_id() + this->tag();
931 }
932
933 static constexpr ObjHeader obj_header() {
934 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::BuiltinFunc), 1);
935 }
936 void* callable;
937
938 DISALLOW_COPY_AND_ASSIGN(value__BuiltinFunc)
939};
940
941class value__Func : public value_t {
942 public:
943 value__Func(BigStr* name, syntax_asdl::Func* parsed, List<value_t*>*
944 pos_defaults, Dict<BigStr*, value_t*>* named_defaults,
945 Dict<BigStr*, runtime_asdl::Cell*>* captured_frame, Dict<BigStr*,
946 runtime_asdl::Cell*>* module_frame)
947 : name(name),
948 parsed(parsed),
949 pos_defaults(pos_defaults),
950 named_defaults(named_defaults),
951 captured_frame(captured_frame),
952 module_frame(module_frame) {
953 }
954
955 static value__Func* CreateNull(bool alloc_lists = false) {
956 return Alloc<value__Func>(kEmptyString, nullptr, alloc_lists ?
957 Alloc<List<value_t*>>() : nullptr, nullptr,
958 nullptr, nullptr);
959 }
960
961 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
962
963 int type_id() {
964 return this->sum_type_id() + this->tag();
965 }
966
967 static constexpr ObjHeader obj_header() {
968 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Func), 6);
969 }
970 BigStr* name;
971 syntax_asdl::Func* parsed;
972 List<value_t*>* pos_defaults;
973 Dict<BigStr*, value_t*>* named_defaults;
974 Dict<BigStr*, runtime_asdl::Cell*>* captured_frame;
975 Dict<BigStr*, runtime_asdl::Cell*>* module_frame;
976
977 DISALLOW_COPY_AND_ASSIGN(value__Func)
978};
979
980class value__BuiltinProc : public value_t {
981 public:
982 value__BuiltinProc(void* builtin)
983 : builtin(builtin) {
984 }
985
986 static value__BuiltinProc* CreateNull(bool alloc_lists = false) {
987 return Alloc<value__BuiltinProc>(nullptr);
988 }
989
990 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
991
992 int type_id() {
993 return this->sum_type_id() + this->tag();
994 }
995
996 static constexpr ObjHeader obj_header() {
997 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::BuiltinProc), 1);
998 }
999 void* builtin;
1000
1001 DISALLOW_COPY_AND_ASSIGN(value__BuiltinProc)
1002};
1003
1004class value__Proc : public value_t {
1005 public:
1006 value__Proc(BigStr* name, syntax_asdl::Token* name_tok,
1007 syntax_asdl::proc_sig_t* sig, syntax_asdl::command_t* body,
1008 ProcDefaults* defaults, bool sh_compat, Dict<BigStr*,
1009 runtime_asdl::Cell*>* captured_frame, Dict<BigStr*,
1010 runtime_asdl::Cell*>* module_frame, BigStr* code_str)
1011 : name(name),
1012 name_tok(name_tok),
1013 sig(sig),
1014 body(body),
1015 defaults(defaults),
1016 captured_frame(captured_frame),
1017 module_frame(module_frame),
1018 code_str(code_str),
1019 sh_compat(sh_compat) {
1020 }
1021
1022 static value__Proc* CreateNull(bool alloc_lists = false) {
1023 return Alloc<value__Proc>(kEmptyString, nullptr, nullptr, nullptr, nullptr,
1024 false, nullptr, nullptr, nullptr);
1025 }
1026
1027 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
1028
1029 int type_id() {
1030 return this->sum_type_id() + this->tag();
1031 }
1032
1033 static constexpr ObjHeader obj_header() {
1034 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Proc), 8);
1035 }
1036 BigStr* name;
1037 syntax_asdl::Token* name_tok;
1038 syntax_asdl::proc_sig_t* sig;
1039 syntax_asdl::command_t* body;
1040 ProcDefaults* defaults;
1041 Dict<BigStr*, runtime_asdl::Cell*>* captured_frame;
1042 Dict<BigStr*, runtime_asdl::Cell*>* module_frame;
1043 BigStr* code_str;
1044 bool sh_compat;
1045
1046 DISALLOW_COPY_AND_ASSIGN(value__Proc)
1047};
1048
1049class value__Expr : public value_t {
1050 public:
1051 value__Expr(syntax_asdl::expr_t* e, Dict<BigStr*, runtime_asdl::Cell*>*
1052 captured_frame, Dict<BigStr*, runtime_asdl::Cell*>* module_frame)
1053 : e(e),
1054 captured_frame(captured_frame),
1055 module_frame(module_frame) {
1056 }
1057
1058 static value__Expr* CreateNull(bool alloc_lists = false) {
1059 return Alloc<value__Expr>(nullptr, nullptr, nullptr);
1060 }
1061
1062 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
1063
1064 int type_id() {
1065 return this->sum_type_id() + this->tag();
1066 }
1067
1068 static constexpr ObjHeader obj_header() {
1069 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Expr), 3);
1070 }
1071 syntax_asdl::expr_t* e;
1072 Dict<BigStr*, runtime_asdl::Cell*>* captured_frame;
1073 Dict<BigStr*, runtime_asdl::Cell*>* module_frame;
1074
1075 DISALLOW_COPY_AND_ASSIGN(value__Expr)
1076};
1077
1078class value__CommandFrag : public value_t {
1079 public:
1080 value__CommandFrag(syntax_asdl::command_t* c)
1081 : c(c) {
1082 }
1083
1084 static value__CommandFrag* CreateNull(bool alloc_lists = false) {
1085 return Alloc<value__CommandFrag>(nullptr);
1086 }
1087
1088 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
1089
1090 int type_id() {
1091 return this->sum_type_id() + this->tag();
1092 }
1093
1094 static constexpr ObjHeader obj_header() {
1095 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::CommandFrag), 1);
1096 }
1097 syntax_asdl::command_t* c;
1098
1099 DISALLOW_COPY_AND_ASSIGN(value__CommandFrag)
1100};
1101
1102class value__Command : public value_t {
1103 public:
1104 value__Command(cmd_frag_t* frag, Dict<BigStr*, runtime_asdl::Cell*>*
1105 captured_frame, Dict<BigStr*, runtime_asdl::Cell*>*
1106 module_frame)
1107 : frag(frag),
1108 captured_frame(captured_frame),
1109 module_frame(module_frame) {
1110 }
1111
1112 static value__Command* CreateNull(bool alloc_lists = false) {
1113 return Alloc<value__Command>(nullptr, nullptr, nullptr);
1114 }
1115
1116 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
1117
1118 int type_id() {
1119 return this->sum_type_id() + this->tag();
1120 }
1121
1122 static constexpr ObjHeader obj_header() {
1123 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Command), 3);
1124 }
1125 cmd_frag_t* frag;
1126 Dict<BigStr*, runtime_asdl::Cell*>* captured_frame;
1127 Dict<BigStr*, runtime_asdl::Cell*>* module_frame;
1128
1129 DISALLOW_COPY_AND_ASSIGN(value__Command)
1130};
1131
1132extern GcGlobal<value__Interrupted> gvalue__Interrupted;
1133extern GcGlobal<value__Stdin> gvalue__Stdin;
1134extern GcGlobal<value__Undef> gvalue__Undef;
1135extern GcGlobal<value__Null> gvalue__Null;
1136ASDL_NAMES value {
1137 static value__Interrupted* Interrupted;
1138 static value__Stdin* Stdin;
1139 typedef value__Slice Slice;
1140 static value__Undef* Undef;
1141 typedef value__Str Str;
1142 typedef value__InitializerList InitializerList;
1143 typedef value__InternalStringArray InternalStringArray;
1144 typedef value__BashArray BashArray;
1145 typedef value__BashAssoc BashAssoc;
1146 static value__Null* Null;
1147 typedef value__Bool Bool;
1148 typedef value__Int Int;
1149 typedef value__Float Float;
1150 typedef value__List List;
1151 typedef value__Dict Dict;
1152 typedef value__Range Range;
1153 typedef value__Eggex Eggex;
1154 typedef value__Place Place;
1155 typedef value__Frame Frame;
1156 typedef value__DebugFrame DebugFrame;
1157 typedef value__BoundFunc BoundFunc;
1158 typedef value__BuiltinFunc BuiltinFunc;
1159 typedef value__Func Func;
1160 typedef value__BuiltinProc BuiltinProc;
1161 typedef value__Proc Proc;
1162 typedef value__Expr Expr;
1163 typedef value__CommandFrag CommandFrag;
1164 typedef value__Command Command;
1165};
1166
1167class IntBox {
1168 public:
1169 IntBox(int i)
1170 : i(i) {
1171 }
1172
1173 static IntBox* CreateNull(bool alloc_lists = false) {
1174 return Alloc<IntBox>(-1);
1175 }
1176
1177 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
1178
1179 int type_id() {
1180 return ObjHeader::FromObject(this)->type_tag;
1181 }
1182
1183 static constexpr ObjHeader obj_header() {
1184 return ObjHeader::AsdlClass(64, 0);
1185 }
1186 int i;
1187
1188 DISALLOW_COPY_AND_ASSIGN(IntBox)
1189};
1190
1191class InitializerValue {
1192 public:
1193 InitializerValue(BigStr* key, BigStr* rval, bool plus_eq)
1194 : key(key),
1195 rval(rval),
1196 plus_eq(plus_eq) {
1197 }
1198
1199 static InitializerValue* CreateNull(bool alloc_lists = false) {
1200 return Alloc<InitializerValue>(nullptr, kEmptyString, false);
1201 }
1202
1203 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
1204
1205 int type_id() {
1206 return ObjHeader::FromObject(this)->type_tag;
1207 }
1208
1209 static constexpr ObjHeader obj_header() {
1210 return ObjHeader::AsdlClass(65, 2);
1211 }
1212 BigStr* key;
1213 BigStr* rval;
1214 bool plus_eq;
1215
1216 DISALLOW_COPY_AND_ASSIGN(InitializerValue)
1217};
1218
1219class ProcDefaults {
1220 public:
1221 ProcDefaults(List<value_t*>* for_word, List<value_t*>* for_typed,
1222 Dict<BigStr*, value_t*>* for_named, value_t* for_block)
1223 : for_word(for_word),
1224 for_typed(for_typed),
1225 for_named(for_named),
1226 for_block(for_block) {
1227 }
1228
1229 static ProcDefaults* CreateNull(bool alloc_lists = false) {
1230 return Alloc<ProcDefaults>(nullptr, nullptr, nullptr, nullptr);
1231 }
1232
1233 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
1234
1235 int type_id() {
1236 return ObjHeader::FromObject(this)->type_tag;
1237 }
1238
1239 static constexpr ObjHeader obj_header() {
1240 return ObjHeader::AsdlClass(66, 4);
1241 }
1242 List<value_t*>* for_word;
1243 List<value_t*>* for_typed;
1244 Dict<BigStr*, value_t*>* for_named;
1245 value_t* for_block;
1246
1247 DISALLOW_COPY_AND_ASSIGN(ProcDefaults)
1248};
1249
1250class LeftName : public y_lvalue_t, public sh_lvalue_t {
1251 public:
1252 LeftName(BigStr* name, syntax_asdl::loc_t* blame_loc)
1253 : name(name),
1254 blame_loc(blame_loc) {
1255 }
1256
1257 static LeftName* CreateNull(bool alloc_lists = false) {
1258 return Alloc<LeftName>(kEmptyString, nullptr);
1259 }
1260
1261 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
1262
1263 int type_id() {
1264 return ObjHeader::FromObject(this)->type_tag;
1265 }
1266
1267 static constexpr ObjHeader obj_header() {
1268 return ObjHeader::AsdlClass(67, 2);
1269 }
1270 BigStr* name;
1271 syntax_asdl::loc_t* blame_loc;
1272
1273 DISALLOW_COPY_AND_ASSIGN(LeftName)
1274};
1275
1276class RegexMatch : public regex_match_t, public value_t {
1277 public:
1278 RegexMatch(BigStr* s, List<int>* indices, eggex_ops_t* ops)
1279 : s(s),
1280 indices(indices),
1281 ops(ops) {
1282 }
1283
1284 static RegexMatch* CreateNull(bool alloc_lists = false) {
1285 return Alloc<RegexMatch>(kEmptyString, alloc_lists ? Alloc<List<int>>() :
1286 nullptr, nullptr);
1287 }
1288
1289 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
1290
1291 int type_id() {
1292 return ObjHeader::FromObject(this)->type_tag;
1293 }
1294
1295 static constexpr ObjHeader obj_header() {
1296 return ObjHeader::AsdlClass(68, 3);
1297 }
1298 BigStr* s;
1299 List<int>* indices;
1300 eggex_ops_t* ops;
1301
1302 DISALLOW_COPY_AND_ASSIGN(RegexMatch)
1303};
1304
1305class LiteralBlock : public cmd_frag_t {
1306 public:
1307 LiteralBlock(syntax_asdl::BraceGroup* brace_group, BigStr* code_str)
1308 : brace_group(brace_group),
1309 code_str(code_str) {
1310 }
1311
1312 static LiteralBlock* CreateNull(bool alloc_lists = false) {
1313 return Alloc<LiteralBlock>(nullptr, nullptr);
1314 }
1315
1316 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
1317
1318 int type_id() {
1319 return ObjHeader::FromObject(this)->type_tag;
1320 }
1321
1322 static constexpr ObjHeader obj_header() {
1323 return ObjHeader::AsdlClass(69, 2);
1324 }
1325 syntax_asdl::BraceGroup* brace_group;
1326 BigStr* code_str;
1327
1328 DISALLOW_COPY_AND_ASSIGN(LiteralBlock)
1329};
1330
1331class Obj : public value_t {
1332 public:
1333 Obj(Obj* prototype, Dict<BigStr*, value_t*>* d)
1334 : prototype(prototype),
1335 d(d) {
1336 }
1337
1338 static Obj* CreateNull(bool alloc_lists = false) {
1339 return Alloc<Obj>(nullptr, nullptr);
1340 }
1341
1342 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
1343
1344 int type_id() {
1345 return ObjHeader::FromObject(this)->type_tag;
1346 }
1347
1348 static constexpr ObjHeader obj_header() {
1349 return ObjHeader::AsdlClass(70, 2);
1350 }
1351 Obj* prototype;
1352 Dict<BigStr*, value_t*>* d;
1353
1354 DISALLOW_COPY_AND_ASSIGN(Obj)
1355};
1356
1357
1358} // namespace value_asdl
1359
1360#endif // VALUE_ASDL