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

1026 lines, 673 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 Undef = 2,
272 Str = 3,
273 BashArray = 4,
274 SparseArray = 5,
275 BashAssoc = 6,
276 Null = 7,
277 Bool = 8,
278 Int = 9,
279 Float = 10,
280 List = 11,
281 Dict = 12,
282 Eggex = 13,
283 Match = 67,
284 Expr = 15,
285 Command = 16,
286 Block = 17,
287 Place = 18,
288 Module = 19,
289 IO = 20,
290 Guts = 21,
291 BuiltinFunc = 22,
292 BoundFunc = 23,
293 Proc = 24,
294 Func = 25,
295 Slice = 26,
296 Range = 27,
297 };
298};
299
300BigStr* value_str(int tag, bool dot = true);
301
302class value_t {
303 protected:
304 value_t() {
305 }
306 public:
307 int tag() const {
308 return ObjHeader::FromObject(this)->type_tag;
309 }
310 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
311 DISALLOW_COPY_AND_ASSIGN(value_t)
312};
313
314class value__Interrupted : public value_t {
315 public:
316 value__Interrupted() {}
317
318 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
319
320 static constexpr ObjHeader obj_header() {
321 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Interrupted), 0);
322 }
323
324
325 DISALLOW_COPY_AND_ASSIGN(value__Interrupted)
326};
327
328class value__Undef : public value_t {
329 public:
330 value__Undef() {}
331
332 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
333
334 static constexpr ObjHeader obj_header() {
335 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Undef), 0);
336 }
337
338
339 DISALLOW_COPY_AND_ASSIGN(value__Undef)
340};
341
342class value__Str : public value_t {
343 public:
344 value__Str(BigStr* s)
345 : s(s) {
346 }
347
348 static value__Str* CreateNull(bool alloc_lists = false) {
349 return Alloc<value__Str>(kEmptyString);
350 }
351
352 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
353
354 static constexpr ObjHeader obj_header() {
355 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Str), 1);
356 }
357
358 BigStr* s;
359
360 DISALLOW_COPY_AND_ASSIGN(value__Str)
361};
362
363class value__BashArray : public value_t {
364 public:
365 value__BashArray(List<BigStr*>* strs)
366 : strs(strs) {
367 }
368
369 static value__BashArray* CreateNull(bool alloc_lists = false) {
370 return Alloc<value__BashArray>(alloc_lists ? Alloc<List<BigStr*>>() :
371 nullptr);
372 }
373
374 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
375
376 static constexpr ObjHeader obj_header() {
377 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::BashArray), 1);
378 }
379
380 List<BigStr*>* strs;
381
382 DISALLOW_COPY_AND_ASSIGN(value__BashArray)
383};
384
385class value__SparseArray : public value_t {
386 public:
387 value__SparseArray(Dict<mops::BigInt, BigStr*>* d, mops::BigInt max_index)
388 : d(d),
389 max_index(max_index) {
390 }
391
392 static value__SparseArray* CreateNull(bool alloc_lists = false) {
393 return Alloc<value__SparseArray>(nullptr, -1);
394 }
395
396 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
397
398 static constexpr ObjHeader obj_header() {
399 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::SparseArray), 1);
400 }
401
402 Dict<mops::BigInt, BigStr*>* d;
403 mops::BigInt max_index;
404
405 DISALLOW_COPY_AND_ASSIGN(value__SparseArray)
406};
407
408class value__BashAssoc : public value_t {
409 public:
410 value__BashAssoc(Dict<BigStr*, BigStr*>* d)
411 : d(d) {
412 }
413
414 static value__BashAssoc* CreateNull(bool alloc_lists = false) {
415 return Alloc<value__BashAssoc>(nullptr);
416 }
417
418 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
419
420 static constexpr ObjHeader obj_header() {
421 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::BashAssoc), 1);
422 }
423
424 Dict<BigStr*, BigStr*>* d;
425
426 DISALLOW_COPY_AND_ASSIGN(value__BashAssoc)
427};
428
429class value__Null : public value_t {
430 public:
431 value__Null() {}
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::Null), 0);
437 }
438
439
440 DISALLOW_COPY_AND_ASSIGN(value__Null)
441};
442
443class value__Bool : public value_t {
444 public:
445 value__Bool(bool b)
446 : b(b) {
447 }
448
449 static value__Bool* CreateNull(bool alloc_lists = false) {
450 return Alloc<value__Bool>(false);
451 }
452
453 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
454
455 static constexpr ObjHeader obj_header() {
456 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Bool), 0);
457 }
458
459 bool b;
460
461 DISALLOW_COPY_AND_ASSIGN(value__Bool)
462};
463
464class value__Int : public value_t {
465 public:
466 value__Int(mops::BigInt i)
467 : i(i) {
468 }
469
470 static value__Int* CreateNull(bool alloc_lists = false) {
471 return Alloc<value__Int>(-1);
472 }
473
474 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
475
476 static constexpr ObjHeader obj_header() {
477 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Int), 0);
478 }
479
480 mops::BigInt i;
481
482 DISALLOW_COPY_AND_ASSIGN(value__Int)
483};
484
485class value__Float : public value_t {
486 public:
487 value__Float(double f)
488 : f(f) {
489 }
490
491 static value__Float* CreateNull(bool alloc_lists = false) {
492 return Alloc<value__Float>(0.0);
493 }
494
495 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
496
497 static constexpr ObjHeader obj_header() {
498 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Float), 0);
499 }
500
501 double f;
502
503 DISALLOW_COPY_AND_ASSIGN(value__Float)
504};
505
506class value__List : public value_t {
507 public:
508 value__List(List<value_t*>* items)
509 : items(items) {
510 }
511
512 static value__List* CreateNull(bool alloc_lists = false) {
513 return Alloc<value__List>(alloc_lists ? Alloc<List<value_t*>>() : nullptr);
514 }
515
516 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
517
518 static constexpr ObjHeader obj_header() {
519 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::List), 1);
520 }
521
522 List<value_t*>* items;
523
524 DISALLOW_COPY_AND_ASSIGN(value__List)
525};
526
527class value__Dict : public value_t {
528 public:
529 value__Dict(Dict<BigStr*, value_t*>* d)
530 : d(d) {
531 }
532
533 static value__Dict* CreateNull(bool alloc_lists = false) {
534 return Alloc<value__Dict>(nullptr);
535 }
536
537 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
538
539 static constexpr ObjHeader obj_header() {
540 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Dict), 1);
541 }
542
543 Dict<BigStr*, value_t*>* d;
544
545 DISALLOW_COPY_AND_ASSIGN(value__Dict)
546};
547
548class value__Eggex : public value_t {
549 public:
550 value__Eggex(syntax_asdl::re_t* spliced, BigStr* canonical_flags,
551 List<value_t*>* convert_funcs, List<syntax_asdl::Token*>*
552 convert_toks, BigStr* as_ere, List<BigStr*>* capture_names)
553 : spliced(spliced),
554 canonical_flags(canonical_flags),
555 convert_funcs(convert_funcs),
556 convert_toks(convert_toks),
557 as_ere(as_ere),
558 capture_names(capture_names) {
559 }
560
561 static value__Eggex* CreateNull(bool alloc_lists = false) {
562 return Alloc<value__Eggex>(nullptr, kEmptyString, alloc_lists ?
563 Alloc<List<value_t*>>() : nullptr, alloc_lists ?
564 Alloc<List<syntax_asdl::Token*>>() : nullptr,
565 nullptr, alloc_lists ? Alloc<List<BigStr*>>() :
566 nullptr);
567 }
568
569 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
570
571 static constexpr ObjHeader obj_header() {
572 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Eggex), 6);
573 }
574
575 syntax_asdl::re_t* spliced;
576 BigStr* canonical_flags;
577 List<value_t*>* convert_funcs;
578 List<syntax_asdl::Token*>* convert_toks;
579 BigStr* as_ere;
580 List<BigStr*>* capture_names;
581
582 DISALLOW_COPY_AND_ASSIGN(value__Eggex)
583};
584
585class value__Expr : public value_t {
586 public:
587 value__Expr(syntax_asdl::expr_t* e)
588 : e(e) {
589 }
590
591 static value__Expr* CreateNull(bool alloc_lists = false) {
592 return Alloc<value__Expr>(nullptr);
593 }
594
595 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
596
597 static constexpr ObjHeader obj_header() {
598 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Expr), 1);
599 }
600
601 syntax_asdl::expr_t* e;
602
603 DISALLOW_COPY_AND_ASSIGN(value__Expr)
604};
605
606class value__Command : public value_t {
607 public:
608 value__Command(syntax_asdl::command_t* c)
609 : c(c) {
610 }
611
612 static value__Command* CreateNull(bool alloc_lists = false) {
613 return Alloc<value__Command>(nullptr);
614 }
615
616 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
617
618 static constexpr ObjHeader obj_header() {
619 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Command), 1);
620 }
621
622 syntax_asdl::command_t* c;
623
624 DISALLOW_COPY_AND_ASSIGN(value__Command)
625};
626
627class value__Block : public value_t {
628 public:
629 value__Block(syntax_asdl::LiteralBlock* block)
630 : block(block) {
631 }
632
633 static value__Block* CreateNull(bool alloc_lists = false) {
634 return Alloc<value__Block>(nullptr);
635 }
636
637 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
638
639 static constexpr ObjHeader obj_header() {
640 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Block), 1);
641 }
642
643 syntax_asdl::LiteralBlock* block;
644
645 DISALLOW_COPY_AND_ASSIGN(value__Block)
646};
647
648class value__Place : public value_t {
649 public:
650 value__Place(y_lvalue_t* lval, Dict<BigStr*, runtime_asdl::Cell*>* frame)
651 : lval(lval),
652 frame(frame) {
653 }
654
655 static value__Place* CreateNull(bool alloc_lists = false) {
656 return Alloc<value__Place>(nullptr, nullptr);
657 }
658
659 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
660
661 static constexpr ObjHeader obj_header() {
662 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Place), 2);
663 }
664
665 y_lvalue_t* lval;
666 Dict<BigStr*, runtime_asdl::Cell*>* frame;
667
668 DISALLOW_COPY_AND_ASSIGN(value__Place)
669};
670
671class value__Module : public value_t {
672 public:
673 value__Module(Dict<BigStr*, value_t*>* defs)
674 : defs(defs) {
675 }
676
677 static value__Module* CreateNull(bool alloc_lists = false) {
678 return Alloc<value__Module>(nullptr);
679 }
680
681 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
682
683 static constexpr ObjHeader obj_header() {
684 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Module), 1);
685 }
686
687 Dict<BigStr*, value_t*>* defs;
688
689 DISALLOW_COPY_AND_ASSIGN(value__Module)
690};
691
692class value__IO : public value_t {
693 public:
694 value__IO(void* cmd_ev, void* prompt_ev)
695 : cmd_ev(cmd_ev),
696 prompt_ev(prompt_ev) {
697 }
698
699 static value__IO* CreateNull(bool alloc_lists = false) {
700 return Alloc<value__IO>(nullptr, nullptr);
701 }
702
703 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
704
705 static constexpr ObjHeader obj_header() {
706 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::IO), 2);
707 }
708
709 void* cmd_ev;
710 void* prompt_ev;
711
712 DISALLOW_COPY_AND_ASSIGN(value__IO)
713};
714
715class value__Guts : public value_t {
716 public:
717 value__Guts(void* vm)
718 : vm(vm) {
719 }
720
721 static value__Guts* CreateNull(bool alloc_lists = false) {
722 return Alloc<value__Guts>(nullptr);
723 }
724
725 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
726
727 static constexpr ObjHeader obj_header() {
728 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Guts), 1);
729 }
730
731 void* vm;
732
733 DISALLOW_COPY_AND_ASSIGN(value__Guts)
734};
735
736class value__BuiltinFunc : public value_t {
737 public:
738 value__BuiltinFunc(void* callable)
739 : callable(callable) {
740 }
741
742 static value__BuiltinFunc* CreateNull(bool alloc_lists = false) {
743 return Alloc<value__BuiltinFunc>(nullptr);
744 }
745
746 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
747
748 static constexpr ObjHeader obj_header() {
749 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::BuiltinFunc), 1);
750 }
751
752 void* callable;
753
754 DISALLOW_COPY_AND_ASSIGN(value__BuiltinFunc)
755};
756
757class value__BoundFunc : public value_t {
758 public:
759 value__BoundFunc(value_t* me, value_t* func)
760 : me(me),
761 func(func) {
762 }
763
764 static value__BoundFunc* CreateNull(bool alloc_lists = false) {
765 return Alloc<value__BoundFunc>(nullptr, nullptr);
766 }
767
768 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
769
770 static constexpr ObjHeader obj_header() {
771 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::BoundFunc), 2);
772 }
773
774 value_t* me;
775 value_t* func;
776
777 DISALLOW_COPY_AND_ASSIGN(value__BoundFunc)
778};
779
780class value__Proc : public value_t {
781 public:
782 value__Proc(BigStr* name, syntax_asdl::Token* name_tok,
783 syntax_asdl::proc_sig_t* sig, syntax_asdl::command_t* body,
784 ProcDefaults* defaults, bool sh_compat)
785 : name(name),
786 name_tok(name_tok),
787 sig(sig),
788 body(body),
789 defaults(defaults),
790 sh_compat(sh_compat) {
791 }
792
793 static value__Proc* CreateNull(bool alloc_lists = false) {
794 return Alloc<value__Proc>(kEmptyString, nullptr, nullptr, nullptr, nullptr,
795 false);
796 }
797
798 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
799
800 static constexpr ObjHeader obj_header() {
801 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Proc), 5);
802 }
803
804 BigStr* name;
805 syntax_asdl::Token* name_tok;
806 syntax_asdl::proc_sig_t* sig;
807 syntax_asdl::command_t* body;
808 ProcDefaults* defaults;
809 bool sh_compat;
810
811 DISALLOW_COPY_AND_ASSIGN(value__Proc)
812};
813
814class value__Func : public value_t {
815 public:
816 value__Func(BigStr* name, syntax_asdl::Func* parsed, List<value_t*>*
817 pos_defaults, Dict<BigStr*, value_t*>* named_defaults,
818 Dict<BigStr*, runtime_asdl::Cell*>* module_)
819 : name(name),
820 parsed(parsed),
821 pos_defaults(pos_defaults),
822 named_defaults(named_defaults),
823 module_(module_) {
824 }
825
826 static value__Func* CreateNull(bool alloc_lists = false) {
827 return Alloc<value__Func>(kEmptyString, nullptr, alloc_lists ?
828 Alloc<List<value_t*>>() : nullptr, nullptr,
829 nullptr);
830 }
831
832 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
833
834 static constexpr ObjHeader obj_header() {
835 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Func), 5);
836 }
837
838 BigStr* name;
839 syntax_asdl::Func* parsed;
840 List<value_t*>* pos_defaults;
841 Dict<BigStr*, value_t*>* named_defaults;
842 Dict<BigStr*, runtime_asdl::Cell*>* module_;
843
844 DISALLOW_COPY_AND_ASSIGN(value__Func)
845};
846
847class value__Slice : public value_t {
848 public:
849 value__Slice(IntBox* lower, IntBox* upper)
850 : lower(lower),
851 upper(upper) {
852 }
853
854 static value__Slice* CreateNull(bool alloc_lists = false) {
855 return Alloc<value__Slice>(nullptr, nullptr);
856 }
857
858 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
859
860 static constexpr ObjHeader obj_header() {
861 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Slice), 2);
862 }
863
864 IntBox* lower;
865 IntBox* upper;
866
867 DISALLOW_COPY_AND_ASSIGN(value__Slice)
868};
869
870class value__Range : public value_t {
871 public:
872 value__Range(int lower, int upper)
873 : lower(lower),
874 upper(upper) {
875 }
876
877 static value__Range* CreateNull(bool alloc_lists = false) {
878 return Alloc<value__Range>(-1, -1);
879 }
880
881 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
882
883 static constexpr ObjHeader obj_header() {
884 return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Range), 0);
885 }
886
887 int lower;
888 int upper;
889
890 DISALLOW_COPY_AND_ASSIGN(value__Range)
891};
892
893extern GcGlobal<value__Interrupted> gvalue__Interrupted;
894extern GcGlobal<value__Undef> gvalue__Undef;
895extern GcGlobal<value__Null> gvalue__Null;
896ASDL_NAMES value {
897 static value__Interrupted* Interrupted;
898 static value__Undef* Undef;
899 typedef value__Str Str;
900 typedef value__BashArray BashArray;
901 typedef value__SparseArray SparseArray;
902 typedef value__BashAssoc BashAssoc;
903 static value__Null* Null;
904 typedef value__Bool Bool;
905 typedef value__Int Int;
906 typedef value__Float Float;
907 typedef value__List List;
908 typedef value__Dict Dict;
909 typedef value__Eggex Eggex;
910 typedef value__Expr Expr;
911 typedef value__Command Command;
912 typedef value__Block Block;
913 typedef value__Place Place;
914 typedef value__Module Module;
915 typedef value__IO IO;
916 typedef value__Guts Guts;
917 typedef value__BuiltinFunc BuiltinFunc;
918 typedef value__BoundFunc BoundFunc;
919 typedef value__Proc Proc;
920 typedef value__Func Func;
921 typedef value__Slice Slice;
922 typedef value__Range Range;
923};
924
925class IntBox {
926 public:
927 IntBox(int i)
928 : i(i) {
929 }
930
931 static IntBox* CreateNull(bool alloc_lists = false) {
932 return Alloc<IntBox>(-1);
933 }
934
935 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
936
937 static constexpr ObjHeader obj_header() {
938 return ObjHeader::AsdlClass(64, 0);
939 }
940
941 int i;
942
943 DISALLOW_COPY_AND_ASSIGN(IntBox)
944};
945
946class ProcDefaults {
947 public:
948 ProcDefaults(List<value_t*>* for_word, List<value_t*>* for_typed,
949 Dict<BigStr*, value_t*>* for_named, value_t* for_block)
950 : for_word(for_word),
951 for_typed(for_typed),
952 for_named(for_named),
953 for_block(for_block) {
954 }
955
956 static ProcDefaults* CreateNull(bool alloc_lists = false) {
957 return Alloc<ProcDefaults>(nullptr, nullptr, nullptr, nullptr);
958 }
959
960 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
961
962 static constexpr ObjHeader obj_header() {
963 return ObjHeader::AsdlClass(65, 4);
964 }
965
966 List<value_t*>* for_word;
967 List<value_t*>* for_typed;
968 Dict<BigStr*, value_t*>* for_named;
969 value_t* for_block;
970
971 DISALLOW_COPY_AND_ASSIGN(ProcDefaults)
972};
973
974class LeftName : public y_lvalue_t, public sh_lvalue_t {
975 public:
976 LeftName(BigStr* name, syntax_asdl::loc_t* blame_loc)
977 : name(name),
978 blame_loc(blame_loc) {
979 }
980
981 static LeftName* CreateNull(bool alloc_lists = false) {
982 return Alloc<LeftName>(kEmptyString, nullptr);
983 }
984
985 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
986
987 static constexpr ObjHeader obj_header() {
988 return ObjHeader::AsdlClass(66, 2);
989 }
990
991 BigStr* name;
992 syntax_asdl::loc_t* blame_loc;
993
994 DISALLOW_COPY_AND_ASSIGN(LeftName)
995};
996
997class RegexMatch : public regex_match_t, public value_t {
998 public:
999 RegexMatch(BigStr* s, List<int>* indices, eggex_ops_t* ops)
1000 : s(s),
1001 indices(indices),
1002 ops(ops) {
1003 }
1004
1005 static RegexMatch* CreateNull(bool alloc_lists = false) {
1006 return Alloc<RegexMatch>(kEmptyString, alloc_lists ? Alloc<List<int>>() :
1007 nullptr, nullptr);
1008 }
1009
1010 hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
1011
1012 static constexpr ObjHeader obj_header() {
1013 return ObjHeader::AsdlClass(67, 3);
1014 }
1015
1016 BigStr* s;
1017 List<int>* indices;
1018 eggex_ops_t* ops;
1019
1020 DISALLOW_COPY_AND_ASSIGN(RegexMatch)
1021};
1022
1023
1024} // namespace value_asdl
1025
1026#endif // VALUE_ASDL