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

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