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

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