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

1066 lines, 698 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 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(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(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(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(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(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(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(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(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(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(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 value_e {
270 enum no_name {
271 Interrupted = 1,
272 Stdin = 2,
273 Undef = 3,
274 Str = 4,
275 BashArray = 5,
276 SparseArray = 6,
277 BashAssoc = 7,
278 Null = 8,
279 Bool = 9,
280 Int = 10,
281 Float = 11,
282 List = 12,
283 Dict = 13,
284 Obj = 68,
285 Eggex = 15,
286 Match = 67,
287 Expr = 17,
288 Command = 18,
289 Block = 19,
290 Place = 20,
291 Module = 21,
292 IO = 22,
293 Guts = 23,
294 BuiltinFunc = 24,
295 BoundFunc = 25,
296 Proc = 26,
297 Func = 27,
298 Slice = 28,
299 Range = 29,
300 };
301};
302
303BigStr* value_str(int tag, bool dot = true);
304
305class value_t {
306 protected:
307 value_t() {
308 }
309 public:
310 int tag() const {
311 return ObjHeader::FromObject(this)->type_tag;
312 }
313 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
314 DISALLOW_COPY_AND_ASSIGN(value_t)
315};
316
317class value__Interrupted : public value_t {
318 public:
319 value__Interrupted() {}
320
321 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
322
323 static constexpr ObjHeader obj_header() {
324 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Interrupted), 0);
325 }
326
327
328 DISALLOW_COPY_AND_ASSIGN(value__Interrupted)
329};
330
331class value__Stdin : public value_t {
332 public:
333 value__Stdin() {}
334
335 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
336
337 static constexpr ObjHeader obj_header() {
338 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Stdin), 0);
339 }
340
341
342 DISALLOW_COPY_AND_ASSIGN(value__Stdin)
343};
344
345class value__Undef : public value_t {
346 public:
347 value__Undef() {}
348
349 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
350
351 static constexpr ObjHeader obj_header() {
352 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Undef), 0);
353 }
354
355
356 DISALLOW_COPY_AND_ASSIGN(value__Undef)
357};
358
359class value__Str : public value_t {
360 public:
361 value__Str(BigStr* s)
362 : s(s) {
363 }
364
365 static value__Str* CreateNull(bool alloc_lists = false) {
366 return Alloc<value__Str>(kEmptyString);
367 }
368
369 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
370
371 static constexpr ObjHeader obj_header() {
372 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Str), 1);
373 }
374
375 BigStr* s;
376
377 DISALLOW_COPY_AND_ASSIGN(value__Str)
378};
379
380class value__BashArray : public value_t {
381 public:
382 value__BashArray(List<BigStr*>* strs)
383 : strs(strs) {
384 }
385
386 static value__BashArray* CreateNull(bool alloc_lists = false) {
387 return Alloc<value__BashArray>(alloc_lists ? Alloc<List<BigStr*>>() :
388 nullptr);
389 }
390
391 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
392
393 static constexpr ObjHeader obj_header() {
394 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::BashArray), 1);
395 }
396
397 List<BigStr*>* strs;
398
399 DISALLOW_COPY_AND_ASSIGN(value__BashArray)
400};
401
402class value__SparseArray : public value_t {
403 public:
404 value__SparseArray(Dict<mops::BigInt, BigStr*>* d, mops::BigInt max_index)
405 : d(d),
406 max_index(max_index) {
407 }
408
409 static value__SparseArray* CreateNull(bool alloc_lists = false) {
410 return Alloc<value__SparseArray>(nullptr, -1);
411 }
412
413 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
414
415 static constexpr ObjHeader obj_header() {
416 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::SparseArray), 1);
417 }
418
419 Dict<mops::BigInt, BigStr*>* d;
420 mops::BigInt max_index;
421
422 DISALLOW_COPY_AND_ASSIGN(value__SparseArray)
423};
424
425class value__BashAssoc : public value_t {
426 public:
427 value__BashAssoc(Dict<BigStr*, BigStr*>* d)
428 : d(d) {
429 }
430
431 static value__BashAssoc* CreateNull(bool alloc_lists = false) {
432 return Alloc<value__BashAssoc>(nullptr);
433 }
434
435 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
436
437 static constexpr ObjHeader obj_header() {
438 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::BashAssoc), 1);
439 }
440
441 Dict<BigStr*, BigStr*>* d;
442
443 DISALLOW_COPY_AND_ASSIGN(value__BashAssoc)
444};
445
446class value__Null : public value_t {
447 public:
448 value__Null() {}
449
450 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
451
452 static constexpr ObjHeader obj_header() {
453 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Null), 0);
454 }
455
456
457 DISALLOW_COPY_AND_ASSIGN(value__Null)
458};
459
460class value__Bool : public value_t {
461 public:
462 value__Bool(bool b)
463 : b(b) {
464 }
465
466 static value__Bool* CreateNull(bool alloc_lists = false) {
467 return Alloc<value__Bool>(false);
468 }
469
470 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
471
472 static constexpr ObjHeader obj_header() {
473 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Bool), 0);
474 }
475
476 bool b;
477
478 DISALLOW_COPY_AND_ASSIGN(value__Bool)
479};
480
481class value__Int : public value_t {
482 public:
483 value__Int(mops::BigInt i)
484 : i(i) {
485 }
486
487 static value__Int* CreateNull(bool alloc_lists = false) {
488 return Alloc<value__Int>(-1);
489 }
490
491 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
492
493 static constexpr ObjHeader obj_header() {
494 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Int), 0);
495 }
496
497 mops::BigInt i;
498
499 DISALLOW_COPY_AND_ASSIGN(value__Int)
500};
501
502class value__Float : public value_t {
503 public:
504 value__Float(double f)
505 : f(f) {
506 }
507
508 static value__Float* CreateNull(bool alloc_lists = false) {
509 return Alloc<value__Float>(0.0);
510 }
511
512 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
513
514 static constexpr ObjHeader obj_header() {
515 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Float), 0);
516 }
517
518 double f;
519
520 DISALLOW_COPY_AND_ASSIGN(value__Float)
521};
522
523class value__List : public value_t {
524 public:
525 value__List(List<value_t*>* items)
526 : items(items) {
527 }
528
529 static value__List* CreateNull(bool alloc_lists = false) {
530 return Alloc<value__List>(alloc_lists ? Alloc<List<value_t*>>() : nullptr);
531 }
532
533 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
534
535 static constexpr ObjHeader obj_header() {
536 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::List), 1);
537 }
538
539 List<value_t*>* items;
540
541 DISALLOW_COPY_AND_ASSIGN(value__List)
542};
543
544class value__Dict : public value_t {
545 public:
546 value__Dict(Dict<BigStr*, value_t*>* d)
547 : d(d) {
548 }
549
550 static value__Dict* CreateNull(bool alloc_lists = false) {
551 return Alloc<value__Dict>(nullptr);
552 }
553
554 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
555
556 static constexpr ObjHeader obj_header() {
557 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Dict), 1);
558 }
559
560 Dict<BigStr*, value_t*>* d;
561
562 DISALLOW_COPY_AND_ASSIGN(value__Dict)
563};
564
565class value__Eggex : public value_t {
566 public:
567 value__Eggex(syntax_asdl::re_t* spliced, BigStr* canonical_flags,
568 List<value_t*>* convert_funcs, List<syntax_asdl::Token*>*
569 convert_toks, BigStr* as_ere, List<BigStr*>* capture_names)
570 : spliced(spliced),
571 canonical_flags(canonical_flags),
572 convert_funcs(convert_funcs),
573 convert_toks(convert_toks),
574 as_ere(as_ere),
575 capture_names(capture_names) {
576 }
577
578 static value__Eggex* CreateNull(bool alloc_lists = false) {
579 return Alloc<value__Eggex>(nullptr, kEmptyString, alloc_lists ?
580 Alloc<List<value_t*>>() : nullptr, alloc_lists ?
581 Alloc<List<syntax_asdl::Token*>>() : nullptr,
582 nullptr, alloc_lists ? Alloc<List<BigStr*>>() :
583 nullptr);
584 }
585
586 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
587
588 static constexpr ObjHeader obj_header() {
589 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Eggex), 6);
590 }
591
592 syntax_asdl::re_t* spliced;
593 BigStr* canonical_flags;
594 List<value_t*>* convert_funcs;
595 List<syntax_asdl::Token*>* convert_toks;
596 BigStr* as_ere;
597 List<BigStr*>* capture_names;
598
599 DISALLOW_COPY_AND_ASSIGN(value__Eggex)
600};
601
602class value__Expr : public value_t {
603 public:
604 value__Expr(syntax_asdl::expr_t* e)
605 : e(e) {
606 }
607
608 static value__Expr* CreateNull(bool alloc_lists = false) {
609 return Alloc<value__Expr>(nullptr);
610 }
611
612 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
613
614 static constexpr ObjHeader obj_header() {
615 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Expr), 1);
616 }
617
618 syntax_asdl::expr_t* e;
619
620 DISALLOW_COPY_AND_ASSIGN(value__Expr)
621};
622
623class value__Command : public value_t {
624 public:
625 value__Command(syntax_asdl::command_t* c)
626 : c(c) {
627 }
628
629 static value__Command* CreateNull(bool alloc_lists = false) {
630 return Alloc<value__Command>(nullptr);
631 }
632
633 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
634
635 static constexpr ObjHeader obj_header() {
636 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Command), 1);
637 }
638
639 syntax_asdl::command_t* c;
640
641 DISALLOW_COPY_AND_ASSIGN(value__Command)
642};
643
644class value__Block : public value_t {
645 public:
646 value__Block(syntax_asdl::LiteralBlock* block)
647 : block(block) {
648 }
649
650 static value__Block* CreateNull(bool alloc_lists = false) {
651 return Alloc<value__Block>(nullptr);
652 }
653
654 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
655
656 static constexpr ObjHeader obj_header() {
657 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Block), 1);
658 }
659
660 syntax_asdl::LiteralBlock* block;
661
662 DISALLOW_COPY_AND_ASSIGN(value__Block)
663};
664
665class value__Place : public value_t {
666 public:
667 value__Place(y_lvalue_t* lval, Dict<BigStr*, runtime_asdl::Cell*>* frame)
668 : lval(lval),
669 frame(frame) {
670 }
671
672 static value__Place* CreateNull(bool alloc_lists = false) {
673 return Alloc<value__Place>(nullptr, nullptr);
674 }
675
676 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
677
678 static constexpr ObjHeader obj_header() {
679 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Place), 2);
680 }
681
682 y_lvalue_t* lval;
683 Dict<BigStr*, runtime_asdl::Cell*>* frame;
684
685 DISALLOW_COPY_AND_ASSIGN(value__Place)
686};
687
688class value__Module : public value_t {
689 public:
690 value__Module(Dict<BigStr*, value_t*>* defs)
691 : defs(defs) {
692 }
693
694 static value__Module* CreateNull(bool alloc_lists = false) {
695 return Alloc<value__Module>(nullptr);
696 }
697
698 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
699
700 static constexpr ObjHeader obj_header() {
701 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Module), 1);
702 }
703
704 Dict<BigStr*, value_t*>* defs;
705
706 DISALLOW_COPY_AND_ASSIGN(value__Module)
707};
708
709class value__IO : public value_t {
710 public:
711 value__IO(void* unused)
712 : unused(unused) {
713 }
714
715 static value__IO* CreateNull(bool alloc_lists = false) {
716 return Alloc<value__IO>(nullptr);
717 }
718
719 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
720
721 static constexpr ObjHeader obj_header() {
722 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::IO), 1);
723 }
724
725 void* unused;
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
1040class Obj : public value_t {
1041 public:
1042 Obj(Obj* prototype, Dict<BigStr*, value_t*>* d)
1043 : prototype(prototype),
1044 d(d) {
1045 }
1046
1047 static Obj* CreateNull(bool alloc_lists = false) {
1048 return Alloc<Obj>(nullptr, nullptr);
1049 }
1050
1051 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
1052
1053 static constexpr ObjHeader obj_header() {
1054 return ObjHeader::AsdlClass(68, 2);
1055 }
1056
1057 Obj* prototype;
1058 Dict<BigStr*, value_t*>* d;
1059
1060 DISALLOW_COPY_AND_ASSIGN(Obj)
1061};
1062
1063
1064} // namespace value_asdl
1065
1066#endif // VALUE_ASDL