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

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