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

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