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

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