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

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