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

1129 lines, 747 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; }
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 BoundFunc = 21,
338 BuiltinFunc = 22,
339 Func = 23,
340 BuiltinProc = 24,
341 Proc = 25,
342 Expr = 26,
343 CommandFrag = 27,
344 Command = 28,
345 };
346};
347
348BigStr* value_str(int tag, bool dot = true);
349
350class value_t {
351 protected:
352 value_t() {
353 }
354 public:
355 int tag() const {
356 return ObjHeader::FromObject(this)->type_tag;
357 }
358 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
359 DISALLOW_COPY_AND_ASSIGN(value_t)
360};
361
362class value__Interrupted : public value_t {
363 public:
364 value__Interrupted() {}
365
366 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
367
368 static constexpr ObjHeader obj_header() {
369 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Interrupted), 0);
370 }
371
372
373 DISALLOW_COPY_AND_ASSIGN(value__Interrupted)
374};
375
376class value__Stdin : public value_t {
377 public:
378 value__Stdin() {}
379
380 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
381
382 static constexpr ObjHeader obj_header() {
383 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Stdin), 0);
384 }
385
386
387 DISALLOW_COPY_AND_ASSIGN(value__Stdin)
388};
389
390class value__Slice : public value_t {
391 public:
392 value__Slice(IntBox* lower, IntBox* upper)
393 : lower(lower),
394 upper(upper) {
395 }
396
397 static value__Slice* CreateNull(bool alloc_lists = false) {
398 return Alloc<value__Slice>(nullptr, nullptr);
399 }
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::Slice), 2);
405 }
406
407 IntBox* lower;
408 IntBox* upper;
409
410 DISALLOW_COPY_AND_ASSIGN(value__Slice)
411};
412
413class value__Undef : public value_t {
414 public:
415 value__Undef() {}
416
417 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
418
419 static constexpr ObjHeader obj_header() {
420 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Undef), 0);
421 }
422
423
424 DISALLOW_COPY_AND_ASSIGN(value__Undef)
425};
426
427class value__Str : public value_t {
428 public:
429 value__Str(BigStr* s)
430 : s(s) {
431 }
432
433 static value__Str* CreateNull(bool alloc_lists = false) {
434 return Alloc<value__Str>(kEmptyString);
435 }
436
437 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
438
439 static constexpr ObjHeader obj_header() {
440 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Str), 1);
441 }
442
443 BigStr* s;
444
445 DISALLOW_COPY_AND_ASSIGN(value__Str)
446};
447
448class value__BashArray : public value_t {
449 public:
450 value__BashArray(List<BigStr*>* strs)
451 : strs(strs) {
452 }
453
454 static value__BashArray* CreateNull(bool alloc_lists = false) {
455 return Alloc<value__BashArray>(alloc_lists ? Alloc<List<BigStr*>>() :
456 nullptr);
457 }
458
459 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
460
461 static constexpr ObjHeader obj_header() {
462 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::BashArray), 1);
463 }
464
465 List<BigStr*>* strs;
466
467 DISALLOW_COPY_AND_ASSIGN(value__BashArray)
468};
469
470class value__SparseArray : public value_t {
471 public:
472 value__SparseArray(Dict<mops::BigInt, BigStr*>* d, mops::BigInt max_index)
473 : d(d),
474 max_index(max_index) {
475 }
476
477 static value__SparseArray* CreateNull(bool alloc_lists = false) {
478 return Alloc<value__SparseArray>(nullptr, -1);
479 }
480
481 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
482
483 static constexpr ObjHeader obj_header() {
484 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::SparseArray), 1);
485 }
486
487 Dict<mops::BigInt, BigStr*>* d;
488 mops::BigInt max_index;
489
490 DISALLOW_COPY_AND_ASSIGN(value__SparseArray)
491};
492
493class value__BashAssoc : public value_t {
494 public:
495 value__BashAssoc(Dict<BigStr*, BigStr*>* d)
496 : d(d) {
497 }
498
499 static value__BashAssoc* CreateNull(bool alloc_lists = false) {
500 return Alloc<value__BashAssoc>(nullptr);
501 }
502
503 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
504
505 static constexpr ObjHeader obj_header() {
506 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::BashAssoc), 1);
507 }
508
509 Dict<BigStr*, BigStr*>* d;
510
511 DISALLOW_COPY_AND_ASSIGN(value__BashAssoc)
512};
513
514class value__Null : public value_t {
515 public:
516 value__Null() {}
517
518 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
519
520 static constexpr ObjHeader obj_header() {
521 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Null), 0);
522 }
523
524
525 DISALLOW_COPY_AND_ASSIGN(value__Null)
526};
527
528class value__Bool : public value_t {
529 public:
530 value__Bool(bool b)
531 : b(b) {
532 }
533
534 static value__Bool* CreateNull(bool alloc_lists = false) {
535 return Alloc<value__Bool>(false);
536 }
537
538 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
539
540 static constexpr ObjHeader obj_header() {
541 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Bool), 0);
542 }
543
544 bool b;
545
546 DISALLOW_COPY_AND_ASSIGN(value__Bool)
547};
548
549class value__Int : public value_t {
550 public:
551 value__Int(mops::BigInt i)
552 : i(i) {
553 }
554
555 static value__Int* CreateNull(bool alloc_lists = false) {
556 return Alloc<value__Int>(-1);
557 }
558
559 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
560
561 static constexpr ObjHeader obj_header() {
562 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Int), 0);
563 }
564
565 mops::BigInt i;
566
567 DISALLOW_COPY_AND_ASSIGN(value__Int)
568};
569
570class value__Float : public value_t {
571 public:
572 value__Float(double f)
573 : f(f) {
574 }
575
576 static value__Float* CreateNull(bool alloc_lists = false) {
577 return Alloc<value__Float>(0.0);
578 }
579
580 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
581
582 static constexpr ObjHeader obj_header() {
583 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Float), 0);
584 }
585
586 double f;
587
588 DISALLOW_COPY_AND_ASSIGN(value__Float)
589};
590
591class value__List : public value_t {
592 public:
593 value__List(List<value_t*>* items)
594 : items(items) {
595 }
596
597 static value__List* CreateNull(bool alloc_lists = false) {
598 return Alloc<value__List>(alloc_lists ? Alloc<List<value_t*>>() : nullptr);
599 }
600
601 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
602
603 static constexpr ObjHeader obj_header() {
604 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::List), 1);
605 }
606
607 List<value_t*>* items;
608
609 DISALLOW_COPY_AND_ASSIGN(value__List)
610};
611
612class value__Dict : public value_t {
613 public:
614 value__Dict(Dict<BigStr*, value_t*>* d)
615 : d(d) {
616 }
617
618 static value__Dict* CreateNull(bool alloc_lists = false) {
619 return Alloc<value__Dict>(nullptr);
620 }
621
622 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
623
624 static constexpr ObjHeader obj_header() {
625 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Dict), 1);
626 }
627
628 Dict<BigStr*, value_t*>* d;
629
630 DISALLOW_COPY_AND_ASSIGN(value__Dict)
631};
632
633class value__Range : public value_t {
634 public:
635 value__Range(int lower, int upper)
636 : lower(lower),
637 upper(upper) {
638 }
639
640 static value__Range* CreateNull(bool alloc_lists = false) {
641 return Alloc<value__Range>(-1, -1);
642 }
643
644 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
645
646 static constexpr ObjHeader obj_header() {
647 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Range), 0);
648 }
649
650 int lower;
651 int upper;
652
653 DISALLOW_COPY_AND_ASSIGN(value__Range)
654};
655
656class value__Eggex : public value_t {
657 public:
658 value__Eggex(syntax_asdl::re_t* spliced, BigStr* canonical_flags,
659 List<value_t*>* convert_funcs, List<syntax_asdl::Token*>*
660 convert_toks, BigStr* as_ere, List<BigStr*>* capture_names)
661 : spliced(spliced),
662 canonical_flags(canonical_flags),
663 convert_funcs(convert_funcs),
664 convert_toks(convert_toks),
665 as_ere(as_ere),
666 capture_names(capture_names) {
667 }
668
669 static value__Eggex* CreateNull(bool alloc_lists = false) {
670 return Alloc<value__Eggex>(nullptr, kEmptyString, alloc_lists ?
671 Alloc<List<value_t*>>() : nullptr, alloc_lists ?
672 Alloc<List<syntax_asdl::Token*>>() : nullptr,
673 nullptr, alloc_lists ? Alloc<List<BigStr*>>() :
674 nullptr);
675 }
676
677 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
678
679 static constexpr ObjHeader obj_header() {
680 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Eggex), 6);
681 }
682
683 syntax_asdl::re_t* spliced;
684 BigStr* canonical_flags;
685 List<value_t*>* convert_funcs;
686 List<syntax_asdl::Token*>* convert_toks;
687 BigStr* as_ere;
688 List<BigStr*>* capture_names;
689
690 DISALLOW_COPY_AND_ASSIGN(value__Eggex)
691};
692
693class value__Place : public value_t {
694 public:
695 value__Place(y_lvalue_t* lval, Dict<BigStr*, runtime_asdl::Cell*>* frame)
696 : lval(lval),
697 frame(frame) {
698 }
699
700 static value__Place* CreateNull(bool alloc_lists = false) {
701 return Alloc<value__Place>(nullptr, nullptr);
702 }
703
704 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
705
706 static constexpr ObjHeader obj_header() {
707 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Place), 2);
708 }
709
710 y_lvalue_t* lval;
711 Dict<BigStr*, runtime_asdl::Cell*>* frame;
712
713 DISALLOW_COPY_AND_ASSIGN(value__Place)
714};
715
716class value__Frame : public value_t {
717 public:
718 value__Frame(Dict<BigStr*, runtime_asdl::Cell*>* frame)
719 : frame(frame) {
720 }
721
722 static value__Frame* CreateNull(bool alloc_lists = false) {
723 return Alloc<value__Frame>(nullptr);
724 }
725
726 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
727
728 static constexpr ObjHeader obj_header() {
729 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Frame), 1);
730 }
731
732 Dict<BigStr*, runtime_asdl::Cell*>* frame;
733
734 DISALLOW_COPY_AND_ASSIGN(value__Frame)
735};
736
737class value__BoundFunc : public value_t {
738 public:
739 value__BoundFunc(value_t* me, value_t* func)
740 : me(me),
741 func(func) {
742 }
743
744 static value__BoundFunc* CreateNull(bool alloc_lists = false) {
745 return Alloc<value__BoundFunc>(nullptr, 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::BoundFunc), 2);
752 }
753
754 value_t* me;
755 value_t* func;
756
757 DISALLOW_COPY_AND_ASSIGN(value__BoundFunc)
758};
759
760class value__BuiltinFunc : public value_t {
761 public:
762 value__BuiltinFunc(void* callable)
763 : callable(callable) {
764 }
765
766 static value__BuiltinFunc* CreateNull(bool alloc_lists = false) {
767 return Alloc<value__BuiltinFunc>(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::BuiltinFunc), 1);
774 }
775
776 void* callable;
777
778 DISALLOW_COPY_AND_ASSIGN(value__BuiltinFunc)
779};
780
781class value__Func : public value_t {
782 public:
783 value__Func(BigStr* name, syntax_asdl::Func* parsed, List<value_t*>*
784 pos_defaults, Dict<BigStr*, value_t*>* named_defaults,
785 Dict<BigStr*, runtime_asdl::Cell*>* module_frame)
786 : name(name),
787 parsed(parsed),
788 pos_defaults(pos_defaults),
789 named_defaults(named_defaults),
790 module_frame(module_frame) {
791 }
792
793 static value__Func* CreateNull(bool alloc_lists = false) {
794 return Alloc<value__Func>(kEmptyString, nullptr, alloc_lists ?
795 Alloc<List<value_t*>>() : nullptr, nullptr,
796 nullptr);
797 }
798
799 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
800
801 static constexpr ObjHeader obj_header() {
802 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Func), 5);
803 }
804
805 BigStr* name;
806 syntax_asdl::Func* parsed;
807 List<value_t*>* pos_defaults;
808 Dict<BigStr*, value_t*>* named_defaults;
809 Dict<BigStr*, runtime_asdl::Cell*>* module_frame;
810
811 DISALLOW_COPY_AND_ASSIGN(value__Func)
812};
813
814class value__BuiltinProc : public value_t {
815 public:
816 value__BuiltinProc(void* builtin)
817 : builtin(builtin) {
818 }
819
820 static value__BuiltinProc* CreateNull(bool alloc_lists = false) {
821 return Alloc<value__BuiltinProc>(nullptr);
822 }
823
824 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
825
826 static constexpr ObjHeader obj_header() {
827 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::BuiltinProc), 1);
828 }
829
830 void* builtin;
831
832 DISALLOW_COPY_AND_ASSIGN(value__BuiltinProc)
833};
834
835class value__Proc : public value_t {
836 public:
837 value__Proc(BigStr* name, syntax_asdl::Token* name_tok,
838 syntax_asdl::proc_sig_t* sig, syntax_asdl::command_t* body,
839 ProcDefaults* defaults, bool sh_compat, Dict<BigStr*,
840 runtime_asdl::Cell*>* module_frame)
841 : name(name),
842 name_tok(name_tok),
843 sig(sig),
844 body(body),
845 defaults(defaults),
846 module_frame(module_frame),
847 sh_compat(sh_compat) {
848 }
849
850 static value__Proc* CreateNull(bool alloc_lists = false) {
851 return Alloc<value__Proc>(kEmptyString, nullptr, nullptr, nullptr, nullptr,
852 false, nullptr);
853 }
854
855 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
856
857 static constexpr ObjHeader obj_header() {
858 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Proc), 6);
859 }
860
861 BigStr* name;
862 syntax_asdl::Token* name_tok;
863 syntax_asdl::proc_sig_t* sig;
864 syntax_asdl::command_t* body;
865 ProcDefaults* defaults;
866 Dict<BigStr*, runtime_asdl::Cell*>* module_frame;
867 bool sh_compat;
868
869 DISALLOW_COPY_AND_ASSIGN(value__Proc)
870};
871
872class value__Expr : public value_t {
873 public:
874 value__Expr(syntax_asdl::expr_t* e, Dict<BigStr*, runtime_asdl::Cell*>*
875 captured_frame, Dict<BigStr*, runtime_asdl::Cell*>* module_frame)
876 : e(e),
877 captured_frame(captured_frame),
878 module_frame(module_frame) {
879 }
880
881 static value__Expr* CreateNull(bool alloc_lists = false) {
882 return Alloc<value__Expr>(nullptr, nullptr, nullptr);
883 }
884
885 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
886
887 static constexpr ObjHeader obj_header() {
888 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Expr), 3);
889 }
890
891 syntax_asdl::expr_t* e;
892 Dict<BigStr*, runtime_asdl::Cell*>* captured_frame;
893 Dict<BigStr*, runtime_asdl::Cell*>* module_frame;
894
895 DISALLOW_COPY_AND_ASSIGN(value__Expr)
896};
897
898class value__CommandFrag : public value_t {
899 public:
900 value__CommandFrag(syntax_asdl::command_t* c)
901 : c(c) {
902 }
903
904 static value__CommandFrag* CreateNull(bool alloc_lists = false) {
905 return Alloc<value__CommandFrag>(nullptr);
906 }
907
908 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
909
910 static constexpr ObjHeader obj_header() {
911 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::CommandFrag), 1);
912 }
913
914 syntax_asdl::command_t* c;
915
916 DISALLOW_COPY_AND_ASSIGN(value__CommandFrag)
917};
918
919class value__Command : public value_t {
920 public:
921 value__Command(cmd_frag_t* frag, Dict<BigStr*, runtime_asdl::Cell*>*
922 captured_frame, Dict<BigStr*, runtime_asdl::Cell*>*
923 module_frame)
924 : frag(frag),
925 captured_frame(captured_frame),
926 module_frame(module_frame) {
927 }
928
929 static value__Command* CreateNull(bool alloc_lists = false) {
930 return Alloc<value__Command>(nullptr, nullptr, nullptr);
931 }
932
933 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
934
935 static constexpr ObjHeader obj_header() {
936 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Command), 3);
937 }
938
939 cmd_frag_t* frag;
940 Dict<BigStr*, runtime_asdl::Cell*>* captured_frame;
941 Dict<BigStr*, runtime_asdl::Cell*>* module_frame;
942
943 DISALLOW_COPY_AND_ASSIGN(value__Command)
944};
945
946extern GcGlobal<value__Interrupted> gvalue__Interrupted;
947extern GcGlobal<value__Stdin> gvalue__Stdin;
948extern GcGlobal<value__Undef> gvalue__Undef;
949extern GcGlobal<value__Null> gvalue__Null;
950ASDL_NAMES value {
951 static value__Interrupted* Interrupted;
952 static value__Stdin* Stdin;
953 typedef value__Slice Slice;
954 static value__Undef* Undef;
955 typedef value__Str Str;
956 typedef value__BashArray BashArray;
957 typedef value__SparseArray SparseArray;
958 typedef value__BashAssoc BashAssoc;
959 static value__Null* Null;
960 typedef value__Bool Bool;
961 typedef value__Int Int;
962 typedef value__Float Float;
963 typedef value__List List;
964 typedef value__Dict Dict;
965 typedef value__Range Range;
966 typedef value__Eggex Eggex;
967 typedef value__Place Place;
968 typedef value__Frame Frame;
969 typedef value__BoundFunc BoundFunc;
970 typedef value__BuiltinFunc BuiltinFunc;
971 typedef value__Func Func;
972 typedef value__BuiltinProc BuiltinProc;
973 typedef value__Proc Proc;
974 typedef value__Expr Expr;
975 typedef value__CommandFrag CommandFrag;
976 typedef value__Command Command;
977};
978
979class IntBox {
980 public:
981 IntBox(int i)
982 : i(i) {
983 }
984
985 static IntBox* CreateNull(bool alloc_lists = false) {
986 return Alloc<IntBox>(-1);
987 }
988
989 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
990
991 static constexpr ObjHeader obj_header() {
992 return ObjHeader::AsdlClass(64, 0);
993 }
994
995 int i;
996
997 DISALLOW_COPY_AND_ASSIGN(IntBox)
998};
999
1000class ProcDefaults {
1001 public:
1002 ProcDefaults(List<value_t*>* for_word, List<value_t*>* for_typed,
1003 Dict<BigStr*, value_t*>* for_named, value_t* for_block)
1004 : for_word(for_word),
1005 for_typed(for_typed),
1006 for_named(for_named),
1007 for_block(for_block) {
1008 }
1009
1010 static ProcDefaults* CreateNull(bool alloc_lists = false) {
1011 return Alloc<ProcDefaults>(nullptr, nullptr, nullptr, nullptr);
1012 }
1013
1014 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
1015
1016 static constexpr ObjHeader obj_header() {
1017 return ObjHeader::AsdlClass(65, 4);
1018 }
1019
1020 List<value_t*>* for_word;
1021 List<value_t*>* for_typed;
1022 Dict<BigStr*, value_t*>* for_named;
1023 value_t* for_block;
1024
1025 DISALLOW_COPY_AND_ASSIGN(ProcDefaults)
1026};
1027
1028class LeftName : public y_lvalue_t, public sh_lvalue_t {
1029 public:
1030 LeftName(BigStr* name, syntax_asdl::loc_t* blame_loc)
1031 : name(name),
1032 blame_loc(blame_loc) {
1033 }
1034
1035 static LeftName* CreateNull(bool alloc_lists = false) {
1036 return Alloc<LeftName>(kEmptyString, nullptr);
1037 }
1038
1039 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
1040
1041 static constexpr ObjHeader obj_header() {
1042 return ObjHeader::AsdlClass(66, 2);
1043 }
1044
1045 BigStr* name;
1046 syntax_asdl::loc_t* blame_loc;
1047
1048 DISALLOW_COPY_AND_ASSIGN(LeftName)
1049};
1050
1051class RegexMatch : public regex_match_t, public value_t {
1052 public:
1053 RegexMatch(BigStr* s, List<int>* indices, eggex_ops_t* ops)
1054 : s(s),
1055 indices(indices),
1056 ops(ops) {
1057 }
1058
1059 static RegexMatch* CreateNull(bool alloc_lists = false) {
1060 return Alloc<RegexMatch>(kEmptyString, alloc_lists ? Alloc<List<int>>() :
1061 nullptr, nullptr);
1062 }
1063
1064 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
1065
1066 static constexpr ObjHeader obj_header() {
1067 return ObjHeader::AsdlClass(67, 3);
1068 }
1069
1070 BigStr* s;
1071 List<int>* indices;
1072 eggex_ops_t* ops;
1073
1074 DISALLOW_COPY_AND_ASSIGN(RegexMatch)
1075};
1076
1077class LiteralBlock : public cmd_frag_t {
1078 public:
1079 LiteralBlock(syntax_asdl::BraceGroup* brace_group,
1080 List<syntax_asdl::SourceLine*>* lines)
1081 : brace_group(brace_group),
1082 lines(lines) {
1083 }
1084
1085 static LiteralBlock* CreateNull(bool alloc_lists = false) {
1086 return Alloc<LiteralBlock>(nullptr, alloc_lists ?
1087 Alloc<List<syntax_asdl::SourceLine*>>() :
1088 nullptr);
1089 }
1090
1091 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
1092
1093 static constexpr ObjHeader obj_header() {
1094 return ObjHeader::AsdlClass(68, 2);
1095 }
1096
1097 syntax_asdl::BraceGroup* brace_group;
1098 List<syntax_asdl::SourceLine*>* lines;
1099
1100 DISALLOW_COPY_AND_ASSIGN(LiteralBlock)
1101};
1102
1103class Obj : public value_t {
1104 public:
1105 Obj(Obj* prototype, Dict<BigStr*, value_t*>* d)
1106 : prototype(prototype),
1107 d(d) {
1108 }
1109
1110 static Obj* CreateNull(bool alloc_lists = false) {
1111 return Alloc<Obj>(nullptr, 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(69, 2);
1118 }
1119
1120 Obj* prototype;
1121 Dict<BigStr*, value_t*>* d;
1122
1123 DISALLOW_COPY_AND_ASSIGN(Obj)
1124};
1125
1126
1127} // namespace value_asdl
1128
1129#endif // VALUE_ASDL