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