1 | // _gen/core/value.asdl.h is generated by asdl_main.py
|
2 |
|
3 | #ifndef VALUE_ASDL
|
4 | #define VALUE_ASDL
|
5 |
|
6 | #include <cstdint>
|
7 |
|
8 | #include "mycpp/runtime.h"
|
9 | #include "_gen/asdl/hnode.asdl.h"
|
10 | using hnode_asdl::hnode_t;
|
11 |
|
12 | namespace syntax_asdl { class loc_t; class Token; class expr_t; class command_t; class DoubleQuoted; class re_t; class proc_sig_t; class Func; class NameType; class EggexFlag; class BraceGroup; class SourceLine; }
|
13 |
|
14 | namespace runtime_asdl { class Cell; }
|
15 |
|
16 | namespace value_asdl {
|
17 |
|
18 | // use struct instead of namespace so 'using' works consistently
|
19 | #define ASDL_NAMES struct
|
20 |
|
21 | class IntBox;
|
22 | class ProcDefaults;
|
23 | class LeftName;
|
24 | class y_lvalue_t;
|
25 | class sh_lvalue_t;
|
26 | class eggex_ops_t;
|
27 | class RegexMatch;
|
28 | class regex_match_t;
|
29 | class LiteralBlock;
|
30 | class cmd_frag_t;
|
31 | class Obj;
|
32 | class value_t;
|
33 |
|
34 | ASDL_NAMES y_lvalue_e {
|
35 | enum no_name {
|
36 | Local = 66,
|
37 | Container = 2,
|
38 | };
|
39 | };
|
40 |
|
41 | BigStr* y_lvalue_str(int tag, bool dot = true);
|
42 |
|
43 | class y_lvalue_t {
|
44 | protected:
|
45 | y_lvalue_t() {
|
46 | }
|
47 | public:
|
48 | int tag() const {
|
49 | return ObjHeader::FromObject(this)->type_tag;
|
50 | }
|
51 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
52 | DISALLOW_COPY_AND_ASSIGN(y_lvalue_t)
|
53 | };
|
54 |
|
55 | class y_lvalue__Container : public y_lvalue_t {
|
56 | public:
|
57 | y_lvalue__Container(value_t* obj, value_t* index)
|
58 | : obj(obj),
|
59 | index(index) {
|
60 | }
|
61 |
|
62 | static y_lvalue__Container* CreateNull(bool alloc_lists = false) {
|
63 | return Alloc<y_lvalue__Container>(nullptr, nullptr);
|
64 | }
|
65 |
|
66 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
67 |
|
68 | static constexpr ObjHeader obj_header() {
|
69 | return ObjHeader::AsdlClass(static_cast<uint16_t>(y_lvalue_e::Container),
|
70 | 2);
|
71 | }
|
72 |
|
73 | value_t* obj;
|
74 | value_t* index;
|
75 |
|
76 | DISALLOW_COPY_AND_ASSIGN(y_lvalue__Container)
|
77 | };
|
78 |
|
79 | ASDL_NAMES y_lvalue {
|
80 | typedef y_lvalue__Container Container;
|
81 | };
|
82 |
|
83 | ASDL_NAMES sh_lvalue_e {
|
84 | enum no_name {
|
85 | Var = 66,
|
86 | Indexed = 2,
|
87 | Keyed = 3,
|
88 | };
|
89 | };
|
90 |
|
91 | BigStr* sh_lvalue_str(int tag, bool dot = true);
|
92 |
|
93 | class sh_lvalue_t {
|
94 | protected:
|
95 | sh_lvalue_t() {
|
96 | }
|
97 | public:
|
98 | int tag() const {
|
99 | return ObjHeader::FromObject(this)->type_tag;
|
100 | }
|
101 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
102 | DISALLOW_COPY_AND_ASSIGN(sh_lvalue_t)
|
103 | };
|
104 |
|
105 | class sh_lvalue__Indexed : public sh_lvalue_t {
|
106 | public:
|
107 | sh_lvalue__Indexed(BigStr* name, int index, syntax_asdl::loc_t* blame_loc)
|
108 | : name(name),
|
109 | blame_loc(blame_loc),
|
110 | index(index) {
|
111 | }
|
112 |
|
113 | static sh_lvalue__Indexed* CreateNull(bool alloc_lists = false) {
|
114 | return Alloc<sh_lvalue__Indexed>(kEmptyString, -1, nullptr);
|
115 | }
|
116 |
|
117 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
118 |
|
119 | static constexpr ObjHeader obj_header() {
|
120 | return ObjHeader::AsdlClass(static_cast<uint16_t>(sh_lvalue_e::Indexed), 2);
|
121 | }
|
122 |
|
123 | BigStr* name;
|
124 | syntax_asdl::loc_t* blame_loc;
|
125 | int index;
|
126 |
|
127 | DISALLOW_COPY_AND_ASSIGN(sh_lvalue__Indexed)
|
128 | };
|
129 |
|
130 | class sh_lvalue__Keyed : public sh_lvalue_t {
|
131 | public:
|
132 | sh_lvalue__Keyed(BigStr* name, BigStr* key, syntax_asdl::loc_t* blame_loc)
|
133 | : name(name),
|
134 | key(key),
|
135 | blame_loc(blame_loc) {
|
136 | }
|
137 |
|
138 | static sh_lvalue__Keyed* CreateNull(bool alloc_lists = false) {
|
139 | return Alloc<sh_lvalue__Keyed>(kEmptyString, kEmptyString, nullptr);
|
140 | }
|
141 |
|
142 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
143 |
|
144 | static constexpr ObjHeader obj_header() {
|
145 | return ObjHeader::AsdlClass(static_cast<uint16_t>(sh_lvalue_e::Keyed), 3);
|
146 | }
|
147 |
|
148 | BigStr* name;
|
149 | BigStr* key;
|
150 | syntax_asdl::loc_t* blame_loc;
|
151 |
|
152 | DISALLOW_COPY_AND_ASSIGN(sh_lvalue__Keyed)
|
153 | };
|
154 |
|
155 | ASDL_NAMES sh_lvalue {
|
156 | typedef sh_lvalue__Indexed Indexed;
|
157 | typedef sh_lvalue__Keyed Keyed;
|
158 | };
|
159 |
|
160 | ASDL_NAMES eggex_ops_e {
|
161 | enum no_name {
|
162 | No = 1,
|
163 | Yes = 2,
|
164 | };
|
165 | };
|
166 |
|
167 | BigStr* eggex_ops_str(int tag, bool dot = true);
|
168 |
|
169 | class eggex_ops_t {
|
170 | protected:
|
171 | eggex_ops_t() {
|
172 | }
|
173 | public:
|
174 | int tag() const {
|
175 | return ObjHeader::FromObject(this)->type_tag;
|
176 | }
|
177 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
178 | DISALLOW_COPY_AND_ASSIGN(eggex_ops_t)
|
179 | };
|
180 |
|
181 | class eggex_ops__No : public eggex_ops_t {
|
182 | public:
|
183 | eggex_ops__No() {}
|
184 |
|
185 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
186 |
|
187 | static constexpr ObjHeader obj_header() {
|
188 | return ObjHeader::AsdlClass(static_cast<uint16_t>(eggex_ops_e::No), 0);
|
189 | }
|
190 |
|
191 |
|
192 | DISALLOW_COPY_AND_ASSIGN(eggex_ops__No)
|
193 | };
|
194 |
|
195 | class eggex_ops__Yes : public eggex_ops_t {
|
196 | public:
|
197 | eggex_ops__Yes(List<value_t*>* convert_funcs, List<syntax_asdl::Token*>*
|
198 | convert_toks, List<BigStr*>* capture_names)
|
199 | : convert_funcs(convert_funcs),
|
200 | convert_toks(convert_toks),
|
201 | capture_names(capture_names) {
|
202 | }
|
203 |
|
204 | static eggex_ops__Yes* CreateNull(bool alloc_lists = false) {
|
205 | return Alloc<eggex_ops__Yes>(alloc_lists ? Alloc<List<value_t*>>() :
|
206 | nullptr, alloc_lists ?
|
207 | Alloc<List<syntax_asdl::Token*>>() : nullptr,
|
208 | alloc_lists ? Alloc<List<BigStr*>>() :
|
209 | nullptr);
|
210 | }
|
211 |
|
212 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
213 |
|
214 | static constexpr ObjHeader obj_header() {
|
215 | return ObjHeader::AsdlClass(static_cast<uint16_t>(eggex_ops_e::Yes), 3);
|
216 | }
|
217 |
|
218 | List<value_t*>* convert_funcs;
|
219 | List<syntax_asdl::Token*>* convert_toks;
|
220 | List<BigStr*>* capture_names;
|
221 |
|
222 | DISALLOW_COPY_AND_ASSIGN(eggex_ops__Yes)
|
223 | };
|
224 |
|
225 | extern GcGlobal<eggex_ops__No> geggex_ops__No;
|
226 | ASDL_NAMES eggex_ops {
|
227 | static eggex_ops__No* No;
|
228 | typedef eggex_ops__Yes Yes;
|
229 | };
|
230 |
|
231 | ASDL_NAMES regex_match_e {
|
232 | enum no_name {
|
233 | No = 1,
|
234 | Yes = 67,
|
235 | };
|
236 | };
|
237 |
|
238 | BigStr* regex_match_str(int tag, bool dot = true);
|
239 |
|
240 | class regex_match_t {
|
241 | protected:
|
242 | regex_match_t() {
|
243 | }
|
244 | public:
|
245 | int tag() const {
|
246 | return ObjHeader::FromObject(this)->type_tag;
|
247 | }
|
248 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
249 | DISALLOW_COPY_AND_ASSIGN(regex_match_t)
|
250 | };
|
251 |
|
252 | class regex_match__No : public regex_match_t {
|
253 | public:
|
254 | regex_match__No() {}
|
255 |
|
256 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
257 |
|
258 | static constexpr ObjHeader obj_header() {
|
259 | return ObjHeader::AsdlClass(static_cast<uint16_t>(regex_match_e::No), 0);
|
260 | }
|
261 |
|
262 |
|
263 | DISALLOW_COPY_AND_ASSIGN(regex_match__No)
|
264 | };
|
265 |
|
266 | extern GcGlobal<regex_match__No> gregex_match__No;
|
267 | ASDL_NAMES regex_match {
|
268 | static regex_match__No* No;
|
269 | };
|
270 |
|
271 | ASDL_NAMES cmd_frag_e {
|
272 | enum no_name {
|
273 | LiteralBlock = 68,
|
274 | Expr = 2,
|
275 | };
|
276 | };
|
277 |
|
278 | BigStr* cmd_frag_str(int tag, bool dot = true);
|
279 |
|
280 | class cmd_frag_t {
|
281 | protected:
|
282 | cmd_frag_t() {
|
283 | }
|
284 | public:
|
285 | int tag() const {
|
286 | return ObjHeader::FromObject(this)->type_tag;
|
287 | }
|
288 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
289 | DISALLOW_COPY_AND_ASSIGN(cmd_frag_t)
|
290 | };
|
291 |
|
292 | class cmd_frag__Expr : public cmd_frag_t {
|
293 | public:
|
294 | cmd_frag__Expr(syntax_asdl::command_t* c)
|
295 | : c(c) {
|
296 | }
|
297 |
|
298 | static cmd_frag__Expr* CreateNull(bool alloc_lists = false) {
|
299 | return Alloc<cmd_frag__Expr>(nullptr);
|
300 | }
|
301 |
|
302 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
303 |
|
304 | static constexpr ObjHeader obj_header() {
|
305 | return ObjHeader::AsdlClass(static_cast<uint16_t>(cmd_frag_e::Expr), 1);
|
306 | }
|
307 |
|
308 | syntax_asdl::command_t* c;
|
309 |
|
310 | DISALLOW_COPY_AND_ASSIGN(cmd_frag__Expr)
|
311 | };
|
312 |
|
313 | ASDL_NAMES cmd_frag {
|
314 | typedef cmd_frag__Expr Expr;
|
315 | };
|
316 |
|
317 | ASDL_NAMES value_e {
|
318 | enum no_name {
|
319 | Interrupted = 1,
|
320 | Stdin = 2,
|
321 | Slice = 3,
|
322 | Undef = 4,
|
323 | Str = 5,
|
324 | BashArray = 6,
|
325 | SparseArray = 7,
|
326 | BashAssoc = 8,
|
327 | Null = 9,
|
328 | Bool = 10,
|
329 | Int = 11,
|
330 | Float = 12,
|
331 | List = 13,
|
332 | Dict = 14,
|
333 | Obj = 69,
|
334 | Range = 16,
|
335 | Eggex = 17,
|
336 | Match = 67,
|
337 | Place = 19,
|
338 | Frame = 20,
|
339 | BoundFunc = 21,
|
340 | BuiltinFunc = 22,
|
341 | Func = 23,
|
342 | BuiltinProc = 24,
|
343 | Proc = 25,
|
344 | Expr = 26,
|
345 | CommandFrag = 27,
|
346 | Command = 28,
|
347 | };
|
348 | };
|
349 |
|
350 | BigStr* value_str(int tag, bool dot = true);
|
351 |
|
352 | class value_t {
|
353 | protected:
|
354 | value_t() {
|
355 | }
|
356 | public:
|
357 | int tag() const {
|
358 | return ObjHeader::FromObject(this)->type_tag;
|
359 | }
|
360 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
361 | DISALLOW_COPY_AND_ASSIGN(value_t)
|
362 | };
|
363 |
|
364 | class value__Interrupted : public value_t {
|
365 | public:
|
366 | value__Interrupted() {}
|
367 |
|
368 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
369 |
|
370 | static constexpr ObjHeader obj_header() {
|
371 | return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Interrupted), 0);
|
372 | }
|
373 |
|
374 |
|
375 | DISALLOW_COPY_AND_ASSIGN(value__Interrupted)
|
376 | };
|
377 |
|
378 | class value__Stdin : public value_t {
|
379 | public:
|
380 | value__Stdin() {}
|
381 |
|
382 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
383 |
|
384 | static constexpr ObjHeader obj_header() {
|
385 | return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Stdin), 0);
|
386 | }
|
387 |
|
388 |
|
389 | DISALLOW_COPY_AND_ASSIGN(value__Stdin)
|
390 | };
|
391 |
|
392 | class value__Slice : public value_t {
|
393 | public:
|
394 | value__Slice(IntBox* lower, IntBox* upper)
|
395 | : lower(lower),
|
396 | upper(upper) {
|
397 | }
|
398 |
|
399 | static value__Slice* CreateNull(bool alloc_lists = false) {
|
400 | return Alloc<value__Slice>(nullptr, nullptr);
|
401 | }
|
402 |
|
403 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
404 |
|
405 | static constexpr ObjHeader obj_header() {
|
406 | return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Slice), 2);
|
407 | }
|
408 |
|
409 | IntBox* lower;
|
410 | IntBox* upper;
|
411 |
|
412 | DISALLOW_COPY_AND_ASSIGN(value__Slice)
|
413 | };
|
414 |
|
415 | class value__Undef : public value_t {
|
416 | public:
|
417 | value__Undef() {}
|
418 |
|
419 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
420 |
|
421 | static constexpr ObjHeader obj_header() {
|
422 | return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Undef), 0);
|
423 | }
|
424 |
|
425 |
|
426 | DISALLOW_COPY_AND_ASSIGN(value__Undef)
|
427 | };
|
428 |
|
429 | class value__Str : public value_t {
|
430 | public:
|
431 | value__Str(BigStr* s)
|
432 | : s(s) {
|
433 | }
|
434 |
|
435 | static value__Str* CreateNull(bool alloc_lists = false) {
|
436 | return Alloc<value__Str>(kEmptyString);
|
437 | }
|
438 |
|
439 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
440 |
|
441 | static constexpr ObjHeader obj_header() {
|
442 | return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Str), 1);
|
443 | }
|
444 |
|
445 | BigStr* s;
|
446 |
|
447 | DISALLOW_COPY_AND_ASSIGN(value__Str)
|
448 | };
|
449 |
|
450 | class value__BashArray : public value_t {
|
451 | public:
|
452 | value__BashArray(List<BigStr*>* strs)
|
453 | : strs(strs) {
|
454 | }
|
455 |
|
456 | static value__BashArray* CreateNull(bool alloc_lists = false) {
|
457 | return Alloc<value__BashArray>(alloc_lists ? Alloc<List<BigStr*>>() :
|
458 | nullptr);
|
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>(value_e::BashArray), 1);
|
465 | }
|
466 |
|
467 | List<BigStr*>* strs;
|
468 |
|
469 | DISALLOW_COPY_AND_ASSIGN(value__BashArray)
|
470 | };
|
471 |
|
472 | class value__SparseArray : public value_t {
|
473 | public:
|
474 | value__SparseArray(Dict<mops::BigInt, BigStr*>* d, mops::BigInt max_index)
|
475 | : d(d),
|
476 | max_index(max_index) {
|
477 | }
|
478 |
|
479 | static value__SparseArray* CreateNull(bool alloc_lists = false) {
|
480 | return Alloc<value__SparseArray>(nullptr, -1);
|
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>(value_e::SparseArray), 1);
|
487 | }
|
488 |
|
489 | Dict<mops::BigInt, BigStr*>* d;
|
490 | mops::BigInt max_index;
|
491 |
|
492 | DISALLOW_COPY_AND_ASSIGN(value__SparseArray)
|
493 | };
|
494 |
|
495 | class value__BashAssoc : public value_t {
|
496 | public:
|
497 | value__BashAssoc(Dict<BigStr*, BigStr*>* d)
|
498 | : d(d) {
|
499 | }
|
500 |
|
501 | static value__BashAssoc* CreateNull(bool alloc_lists = false) {
|
502 | return Alloc<value__BashAssoc>(nullptr);
|
503 | }
|
504 |
|
505 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
506 |
|
507 | static constexpr ObjHeader obj_header() {
|
508 | return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::BashAssoc), 1);
|
509 | }
|
510 |
|
511 | Dict<BigStr*, BigStr*>* d;
|
512 |
|
513 | DISALLOW_COPY_AND_ASSIGN(value__BashAssoc)
|
514 | };
|
515 |
|
516 | class value__Null : public value_t {
|
517 | public:
|
518 | value__Null() {}
|
519 |
|
520 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
521 |
|
522 | static constexpr ObjHeader obj_header() {
|
523 | return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Null), 0);
|
524 | }
|
525 |
|
526 |
|
527 | DISALLOW_COPY_AND_ASSIGN(value__Null)
|
528 | };
|
529 |
|
530 | class value__Bool : public value_t {
|
531 | public:
|
532 | value__Bool(bool b)
|
533 | : b(b) {
|
534 | }
|
535 |
|
536 | static value__Bool* CreateNull(bool alloc_lists = false) {
|
537 | return Alloc<value__Bool>(false);
|
538 | }
|
539 |
|
540 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
541 |
|
542 | static constexpr ObjHeader obj_header() {
|
543 | return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Bool), 0);
|
544 | }
|
545 |
|
546 | bool b;
|
547 |
|
548 | DISALLOW_COPY_AND_ASSIGN(value__Bool)
|
549 | };
|
550 |
|
551 | class value__Int : public value_t {
|
552 | public:
|
553 | value__Int(mops::BigInt i)
|
554 | : i(i) {
|
555 | }
|
556 |
|
557 | static value__Int* CreateNull(bool alloc_lists = false) {
|
558 | return Alloc<value__Int>(-1);
|
559 | }
|
560 |
|
561 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
562 |
|
563 | static constexpr ObjHeader obj_header() {
|
564 | return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Int), 0);
|
565 | }
|
566 |
|
567 | mops::BigInt i;
|
568 |
|
569 | DISALLOW_COPY_AND_ASSIGN(value__Int)
|
570 | };
|
571 |
|
572 | class value__Float : public value_t {
|
573 | public:
|
574 | value__Float(double f)
|
575 | : f(f) {
|
576 | }
|
577 |
|
578 | static value__Float* CreateNull(bool alloc_lists = false) {
|
579 | return Alloc<value__Float>(0.0);
|
580 | }
|
581 |
|
582 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
583 |
|
584 | static constexpr ObjHeader obj_header() {
|
585 | return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Float), 0);
|
586 | }
|
587 |
|
588 | double f;
|
589 |
|
590 | DISALLOW_COPY_AND_ASSIGN(value__Float)
|
591 | };
|
592 |
|
593 | class value__List : public value_t {
|
594 | public:
|
595 | value__List(List<value_t*>* items)
|
596 | : items(items) {
|
597 | }
|
598 |
|
599 | static value__List* CreateNull(bool alloc_lists = false) {
|
600 | return Alloc<value__List>(alloc_lists ? Alloc<List<value_t*>>() : nullptr);
|
601 | }
|
602 |
|
603 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
604 |
|
605 | static constexpr ObjHeader obj_header() {
|
606 | return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::List), 1);
|
607 | }
|
608 |
|
609 | List<value_t*>* items;
|
610 |
|
611 | DISALLOW_COPY_AND_ASSIGN(value__List)
|
612 | };
|
613 |
|
614 | class value__Dict : public value_t {
|
615 | public:
|
616 | value__Dict(Dict<BigStr*, value_t*>* d)
|
617 | : d(d) {
|
618 | }
|
619 |
|
620 | static value__Dict* CreateNull(bool alloc_lists = false) {
|
621 | return Alloc<value__Dict>(nullptr);
|
622 | }
|
623 |
|
624 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
625 |
|
626 | static constexpr ObjHeader obj_header() {
|
627 | return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Dict), 1);
|
628 | }
|
629 |
|
630 | Dict<BigStr*, value_t*>* d;
|
631 |
|
632 | DISALLOW_COPY_AND_ASSIGN(value__Dict)
|
633 | };
|
634 |
|
635 | class value__Range : public value_t {
|
636 | public:
|
637 | value__Range(int lower, int upper)
|
638 | : lower(lower),
|
639 | upper(upper) {
|
640 | }
|
641 |
|
642 | static value__Range* CreateNull(bool alloc_lists = false) {
|
643 | return Alloc<value__Range>(-1, -1);
|
644 | }
|
645 |
|
646 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
647 |
|
648 | static constexpr ObjHeader obj_header() {
|
649 | return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Range), 0);
|
650 | }
|
651 |
|
652 | int lower;
|
653 | int upper;
|
654 |
|
655 | DISALLOW_COPY_AND_ASSIGN(value__Range)
|
656 | };
|
657 |
|
658 | class value__Eggex : public value_t {
|
659 | public:
|
660 | value__Eggex(syntax_asdl::re_t* spliced, BigStr* canonical_flags,
|
661 | List<value_t*>* convert_funcs, List<syntax_asdl::Token*>*
|
662 | convert_toks, BigStr* as_ere, List<BigStr*>* capture_names)
|
663 | : spliced(spliced),
|
664 | canonical_flags(canonical_flags),
|
665 | convert_funcs(convert_funcs),
|
666 | convert_toks(convert_toks),
|
667 | as_ere(as_ere),
|
668 | capture_names(capture_names) {
|
669 | }
|
670 |
|
671 | static value__Eggex* CreateNull(bool alloc_lists = false) {
|
672 | return Alloc<value__Eggex>(nullptr, kEmptyString, alloc_lists ?
|
673 | Alloc<List<value_t*>>() : nullptr, alloc_lists ?
|
674 | Alloc<List<syntax_asdl::Token*>>() : nullptr,
|
675 | nullptr, alloc_lists ? Alloc<List<BigStr*>>() :
|
676 | nullptr);
|
677 | }
|
678 |
|
679 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
680 |
|
681 | static constexpr ObjHeader obj_header() {
|
682 | return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Eggex), 6);
|
683 | }
|
684 |
|
685 | syntax_asdl::re_t* spliced;
|
686 | BigStr* canonical_flags;
|
687 | List<value_t*>* convert_funcs;
|
688 | List<syntax_asdl::Token*>* convert_toks;
|
689 | BigStr* as_ere;
|
690 | List<BigStr*>* capture_names;
|
691 |
|
692 | DISALLOW_COPY_AND_ASSIGN(value__Eggex)
|
693 | };
|
694 |
|
695 | class value__Place : public value_t {
|
696 | public:
|
697 | value__Place(y_lvalue_t* lval, Dict<BigStr*, runtime_asdl::Cell*>* frame)
|
698 | : lval(lval),
|
699 | frame(frame) {
|
700 | }
|
701 |
|
702 | static value__Place* CreateNull(bool alloc_lists = false) {
|
703 | return Alloc<value__Place>(nullptr, nullptr);
|
704 | }
|
705 |
|
706 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
707 |
|
708 | static constexpr ObjHeader obj_header() {
|
709 | return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Place), 2);
|
710 | }
|
711 |
|
712 | y_lvalue_t* lval;
|
713 | Dict<BigStr*, runtime_asdl::Cell*>* frame;
|
714 |
|
715 | DISALLOW_COPY_AND_ASSIGN(value__Place)
|
716 | };
|
717 |
|
718 | class value__Frame : public value_t {
|
719 | public:
|
720 | value__Frame(Dict<BigStr*, runtime_asdl::Cell*>* frame)
|
721 | : frame(frame) {
|
722 | }
|
723 |
|
724 | static value__Frame* CreateNull(bool alloc_lists = false) {
|
725 | return Alloc<value__Frame>(nullptr);
|
726 | }
|
727 |
|
728 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
729 |
|
730 | static constexpr ObjHeader obj_header() {
|
731 | return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Frame), 1);
|
732 | }
|
733 |
|
734 | Dict<BigStr*, runtime_asdl::Cell*>* frame;
|
735 |
|
736 | DISALLOW_COPY_AND_ASSIGN(value__Frame)
|
737 | };
|
738 |
|
739 | class value__BoundFunc : public value_t {
|
740 | public:
|
741 | value__BoundFunc(value_t* me, value_t* func)
|
742 | : me(me),
|
743 | func(func) {
|
744 | }
|
745 |
|
746 | static value__BoundFunc* CreateNull(bool alloc_lists = false) {
|
747 | return Alloc<value__BoundFunc>(nullptr, nullptr);
|
748 | }
|
749 |
|
750 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
751 |
|
752 | static constexpr ObjHeader obj_header() {
|
753 | return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::BoundFunc), 2);
|
754 | }
|
755 |
|
756 | value_t* me;
|
757 | value_t* func;
|
758 |
|
759 | DISALLOW_COPY_AND_ASSIGN(value__BoundFunc)
|
760 | };
|
761 |
|
762 | class value__BuiltinFunc : public value_t {
|
763 | public:
|
764 | value__BuiltinFunc(void* callable)
|
765 | : callable(callable) {
|
766 | }
|
767 |
|
768 | static value__BuiltinFunc* CreateNull(bool alloc_lists = false) {
|
769 | return Alloc<value__BuiltinFunc>(nullptr);
|
770 | }
|
771 |
|
772 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
773 |
|
774 | static constexpr ObjHeader obj_header() {
|
775 | return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::BuiltinFunc), 1);
|
776 | }
|
777 |
|
778 | void* callable;
|
779 |
|
780 | DISALLOW_COPY_AND_ASSIGN(value__BuiltinFunc)
|
781 | };
|
782 |
|
783 | class value__Func : public value_t {
|
784 | public:
|
785 | value__Func(BigStr* name, syntax_asdl::Func* parsed, List<value_t*>*
|
786 | pos_defaults, Dict<BigStr*, value_t*>* named_defaults,
|
787 | Dict<BigStr*, runtime_asdl::Cell*>* module_frame)
|
788 | : name(name),
|
789 | parsed(parsed),
|
790 | pos_defaults(pos_defaults),
|
791 | named_defaults(named_defaults),
|
792 | module_frame(module_frame) {
|
793 | }
|
794 |
|
795 | static value__Func* CreateNull(bool alloc_lists = false) {
|
796 | return Alloc<value__Func>(kEmptyString, nullptr, alloc_lists ?
|
797 | Alloc<List<value_t*>>() : nullptr, nullptr,
|
798 | nullptr);
|
799 | }
|
800 |
|
801 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
802 |
|
803 | static constexpr ObjHeader obj_header() {
|
804 | return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Func), 5);
|
805 | }
|
806 |
|
807 | BigStr* name;
|
808 | syntax_asdl::Func* parsed;
|
809 | List<value_t*>* pos_defaults;
|
810 | Dict<BigStr*, value_t*>* named_defaults;
|
811 | Dict<BigStr*, runtime_asdl::Cell*>* module_frame;
|
812 |
|
813 | DISALLOW_COPY_AND_ASSIGN(value__Func)
|
814 | };
|
815 |
|
816 | class value__BuiltinProc : public value_t {
|
817 | public:
|
818 | value__BuiltinProc(void* builtin)
|
819 | : builtin(builtin) {
|
820 | }
|
821 |
|
822 | static value__BuiltinProc* CreateNull(bool alloc_lists = false) {
|
823 | return Alloc<value__BuiltinProc>(nullptr);
|
824 | }
|
825 |
|
826 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
827 |
|
828 | static constexpr ObjHeader obj_header() {
|
829 | return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::BuiltinProc), 1);
|
830 | }
|
831 |
|
832 | void* builtin;
|
833 |
|
834 | DISALLOW_COPY_AND_ASSIGN(value__BuiltinProc)
|
835 | };
|
836 |
|
837 | class value__Proc : public value_t {
|
838 | public:
|
839 | value__Proc(BigStr* name, syntax_asdl::Token* name_tok,
|
840 | syntax_asdl::proc_sig_t* sig, syntax_asdl::command_t* body,
|
841 | ProcDefaults* defaults, bool sh_compat, Dict<BigStr*,
|
842 | runtime_asdl::Cell*>* module_frame)
|
843 | : name(name),
|
844 | name_tok(name_tok),
|
845 | sig(sig),
|
846 | body(body),
|
847 | defaults(defaults),
|
848 | module_frame(module_frame),
|
849 | sh_compat(sh_compat) {
|
850 | }
|
851 |
|
852 | static value__Proc* CreateNull(bool alloc_lists = false) {
|
853 | return Alloc<value__Proc>(kEmptyString, nullptr, nullptr, nullptr, nullptr,
|
854 | false, nullptr);
|
855 | }
|
856 |
|
857 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
858 |
|
859 | static constexpr ObjHeader obj_header() {
|
860 | return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Proc), 6);
|
861 | }
|
862 |
|
863 | BigStr* name;
|
864 | syntax_asdl::Token* name_tok;
|
865 | syntax_asdl::proc_sig_t* sig;
|
866 | syntax_asdl::command_t* body;
|
867 | ProcDefaults* defaults;
|
868 | Dict<BigStr*, runtime_asdl::Cell*>* module_frame;
|
869 | bool sh_compat;
|
870 |
|
871 | DISALLOW_COPY_AND_ASSIGN(value__Proc)
|
872 | };
|
873 |
|
874 | class value__Expr : public value_t {
|
875 | public:
|
876 | value__Expr(syntax_asdl::expr_t* e, Dict<BigStr*, runtime_asdl::Cell*>*
|
877 | captured_frame, Dict<BigStr*, runtime_asdl::Cell*>* module_frame)
|
878 | : e(e),
|
879 | captured_frame(captured_frame),
|
880 | module_frame(module_frame) {
|
881 | }
|
882 |
|
883 | static value__Expr* CreateNull(bool alloc_lists = false) {
|
884 | return Alloc<value__Expr>(nullptr, nullptr, nullptr);
|
885 | }
|
886 |
|
887 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
888 |
|
889 | static constexpr ObjHeader obj_header() {
|
890 | return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Expr), 3);
|
891 | }
|
892 |
|
893 | syntax_asdl::expr_t* e;
|
894 | Dict<BigStr*, runtime_asdl::Cell*>* captured_frame;
|
895 | Dict<BigStr*, runtime_asdl::Cell*>* module_frame;
|
896 |
|
897 | DISALLOW_COPY_AND_ASSIGN(value__Expr)
|
898 | };
|
899 |
|
900 | class value__CommandFrag : public value_t {
|
901 | public:
|
902 | value__CommandFrag(syntax_asdl::command_t* c)
|
903 | : c(c) {
|
904 | }
|
905 |
|
906 | static value__CommandFrag* CreateNull(bool alloc_lists = false) {
|
907 | return Alloc<value__CommandFrag>(nullptr);
|
908 | }
|
909 |
|
910 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
911 |
|
912 | static constexpr ObjHeader obj_header() {
|
913 | return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::CommandFrag), 1);
|
914 | }
|
915 |
|
916 | syntax_asdl::command_t* c;
|
917 |
|
918 | DISALLOW_COPY_AND_ASSIGN(value__CommandFrag)
|
919 | };
|
920 |
|
921 | class value__Command : public value_t {
|
922 | public:
|
923 | value__Command(cmd_frag_t* frag, Dict<BigStr*, runtime_asdl::Cell*>*
|
924 | captured_frame, Dict<BigStr*, runtime_asdl::Cell*>*
|
925 | module_frame)
|
926 | : frag(frag),
|
927 | captured_frame(captured_frame),
|
928 | module_frame(module_frame) {
|
929 | }
|
930 |
|
931 | static value__Command* CreateNull(bool alloc_lists = false) {
|
932 | return Alloc<value__Command>(nullptr, nullptr, nullptr);
|
933 | }
|
934 |
|
935 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
936 |
|
937 | static constexpr ObjHeader obj_header() {
|
938 | return ObjHeader::AsdlClass(static_cast<uint16_t>(value_e::Command), 3);
|
939 | }
|
940 |
|
941 | cmd_frag_t* frag;
|
942 | Dict<BigStr*, runtime_asdl::Cell*>* captured_frame;
|
943 | Dict<BigStr*, runtime_asdl::Cell*>* module_frame;
|
944 |
|
945 | DISALLOW_COPY_AND_ASSIGN(value__Command)
|
946 | };
|
947 |
|
948 | extern GcGlobal<value__Interrupted> gvalue__Interrupted;
|
949 | extern GcGlobal<value__Stdin> gvalue__Stdin;
|
950 | extern GcGlobal<value__Undef> gvalue__Undef;
|
951 | extern GcGlobal<value__Null> gvalue__Null;
|
952 | ASDL_NAMES value {
|
953 | static value__Interrupted* Interrupted;
|
954 | static value__Stdin* Stdin;
|
955 | typedef value__Slice Slice;
|
956 | static value__Undef* Undef;
|
957 | typedef value__Str Str;
|
958 | typedef value__BashArray BashArray;
|
959 | typedef value__SparseArray SparseArray;
|
960 | typedef value__BashAssoc BashAssoc;
|
961 | static value__Null* Null;
|
962 | typedef value__Bool Bool;
|
963 | typedef value__Int Int;
|
964 | typedef value__Float Float;
|
965 | typedef value__List List;
|
966 | typedef value__Dict Dict;
|
967 | typedef value__Range Range;
|
968 | typedef value__Eggex Eggex;
|
969 | typedef value__Place Place;
|
970 | typedef value__Frame Frame;
|
971 | typedef value__BoundFunc BoundFunc;
|
972 | typedef value__BuiltinFunc BuiltinFunc;
|
973 | typedef value__Func Func;
|
974 | typedef value__BuiltinProc BuiltinProc;
|
975 | typedef value__Proc Proc;
|
976 | typedef value__Expr Expr;
|
977 | typedef value__CommandFrag CommandFrag;
|
978 | typedef value__Command Command;
|
979 | };
|
980 |
|
981 | class IntBox {
|
982 | public:
|
983 | IntBox(int i)
|
984 | : i(i) {
|
985 | }
|
986 |
|
987 | static IntBox* CreateNull(bool alloc_lists = false) {
|
988 | return Alloc<IntBox>(-1);
|
989 | }
|
990 |
|
991 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
992 |
|
993 | static constexpr ObjHeader obj_header() {
|
994 | return ObjHeader::AsdlClass(64, 0);
|
995 | }
|
996 |
|
997 | int i;
|
998 |
|
999 | DISALLOW_COPY_AND_ASSIGN(IntBox)
|
1000 | };
|
1001 |
|
1002 | class ProcDefaults {
|
1003 | public:
|
1004 | ProcDefaults(List<value_t*>* for_word, List<value_t*>* for_typed,
|
1005 | Dict<BigStr*, value_t*>* for_named, value_t* for_block)
|
1006 | : for_word(for_word),
|
1007 | for_typed(for_typed),
|
1008 | for_named(for_named),
|
1009 | for_block(for_block) {
|
1010 | }
|
1011 |
|
1012 | static ProcDefaults* CreateNull(bool alloc_lists = false) {
|
1013 | return Alloc<ProcDefaults>(nullptr, nullptr, nullptr, nullptr);
|
1014 | }
|
1015 |
|
1016 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
1017 |
|
1018 | static constexpr ObjHeader obj_header() {
|
1019 | return ObjHeader::AsdlClass(65, 4);
|
1020 | }
|
1021 |
|
1022 | List<value_t*>* for_word;
|
1023 | List<value_t*>* for_typed;
|
1024 | Dict<BigStr*, value_t*>* for_named;
|
1025 | value_t* for_block;
|
1026 |
|
1027 | DISALLOW_COPY_AND_ASSIGN(ProcDefaults)
|
1028 | };
|
1029 |
|
1030 | class LeftName : public y_lvalue_t, public sh_lvalue_t {
|
1031 | public:
|
1032 | LeftName(BigStr* name, syntax_asdl::loc_t* blame_loc)
|
1033 | : name(name),
|
1034 | blame_loc(blame_loc) {
|
1035 | }
|
1036 |
|
1037 | static LeftName* CreateNull(bool alloc_lists = false) {
|
1038 | return Alloc<LeftName>(kEmptyString, nullptr);
|
1039 | }
|
1040 |
|
1041 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
1042 |
|
1043 | static constexpr ObjHeader obj_header() {
|
1044 | return ObjHeader::AsdlClass(66, 2);
|
1045 | }
|
1046 |
|
1047 | BigStr* name;
|
1048 | syntax_asdl::loc_t* blame_loc;
|
1049 |
|
1050 | DISALLOW_COPY_AND_ASSIGN(LeftName)
|
1051 | };
|
1052 |
|
1053 | class RegexMatch : public regex_match_t, public value_t {
|
1054 | public:
|
1055 | RegexMatch(BigStr* s, List<int>* indices, eggex_ops_t* ops)
|
1056 | : s(s),
|
1057 | indices(indices),
|
1058 | ops(ops) {
|
1059 | }
|
1060 |
|
1061 | static RegexMatch* CreateNull(bool alloc_lists = false) {
|
1062 | return Alloc<RegexMatch>(kEmptyString, alloc_lists ? Alloc<List<int>>() :
|
1063 | nullptr, nullptr);
|
1064 | }
|
1065 |
|
1066 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
1067 |
|
1068 | static constexpr ObjHeader obj_header() {
|
1069 | return ObjHeader::AsdlClass(67, 3);
|
1070 | }
|
1071 |
|
1072 | BigStr* s;
|
1073 | List<int>* indices;
|
1074 | eggex_ops_t* ops;
|
1075 |
|
1076 | DISALLOW_COPY_AND_ASSIGN(RegexMatch)
|
1077 | };
|
1078 |
|
1079 | class LiteralBlock : public cmd_frag_t {
|
1080 | public:
|
1081 | LiteralBlock(syntax_asdl::BraceGroup* brace_group,
|
1082 | List<syntax_asdl::SourceLine*>* lines)
|
1083 | : brace_group(brace_group),
|
1084 | lines(lines) {
|
1085 | }
|
1086 |
|
1087 | static LiteralBlock* CreateNull(bool alloc_lists = false) {
|
1088 | return Alloc<LiteralBlock>(nullptr, alloc_lists ?
|
1089 | Alloc<List<syntax_asdl::SourceLine*>>() :
|
1090 | nullptr);
|
1091 | }
|
1092 |
|
1093 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
1094 |
|
1095 | static constexpr ObjHeader obj_header() {
|
1096 | return ObjHeader::AsdlClass(68, 2);
|
1097 | }
|
1098 |
|
1099 | syntax_asdl::BraceGroup* brace_group;
|
1100 | List<syntax_asdl::SourceLine*>* lines;
|
1101 |
|
1102 | DISALLOW_COPY_AND_ASSIGN(LiteralBlock)
|
1103 | };
|
1104 |
|
1105 | class Obj : public value_t {
|
1106 | public:
|
1107 | Obj(Obj* prototype, Dict<BigStr*, value_t*>* d)
|
1108 | : prototype(prototype),
|
1109 | d(d) {
|
1110 | }
|
1111 |
|
1112 | static Obj* CreateNull(bool alloc_lists = false) {
|
1113 | return Alloc<Obj>(nullptr, nullptr);
|
1114 | }
|
1115 |
|
1116 | hnode_t* PrettyTree(Dict<int, bool>* seen = nullptr);
|
1117 |
|
1118 | static constexpr ObjHeader obj_header() {
|
1119 | return ObjHeader::AsdlClass(69, 2);
|
1120 | }
|
1121 |
|
1122 | Obj* prototype;
|
1123 | Dict<BigStr*, value_t*>* d;
|
1124 |
|
1125 | DISALLOW_COPY_AND_ASSIGN(Obj)
|
1126 | };
|
1127 |
|
1128 |
|
1129 | } // namespace value_asdl
|
1130 |
|
1131 | #endif // VALUE_ASDL
|