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

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