OILS / _gen / core / value.asdl.h View on Github | oilshell.org

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