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

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