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

1243 lines, 840 significant
1// _gen/core/runtime.asdl.h is generated by asdl_main.py
2
3#ifndef RUNTIME_ASDL
4#define RUNTIME_ASDL
5
6#include <cstdint>
7
8#include "mycpp/runtime.h"
9#include "asdl/cpp_runtime.h"
10#include "_gen/frontend/id_kind.asdl.h"
11using id_kind_asdl::Id_t;
12
13namespace syntax_asdl { class loc_t; class Token; class expr_t; class word_t; class command_t; class CompoundWord; class DoubleQuoted; class ArgList; class re_t; class redir_loc_t; class proc_sig_t; class Func; }
14
15namespace value_asdl { class value_t; class Obj; }
16
17namespace runtime_asdl {
18
19// use struct instead of namespace so 'using' works consistently
20#define ASDL_NAMES struct
21
22class AssignArg;
23class ProcArgs;
24class cmd_value_t;
25class Piece;
26class part_value_t;
27class VarSubState;
28class Cell;
29class a_index_t;
30class VTestPlace;
31class redirect_arg_t;
32class RedirValue;
33class StatusArray;
34class CommandStatus;
35class wait_status_t;
36class trace_t;
37class HayNode;
38class trap_action_t;
39
40ASDL_NAMES cmd_value_e {
41 enum no_name {
42 Argv = 1,
43 Assign = 2,
44 };
45};
46
47BigStr* cmd_value_str(int tag, bool dot = true);
48
49class cmd_value_t {
50 protected:
51 cmd_value_t() {
52 }
53 public:
54 int tag() const {
55 return ObjHeader::FromObject(this)->type_tag;
56 }
57 constexpr int sum_type_id() {
58 return 256;
59 }
60 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
61
62 DISALLOW_COPY_AND_ASSIGN(cmd_value_t)
63};
64
65class cmd_value__Argv : public cmd_value_t {
66 public:
67 cmd_value__Argv(List<BigStr*>* argv, List<syntax_asdl::CompoundWord*>*
68 arg_locs, bool is_last_cmd, value_asdl::Obj* self_obj,
69 ProcArgs* proc_args)
70 : argv(argv),
71 arg_locs(arg_locs),
72 self_obj(self_obj),
73 proc_args(proc_args),
74 is_last_cmd(is_last_cmd) {
75 }
76
77 static cmd_value__Argv* CreateNull(bool alloc_lists = false) {
78 return Alloc<cmd_value__Argv>(alloc_lists ? Alloc<List<BigStr*>>() :
79 nullptr, alloc_lists ?
80 Alloc<List<syntax_asdl::CompoundWord*>>() :
81 nullptr, false, nullptr, nullptr);
82 }
83
84 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
85
86 int type_id() {
87 return this->sum_type_id() + this->tag();
88 }
89
90 static constexpr ObjHeader obj_header() {
91 return ObjHeader::AsdlClass(static_cast<uint16_t>(cmd_value_e::Argv), 4);
92 }
93 List<BigStr*>* argv;
94 List<syntax_asdl::CompoundWord*>* arg_locs;
95 value_asdl::Obj* self_obj;
96 ProcArgs* proc_args;
97 bool is_last_cmd;
98
99 DISALLOW_COPY_AND_ASSIGN(cmd_value__Argv)
100};
101
102class cmd_value__Assign : public cmd_value_t {
103 public:
104 cmd_value__Assign(int builtin_id, List<BigStr*>* argv,
105 List<syntax_asdl::CompoundWord*>* arg_locs,
106 List<AssignArg*>* pairs)
107 : argv(argv),
108 arg_locs(arg_locs),
109 pairs(pairs),
110 builtin_id(builtin_id) {
111 }
112
113 static cmd_value__Assign* CreateNull(bool alloc_lists = false) {
114 return Alloc<cmd_value__Assign>(-1, alloc_lists ? Alloc<List<BigStr*>>() :
115 nullptr, alloc_lists ?
116 Alloc<List<syntax_asdl::CompoundWord*>>() :
117 nullptr, alloc_lists ?
118 Alloc<List<AssignArg*>>() : nullptr);
119 }
120
121 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
122
123 int type_id() {
124 return this->sum_type_id() + this->tag();
125 }
126
127 static constexpr ObjHeader obj_header() {
128 return ObjHeader::AsdlClass(static_cast<uint16_t>(cmd_value_e::Assign), 3);
129 }
130 List<BigStr*>* argv;
131 List<syntax_asdl::CompoundWord*>* arg_locs;
132 List<AssignArg*>* pairs;
133 int builtin_id;
134
135 DISALLOW_COPY_AND_ASSIGN(cmd_value__Assign)
136};
137
138ASDL_NAMES cmd_value {
139 typedef cmd_value__Argv Argv;
140 typedef cmd_value__Assign Assign;
141};
142
143ASDL_NAMES part_value_e {
144 enum no_name {
145 String = 66,
146 Array = 2,
147 ExtGlob = 3,
148 };
149};
150
151BigStr* part_value_str(int tag, bool dot = true);
152
153class part_value_t {
154 protected:
155 part_value_t() {
156 }
157 public:
158 int tag() const {
159 return ObjHeader::FromObject(this)->type_tag;
160 }
161 constexpr int sum_type_id() {
162 return 320;
163 }
164 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
165
166 DISALLOW_COPY_AND_ASSIGN(part_value_t)
167};
168
169class part_value__Array : public part_value_t {
170 public:
171 part_value__Array(List<BigStr*>* strs, bool quoted)
172 : strs(strs),
173 quoted(quoted) {
174 }
175
176 static part_value__Array* CreateNull(bool alloc_lists = false) {
177 return Alloc<part_value__Array>(alloc_lists ? Alloc<List<BigStr*>>() :
178 nullptr, false);
179 }
180
181 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
182
183 int type_id() {
184 return this->sum_type_id() + this->tag();
185 }
186
187 static constexpr ObjHeader obj_header() {
188 return ObjHeader::AsdlClass(static_cast<uint16_t>(part_value_e::Array), 1);
189 }
190 List<BigStr*>* strs;
191 bool quoted;
192
193 DISALLOW_COPY_AND_ASSIGN(part_value__Array)
194};
195
196class part_value__ExtGlob : public part_value_t {
197 public:
198 part_value__ExtGlob(List<part_value_t*>* part_vals)
199 : part_vals(part_vals) {
200 }
201
202 static part_value__ExtGlob* CreateNull(bool alloc_lists = false) {
203 return Alloc<part_value__ExtGlob>(alloc_lists ?
204 Alloc<List<part_value_t*>>() : nullptr);
205 }
206
207 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
208
209 int type_id() {
210 return this->sum_type_id() + this->tag();
211 }
212
213 static constexpr ObjHeader obj_header() {
214 return ObjHeader::AsdlClass(static_cast<uint16_t>(part_value_e::ExtGlob),
215 1);
216 }
217 List<part_value_t*>* part_vals;
218
219 DISALLOW_COPY_AND_ASSIGN(part_value__ExtGlob)
220};
221
222ASDL_NAMES part_value {
223 typedef part_value__Array Array;
224 typedef part_value__ExtGlob ExtGlob;
225};
226
227enum class coerced_e {
228 Int = 1,
229 Float = 2,
230 Neither = 3,
231};
232typedef coerced_e coerced_t;
233
234BigStr* coerced_str(coerced_e tag, bool dot = true);
235
236enum class scope_e {
237 Shopt = 1,
238 Dynamic = 2,
239 LocalOrGlobal = 3,
240 LocalOnly = 4,
241 GlobalOnly = 5,
242};
243typedef scope_e scope_t;
244
245BigStr* scope_str(scope_e tag, bool dot = true);
246
247ASDL_NAMES a_index_e {
248 enum no_name {
249 Str = 1,
250 Int = 2,
251 };
252};
253
254BigStr* a_index_str(int tag, bool dot = true);
255
256class a_index_t {
257 protected:
258 a_index_t() {
259 }
260 public:
261 int tag() const {
262 return ObjHeader::FromObject(this)->type_tag;
263 }
264 constexpr int sum_type_id() {
265 return 384;
266 }
267 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
268
269 DISALLOW_COPY_AND_ASSIGN(a_index_t)
270};
271
272class a_index__Str : public a_index_t {
273 public:
274 a_index__Str(BigStr* s)
275 : s(s) {
276 }
277
278 static a_index__Str* CreateNull(bool alloc_lists = false) {
279 return Alloc<a_index__Str>(kEmptyString);
280 }
281
282 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
283
284 int type_id() {
285 return this->sum_type_id() + this->tag();
286 }
287
288 static constexpr ObjHeader obj_header() {
289 return ObjHeader::AsdlClass(static_cast<uint16_t>(a_index_e::Str), 1);
290 }
291 BigStr* s;
292
293 DISALLOW_COPY_AND_ASSIGN(a_index__Str)
294};
295
296class a_index__Int : public a_index_t {
297 public:
298 a_index__Int(int i)
299 : i(i) {
300 }
301
302 static a_index__Int* CreateNull(bool alloc_lists = false) {
303 return Alloc<a_index__Int>(-1);
304 }
305
306 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
307
308 int type_id() {
309 return this->sum_type_id() + this->tag();
310 }
311
312 static constexpr ObjHeader obj_header() {
313 return ObjHeader::AsdlClass(static_cast<uint16_t>(a_index_e::Int), 0);
314 }
315 int i;
316
317 DISALLOW_COPY_AND_ASSIGN(a_index__Int)
318};
319
320ASDL_NAMES a_index {
321 typedef a_index__Str Str;
322 typedef a_index__Int Int;
323};
324
325ASDL_NAMES redirect_arg_e {
326 enum no_name {
327 Path = 1,
328 CopyFd = 2,
329 MoveFd = 3,
330 CloseFd = 4,
331 HereDoc = 5,
332 };
333};
334
335BigStr* redirect_arg_str(int tag, bool dot = true);
336
337class redirect_arg_t {
338 protected:
339 redirect_arg_t() {
340 }
341 public:
342 int tag() const {
343 return ObjHeader::FromObject(this)->type_tag;
344 }
345 constexpr int sum_type_id() {
346 return 448;
347 }
348 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
349
350 DISALLOW_COPY_AND_ASSIGN(redirect_arg_t)
351};
352
353class redirect_arg__Path : public redirect_arg_t {
354 public:
355 redirect_arg__Path(BigStr* filename)
356 : filename(filename) {
357 }
358
359 static redirect_arg__Path* CreateNull(bool alloc_lists = false) {
360 return Alloc<redirect_arg__Path>(kEmptyString);
361 }
362
363 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
364
365 int type_id() {
366 return this->sum_type_id() + this->tag();
367 }
368
369 static constexpr ObjHeader obj_header() {
370 return ObjHeader::AsdlClass(static_cast<uint16_t>(redirect_arg_e::Path), 1);
371 }
372 BigStr* filename;
373
374 DISALLOW_COPY_AND_ASSIGN(redirect_arg__Path)
375};
376
377class redirect_arg__CopyFd : public redirect_arg_t {
378 public:
379 redirect_arg__CopyFd(int target_fd)
380 : target_fd(target_fd) {
381 }
382
383 static redirect_arg__CopyFd* CreateNull(bool alloc_lists = false) {
384 return Alloc<redirect_arg__CopyFd>(-1);
385 }
386
387 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
388
389 int type_id() {
390 return this->sum_type_id() + this->tag();
391 }
392
393 static constexpr ObjHeader obj_header() {
394 return ObjHeader::AsdlClass(static_cast<uint16_t>(redirect_arg_e::CopyFd),
395 0);
396 }
397 int target_fd;
398
399 DISALLOW_COPY_AND_ASSIGN(redirect_arg__CopyFd)
400};
401
402class redirect_arg__MoveFd : public redirect_arg_t {
403 public:
404 redirect_arg__MoveFd(int target_fd)
405 : target_fd(target_fd) {
406 }
407
408 static redirect_arg__MoveFd* CreateNull(bool alloc_lists = false) {
409 return Alloc<redirect_arg__MoveFd>(-1);
410 }
411
412 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
413
414 int type_id() {
415 return this->sum_type_id() + this->tag();
416 }
417
418 static constexpr ObjHeader obj_header() {
419 return ObjHeader::AsdlClass(static_cast<uint16_t>(redirect_arg_e::MoveFd),
420 0);
421 }
422 int target_fd;
423
424 DISALLOW_COPY_AND_ASSIGN(redirect_arg__MoveFd)
425};
426
427class redirect_arg__CloseFd : public redirect_arg_t {
428 public:
429 redirect_arg__CloseFd() {}
430
431 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
432
433 int type_id() {
434 return this->sum_type_id() + this->tag();
435 }
436
437 static constexpr ObjHeader obj_header() {
438 return ObjHeader::AsdlClass(static_cast<uint16_t>(redirect_arg_e::CloseFd),
439 0);
440 }
441
442 DISALLOW_COPY_AND_ASSIGN(redirect_arg__CloseFd)
443};
444
445class redirect_arg__HereDoc : public redirect_arg_t {
446 public:
447 redirect_arg__HereDoc(BigStr* body)
448 : body(body) {
449 }
450
451 static redirect_arg__HereDoc* CreateNull(bool alloc_lists = false) {
452 return Alloc<redirect_arg__HereDoc>(kEmptyString);
453 }
454
455 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
456
457 int type_id() {
458 return this->sum_type_id() + this->tag();
459 }
460
461 static constexpr ObjHeader obj_header() {
462 return ObjHeader::AsdlClass(static_cast<uint16_t>(redirect_arg_e::HereDoc),
463 1);
464 }
465 BigStr* body;
466
467 DISALLOW_COPY_AND_ASSIGN(redirect_arg__HereDoc)
468};
469
470extern GcGlobal<redirect_arg__CloseFd> gredirect_arg__CloseFd;
471ASDL_NAMES redirect_arg {
472 typedef redirect_arg__Path Path;
473 typedef redirect_arg__CopyFd CopyFd;
474 typedef redirect_arg__MoveFd MoveFd;
475 static redirect_arg__CloseFd* CloseFd;
476 typedef redirect_arg__HereDoc HereDoc;
477};
478
479enum class job_state_e {
480 Running = 1,
481 Exited = 2,
482 Stopped = 3,
483};
484typedef job_state_e job_state_t;
485
486BigStr* job_state_str(job_state_e tag, bool dot = true);
487
488ASDL_NAMES wait_status_e {
489 enum no_name {
490 Proc = 1,
491 Pipeline = 2,
492 Cancelled = 3,
493 };
494};
495
496BigStr* wait_status_str(int tag, bool dot = true);
497
498class wait_status_t {
499 protected:
500 wait_status_t() {
501 }
502 public:
503 int tag() const {
504 return ObjHeader::FromObject(this)->type_tag;
505 }
506 constexpr int sum_type_id() {
507 return 512;
508 }
509 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
510
511 DISALLOW_COPY_AND_ASSIGN(wait_status_t)
512};
513
514class wait_status__Proc : public wait_status_t {
515 public:
516 wait_status__Proc(job_state_t state, int code)
517 : state(state),
518 code(code) {
519 }
520
521 static wait_status__Proc* CreateNull(bool alloc_lists = false) {
522 return Alloc<wait_status__Proc>(job_state_e::Running, -1);
523 }
524
525 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
526
527 int type_id() {
528 return this->sum_type_id() + this->tag();
529 }
530
531 static constexpr ObjHeader obj_header() {
532 return ObjHeader::AsdlClass(static_cast<uint16_t>(wait_status_e::Proc), 0);
533 }
534 job_state_t state;
535 int code;
536
537 DISALLOW_COPY_AND_ASSIGN(wait_status__Proc)
538};
539
540class wait_status__Pipeline : public wait_status_t {
541 public:
542 wait_status__Pipeline(job_state_t state, List<int>* codes)
543 : codes(codes),
544 state(state) {
545 }
546
547 static wait_status__Pipeline* CreateNull(bool alloc_lists = false) {
548 return Alloc<wait_status__Pipeline>(job_state_e::Running, alloc_lists ?
549 Alloc<List<int>>() : nullptr);
550 }
551
552 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
553
554 int type_id() {
555 return this->sum_type_id() + this->tag();
556 }
557
558 static constexpr ObjHeader obj_header() {
559 return ObjHeader::AsdlClass(static_cast<uint16_t>(wait_status_e::Pipeline),
560 1);
561 }
562 List<int>* codes;
563 job_state_t state;
564
565 DISALLOW_COPY_AND_ASSIGN(wait_status__Pipeline)
566};
567
568class wait_status__Cancelled : public wait_status_t {
569 public:
570 wait_status__Cancelled(int sig_num)
571 : sig_num(sig_num) {
572 }
573
574 static wait_status__Cancelled* CreateNull(bool alloc_lists = false) {
575 return Alloc<wait_status__Cancelled>(-1);
576 }
577
578 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
579
580 int type_id() {
581 return this->sum_type_id() + this->tag();
582 }
583
584 static constexpr ObjHeader obj_header() {
585 return
586 ObjHeader::AsdlClass(static_cast<uint16_t>(wait_status_e::Cancelled), 0);
587 }
588 int sig_num;
589
590 DISALLOW_COPY_AND_ASSIGN(wait_status__Cancelled)
591};
592
593ASDL_NAMES wait_status {
594 typedef wait_status__Proc Proc;
595 typedef wait_status__Pipeline Pipeline;
596 typedef wait_status__Cancelled Cancelled;
597};
598
599enum class flow_e {
600 Nothing = 1,
601 Break = 2,
602 Raise = 3,
603};
604typedef flow_e flow_t;
605
606BigStr* flow_str(flow_e tag, bool dot = true);
607
608enum class span_e {
609 Black = 1,
610 Delim = 2,
611 Backslash = 3,
612};
613typedef span_e span_t;
614
615BigStr* span_str(span_e tag, bool dot = true);
616
617ASDL_NAMES emit_i {
618 enum no_name {
619 Part = 1,
620 Delim = 2,
621 Empty = 3,
622 Escape = 4,
623 Nothing = 5,
624 ARRAY_SIZE = 6,
625 };
626};
627
628BigStr* emit_str(int tag, bool dot = true);
629
630typedef int emit_t;
631
632ASDL_NAMES state_i {
633 enum no_name {
634 Invalid = 1,
635 Start = 2,
636 DE_White1 = 3,
637 DE_Gray = 4,
638 DE_White2 = 5,
639 Black = 6,
640 Backslash = 7,
641 Done = 8,
642 ARRAY_SIZE = 9,
643 };
644};
645
646BigStr* state_str(int tag, bool dot = true);
647
648typedef int state_t;
649
650ASDL_NAMES char_kind_i {
651 enum no_name {
652 DE_White = 1,
653 DE_Gray = 2,
654 Black = 3,
655 Backslash = 4,
656 Sentinel = 5,
657 ARRAY_SIZE = 6,
658 };
659};
660
661BigStr* char_kind_str(int tag, bool dot = true);
662
663typedef int char_kind_t;
664
665enum class error_code_e {
666 OK = 1,
667 IndexOutOfRange = 2,
668};
669typedef error_code_e error_code_t;
670
671BigStr* error_code_str(error_code_e tag, bool dot = true);
672
673enum class flag_type_e {
674 Bool = 1,
675 Int = 2,
676 Float = 3,
677 Str = 4,
678};
679typedef flag_type_e flag_type_t;
680
681BigStr* flag_type_str(flag_type_e tag, bool dot = true);
682
683ASDL_NAMES trace_e {
684 enum no_name {
685 External = 1,
686 CommandSub = 2,
687 ForkWait = 3,
688 Fork = 4,
689 PipelinePart = 5,
690 ProcessSub = 6,
691 HereDoc = 7,
692 };
693};
694
695BigStr* trace_str(int tag, bool dot = true);
696
697class trace_t {
698 protected:
699 trace_t() {
700 }
701 public:
702 int tag() const {
703 return ObjHeader::FromObject(this)->type_tag;
704 }
705 constexpr int sum_type_id() {
706 return 576;
707 }
708 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
709
710 DISALLOW_COPY_AND_ASSIGN(trace_t)
711};
712
713class trace__External : public trace_t {
714 public:
715 trace__External(List<BigStr*>* argv)
716 : argv(argv) {
717 }
718
719 static trace__External* CreateNull(bool alloc_lists = false) {
720 return Alloc<trace__External>(alloc_lists ? Alloc<List<BigStr*>>() :
721 nullptr);
722 }
723
724 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
725
726 int type_id() {
727 return this->sum_type_id() + this->tag();
728 }
729
730 static constexpr ObjHeader obj_header() {
731 return ObjHeader::AsdlClass(static_cast<uint16_t>(trace_e::External), 1);
732 }
733 List<BigStr*>* argv;
734
735 DISALLOW_COPY_AND_ASSIGN(trace__External)
736};
737
738class trace__CommandSub : public trace_t {
739 public:
740 trace__CommandSub() {}
741
742 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
743
744 int type_id() {
745 return this->sum_type_id() + this->tag();
746 }
747
748 static constexpr ObjHeader obj_header() {
749 return ObjHeader::AsdlClass(static_cast<uint16_t>(trace_e::CommandSub), 0);
750 }
751
752 DISALLOW_COPY_AND_ASSIGN(trace__CommandSub)
753};
754
755class trace__ForkWait : public trace_t {
756 public:
757 trace__ForkWait() {}
758
759 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
760
761 int type_id() {
762 return this->sum_type_id() + this->tag();
763 }
764
765 static constexpr ObjHeader obj_header() {
766 return ObjHeader::AsdlClass(static_cast<uint16_t>(trace_e::ForkWait), 0);
767 }
768
769 DISALLOW_COPY_AND_ASSIGN(trace__ForkWait)
770};
771
772class trace__Fork : public trace_t {
773 public:
774 trace__Fork() {}
775
776 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
777
778 int type_id() {
779 return this->sum_type_id() + this->tag();
780 }
781
782 static constexpr ObjHeader obj_header() {
783 return ObjHeader::AsdlClass(static_cast<uint16_t>(trace_e::Fork), 0);
784 }
785
786 DISALLOW_COPY_AND_ASSIGN(trace__Fork)
787};
788
789class trace__PipelinePart : public trace_t {
790 public:
791 trace__PipelinePart() {}
792
793 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
794
795 int type_id() {
796 return this->sum_type_id() + this->tag();
797 }
798
799 static constexpr ObjHeader obj_header() {
800 return ObjHeader::AsdlClass(static_cast<uint16_t>(trace_e::PipelinePart),
801 0);
802 }
803
804 DISALLOW_COPY_AND_ASSIGN(trace__PipelinePart)
805};
806
807class trace__ProcessSub : public trace_t {
808 public:
809 trace__ProcessSub() {}
810
811 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
812
813 int type_id() {
814 return this->sum_type_id() + this->tag();
815 }
816
817 static constexpr ObjHeader obj_header() {
818 return ObjHeader::AsdlClass(static_cast<uint16_t>(trace_e::ProcessSub), 0);
819 }
820
821 DISALLOW_COPY_AND_ASSIGN(trace__ProcessSub)
822};
823
824class trace__HereDoc : public trace_t {
825 public:
826 trace__HereDoc() {}
827
828 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
829
830 int type_id() {
831 return this->sum_type_id() + this->tag();
832 }
833
834 static constexpr ObjHeader obj_header() {
835 return ObjHeader::AsdlClass(static_cast<uint16_t>(trace_e::HereDoc), 0);
836 }
837
838 DISALLOW_COPY_AND_ASSIGN(trace__HereDoc)
839};
840
841extern GcGlobal<trace__CommandSub> gtrace__CommandSub;
842extern GcGlobal<trace__ForkWait> gtrace__ForkWait;
843extern GcGlobal<trace__Fork> gtrace__Fork;
844extern GcGlobal<trace__PipelinePart> gtrace__PipelinePart;
845extern GcGlobal<trace__ProcessSub> gtrace__ProcessSub;
846extern GcGlobal<trace__HereDoc> gtrace__HereDoc;
847ASDL_NAMES trace {
848 typedef trace__External External;
849 static trace__CommandSub* CommandSub;
850 static trace__ForkWait* ForkWait;
851 static trace__Fork* Fork;
852 static trace__PipelinePart* PipelinePart;
853 static trace__ProcessSub* ProcessSub;
854 static trace__HereDoc* HereDoc;
855};
856
857enum class word_style_e {
858 Expr = 1,
859 Unquoted = 2,
860 DQ = 3,
861 SQ = 4,
862};
863typedef word_style_e word_style_t;
864
865BigStr* word_style_str(word_style_e tag, bool dot = true);
866
867enum class comp_action_e {
868 Other = 1,
869 FileSystem = 2,
870 BashFunc = 3,
871};
872typedef comp_action_e comp_action_t;
873
874BigStr* comp_action_str(comp_action_e tag, bool dot = true);
875
876ASDL_NAMES trap_action_e {
877 enum no_name {
878 Ignored = 1,
879 Command = 2,
880 };
881};
882
883BigStr* trap_action_str(int tag, bool dot = true);
884
885class trap_action_t {
886 protected:
887 trap_action_t() {
888 }
889 public:
890 int tag() const {
891 return ObjHeader::FromObject(this)->type_tag;
892 }
893 constexpr int sum_type_id() {
894 return 640;
895 }
896 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
897
898 DISALLOW_COPY_AND_ASSIGN(trap_action_t)
899};
900
901class trap_action__Ignored : public trap_action_t {
902 public:
903 trap_action__Ignored() {}
904
905 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
906
907 int type_id() {
908 return this->sum_type_id() + this->tag();
909 }
910
911 static constexpr ObjHeader obj_header() {
912 return ObjHeader::AsdlClass(static_cast<uint16_t>(trap_action_e::Ignored),
913 0);
914 }
915
916 DISALLOW_COPY_AND_ASSIGN(trap_action__Ignored)
917};
918
919class trap_action__Command : public trap_action_t {
920 public:
921 trap_action__Command(syntax_asdl::command_t* c)
922 : c(c) {
923 }
924
925 static trap_action__Command* CreateNull(bool alloc_lists = false) {
926 return Alloc<trap_action__Command>(nullptr);
927 }
928
929 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
930
931 int type_id() {
932 return this->sum_type_id() + this->tag();
933 }
934
935 static constexpr ObjHeader obj_header() {
936 return ObjHeader::AsdlClass(static_cast<uint16_t>(trap_action_e::Command),
937 1);
938 }
939 syntax_asdl::command_t* c;
940
941 DISALLOW_COPY_AND_ASSIGN(trap_action__Command)
942};
943
944extern GcGlobal<trap_action__Ignored> gtrap_action__Ignored;
945ASDL_NAMES trap_action {
946 static trap_action__Ignored* Ignored;
947 typedef trap_action__Command Command;
948};
949
950class AssignArg {
951 public:
952 AssignArg(BigStr* var_name, value_asdl::value_t* rval, bool plus_eq,
953 syntax_asdl::CompoundWord* blame_word)
954 : var_name(var_name),
955 rval(rval),
956 blame_word(blame_word),
957 plus_eq(plus_eq) {
958 }
959
960 static AssignArg* CreateNull(bool alloc_lists = false) {
961 return Alloc<AssignArg>(kEmptyString, nullptr, false, nullptr);
962 }
963
964 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
965
966 int type_id() {
967 return ObjHeader::FromObject(this)->type_tag;
968 }
969
970 static constexpr ObjHeader obj_header() {
971 return ObjHeader::AsdlClass(64, 3);
972 }
973 BigStr* var_name;
974 value_asdl::value_t* rval;
975 syntax_asdl::CompoundWord* blame_word;
976 bool plus_eq;
977
978 DISALLOW_COPY_AND_ASSIGN(AssignArg)
979};
980
981class ProcArgs {
982 public:
983 ProcArgs(syntax_asdl::ArgList* typed_args, List<value_asdl::value_t*>*
984 pos_args, Dict<BigStr*, value_asdl::value_t*>* named_args,
985 value_asdl::value_t* block_arg)
986 : typed_args(typed_args),
987 pos_args(pos_args),
988 named_args(named_args),
989 block_arg(block_arg) {
990 }
991
992 static ProcArgs* CreateNull(bool alloc_lists = false) {
993 return Alloc<ProcArgs>(nullptr, nullptr, nullptr, nullptr);
994 }
995
996 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
997
998 int type_id() {
999 return ObjHeader::FromObject(this)->type_tag;
1000 }
1001
1002 static constexpr ObjHeader obj_header() {
1003 return ObjHeader::AsdlClass(65, 4);
1004 }
1005 syntax_asdl::ArgList* typed_args;
1006 List<value_asdl::value_t*>* pos_args;
1007 Dict<BigStr*, value_asdl::value_t*>* named_args;
1008 value_asdl::value_t* block_arg;
1009
1010 DISALLOW_COPY_AND_ASSIGN(ProcArgs)
1011};
1012
1013class Piece : public part_value_t {
1014 public:
1015 Piece(BigStr* s, bool quoted, bool do_split)
1016 : s(s),
1017 quoted(quoted),
1018 do_split(do_split) {
1019 }
1020
1021 static Piece* CreateNull(bool alloc_lists = false) {
1022 return Alloc<Piece>(kEmptyString, false, false);
1023 }
1024
1025 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
1026
1027 int type_id() {
1028 return ObjHeader::FromObject(this)->type_tag;
1029 }
1030
1031 static constexpr ObjHeader obj_header() {
1032 return ObjHeader::AsdlClass(66, 1);
1033 }
1034 BigStr* s;
1035 bool quoted;
1036 bool do_split;
1037
1038 DISALLOW_COPY_AND_ASSIGN(Piece)
1039};
1040
1041class VarSubState {
1042 public:
1043 VarSubState(bool join_array, value_asdl::value_t* h_value,
1044 syntax_asdl::Token* array_ref)
1045 : h_value(h_value),
1046 array_ref(array_ref),
1047 join_array(join_array) {
1048 }
1049
1050 static VarSubState* CreateNull(bool alloc_lists = false) {
1051 return Alloc<VarSubState>(false, nullptr, nullptr);
1052 }
1053
1054 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
1055
1056 int type_id() {
1057 return ObjHeader::FromObject(this)->type_tag;
1058 }
1059
1060 static constexpr ObjHeader obj_header() {
1061 return ObjHeader::AsdlClass(67, 2);
1062 }
1063 value_asdl::value_t* h_value;
1064 syntax_asdl::Token* array_ref;
1065 bool join_array;
1066
1067 DISALLOW_COPY_AND_ASSIGN(VarSubState)
1068};
1069
1070class Cell {
1071 public:
1072 Cell(bool exported, bool readonly, bool nameref, value_asdl::value_t* val)
1073 : val(val),
1074 exported(exported),
1075 readonly(readonly),
1076 nameref(nameref) {
1077 }
1078
1079 static Cell* CreateNull(bool alloc_lists = false) {
1080 return Alloc<Cell>(false, false, false, nullptr);
1081 }
1082
1083 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
1084
1085 int type_id() {
1086 return ObjHeader::FromObject(this)->type_tag;
1087 }
1088
1089 static constexpr ObjHeader obj_header() {
1090 return ObjHeader::AsdlClass(68, 1);
1091 }
1092 value_asdl::value_t* val;
1093 bool exported;
1094 bool readonly;
1095 bool nameref;
1096
1097 DISALLOW_COPY_AND_ASSIGN(Cell)
1098};
1099
1100class VTestPlace {
1101 public:
1102 VTestPlace(BigStr* name, a_index_t* index)
1103 : name(name),
1104 index(index) {
1105 }
1106
1107 static VTestPlace* CreateNull(bool alloc_lists = false) {
1108 return Alloc<VTestPlace>(nullptr, nullptr);
1109 }
1110
1111 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
1112
1113 int type_id() {
1114 return ObjHeader::FromObject(this)->type_tag;
1115 }
1116
1117 static constexpr ObjHeader obj_header() {
1118 return ObjHeader::AsdlClass(69, 2);
1119 }
1120 BigStr* name;
1121 a_index_t* index;
1122
1123 DISALLOW_COPY_AND_ASSIGN(VTestPlace)
1124};
1125
1126class RedirValue {
1127 public:
1128 RedirValue(Id_t op_id, syntax_asdl::loc_t* op_loc, syntax_asdl::redir_loc_t*
1129 loc, redirect_arg_t* arg)
1130 : op_loc(op_loc),
1131 loc(loc),
1132 arg(arg),
1133 op_id(op_id) {
1134 }
1135
1136 static RedirValue* CreateNull(bool alloc_lists = false) {
1137 return Alloc<RedirValue>(-1, nullptr, nullptr, nullptr);
1138 }
1139
1140 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
1141
1142 int type_id() {
1143 return ObjHeader::FromObject(this)->type_tag;
1144 }
1145
1146 static constexpr ObjHeader obj_header() {
1147 return ObjHeader::AsdlClass(70, 3);
1148 }
1149 syntax_asdl::loc_t* op_loc;
1150 syntax_asdl::redir_loc_t* loc;
1151 redirect_arg_t* arg;
1152 Id_t op_id;
1153
1154 DISALLOW_COPY_AND_ASSIGN(RedirValue)
1155};
1156
1157class StatusArray {
1158 public:
1159 StatusArray(List<int>* codes, List<syntax_asdl::loc_t*>* locs)
1160 : codes(codes),
1161 locs(locs) {
1162 }
1163
1164 static StatusArray* CreateNull(bool alloc_lists = false) {
1165 return Alloc<StatusArray>(nullptr, nullptr);
1166 }
1167
1168 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
1169
1170 int type_id() {
1171 return ObjHeader::FromObject(this)->type_tag;
1172 }
1173
1174 static constexpr ObjHeader obj_header() {
1175 return ObjHeader::AsdlClass(71, 2);
1176 }
1177 List<int>* codes;
1178 List<syntax_asdl::loc_t*>* locs;
1179
1180 DISALLOW_COPY_AND_ASSIGN(StatusArray)
1181};
1182
1183class CommandStatus {
1184 public:
1185 CommandStatus(bool check_errexit, bool show_code, bool pipe_negated,
1186 List<int>* pipe_status, List<syntax_asdl::loc_t*>* pipe_locs)
1187 : pipe_status(pipe_status),
1188 pipe_locs(pipe_locs),
1189 check_errexit(check_errexit),
1190 show_code(show_code),
1191 pipe_negated(pipe_negated) {
1192 }
1193
1194 static CommandStatus* CreateNull(bool alloc_lists = false) {
1195 return Alloc<CommandStatus>(false, false, false, nullptr, nullptr);
1196 }
1197
1198 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
1199
1200 int type_id() {
1201 return ObjHeader::FromObject(this)->type_tag;
1202 }
1203
1204 static constexpr ObjHeader obj_header() {
1205 return ObjHeader::AsdlClass(72, 2);
1206 }
1207 List<int>* pipe_status;
1208 List<syntax_asdl::loc_t*>* pipe_locs;
1209 bool check_errexit;
1210 bool show_code;
1211 bool pipe_negated;
1212
1213 DISALLOW_COPY_AND_ASSIGN(CommandStatus)
1214};
1215
1216class HayNode {
1217 public:
1218 HayNode(Dict<BigStr*, HayNode*>* children)
1219 : children(children) {
1220 }
1221
1222 static HayNode* CreateNull(bool alloc_lists = false) {
1223 return Alloc<HayNode>(nullptr);
1224 }
1225
1226 hnode_t* PrettyTree(bool do_abbrev, Dict<int, bool>* seen = nullptr);
1227
1228 int type_id() {
1229 return ObjHeader::FromObject(this)->type_tag;
1230 }
1231
1232 static constexpr ObjHeader obj_header() {
1233 return ObjHeader::AsdlClass(73, 1);
1234 }
1235 Dict<BigStr*, HayNode*>* children;
1236
1237 DISALLOW_COPY_AND_ASSIGN(HayNode)
1238};
1239
1240
1241} // namespace runtime_asdl
1242
1243#endif // RUNTIME_ASDL