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

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