Skip to content

Instantly share code, notes, and snippets.

@ridiculousfish
Created September 24, 2022 02:03
Show Gist options
  • Save ridiculousfish/32b053325b698adda782fdbad7a20d6d to your computer and use it in GitHub Desktop.
Save ridiculousfish/32b053325b698adda782fdbad7a20d6d to your computer and use it in GitHub Desktop.
calc_gen.cpp file
#include "calc__gen.hpp"
namespace lang::calc::lexer {
rc_ptr<lang_rt::DFALabelIdVec> label_ids_ascii() {
auto ret = Vec<lang_rt::DFALabelId>::repeat(lang_rt::DFATable::NO_LABEL, 128);
ret->at_unchecked(0) = 1;
ret->at_unchecked(1) = 1;
ret->at_unchecked(2) = 1;
ret->at_unchecked(3) = 1;
ret->at_unchecked(4) = 1;
ret->at_unchecked(5) = 1;
ret->at_unchecked(6) = 1;
ret->at_unchecked(7) = 1;
ret->at_unchecked(8) = 1;
ret->at_unchecked(9) = 1;
ret->at_unchecked(10) = 2;
ret->at_unchecked(11) = 3;
ret->at_unchecked(12) = 3;
ret->at_unchecked(13) = 3;
ret->at_unchecked(14) = 3;
ret->at_unchecked(15) = 3;
ret->at_unchecked(16) = 3;
ret->at_unchecked(17) = 3;
ret->at_unchecked(18) = 3;
ret->at_unchecked(19) = 3;
ret->at_unchecked(20) = 3;
ret->at_unchecked(21) = 3;
ret->at_unchecked(22) = 3;
ret->at_unchecked(23) = 3;
ret->at_unchecked(24) = 3;
ret->at_unchecked(25) = 3;
ret->at_unchecked(26) = 3;
ret->at_unchecked(27) = 3;
ret->at_unchecked(28) = 3;
ret->at_unchecked(29) = 3;
ret->at_unchecked(30) = 3;
ret->at_unchecked(31) = 3;
ret->at_unchecked(32) = 4;
ret->at_unchecked(33) = 5;
ret->at_unchecked(34) = 5;
ret->at_unchecked(35) = 5;
ret->at_unchecked(36) = 5;
ret->at_unchecked(37) = 5;
ret->at_unchecked(38) = 5;
ret->at_unchecked(39) = 5;
ret->at_unchecked(40) = 6;
ret->at_unchecked(41) = 7;
ret->at_unchecked(42) = 8;
ret->at_unchecked(43) = 9;
ret->at_unchecked(44) = 10;
ret->at_unchecked(45) = 11;
ret->at_unchecked(46) = 12;
ret->at_unchecked(47) = 13;
ret->at_unchecked(48) = 14;
ret->at_unchecked(49) = 15;
ret->at_unchecked(50) = 15;
ret->at_unchecked(51) = 15;
ret->at_unchecked(52) = 15;
ret->at_unchecked(53) = 15;
ret->at_unchecked(54) = 15;
ret->at_unchecked(55) = 15;
ret->at_unchecked(56) = 15;
ret->at_unchecked(57) = 15;
ret->at_unchecked(58) = 16;
ret->at_unchecked(59) = 16;
ret->at_unchecked(60) = 16;
ret->at_unchecked(61) = 17;
ret->at_unchecked(62) = 18;
ret->at_unchecked(63) = 18;
ret->at_unchecked(64) = 18;
ret->at_unchecked(65) = 18;
ret->at_unchecked(66) = 18;
ret->at_unchecked(67) = 18;
ret->at_unchecked(68) = 18;
ret->at_unchecked(69) = 18;
ret->at_unchecked(70) = 18;
ret->at_unchecked(71) = 18;
ret->at_unchecked(72) = 18;
ret->at_unchecked(73) = 18;
ret->at_unchecked(74) = 18;
ret->at_unchecked(75) = 18;
ret->at_unchecked(76) = 18;
ret->at_unchecked(77) = 18;
ret->at_unchecked(78) = 18;
ret->at_unchecked(79) = 18;
ret->at_unchecked(80) = 18;
ret->at_unchecked(81) = 18;
ret->at_unchecked(82) = 18;
ret->at_unchecked(83) = 18;
ret->at_unchecked(84) = 18;
ret->at_unchecked(85) = 18;
ret->at_unchecked(86) = 18;
ret->at_unchecked(87) = 18;
ret->at_unchecked(88) = 18;
ret->at_unchecked(89) = 18;
ret->at_unchecked(90) = 18;
ret->at_unchecked(91) = 18;
ret->at_unchecked(92) = 18;
ret->at_unchecked(93) = 18;
ret->at_unchecked(94) = 19;
ret->at_unchecked(95) = 20;
ret->at_unchecked(96) = 20;
ret->at_unchecked(97) = 21;
ret->at_unchecked(98) = 21;
ret->at_unchecked(99) = 21;
ret->at_unchecked(100) = 21;
ret->at_unchecked(101) = 21;
ret->at_unchecked(102) = 21;
ret->at_unchecked(103) = 21;
ret->at_unchecked(104) = 21;
ret->at_unchecked(105) = 21;
ret->at_unchecked(106) = 21;
ret->at_unchecked(107) = 21;
ret->at_unchecked(108) = 21;
ret->at_unchecked(109) = 21;
ret->at_unchecked(110) = 21;
ret->at_unchecked(111) = 21;
ret->at_unchecked(112) = 21;
ret->at_unchecked(113) = 21;
ret->at_unchecked(114) = 21;
ret->at_unchecked(115) = 21;
ret->at_unchecked(116) = 21;
ret->at_unchecked(117) = 21;
ret->at_unchecked(118) = 21;
ret->at_unchecked(119) = 21;
ret->at_unchecked(120) = 21;
ret->at_unchecked(121) = 21;
ret->at_unchecked(122) = 21;
ret->at_unchecked(123) = 22;
ret->at_unchecked(124) = 22;
ret->at_unchecked(125) = 22;
ret->at_unchecked(126) = 22;
ret->at_unchecked(127) = 22;
return ret;
}
}
namespace lang::calc::lexer {
rc_ptr<lang_rt::DFALabelIdMap> label_ids_unicode() {
auto ret = make_rc<lang_rt::DFALabelIdMap>();
ret->insert(make_pair(128, 22));
ret->insert(make_pair(1114112, 23));
return ret;
}
}
namespace lang::calc::lexer::body {
lang_rt::DFAVertexId step(lang_rt::DFAVertexId v, lang_rt::DFALabelId lbl) {
static const u16_array tt = {0x0003, 0xffff, 0xffff, 0xffff, 0x0001, 0xffff, 0x000c, 0x000d, 0x0009, 0x0007, 0xffff, 0x0008, 0xffff, 0x0002, 0x0005, 0x0006, 0xffff, 0x000b, 0xffff, 0x000a, 0xffff, 0x0004, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x000e, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x000f, 0x000f, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x000f, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x0010, 0x0010, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x000f, 0x000f, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x000f, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x0010, 0x0010, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff};
return static_cast<i16>(tt[v * 23 + lbl]);
}
}
namespace lang::calc::lexer::body {
__attribute__((always_inline)) lang_rt::DFAActionWithToken acc(lang_rt::DFAVertexId v) {
switch (v) {
case 0: {
return make_pair(lang_rt::DFATable::NO_ACTION, lang_rt::NO_TOKEN);
}
case 1: {
return make_pair(1, lang_rt::NO_TOKEN);
}
case 2: {
return make_pair(0, 5);
}
case 3: {
return make_pair(3, lang_rt::NO_TOKEN);
}
case 4: {
return make_pair(0, 0);
}
case 5: {
return make_pair(0, 1);
}
case 6: {
return make_pair(0, 1);
}
case 7: {
return make_pair(0, 2);
}
case 8: {
return make_pair(0, 3);
}
case 9: {
return make_pair(0, 4);
}
case 10: {
return make_pair(0, 6);
}
case 11: {
return make_pair(0, 7);
}
case 12: {
return make_pair(0, 8);
}
case 13: {
return make_pair(0, 9);
}
case 14: {
return make_pair(2, lang_rt::NO_TOKEN);
}
case 15: {
return make_pair(0, 0);
}
case 16: {
return make_pair(0, 1);
}
default: {
return make_pair(lang_rt::DFATable::NO_ACTION, lang_rt::NO_TOKEN);
}
}
}
}
namespace lang::calc::lexer::body {
__attribute__((always_inline)) IntPair step_exec(ptr<lang_rt::LexerState> st, ptr<lang_rt::SymItemVec> emit_dst, ptr<lang_rt::LexWhitespaceState> ws_state, lang_rt::DFAActionId acc, lang_rt::TokenId tok, Int& in_i, Int& tok_lo, Int& tok_hi) {
auto ret = make_pair(-1, -1);
bool mode_switch = false;
switch (acc) {
case 0: {
st->enqueue_emit_ext(emit_dst, ws_state, tok, tok_lo, tok_hi, true);
in_i = tok_hi;
break;
}
case 1: {
in_i = tok_hi;
break;
}
case 2: {
ret = make_pair(1, in_i);
mode_switch = true;
in_i = tok_hi;
break;
}
case 3: {
ret = make_pair(lang_rt::DFATable::NEW_MODE_POP, -1);
mode_switch = true;
break;
}
default: {
AX();
}
}
return ret;
}
}
namespace lang::calc::lexer::comment_single {
lang_rt::DFAVertexId step(lang_rt::DFAVertexId v, lang_rt::DFALabelId lbl) {
static const u16_array tt = {0x0002, 0x0003, 0x0001, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff};
return static_cast<i16>(tt[v * 23 + lbl]);
}
}
namespace lang::calc::lexer::comment_single {
__attribute__((always_inline)) lang_rt::DFAActionWithToken acc(lang_rt::DFAVertexId v) {
switch (v) {
case 0: {
return make_pair(lang_rt::DFATable::NO_ACTION, lang_rt::NO_TOKEN);
}
case 1: {
return make_pair(0, lang_rt::NO_TOKEN);
}
case 2: {
return make_pair(1, lang_rt::NO_TOKEN);
}
case 3: {
return make_pair(2, lang_rt::NO_TOKEN);
}
default: {
return make_pair(lang_rt::DFATable::NO_ACTION, lang_rt::NO_TOKEN);
}
}
}
}
namespace lang::calc::lexer::comment_single {
__attribute__((always_inline)) IntPair step_exec(ptr<lang_rt::LexerState> st, ptr<lang_rt::SymItemVec> emit_dst, ptr<lang_rt::LexWhitespaceState> ws_state, lang_rt::DFAActionId acc, lang_rt::TokenId tok, Int& in_i, Int& tok_lo, Int& tok_hi) {
auto ret = make_pair(-1, -1);
bool mode_switch = false;
switch (acc) {
case 0: {
ret = make_pair(lang_rt::DFATable::NEW_MODE_POP_EXTRACT, -1);
mode_switch = true;
break;
}
case 1: {
ret = make_pair(lang_rt::DFATable::NEW_MODE_POP_EXTRACT, -1);
mode_switch = true;
break;
}
case 2: {
in_i = tok_hi;
break;
}
default: {
AX();
}
}
return ret;
}
}
void pr_debug(ostream& os, FmtFlags flags, lang::calc::Node_T x) {
switch (x->w_) {
case lang::calc::Node::_W::Expr__UnaryPre__op: {
pr_debug(os, flags, x->as_Expr__UnaryPre__op());
break;
}
case lang::calc::Node::_W::Expr__BinOp1__op: {
pr_debug(os, flags, x->as_Expr__BinOp1__op());
break;
}
case lang::calc::Node::_W::Expr__BinOp2__op: {
pr_debug(os, flags, x->as_Expr__BinOp2__op());
break;
}
case lang::calc::Node::_W::Expr__BinOp3__op: {
pr_debug(os, flags, x->as_Expr__BinOp3__op());
break;
}
case lang::calc::Node::_W::Stmt: {
pr_debug(os, flags, x->as_Stmt());
break;
}
case lang::calc::Node::_W::Expr: {
pr_debug(os, flags, x->as_Expr());
break;
}
default: {
AX();
}
}
}
lang::calc::Node::_T::~_T() {
}
lang::calc::Node::_T::_T(lang::calc::Node::_W w) {
w_ = w;
}
bool lang::calc::Node::_T::is_Expr__UnaryPre__op() {
return w_ == lang::calc::Node::_W::Expr__UnaryPre__op;
}
bool lang::calc::Node::_T::is_Expr__BinOp1__op() {
return w_ == lang::calc::Node::_W::Expr__BinOp1__op;
}
bool lang::calc::Node::_T::is_Expr__BinOp2__op() {
return w_ == lang::calc::Node::_W::Expr__BinOp2__op;
}
bool lang::calc::Node::_T::is_Expr__BinOp3__op() {
return w_ == lang::calc::Node::_W::Expr__BinOp3__op;
}
bool lang::calc::Node::_T::is_Stmt() {
return w_ == lang::calc::Node::_W::Stmt;
}
bool lang::calc::Node::_T::is_Expr() {
return w_ == lang::calc::Node::_W::Expr;
}
lang::calc::Node::Expr::UnaryPre::op_T lang::calc::Node::_T::as_Expr__UnaryPre__op() {
AT(this->is_Expr__UnaryPre__op());
return this->rc_from_this_poly<lang::calc::Node::Expr::UnaryPre::op::_T>();
}
lang::calc::Node::Expr::BinOp1::op_T lang::calc::Node::_T::as_Expr__BinOp1__op() {
AT(this->is_Expr__BinOp1__op());
return this->rc_from_this_poly<lang::calc::Node::Expr::BinOp1::op::_T>();
}
lang::calc::Node::Expr::BinOp2::op_T lang::calc::Node::_T::as_Expr__BinOp2__op() {
AT(this->is_Expr__BinOp2__op());
return this->rc_from_this_poly<lang::calc::Node::Expr::BinOp2::op::_T>();
}
lang::calc::Node::Expr::BinOp3::op_T lang::calc::Node::_T::as_Expr__BinOp3__op() {
AT(this->is_Expr__BinOp3__op());
return this->rc_from_this_poly<lang::calc::Node::Expr::BinOp3::op::_T>();
}
lang::calc::Node::Stmt_T lang::calc::Node::_T::as_Stmt() {
AT(this->is_Stmt());
return this->rc_from_this_poly<lang::calc::Node::Stmt::_T>();
}
lang::calc::Node::Expr_T lang::calc::Node::_T::as_Expr() {
AT(this->is_Expr());
return this->rc_from_this_poly<lang::calc::Node::Expr::_T>();
}
void lang::calc::Node::_T::hash_ser_acc_lang_calc_Node(SerBuf& buf) const {
hash_ser(buf, static_cast<Int>(w_));
hash_ser(buf, is_top_);
hash_ser(buf, sym_);
hash_ser(buf, attr_);
hash_ser(buf, first_k_);
}
void pr_debug(ostream& os, FmtFlags flags, lang::calc::Node::Stmt_T x) {
switch (x->w_) {
case lang::calc::Node::Stmt::_W::Assign: {
pr_debug(os, flags, x->as_Assign());
break;
}
case lang::calc::Node::Stmt::_W::Expr: {
pr_debug(os, flags, x->as_Expr());
break;
}
default: {
AX();
}
}
}
lang::calc::Node::Stmt::_T::~_T() {
}
lang::calc::Node::Stmt::_T::_T(lang::calc::Node::Stmt::_W w) : lang::calc::Node::_T(lang::calc::Node::_W::Stmt) {
w_ = w;
}
bool lang::calc::Node::Stmt::_T::is_Assign() {
return w_ == lang::calc::Node::Stmt::_W::Assign;
}
bool lang::calc::Node::Stmt::_T::is_Expr() {
return w_ == lang::calc::Node::Stmt::_W::Expr;
}
lang::calc::Node::Stmt::Assign_T lang::calc::Node::Stmt::_T::as_Assign() {
AT(this->is_Assign());
return this->rc_from_this_poly<lang::calc::Node::Stmt::Assign::_T>();
}
lang::calc::Node::Stmt::Expr_T lang::calc::Node::Stmt::_T::as_Expr() {
AT(this->is_Expr());
return this->rc_from_this_poly<lang::calc::Node::Stmt::Expr::_T>();
}
void lang::calc::Node::Stmt::_T::hash_ser_acc_lang_calc_Node_Stmt(SerBuf& buf) const {
this->hash_ser_acc_lang_calc_Node(buf);
hash_ser(buf, static_cast<Int>(w_));
hash_ser(buf, is_top_);
hash_ser(buf, sym_);
hash_ser(buf, attr_);
hash_ser(buf, first_k_);
}
void pr_debug(ostream& os, FmtFlags flags, lang::calc::Node::Expr_T x) {
switch (x->w_) {
case lang::calc::Node::Expr::_W::Id: {
pr_debug(os, flags, x->as_Id());
break;
}
case lang::calc::Node::Expr::_W::UnaryPre: {
pr_debug(os, flags, x->as_UnaryPre());
break;
}
case lang::calc::Node::Expr::_W::BinOp1: {
pr_debug(os, flags, x->as_BinOp1());
break;
}
case lang::calc::Node::Expr::_W::BinOp2: {
pr_debug(os, flags, x->as_BinOp2());
break;
}
case lang::calc::Node::Expr::_W::BinOp3: {
pr_debug(os, flags, x->as_BinOp3());
break;
}
case lang::calc::Node::Expr::_W::Paren: {
pr_debug(os, flags, x->as_Paren());
break;
}
case lang::calc::Node::Expr::_W::Lit: {
pr_debug(os, flags, x->as_Lit());
break;
}
default: {
AX();
}
}
}
lang::calc::Node::Expr::_T::~_T() {
}
lang::calc::Node::Expr::_T::_T(lang::calc::Node::Expr::_W w) : lang::calc::Node::_T(lang::calc::Node::_W::Expr) {
w_ = w;
}
bool lang::calc::Node::Expr::_T::is_Id() {
return w_ == lang::calc::Node::Expr::_W::Id;
}
bool lang::calc::Node::Expr::_T::is_UnaryPre() {
return w_ == lang::calc::Node::Expr::_W::UnaryPre;
}
bool lang::calc::Node::Expr::_T::is_BinOp1() {
return w_ == lang::calc::Node::Expr::_W::BinOp1;
}
bool lang::calc::Node::Expr::_T::is_BinOp2() {
return w_ == lang::calc::Node::Expr::_W::BinOp2;
}
bool lang::calc::Node::Expr::_T::is_BinOp3() {
return w_ == lang::calc::Node::Expr::_W::BinOp3;
}
bool lang::calc::Node::Expr::_T::is_Paren() {
return w_ == lang::calc::Node::Expr::_W::Paren;
}
bool lang::calc::Node::Expr::_T::is_Lit() {
return w_ == lang::calc::Node::Expr::_W::Lit;
}
lang::calc::Node::Expr::Id_T lang::calc::Node::Expr::_T::as_Id() {
AT(this->is_Id());
return this->rc_from_this_poly<lang::calc::Node::Expr::Id::_T>();
}
lang::calc::Node::Expr::UnaryPre_T lang::calc::Node::Expr::_T::as_UnaryPre() {
AT(this->is_UnaryPre());
return this->rc_from_this_poly<lang::calc::Node::Expr::UnaryPre::_T>();
}
lang::calc::Node::Expr::BinOp1_T lang::calc::Node::Expr::_T::as_BinOp1() {
AT(this->is_BinOp1());
return this->rc_from_this_poly<lang::calc::Node::Expr::BinOp1::_T>();
}
lang::calc::Node::Expr::BinOp2_T lang::calc::Node::Expr::_T::as_BinOp2() {
AT(this->is_BinOp2());
return this->rc_from_this_poly<lang::calc::Node::Expr::BinOp2::_T>();
}
lang::calc::Node::Expr::BinOp3_T lang::calc::Node::Expr::_T::as_BinOp3() {
AT(this->is_BinOp3());
return this->rc_from_this_poly<lang::calc::Node::Expr::BinOp3::_T>();
}
lang::calc::Node::Expr::Paren_T lang::calc::Node::Expr::_T::as_Paren() {
AT(this->is_Paren());
return this->rc_from_this_poly<lang::calc::Node::Expr::Paren::_T>();
}
lang::calc::Node::Expr::Lit_T lang::calc::Node::Expr::_T::as_Lit() {
AT(this->is_Lit());
return this->rc_from_this_poly<lang::calc::Node::Expr::Lit::_T>();
}
void lang::calc::Node::Expr::_T::hash_ser_acc_lang_calc_Node_Expr(SerBuf& buf) const {
this->hash_ser_acc_lang_calc_Node(buf);
hash_ser(buf, static_cast<Int>(w_));
hash_ser(buf, is_top_);
hash_ser(buf, sym_);
hash_ser(buf, attr_);
hash_ser(buf, first_k_);
}
void pr_debug(ostream& os, FmtFlags flags, lang::calc::Node::Stmt::Assign_T x) {
os << "lang::calc::Node::Stmt::Assign {";
flags.sub_lo().advance_lines(1, os);
os << "id: ";
pr_debug(os, flags.sub_lo(), x->id_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "bounds: ";
pr_debug(os, flags.sub_lo(), x->bounds_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "is_top: ";
pr_debug(os, flags.sub_lo(), x->is_top_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "sym: ";
pr_debug(os, flags.sub_lo(), x->sym_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "attr: ";
pr_debug(os, flags.sub_lo(), x->attr_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "first_k: ";
pr_debug(os, flags.sub_lo(), x->first_k_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "x: ";
pr_debug(os, flags.sub_lo(), x->x_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "y: ";
pr_debug(os, flags.sub_lo(), x->y_);
os << ",";
flags.advance_lines(1, os);
os << "}";
}
lang::calc::Node::Stmt::Assign::_T::_T() : lang::calc::Node::Stmt::_T(lang::calc::Node::Stmt::_W::Assign) {
}
__attribute__((always_inline)) lang::calc::Node::Stmt::Assign_T lang::calc::Node::Stmt::Assign::make(Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k, lang::calc::Node::Expr_T x, lang::calc::Node::Expr_T y) {
auto ret = make_rc<lang::calc::Node::Stmt::Assign::_T>();
ret->id_ = id;
ret->bounds_ = bounds;
ret->is_top_ = is_top;
ret->sym_ = sym;
ret->attr_ = attr;
ret->first_k_ = first_k;
ret->x_ = x;
ret->y_ = y;
return ret;
}
__attribute__((always_inline)) lang::calc::Node::Stmt::Assign_T lang::calc::Node::Stmt::Assign::make_ext(ArenaPtr arena, Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k, lang::calc::Node::Expr_T x, lang::calc::Node::Expr_T y) {
auto ret1 = make_rc_ext<lang::calc::Node::Stmt::Assign::_T>(arena);
ret1->id_ = id;
ret1->bounds_ = bounds;
ret1->is_top_ = is_top;
ret1->sym_ = sym;
ret1->attr_ = attr;
ret1->first_k_ = first_k;
ret1->x_ = x;
ret1->y_ = y;
return ret1;
}
lang::calc::Node::Stmt::Assign_T lang::calc::Node::Stmt::Assign::_T::with_id(Int id) {
auto ret = make_rc<lang::calc::Node::Stmt::Assign::_T>();
ret->id_ = id;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Stmt::Assign_T lang::calc::Node::Stmt::Assign::_T::with_bounds(lang_rt::TokenBounds bounds) {
auto ret = make_rc<lang::calc::Node::Stmt::Assign::_T>();
ret->id_ = this->id_;
ret->bounds_ = bounds;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Stmt::Assign_T lang::calc::Node::Stmt::Assign::_T::with_is_top(bool is_top) {
auto ret = make_rc<lang::calc::Node::Stmt::Assign::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = is_top;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Stmt::Assign_T lang::calc::Node::Stmt::Assign::_T::with_sym(lang_rt::ParserSymId sym) {
auto ret = make_rc<lang::calc::Node::Stmt::Assign::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = sym;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Stmt::Assign_T lang::calc::Node::Stmt::Assign::_T::with_attr(lang_rt::ParserAttrMask attr) {
auto ret = make_rc<lang::calc::Node::Stmt::Assign::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = attr;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Stmt::Assign_T lang::calc::Node::Stmt::Assign::_T::with_first_k(lang_rt::ParserLookahead first_k) {
auto ret = make_rc<lang::calc::Node::Stmt::Assign::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = first_k;
ret->x_ = this->x_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Stmt::Assign_T lang::calc::Node::Stmt::Assign::_T::with_x(lang::calc::Node::Expr_T x) {
auto ret = make_rc<lang::calc::Node::Stmt::Assign::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = x;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Stmt::Assign_T lang::calc::Node::Stmt::Assign::_T::with_y(lang::calc::Node::Expr_T y) {
auto ret = make_rc<lang::calc::Node::Stmt::Assign::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->y_ = y;
return ret;
}
void lang::calc::Node::Stmt::Assign::_T::hash_ser_acc_lang_calc_Node_Stmt_Assign(SerBuf& buf) const {
this->hash_ser_acc_lang_calc_Node_Stmt(buf);
hash_ser(buf, is_top_);
hash_ser(buf, sym_);
hash_ser(buf, attr_);
hash_ser(buf, first_k_);
hash_ser(buf, x_);
hash_ser(buf, y_);
}
void lang::calc::Node::Stmt::Assign::_T::hash_ser_acc(SerBuf& buf) const {
this->lang::calc::Node::Stmt::Assign::_T::hash_ser_acc_lang_calc_Node_Stmt_Assign(buf);
}
void pr_debug(ostream& os, FmtFlags flags, lang::calc::Node::Stmt::Expr_T x) {
os << "lang::calc::Node::Stmt::Expr {";
flags.sub_lo().advance_lines(1, os);
os << "id: ";
pr_debug(os, flags.sub_lo(), x->id_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "bounds: ";
pr_debug(os, flags.sub_lo(), x->bounds_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "is_top: ";
pr_debug(os, flags.sub_lo(), x->is_top_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "sym: ";
pr_debug(os, flags.sub_lo(), x->sym_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "attr: ";
pr_debug(os, flags.sub_lo(), x->attr_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "first_k: ";
pr_debug(os, flags.sub_lo(), x->first_k_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "x: ";
pr_debug(os, flags.sub_lo(), x->x_);
os << ",";
flags.advance_lines(1, os);
os << "}";
}
lang::calc::Node::Stmt::Expr::_T::_T() : lang::calc::Node::Stmt::_T(lang::calc::Node::Stmt::_W::Expr) {
}
__attribute__((always_inline)) lang::calc::Node::Stmt::Expr_T lang::calc::Node::Stmt::Expr::make(Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k, lang::calc::Node::Expr_T x) {
auto ret = make_rc<lang::calc::Node::Stmt::Expr::_T>();
ret->id_ = id;
ret->bounds_ = bounds;
ret->is_top_ = is_top;
ret->sym_ = sym;
ret->attr_ = attr;
ret->first_k_ = first_k;
ret->x_ = x;
return ret;
}
__attribute__((always_inline)) lang::calc::Node::Stmt::Expr_T lang::calc::Node::Stmt::Expr::make_ext(ArenaPtr arena, Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k, lang::calc::Node::Expr_T x) {
auto ret1 = make_rc_ext<lang::calc::Node::Stmt::Expr::_T>(arena);
ret1->id_ = id;
ret1->bounds_ = bounds;
ret1->is_top_ = is_top;
ret1->sym_ = sym;
ret1->attr_ = attr;
ret1->first_k_ = first_k;
ret1->x_ = x;
return ret1;
}
lang::calc::Node::Stmt::Expr_T lang::calc::Node::Stmt::Expr::_T::with_id(Int id) {
auto ret = make_rc<lang::calc::Node::Stmt::Expr::_T>();
ret->id_ = id;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
return ret;
}
lang::calc::Node::Stmt::Expr_T lang::calc::Node::Stmt::Expr::_T::with_bounds(lang_rt::TokenBounds bounds) {
auto ret = make_rc<lang::calc::Node::Stmt::Expr::_T>();
ret->id_ = this->id_;
ret->bounds_ = bounds;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
return ret;
}
lang::calc::Node::Stmt::Expr_T lang::calc::Node::Stmt::Expr::_T::with_is_top(bool is_top) {
auto ret = make_rc<lang::calc::Node::Stmt::Expr::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = is_top;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
return ret;
}
lang::calc::Node::Stmt::Expr_T lang::calc::Node::Stmt::Expr::_T::with_sym(lang_rt::ParserSymId sym) {
auto ret = make_rc<lang::calc::Node::Stmt::Expr::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = sym;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
return ret;
}
lang::calc::Node::Stmt::Expr_T lang::calc::Node::Stmt::Expr::_T::with_attr(lang_rt::ParserAttrMask attr) {
auto ret = make_rc<lang::calc::Node::Stmt::Expr::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = attr;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
return ret;
}
lang::calc::Node::Stmt::Expr_T lang::calc::Node::Stmt::Expr::_T::with_first_k(lang_rt::ParserLookahead first_k) {
auto ret = make_rc<lang::calc::Node::Stmt::Expr::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = first_k;
ret->x_ = this->x_;
return ret;
}
lang::calc::Node::Stmt::Expr_T lang::calc::Node::Stmt::Expr::_T::with_x(lang::calc::Node::Expr_T x) {
auto ret = make_rc<lang::calc::Node::Stmt::Expr::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = x;
return ret;
}
void lang::calc::Node::Stmt::Expr::_T::hash_ser_acc_lang_calc_Node_Stmt_Expr(SerBuf& buf) const {
this->hash_ser_acc_lang_calc_Node_Stmt(buf);
hash_ser(buf, is_top_);
hash_ser(buf, sym_);
hash_ser(buf, attr_);
hash_ser(buf, first_k_);
hash_ser(buf, x_);
}
void lang::calc::Node::Stmt::Expr::_T::hash_ser_acc(SerBuf& buf) const {
this->lang::calc::Node::Stmt::Expr::_T::hash_ser_acc_lang_calc_Node_Stmt_Expr(buf);
}
void pr_debug(ostream& os, FmtFlags flags, lang::calc::Node::Expr::Id_T x) {
os << "lang::calc::Node::Expr::Id {";
flags.sub_lo().advance_lines(1, os);
os << "id: ";
pr_debug(os, flags.sub_lo(), x->id_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "bounds: ";
pr_debug(os, flags.sub_lo(), x->bounds_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "is_top: ";
pr_debug(os, flags.sub_lo(), x->is_top_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "sym: ";
pr_debug(os, flags.sub_lo(), x->sym_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "attr: ";
pr_debug(os, flags.sub_lo(), x->attr_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "first_k: ";
pr_debug(os, flags.sub_lo(), x->first_k_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "name: ";
pr_debug(os, flags.sub_lo(), x->name_);
os << ",";
flags.advance_lines(1, os);
os << "}";
}
lang::calc::Node::Expr::Id::_T::_T() : lang::calc::Node::Expr::_T(lang::calc::Node::Expr::_W::Id) {
}
__attribute__((always_inline)) lang::calc::Node::Expr::Id_T lang::calc::Node::Expr::Id::make(Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k, StrSlice name) {
auto ret = make_rc<lang::calc::Node::Expr::Id::_T>();
ret->id_ = id;
ret->bounds_ = bounds;
ret->is_top_ = is_top;
ret->sym_ = sym;
ret->attr_ = attr;
ret->first_k_ = first_k;
ret->name_ = name;
return ret;
}
__attribute__((always_inline)) lang::calc::Node::Expr::Id_T lang::calc::Node::Expr::Id::make_ext(ArenaPtr arena, Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k, StrSlice name) {
auto ret1 = make_rc_ext<lang::calc::Node::Expr::Id::_T>(arena);
ret1->id_ = id;
ret1->bounds_ = bounds;
ret1->is_top_ = is_top;
ret1->sym_ = sym;
ret1->attr_ = attr;
ret1->first_k_ = first_k;
ret1->name_ = name;
return ret1;
}
lang::calc::Node::Expr::Id_T lang::calc::Node::Expr::Id::_T::with_id(Int id) {
auto ret = make_rc<lang::calc::Node::Expr::Id::_T>();
ret->id_ = id;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->name_ = this->name_;
return ret;
}
lang::calc::Node::Expr::Id_T lang::calc::Node::Expr::Id::_T::with_bounds(lang_rt::TokenBounds bounds) {
auto ret = make_rc<lang::calc::Node::Expr::Id::_T>();
ret->id_ = this->id_;
ret->bounds_ = bounds;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->name_ = this->name_;
return ret;
}
lang::calc::Node::Expr::Id_T lang::calc::Node::Expr::Id::_T::with_is_top(bool is_top) {
auto ret = make_rc<lang::calc::Node::Expr::Id::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = is_top;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->name_ = this->name_;
return ret;
}
lang::calc::Node::Expr::Id_T lang::calc::Node::Expr::Id::_T::with_sym(lang_rt::ParserSymId sym) {
auto ret = make_rc<lang::calc::Node::Expr::Id::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = sym;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->name_ = this->name_;
return ret;
}
lang::calc::Node::Expr::Id_T lang::calc::Node::Expr::Id::_T::with_attr(lang_rt::ParserAttrMask attr) {
auto ret = make_rc<lang::calc::Node::Expr::Id::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = attr;
ret->first_k_ = this->first_k_;
ret->name_ = this->name_;
return ret;
}
lang::calc::Node::Expr::Id_T lang::calc::Node::Expr::Id::_T::with_first_k(lang_rt::ParserLookahead first_k) {
auto ret = make_rc<lang::calc::Node::Expr::Id::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = first_k;
ret->name_ = this->name_;
return ret;
}
lang::calc::Node::Expr::Id_T lang::calc::Node::Expr::Id::_T::with_name(StrSlice name) {
auto ret = make_rc<lang::calc::Node::Expr::Id::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->name_ = name;
return ret;
}
void lang::calc::Node::Expr::Id::_T::hash_ser_acc_lang_calc_Node_Expr_Id(SerBuf& buf) const {
this->hash_ser_acc_lang_calc_Node_Expr(buf);
hash_ser(buf, is_top_);
hash_ser(buf, sym_);
hash_ser(buf, attr_);
hash_ser(buf, first_k_);
hash_ser(buf, name_);
}
void lang::calc::Node::Expr::Id::_T::hash_ser_acc(SerBuf& buf) const {
this->lang::calc::Node::Expr::Id::_T::hash_ser_acc_lang_calc_Node_Expr_Id(buf);
}
void pr_debug(ostream& os, FmtFlags flags, lang::calc::Node::Expr::UnaryPre_T x) {
os << "lang::calc::Node::Expr::UnaryPre {";
flags.sub_lo().advance_lines(1, os);
os << "id: ";
pr_debug(os, flags.sub_lo(), x->id_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "bounds: ";
pr_debug(os, flags.sub_lo(), x->bounds_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "is_top: ";
pr_debug(os, flags.sub_lo(), x->is_top_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "sym: ";
pr_debug(os, flags.sub_lo(), x->sym_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "attr: ";
pr_debug(os, flags.sub_lo(), x->attr_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "first_k: ";
pr_debug(os, flags.sub_lo(), x->first_k_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "op: ";
pr_debug(os, flags.sub_lo(), x->op_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "x: ";
pr_debug(os, flags.sub_lo(), x->x_);
os << ",";
flags.advance_lines(1, os);
os << "}";
}
lang::calc::Node::Expr::UnaryPre::_T::_T() : lang::calc::Node::Expr::_T(lang::calc::Node::Expr::_W::UnaryPre) {
}
__attribute__((always_inline)) lang::calc::Node::Expr::UnaryPre_T lang::calc::Node::Expr::UnaryPre::make(Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k, lang::calc::Node::Expr::UnaryPre::op_T op, lang::calc::Node::Expr_T x) {
auto ret = make_rc<lang::calc::Node::Expr::UnaryPre::_T>();
ret->id_ = id;
ret->bounds_ = bounds;
ret->is_top_ = is_top;
ret->sym_ = sym;
ret->attr_ = attr;
ret->first_k_ = first_k;
ret->op_ = op;
ret->x_ = x;
return ret;
}
__attribute__((always_inline)) lang::calc::Node::Expr::UnaryPre_T lang::calc::Node::Expr::UnaryPre::make_ext(ArenaPtr arena, Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k, lang::calc::Node::Expr::UnaryPre::op_T op, lang::calc::Node::Expr_T x) {
auto ret1 = make_rc_ext<lang::calc::Node::Expr::UnaryPre::_T>(arena);
ret1->id_ = id;
ret1->bounds_ = bounds;
ret1->is_top_ = is_top;
ret1->sym_ = sym;
ret1->attr_ = attr;
ret1->first_k_ = first_k;
ret1->op_ = op;
ret1->x_ = x;
return ret1;
}
lang::calc::Node::Expr::UnaryPre_T lang::calc::Node::Expr::UnaryPre::_T::with_id(Int id) {
auto ret = make_rc<lang::calc::Node::Expr::UnaryPre::_T>();
ret->id_ = id;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->op_ = this->op_;
ret->x_ = this->x_;
return ret;
}
lang::calc::Node::Expr::UnaryPre_T lang::calc::Node::Expr::UnaryPre::_T::with_bounds(lang_rt::TokenBounds bounds) {
auto ret = make_rc<lang::calc::Node::Expr::UnaryPre::_T>();
ret->id_ = this->id_;
ret->bounds_ = bounds;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->op_ = this->op_;
ret->x_ = this->x_;
return ret;
}
lang::calc::Node::Expr::UnaryPre_T lang::calc::Node::Expr::UnaryPre::_T::with_is_top(bool is_top) {
auto ret = make_rc<lang::calc::Node::Expr::UnaryPre::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = is_top;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->op_ = this->op_;
ret->x_ = this->x_;
return ret;
}
lang::calc::Node::Expr::UnaryPre_T lang::calc::Node::Expr::UnaryPre::_T::with_sym(lang_rt::ParserSymId sym) {
auto ret = make_rc<lang::calc::Node::Expr::UnaryPre::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = sym;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->op_ = this->op_;
ret->x_ = this->x_;
return ret;
}
lang::calc::Node::Expr::UnaryPre_T lang::calc::Node::Expr::UnaryPre::_T::with_attr(lang_rt::ParserAttrMask attr) {
auto ret = make_rc<lang::calc::Node::Expr::UnaryPre::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = attr;
ret->first_k_ = this->first_k_;
ret->op_ = this->op_;
ret->x_ = this->x_;
return ret;
}
lang::calc::Node::Expr::UnaryPre_T lang::calc::Node::Expr::UnaryPre::_T::with_first_k(lang_rt::ParserLookahead first_k) {
auto ret = make_rc<lang::calc::Node::Expr::UnaryPre::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = first_k;
ret->op_ = this->op_;
ret->x_ = this->x_;
return ret;
}
lang::calc::Node::Expr::UnaryPre_T lang::calc::Node::Expr::UnaryPre::_T::with_op(lang::calc::Node::Expr::UnaryPre::op_T op) {
auto ret = make_rc<lang::calc::Node::Expr::UnaryPre::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->op_ = op;
ret->x_ = this->x_;
return ret;
}
lang::calc::Node::Expr::UnaryPre_T lang::calc::Node::Expr::UnaryPre::_T::with_x(lang::calc::Node::Expr_T x) {
auto ret = make_rc<lang::calc::Node::Expr::UnaryPre::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->op_ = this->op_;
ret->x_ = x;
return ret;
}
void lang::calc::Node::Expr::UnaryPre::_T::hash_ser_acc_lang_calc_Node_Expr_UnaryPre(SerBuf& buf) const {
this->hash_ser_acc_lang_calc_Node_Expr(buf);
hash_ser(buf, is_top_);
hash_ser(buf, sym_);
hash_ser(buf, attr_);
hash_ser(buf, first_k_);
hash_ser(buf, op_);
hash_ser(buf, x_);
}
void lang::calc::Node::Expr::UnaryPre::_T::hash_ser_acc(SerBuf& buf) const {
this->lang::calc::Node::Expr::UnaryPre::_T::hash_ser_acc_lang_calc_Node_Expr_UnaryPre(buf);
}
void pr_debug(ostream& os, FmtFlags flags, lang::calc::Node::Expr::BinOp1_T x) {
os << "lang::calc::Node::Expr::BinOp1 {";
flags.sub_lo().advance_lines(1, os);
os << "id: ";
pr_debug(os, flags.sub_lo(), x->id_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "bounds: ";
pr_debug(os, flags.sub_lo(), x->bounds_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "is_top: ";
pr_debug(os, flags.sub_lo(), x->is_top_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "sym: ";
pr_debug(os, flags.sub_lo(), x->sym_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "attr: ";
pr_debug(os, flags.sub_lo(), x->attr_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "first_k: ";
pr_debug(os, flags.sub_lo(), x->first_k_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "x: ";
pr_debug(os, flags.sub_lo(), x->x_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "op: ";
pr_debug(os, flags.sub_lo(), x->op_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "y: ";
pr_debug(os, flags.sub_lo(), x->y_);
os << ",";
flags.advance_lines(1, os);
os << "}";
}
lang::calc::Node::Expr::BinOp1::_T::_T() : lang::calc::Node::Expr::_T(lang::calc::Node::Expr::_W::BinOp1) {
}
__attribute__((always_inline)) lang::calc::Node::Expr::BinOp1_T lang::calc::Node::Expr::BinOp1::make(Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k, lang::calc::Node::Expr_T x, lang::calc::Node::Expr::BinOp1::op_T op, lang::calc::Node::Expr_T y) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp1::_T>();
ret->id_ = id;
ret->bounds_ = bounds;
ret->is_top_ = is_top;
ret->sym_ = sym;
ret->attr_ = attr;
ret->first_k_ = first_k;
ret->x_ = x;
ret->op_ = op;
ret->y_ = y;
return ret;
}
__attribute__((always_inline)) lang::calc::Node::Expr::BinOp1_T lang::calc::Node::Expr::BinOp1::make_ext(ArenaPtr arena, Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k, lang::calc::Node::Expr_T x, lang::calc::Node::Expr::BinOp1::op_T op, lang::calc::Node::Expr_T y) {
auto ret1 = make_rc_ext<lang::calc::Node::Expr::BinOp1::_T>(arena);
ret1->id_ = id;
ret1->bounds_ = bounds;
ret1->is_top_ = is_top;
ret1->sym_ = sym;
ret1->attr_ = attr;
ret1->first_k_ = first_k;
ret1->x_ = x;
ret1->op_ = op;
ret1->y_ = y;
return ret1;
}
lang::calc::Node::Expr::BinOp1_T lang::calc::Node::Expr::BinOp1::_T::with_id(Int id) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp1::_T>();
ret->id_ = id;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->op_ = this->op_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Expr::BinOp1_T lang::calc::Node::Expr::BinOp1::_T::with_bounds(lang_rt::TokenBounds bounds) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp1::_T>();
ret->id_ = this->id_;
ret->bounds_ = bounds;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->op_ = this->op_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Expr::BinOp1_T lang::calc::Node::Expr::BinOp1::_T::with_is_top(bool is_top) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp1::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = is_top;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->op_ = this->op_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Expr::BinOp1_T lang::calc::Node::Expr::BinOp1::_T::with_sym(lang_rt::ParserSymId sym) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp1::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = sym;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->op_ = this->op_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Expr::BinOp1_T lang::calc::Node::Expr::BinOp1::_T::with_attr(lang_rt::ParserAttrMask attr) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp1::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = attr;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->op_ = this->op_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Expr::BinOp1_T lang::calc::Node::Expr::BinOp1::_T::with_first_k(lang_rt::ParserLookahead first_k) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp1::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = first_k;
ret->x_ = this->x_;
ret->op_ = this->op_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Expr::BinOp1_T lang::calc::Node::Expr::BinOp1::_T::with_x(lang::calc::Node::Expr_T x) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp1::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = x;
ret->op_ = this->op_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Expr::BinOp1_T lang::calc::Node::Expr::BinOp1::_T::with_op(lang::calc::Node::Expr::BinOp1::op_T op) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp1::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->op_ = op;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Expr::BinOp1_T lang::calc::Node::Expr::BinOp1::_T::with_y(lang::calc::Node::Expr_T y) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp1::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->op_ = this->op_;
ret->y_ = y;
return ret;
}
void lang::calc::Node::Expr::BinOp1::_T::hash_ser_acc_lang_calc_Node_Expr_BinOp1(SerBuf& buf) const {
this->hash_ser_acc_lang_calc_Node_Expr(buf);
hash_ser(buf, is_top_);
hash_ser(buf, sym_);
hash_ser(buf, attr_);
hash_ser(buf, first_k_);
hash_ser(buf, x_);
hash_ser(buf, op_);
hash_ser(buf, y_);
}
void lang::calc::Node::Expr::BinOp1::_T::hash_ser_acc(SerBuf& buf) const {
this->lang::calc::Node::Expr::BinOp1::_T::hash_ser_acc_lang_calc_Node_Expr_BinOp1(buf);
}
void pr_debug(ostream& os, FmtFlags flags, lang::calc::Node::Expr::BinOp2_T x) {
os << "lang::calc::Node::Expr::BinOp2 {";
flags.sub_lo().advance_lines(1, os);
os << "id: ";
pr_debug(os, flags.sub_lo(), x->id_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "bounds: ";
pr_debug(os, flags.sub_lo(), x->bounds_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "is_top: ";
pr_debug(os, flags.sub_lo(), x->is_top_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "sym: ";
pr_debug(os, flags.sub_lo(), x->sym_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "attr: ";
pr_debug(os, flags.sub_lo(), x->attr_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "first_k: ";
pr_debug(os, flags.sub_lo(), x->first_k_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "x: ";
pr_debug(os, flags.sub_lo(), x->x_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "op: ";
pr_debug(os, flags.sub_lo(), x->op_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "y: ";
pr_debug(os, flags.sub_lo(), x->y_);
os << ",";
flags.advance_lines(1, os);
os << "}";
}
lang::calc::Node::Expr::BinOp2::_T::_T() : lang::calc::Node::Expr::_T(lang::calc::Node::Expr::_W::BinOp2) {
}
__attribute__((always_inline)) lang::calc::Node::Expr::BinOp2_T lang::calc::Node::Expr::BinOp2::make(Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k, lang::calc::Node::Expr_T x, lang::calc::Node::Expr::BinOp2::op_T op, lang::calc::Node::Expr_T y) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp2::_T>();
ret->id_ = id;
ret->bounds_ = bounds;
ret->is_top_ = is_top;
ret->sym_ = sym;
ret->attr_ = attr;
ret->first_k_ = first_k;
ret->x_ = x;
ret->op_ = op;
ret->y_ = y;
return ret;
}
__attribute__((always_inline)) lang::calc::Node::Expr::BinOp2_T lang::calc::Node::Expr::BinOp2::make_ext(ArenaPtr arena, Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k, lang::calc::Node::Expr_T x, lang::calc::Node::Expr::BinOp2::op_T op, lang::calc::Node::Expr_T y) {
auto ret1 = make_rc_ext<lang::calc::Node::Expr::BinOp2::_T>(arena);
ret1->id_ = id;
ret1->bounds_ = bounds;
ret1->is_top_ = is_top;
ret1->sym_ = sym;
ret1->attr_ = attr;
ret1->first_k_ = first_k;
ret1->x_ = x;
ret1->op_ = op;
ret1->y_ = y;
return ret1;
}
lang::calc::Node::Expr::BinOp2_T lang::calc::Node::Expr::BinOp2::_T::with_id(Int id) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp2::_T>();
ret->id_ = id;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->op_ = this->op_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Expr::BinOp2_T lang::calc::Node::Expr::BinOp2::_T::with_bounds(lang_rt::TokenBounds bounds) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp2::_T>();
ret->id_ = this->id_;
ret->bounds_ = bounds;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->op_ = this->op_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Expr::BinOp2_T lang::calc::Node::Expr::BinOp2::_T::with_is_top(bool is_top) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp2::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = is_top;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->op_ = this->op_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Expr::BinOp2_T lang::calc::Node::Expr::BinOp2::_T::with_sym(lang_rt::ParserSymId sym) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp2::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = sym;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->op_ = this->op_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Expr::BinOp2_T lang::calc::Node::Expr::BinOp2::_T::with_attr(lang_rt::ParserAttrMask attr) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp2::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = attr;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->op_ = this->op_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Expr::BinOp2_T lang::calc::Node::Expr::BinOp2::_T::with_first_k(lang_rt::ParserLookahead first_k) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp2::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = first_k;
ret->x_ = this->x_;
ret->op_ = this->op_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Expr::BinOp2_T lang::calc::Node::Expr::BinOp2::_T::with_x(lang::calc::Node::Expr_T x) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp2::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = x;
ret->op_ = this->op_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Expr::BinOp2_T lang::calc::Node::Expr::BinOp2::_T::with_op(lang::calc::Node::Expr::BinOp2::op_T op) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp2::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->op_ = op;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Expr::BinOp2_T lang::calc::Node::Expr::BinOp2::_T::with_y(lang::calc::Node::Expr_T y) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp2::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->op_ = this->op_;
ret->y_ = y;
return ret;
}
void lang::calc::Node::Expr::BinOp2::_T::hash_ser_acc_lang_calc_Node_Expr_BinOp2(SerBuf& buf) const {
this->hash_ser_acc_lang_calc_Node_Expr(buf);
hash_ser(buf, is_top_);
hash_ser(buf, sym_);
hash_ser(buf, attr_);
hash_ser(buf, first_k_);
hash_ser(buf, x_);
hash_ser(buf, op_);
hash_ser(buf, y_);
}
void lang::calc::Node::Expr::BinOp2::_T::hash_ser_acc(SerBuf& buf) const {
this->lang::calc::Node::Expr::BinOp2::_T::hash_ser_acc_lang_calc_Node_Expr_BinOp2(buf);
}
void pr_debug(ostream& os, FmtFlags flags, lang::calc::Node::Expr::BinOp3_T x) {
os << "lang::calc::Node::Expr::BinOp3 {";
flags.sub_lo().advance_lines(1, os);
os << "id: ";
pr_debug(os, flags.sub_lo(), x->id_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "bounds: ";
pr_debug(os, flags.sub_lo(), x->bounds_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "is_top: ";
pr_debug(os, flags.sub_lo(), x->is_top_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "sym: ";
pr_debug(os, flags.sub_lo(), x->sym_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "attr: ";
pr_debug(os, flags.sub_lo(), x->attr_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "first_k: ";
pr_debug(os, flags.sub_lo(), x->first_k_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "x: ";
pr_debug(os, flags.sub_lo(), x->x_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "op: ";
pr_debug(os, flags.sub_lo(), x->op_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "y: ";
pr_debug(os, flags.sub_lo(), x->y_);
os << ",";
flags.advance_lines(1, os);
os << "}";
}
lang::calc::Node::Expr::BinOp3::_T::_T() : lang::calc::Node::Expr::_T(lang::calc::Node::Expr::_W::BinOp3) {
}
__attribute__((always_inline)) lang::calc::Node::Expr::BinOp3_T lang::calc::Node::Expr::BinOp3::make(Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k, lang::calc::Node::Expr_T x, lang::calc::Node::Expr::BinOp3::op_T op, lang::calc::Node::Expr_T y) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp3::_T>();
ret->id_ = id;
ret->bounds_ = bounds;
ret->is_top_ = is_top;
ret->sym_ = sym;
ret->attr_ = attr;
ret->first_k_ = first_k;
ret->x_ = x;
ret->op_ = op;
ret->y_ = y;
return ret;
}
__attribute__((always_inline)) lang::calc::Node::Expr::BinOp3_T lang::calc::Node::Expr::BinOp3::make_ext(ArenaPtr arena, Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k, lang::calc::Node::Expr_T x, lang::calc::Node::Expr::BinOp3::op_T op, lang::calc::Node::Expr_T y) {
auto ret1 = make_rc_ext<lang::calc::Node::Expr::BinOp3::_T>(arena);
ret1->id_ = id;
ret1->bounds_ = bounds;
ret1->is_top_ = is_top;
ret1->sym_ = sym;
ret1->attr_ = attr;
ret1->first_k_ = first_k;
ret1->x_ = x;
ret1->op_ = op;
ret1->y_ = y;
return ret1;
}
lang::calc::Node::Expr::BinOp3_T lang::calc::Node::Expr::BinOp3::_T::with_id(Int id) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp3::_T>();
ret->id_ = id;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->op_ = this->op_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Expr::BinOp3_T lang::calc::Node::Expr::BinOp3::_T::with_bounds(lang_rt::TokenBounds bounds) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp3::_T>();
ret->id_ = this->id_;
ret->bounds_ = bounds;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->op_ = this->op_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Expr::BinOp3_T lang::calc::Node::Expr::BinOp3::_T::with_is_top(bool is_top) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp3::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = is_top;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->op_ = this->op_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Expr::BinOp3_T lang::calc::Node::Expr::BinOp3::_T::with_sym(lang_rt::ParserSymId sym) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp3::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = sym;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->op_ = this->op_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Expr::BinOp3_T lang::calc::Node::Expr::BinOp3::_T::with_attr(lang_rt::ParserAttrMask attr) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp3::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = attr;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->op_ = this->op_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Expr::BinOp3_T lang::calc::Node::Expr::BinOp3::_T::with_first_k(lang_rt::ParserLookahead first_k) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp3::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = first_k;
ret->x_ = this->x_;
ret->op_ = this->op_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Expr::BinOp3_T lang::calc::Node::Expr::BinOp3::_T::with_x(lang::calc::Node::Expr_T x) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp3::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = x;
ret->op_ = this->op_;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Expr::BinOp3_T lang::calc::Node::Expr::BinOp3::_T::with_op(lang::calc::Node::Expr::BinOp3::op_T op) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp3::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->op_ = op;
ret->y_ = this->y_;
return ret;
}
lang::calc::Node::Expr::BinOp3_T lang::calc::Node::Expr::BinOp3::_T::with_y(lang::calc::Node::Expr_T y) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp3::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
ret->op_ = this->op_;
ret->y_ = y;
return ret;
}
void lang::calc::Node::Expr::BinOp3::_T::hash_ser_acc_lang_calc_Node_Expr_BinOp3(SerBuf& buf) const {
this->hash_ser_acc_lang_calc_Node_Expr(buf);
hash_ser(buf, is_top_);
hash_ser(buf, sym_);
hash_ser(buf, attr_);
hash_ser(buf, first_k_);
hash_ser(buf, x_);
hash_ser(buf, op_);
hash_ser(buf, y_);
}
void lang::calc::Node::Expr::BinOp3::_T::hash_ser_acc(SerBuf& buf) const {
this->lang::calc::Node::Expr::BinOp3::_T::hash_ser_acc_lang_calc_Node_Expr_BinOp3(buf);
}
void pr_debug(ostream& os, FmtFlags flags, lang::calc::Node::Expr::Paren_T x) {
os << "lang::calc::Node::Expr::Paren {";
flags.sub_lo().advance_lines(1, os);
os << "id: ";
pr_debug(os, flags.sub_lo(), x->id_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "bounds: ";
pr_debug(os, flags.sub_lo(), x->bounds_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "is_top: ";
pr_debug(os, flags.sub_lo(), x->is_top_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "sym: ";
pr_debug(os, flags.sub_lo(), x->sym_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "attr: ";
pr_debug(os, flags.sub_lo(), x->attr_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "first_k: ";
pr_debug(os, flags.sub_lo(), x->first_k_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "x: ";
pr_debug(os, flags.sub_lo(), x->x_);
os << ",";
flags.advance_lines(1, os);
os << "}";
}
lang::calc::Node::Expr::Paren::_T::_T() : lang::calc::Node::Expr::_T(lang::calc::Node::Expr::_W::Paren) {
}
__attribute__((always_inline)) lang::calc::Node::Expr::Paren_T lang::calc::Node::Expr::Paren::make(Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k, lang::calc::Node::Expr_T x) {
auto ret = make_rc<lang::calc::Node::Expr::Paren::_T>();
ret->id_ = id;
ret->bounds_ = bounds;
ret->is_top_ = is_top;
ret->sym_ = sym;
ret->attr_ = attr;
ret->first_k_ = first_k;
ret->x_ = x;
return ret;
}
__attribute__((always_inline)) lang::calc::Node::Expr::Paren_T lang::calc::Node::Expr::Paren::make_ext(ArenaPtr arena, Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k, lang::calc::Node::Expr_T x) {
auto ret1 = make_rc_ext<lang::calc::Node::Expr::Paren::_T>(arena);
ret1->id_ = id;
ret1->bounds_ = bounds;
ret1->is_top_ = is_top;
ret1->sym_ = sym;
ret1->attr_ = attr;
ret1->first_k_ = first_k;
ret1->x_ = x;
return ret1;
}
lang::calc::Node::Expr::Paren_T lang::calc::Node::Expr::Paren::_T::with_id(Int id) {
auto ret = make_rc<lang::calc::Node::Expr::Paren::_T>();
ret->id_ = id;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
return ret;
}
lang::calc::Node::Expr::Paren_T lang::calc::Node::Expr::Paren::_T::with_bounds(lang_rt::TokenBounds bounds) {
auto ret = make_rc<lang::calc::Node::Expr::Paren::_T>();
ret->id_ = this->id_;
ret->bounds_ = bounds;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
return ret;
}
lang::calc::Node::Expr::Paren_T lang::calc::Node::Expr::Paren::_T::with_is_top(bool is_top) {
auto ret = make_rc<lang::calc::Node::Expr::Paren::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = is_top;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
return ret;
}
lang::calc::Node::Expr::Paren_T lang::calc::Node::Expr::Paren::_T::with_sym(lang_rt::ParserSymId sym) {
auto ret = make_rc<lang::calc::Node::Expr::Paren::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = sym;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
return ret;
}
lang::calc::Node::Expr::Paren_T lang::calc::Node::Expr::Paren::_T::with_attr(lang_rt::ParserAttrMask attr) {
auto ret = make_rc<lang::calc::Node::Expr::Paren::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = attr;
ret->first_k_ = this->first_k_;
ret->x_ = this->x_;
return ret;
}
lang::calc::Node::Expr::Paren_T lang::calc::Node::Expr::Paren::_T::with_first_k(lang_rt::ParserLookahead first_k) {
auto ret = make_rc<lang::calc::Node::Expr::Paren::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = first_k;
ret->x_ = this->x_;
return ret;
}
lang::calc::Node::Expr::Paren_T lang::calc::Node::Expr::Paren::_T::with_x(lang::calc::Node::Expr_T x) {
auto ret = make_rc<lang::calc::Node::Expr::Paren::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->x_ = x;
return ret;
}
void lang::calc::Node::Expr::Paren::_T::hash_ser_acc_lang_calc_Node_Expr_Paren(SerBuf& buf) const {
this->hash_ser_acc_lang_calc_Node_Expr(buf);
hash_ser(buf, is_top_);
hash_ser(buf, sym_);
hash_ser(buf, attr_);
hash_ser(buf, first_k_);
hash_ser(buf, x_);
}
void lang::calc::Node::Expr::Paren::_T::hash_ser_acc(SerBuf& buf) const {
this->lang::calc::Node::Expr::Paren::_T::hash_ser_acc_lang_calc_Node_Expr_Paren(buf);
}
void pr_debug(ostream& os, FmtFlags flags, lang::calc::Node::Expr::Lit_T x) {
switch (x->w_) {
case lang::calc::Node::Expr::Lit::_W::Int_: {
pr_debug(os, flags, x->as_Int_());
break;
}
default: {
AX();
}
}
}
lang::calc::Node::Expr::Lit::_T::~_T() {
}
lang::calc::Node::Expr::Lit::_T::_T(lang::calc::Node::Expr::Lit::_W w) : lang::calc::Node::Expr::_T(lang::calc::Node::Expr::_W::Lit) {
w_ = w;
}
bool lang::calc::Node::Expr::Lit::_T::is_Int_() {
return w_ == lang::calc::Node::Expr::Lit::_W::Int_;
}
lang::calc::Node::Expr::Lit::Int__T lang::calc::Node::Expr::Lit::_T::as_Int_() {
AT(this->is_Int_());
return this->rc_from_this_poly<lang::calc::Node::Expr::Lit::Int_::_T>();
}
void lang::calc::Node::Expr::Lit::_T::hash_ser_acc_lang_calc_Node_Expr_Lit(SerBuf& buf) const {
this->hash_ser_acc_lang_calc_Node_Expr(buf);
hash_ser(buf, static_cast<Int>(w_));
hash_ser(buf, is_top_);
hash_ser(buf, sym_);
hash_ser(buf, attr_);
hash_ser(buf, first_k_);
}
void pr_debug(ostream& os, FmtFlags flags, lang::calc::Node::Expr::Lit::Int__T x) {
os << "lang::calc::Node::Expr::Lit::Int_ {";
flags.sub_lo().advance_lines(1, os);
os << "id: ";
pr_debug(os, flags.sub_lo(), x->id_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "bounds: ";
pr_debug(os, flags.sub_lo(), x->bounds_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "is_top: ";
pr_debug(os, flags.sub_lo(), x->is_top_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "sym: ";
pr_debug(os, flags.sub_lo(), x->sym_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "attr: ";
pr_debug(os, flags.sub_lo(), x->attr_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "first_k: ";
pr_debug(os, flags.sub_lo(), x->first_k_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "val: ";
pr_debug(os, flags.sub_lo(), x->val_);
os << ",";
flags.advance_lines(1, os);
os << "}";
}
lang::calc::Node::Expr::Lit::Int_::_T::_T() : lang::calc::Node::Expr::Lit::_T(lang::calc::Node::Expr::Lit::_W::Int_) {
}
__attribute__((always_inline)) lang::calc::Node::Expr::Lit::Int__T lang::calc::Node::Expr::Lit::Int_::make(Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k, StrSlice val) {
auto ret = make_rc<lang::calc::Node::Expr::Lit::Int_::_T>();
ret->id_ = id;
ret->bounds_ = bounds;
ret->is_top_ = is_top;
ret->sym_ = sym;
ret->attr_ = attr;
ret->first_k_ = first_k;
ret->val_ = val;
return ret;
}
__attribute__((always_inline)) lang::calc::Node::Expr::Lit::Int__T lang::calc::Node::Expr::Lit::Int_::make_ext(ArenaPtr arena, Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k, StrSlice val) {
auto ret1 = make_rc_ext<lang::calc::Node::Expr::Lit::Int_::_T>(arena);
ret1->id_ = id;
ret1->bounds_ = bounds;
ret1->is_top_ = is_top;
ret1->sym_ = sym;
ret1->attr_ = attr;
ret1->first_k_ = first_k;
ret1->val_ = val;
return ret1;
}
lang::calc::Node::Expr::Lit::Int__T lang::calc::Node::Expr::Lit::Int_::_T::with_id(Int id) {
auto ret = make_rc<lang::calc::Node::Expr::Lit::Int_::_T>();
ret->id_ = id;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->val_ = this->val_;
return ret;
}
lang::calc::Node::Expr::Lit::Int__T lang::calc::Node::Expr::Lit::Int_::_T::with_bounds(lang_rt::TokenBounds bounds) {
auto ret = make_rc<lang::calc::Node::Expr::Lit::Int_::_T>();
ret->id_ = this->id_;
ret->bounds_ = bounds;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->val_ = this->val_;
return ret;
}
lang::calc::Node::Expr::Lit::Int__T lang::calc::Node::Expr::Lit::Int_::_T::with_is_top(bool is_top) {
auto ret = make_rc<lang::calc::Node::Expr::Lit::Int_::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = is_top;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->val_ = this->val_;
return ret;
}
lang::calc::Node::Expr::Lit::Int__T lang::calc::Node::Expr::Lit::Int_::_T::with_sym(lang_rt::ParserSymId sym) {
auto ret = make_rc<lang::calc::Node::Expr::Lit::Int_::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = sym;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->val_ = this->val_;
return ret;
}
lang::calc::Node::Expr::Lit::Int__T lang::calc::Node::Expr::Lit::Int_::_T::with_attr(lang_rt::ParserAttrMask attr) {
auto ret = make_rc<lang::calc::Node::Expr::Lit::Int_::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = attr;
ret->first_k_ = this->first_k_;
ret->val_ = this->val_;
return ret;
}
lang::calc::Node::Expr::Lit::Int__T lang::calc::Node::Expr::Lit::Int_::_T::with_first_k(lang_rt::ParserLookahead first_k) {
auto ret = make_rc<lang::calc::Node::Expr::Lit::Int_::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = first_k;
ret->val_ = this->val_;
return ret;
}
lang::calc::Node::Expr::Lit::Int__T lang::calc::Node::Expr::Lit::Int_::_T::with_val(StrSlice val) {
auto ret = make_rc<lang::calc::Node::Expr::Lit::Int_::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
ret->val_ = val;
return ret;
}
void lang::calc::Node::Expr::Lit::Int_::_T::hash_ser_acc_lang_calc_Node_Expr_Lit_Int_(SerBuf& buf) const {
this->hash_ser_acc_lang_calc_Node_Expr_Lit(buf);
hash_ser(buf, is_top_);
hash_ser(buf, sym_);
hash_ser(buf, attr_);
hash_ser(buf, first_k_);
hash_ser(buf, val_);
}
void lang::calc::Node::Expr::Lit::Int_::_T::hash_ser_acc(SerBuf& buf) const {
this->lang::calc::Node::Expr::Lit::Int_::_T::hash_ser_acc_lang_calc_Node_Expr_Lit_Int_(buf);
}
void pr_debug(ostream& os, FmtFlags flags, lang::calc::Node::Expr::UnaryPre::op_T x) {
switch (x->w_) {
case lang::calc::Node::Expr::UnaryPre::op::_W::Neg: {
pr_debug(os, flags, x->as_Neg());
break;
}
default: {
AX();
}
}
}
lang::calc::Node::Expr::UnaryPre::op::_T::~_T() {
}
lang::calc::Node::Expr::UnaryPre::op::_T::_T(lang::calc::Node::Expr::UnaryPre::op::_W w) : lang::calc::Node::_T(lang::calc::Node::_W::Expr__UnaryPre__op) {
w_ = w;
}
bool lang::calc::Node::Expr::UnaryPre::op::_T::is_Neg() {
return w_ == lang::calc::Node::Expr::UnaryPre::op::_W::Neg;
}
lang::calc::Node::Expr::UnaryPre::op::Neg_T lang::calc::Node::Expr::UnaryPre::op::_T::as_Neg() {
AT(this->is_Neg());
return this->rc_from_this_poly<lang::calc::Node::Expr::UnaryPre::op::Neg::_T>();
}
void lang::calc::Node::Expr::UnaryPre::op::_T::hash_ser_acc_lang_calc_Node_Expr_UnaryPre_op(SerBuf& buf) const {
this->hash_ser_acc_lang_calc_Node(buf);
hash_ser(buf, static_cast<Int>(w_));
hash_ser(buf, is_top_);
hash_ser(buf, sym_);
hash_ser(buf, attr_);
hash_ser(buf, first_k_);
}
void pr_debug(ostream& os, FmtFlags flags, lang::calc::Node::Expr::BinOp1::op_T x) {
switch (x->w_) {
case lang::calc::Node::Expr::BinOp1::op::_W::Add: {
pr_debug(os, flags, x->as_Add());
break;
}
case lang::calc::Node::Expr::BinOp1::op::_W::Sub: {
pr_debug(os, flags, x->as_Sub());
break;
}
default: {
AX();
}
}
}
lang::calc::Node::Expr::BinOp1::op::_T::~_T() {
}
lang::calc::Node::Expr::BinOp1::op::_T::_T(lang::calc::Node::Expr::BinOp1::op::_W w) : lang::calc::Node::_T(lang::calc::Node::_W::Expr__BinOp1__op) {
w_ = w;
}
bool lang::calc::Node::Expr::BinOp1::op::_T::is_Add() {
return w_ == lang::calc::Node::Expr::BinOp1::op::_W::Add;
}
bool lang::calc::Node::Expr::BinOp1::op::_T::is_Sub() {
return w_ == lang::calc::Node::Expr::BinOp1::op::_W::Sub;
}
lang::calc::Node::Expr::BinOp1::op::Add_T lang::calc::Node::Expr::BinOp1::op::_T::as_Add() {
AT(this->is_Add());
return this->rc_from_this_poly<lang::calc::Node::Expr::BinOp1::op::Add::_T>();
}
lang::calc::Node::Expr::BinOp1::op::Sub_T lang::calc::Node::Expr::BinOp1::op::_T::as_Sub() {
AT(this->is_Sub());
return this->rc_from_this_poly<lang::calc::Node::Expr::BinOp1::op::Sub::_T>();
}
void lang::calc::Node::Expr::BinOp1::op::_T::hash_ser_acc_lang_calc_Node_Expr_BinOp1_op(SerBuf& buf) const {
this->hash_ser_acc_lang_calc_Node(buf);
hash_ser(buf, static_cast<Int>(w_));
hash_ser(buf, is_top_);
hash_ser(buf, sym_);
hash_ser(buf, attr_);
hash_ser(buf, first_k_);
}
void pr_debug(ostream& os, FmtFlags flags, lang::calc::Node::Expr::BinOp2::op_T x) {
switch (x->w_) {
case lang::calc::Node::Expr::BinOp2::op::_W::Mul: {
pr_debug(os, flags, x->as_Mul());
break;
}
case lang::calc::Node::Expr::BinOp2::op::_W::Div: {
pr_debug(os, flags, x->as_Div());
break;
}
default: {
AX();
}
}
}
lang::calc::Node::Expr::BinOp2::op::_T::~_T() {
}
lang::calc::Node::Expr::BinOp2::op::_T::_T(lang::calc::Node::Expr::BinOp2::op::_W w) : lang::calc::Node::_T(lang::calc::Node::_W::Expr__BinOp2__op) {
w_ = w;
}
bool lang::calc::Node::Expr::BinOp2::op::_T::is_Mul() {
return w_ == lang::calc::Node::Expr::BinOp2::op::_W::Mul;
}
bool lang::calc::Node::Expr::BinOp2::op::_T::is_Div() {
return w_ == lang::calc::Node::Expr::BinOp2::op::_W::Div;
}
lang::calc::Node::Expr::BinOp2::op::Mul_T lang::calc::Node::Expr::BinOp2::op::_T::as_Mul() {
AT(this->is_Mul());
return this->rc_from_this_poly<lang::calc::Node::Expr::BinOp2::op::Mul::_T>();
}
lang::calc::Node::Expr::BinOp2::op::Div_T lang::calc::Node::Expr::BinOp2::op::_T::as_Div() {
AT(this->is_Div());
return this->rc_from_this_poly<lang::calc::Node::Expr::BinOp2::op::Div::_T>();
}
void lang::calc::Node::Expr::BinOp2::op::_T::hash_ser_acc_lang_calc_Node_Expr_BinOp2_op(SerBuf& buf) const {
this->hash_ser_acc_lang_calc_Node(buf);
hash_ser(buf, static_cast<Int>(w_));
hash_ser(buf, is_top_);
hash_ser(buf, sym_);
hash_ser(buf, attr_);
hash_ser(buf, first_k_);
}
void pr_debug(ostream& os, FmtFlags flags, lang::calc::Node::Expr::BinOp3::op_T x) {
switch (x->w_) {
case lang::calc::Node::Expr::BinOp3::op::_W::Pow: {
pr_debug(os, flags, x->as_Pow());
break;
}
default: {
AX();
}
}
}
lang::calc::Node::Expr::BinOp3::op::_T::~_T() {
}
lang::calc::Node::Expr::BinOp3::op::_T::_T(lang::calc::Node::Expr::BinOp3::op::_W w) : lang::calc::Node::_T(lang::calc::Node::_W::Expr__BinOp3__op) {
w_ = w;
}
bool lang::calc::Node::Expr::BinOp3::op::_T::is_Pow() {
return w_ == lang::calc::Node::Expr::BinOp3::op::_W::Pow;
}
lang::calc::Node::Expr::BinOp3::op::Pow_T lang::calc::Node::Expr::BinOp3::op::_T::as_Pow() {
AT(this->is_Pow());
return this->rc_from_this_poly<lang::calc::Node::Expr::BinOp3::op::Pow::_T>();
}
void lang::calc::Node::Expr::BinOp3::op::_T::hash_ser_acc_lang_calc_Node_Expr_BinOp3_op(SerBuf& buf) const {
this->hash_ser_acc_lang_calc_Node(buf);
hash_ser(buf, static_cast<Int>(w_));
hash_ser(buf, is_top_);
hash_ser(buf, sym_);
hash_ser(buf, attr_);
hash_ser(buf, first_k_);
}
void pr_debug(ostream& os, FmtFlags flags, lang::calc::Node::Expr::UnaryPre::op::Neg_T x) {
os << "lang::calc::Node::Expr::UnaryPre::op::Neg {";
flags.sub_lo().advance_lines(1, os);
os << "id: ";
pr_debug(os, flags.sub_lo(), x->id_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "bounds: ";
pr_debug(os, flags.sub_lo(), x->bounds_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "is_top: ";
pr_debug(os, flags.sub_lo(), x->is_top_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "sym: ";
pr_debug(os, flags.sub_lo(), x->sym_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "attr: ";
pr_debug(os, flags.sub_lo(), x->attr_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "first_k: ";
pr_debug(os, flags.sub_lo(), x->first_k_);
os << ",";
flags.advance_lines(1, os);
os << "}";
}
lang::calc::Node::Expr::UnaryPre::op::Neg::_T::_T() : lang::calc::Node::Expr::UnaryPre::op::_T(lang::calc::Node::Expr::UnaryPre::op::_W::Neg) {
}
__attribute__((always_inline)) lang::calc::Node::Expr::UnaryPre::op::Neg_T lang::calc::Node::Expr::UnaryPre::op::Neg::make(Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k) {
auto ret = make_rc<lang::calc::Node::Expr::UnaryPre::op::Neg::_T>();
ret->id_ = id;
ret->bounds_ = bounds;
ret->is_top_ = is_top;
ret->sym_ = sym;
ret->attr_ = attr;
ret->first_k_ = first_k;
return ret;
}
__attribute__((always_inline)) lang::calc::Node::Expr::UnaryPre::op::Neg_T lang::calc::Node::Expr::UnaryPre::op::Neg::make_ext(ArenaPtr arena, Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k) {
auto ret1 = make_rc_ext<lang::calc::Node::Expr::UnaryPre::op::Neg::_T>(arena);
ret1->id_ = id;
ret1->bounds_ = bounds;
ret1->is_top_ = is_top;
ret1->sym_ = sym;
ret1->attr_ = attr;
ret1->first_k_ = first_k;
return ret1;
}
lang::calc::Node::Expr::UnaryPre::op::Neg_T lang::calc::Node::Expr::UnaryPre::op::Neg::_T::with_id(Int id) {
auto ret = make_rc<lang::calc::Node::Expr::UnaryPre::op::Neg::_T>();
ret->id_ = id;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::UnaryPre::op::Neg_T lang::calc::Node::Expr::UnaryPre::op::Neg::_T::with_bounds(lang_rt::TokenBounds bounds) {
auto ret = make_rc<lang::calc::Node::Expr::UnaryPre::op::Neg::_T>();
ret->id_ = this->id_;
ret->bounds_ = bounds;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::UnaryPre::op::Neg_T lang::calc::Node::Expr::UnaryPre::op::Neg::_T::with_is_top(bool is_top) {
auto ret = make_rc<lang::calc::Node::Expr::UnaryPre::op::Neg::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = is_top;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::UnaryPre::op::Neg_T lang::calc::Node::Expr::UnaryPre::op::Neg::_T::with_sym(lang_rt::ParserSymId sym) {
auto ret = make_rc<lang::calc::Node::Expr::UnaryPre::op::Neg::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = sym;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::UnaryPre::op::Neg_T lang::calc::Node::Expr::UnaryPre::op::Neg::_T::with_attr(lang_rt::ParserAttrMask attr) {
auto ret = make_rc<lang::calc::Node::Expr::UnaryPre::op::Neg::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = attr;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::UnaryPre::op::Neg_T lang::calc::Node::Expr::UnaryPre::op::Neg::_T::with_first_k(lang_rt::ParserLookahead first_k) {
auto ret = make_rc<lang::calc::Node::Expr::UnaryPre::op::Neg::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = first_k;
return ret;
}
void lang::calc::Node::Expr::UnaryPre::op::Neg::_T::hash_ser_acc_lang_calc_Node_Expr_UnaryPre_op_Neg(SerBuf& buf) const {
this->hash_ser_acc_lang_calc_Node_Expr_UnaryPre_op(buf);
hash_ser(buf, is_top_);
hash_ser(buf, sym_);
hash_ser(buf, attr_);
hash_ser(buf, first_k_);
}
void lang::calc::Node::Expr::UnaryPre::op::Neg::_T::hash_ser_acc(SerBuf& buf) const {
this->lang::calc::Node::Expr::UnaryPre::op::Neg::_T::hash_ser_acc_lang_calc_Node_Expr_UnaryPre_op_Neg(buf);
}
void pr_debug(ostream& os, FmtFlags flags, lang::calc::Node::Expr::BinOp1::op::Add_T x) {
os << "lang::calc::Node::Expr::BinOp1::op::Add {";
flags.sub_lo().advance_lines(1, os);
os << "id: ";
pr_debug(os, flags.sub_lo(), x->id_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "bounds: ";
pr_debug(os, flags.sub_lo(), x->bounds_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "is_top: ";
pr_debug(os, flags.sub_lo(), x->is_top_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "sym: ";
pr_debug(os, flags.sub_lo(), x->sym_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "attr: ";
pr_debug(os, flags.sub_lo(), x->attr_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "first_k: ";
pr_debug(os, flags.sub_lo(), x->first_k_);
os << ",";
flags.advance_lines(1, os);
os << "}";
}
lang::calc::Node::Expr::BinOp1::op::Add::_T::_T() : lang::calc::Node::Expr::BinOp1::op::_T(lang::calc::Node::Expr::BinOp1::op::_W::Add) {
}
__attribute__((always_inline)) lang::calc::Node::Expr::BinOp1::op::Add_T lang::calc::Node::Expr::BinOp1::op::Add::make(Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp1::op::Add::_T>();
ret->id_ = id;
ret->bounds_ = bounds;
ret->is_top_ = is_top;
ret->sym_ = sym;
ret->attr_ = attr;
ret->first_k_ = first_k;
return ret;
}
__attribute__((always_inline)) lang::calc::Node::Expr::BinOp1::op::Add_T lang::calc::Node::Expr::BinOp1::op::Add::make_ext(ArenaPtr arena, Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k) {
auto ret1 = make_rc_ext<lang::calc::Node::Expr::BinOp1::op::Add::_T>(arena);
ret1->id_ = id;
ret1->bounds_ = bounds;
ret1->is_top_ = is_top;
ret1->sym_ = sym;
ret1->attr_ = attr;
ret1->first_k_ = first_k;
return ret1;
}
lang::calc::Node::Expr::BinOp1::op::Add_T lang::calc::Node::Expr::BinOp1::op::Add::_T::with_id(Int id) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp1::op::Add::_T>();
ret->id_ = id;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp1::op::Add_T lang::calc::Node::Expr::BinOp1::op::Add::_T::with_bounds(lang_rt::TokenBounds bounds) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp1::op::Add::_T>();
ret->id_ = this->id_;
ret->bounds_ = bounds;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp1::op::Add_T lang::calc::Node::Expr::BinOp1::op::Add::_T::with_is_top(bool is_top) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp1::op::Add::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = is_top;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp1::op::Add_T lang::calc::Node::Expr::BinOp1::op::Add::_T::with_sym(lang_rt::ParserSymId sym) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp1::op::Add::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = sym;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp1::op::Add_T lang::calc::Node::Expr::BinOp1::op::Add::_T::with_attr(lang_rt::ParserAttrMask attr) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp1::op::Add::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = attr;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp1::op::Add_T lang::calc::Node::Expr::BinOp1::op::Add::_T::with_first_k(lang_rt::ParserLookahead first_k) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp1::op::Add::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = first_k;
return ret;
}
void lang::calc::Node::Expr::BinOp1::op::Add::_T::hash_ser_acc_lang_calc_Node_Expr_BinOp1_op_Add(SerBuf& buf) const {
this->hash_ser_acc_lang_calc_Node_Expr_BinOp1_op(buf);
hash_ser(buf, is_top_);
hash_ser(buf, sym_);
hash_ser(buf, attr_);
hash_ser(buf, first_k_);
}
void lang::calc::Node::Expr::BinOp1::op::Add::_T::hash_ser_acc(SerBuf& buf) const {
this->lang::calc::Node::Expr::BinOp1::op::Add::_T::hash_ser_acc_lang_calc_Node_Expr_BinOp1_op_Add(buf);
}
void pr_debug(ostream& os, FmtFlags flags, lang::calc::Node::Expr::BinOp1::op::Sub_T x) {
os << "lang::calc::Node::Expr::BinOp1::op::Sub {";
flags.sub_lo().advance_lines(1, os);
os << "id: ";
pr_debug(os, flags.sub_lo(), x->id_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "bounds: ";
pr_debug(os, flags.sub_lo(), x->bounds_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "is_top: ";
pr_debug(os, flags.sub_lo(), x->is_top_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "sym: ";
pr_debug(os, flags.sub_lo(), x->sym_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "attr: ";
pr_debug(os, flags.sub_lo(), x->attr_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "first_k: ";
pr_debug(os, flags.sub_lo(), x->first_k_);
os << ",";
flags.advance_lines(1, os);
os << "}";
}
lang::calc::Node::Expr::BinOp1::op::Sub::_T::_T() : lang::calc::Node::Expr::BinOp1::op::_T(lang::calc::Node::Expr::BinOp1::op::_W::Sub) {
}
__attribute__((always_inline)) lang::calc::Node::Expr::BinOp1::op::Sub_T lang::calc::Node::Expr::BinOp1::op::Sub::make(Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp1::op::Sub::_T>();
ret->id_ = id;
ret->bounds_ = bounds;
ret->is_top_ = is_top;
ret->sym_ = sym;
ret->attr_ = attr;
ret->first_k_ = first_k;
return ret;
}
__attribute__((always_inline)) lang::calc::Node::Expr::BinOp1::op::Sub_T lang::calc::Node::Expr::BinOp1::op::Sub::make_ext(ArenaPtr arena, Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k) {
auto ret1 = make_rc_ext<lang::calc::Node::Expr::BinOp1::op::Sub::_T>(arena);
ret1->id_ = id;
ret1->bounds_ = bounds;
ret1->is_top_ = is_top;
ret1->sym_ = sym;
ret1->attr_ = attr;
ret1->first_k_ = first_k;
return ret1;
}
lang::calc::Node::Expr::BinOp1::op::Sub_T lang::calc::Node::Expr::BinOp1::op::Sub::_T::with_id(Int id) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp1::op::Sub::_T>();
ret->id_ = id;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp1::op::Sub_T lang::calc::Node::Expr::BinOp1::op::Sub::_T::with_bounds(lang_rt::TokenBounds bounds) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp1::op::Sub::_T>();
ret->id_ = this->id_;
ret->bounds_ = bounds;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp1::op::Sub_T lang::calc::Node::Expr::BinOp1::op::Sub::_T::with_is_top(bool is_top) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp1::op::Sub::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = is_top;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp1::op::Sub_T lang::calc::Node::Expr::BinOp1::op::Sub::_T::with_sym(lang_rt::ParserSymId sym) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp1::op::Sub::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = sym;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp1::op::Sub_T lang::calc::Node::Expr::BinOp1::op::Sub::_T::with_attr(lang_rt::ParserAttrMask attr) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp1::op::Sub::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = attr;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp1::op::Sub_T lang::calc::Node::Expr::BinOp1::op::Sub::_T::with_first_k(lang_rt::ParserLookahead first_k) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp1::op::Sub::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = first_k;
return ret;
}
void lang::calc::Node::Expr::BinOp1::op::Sub::_T::hash_ser_acc_lang_calc_Node_Expr_BinOp1_op_Sub(SerBuf& buf) const {
this->hash_ser_acc_lang_calc_Node_Expr_BinOp1_op(buf);
hash_ser(buf, is_top_);
hash_ser(buf, sym_);
hash_ser(buf, attr_);
hash_ser(buf, first_k_);
}
void lang::calc::Node::Expr::BinOp1::op::Sub::_T::hash_ser_acc(SerBuf& buf) const {
this->lang::calc::Node::Expr::BinOp1::op::Sub::_T::hash_ser_acc_lang_calc_Node_Expr_BinOp1_op_Sub(buf);
}
void pr_debug(ostream& os, FmtFlags flags, lang::calc::Node::Expr::BinOp2::op::Mul_T x) {
os << "lang::calc::Node::Expr::BinOp2::op::Mul {";
flags.sub_lo().advance_lines(1, os);
os << "id: ";
pr_debug(os, flags.sub_lo(), x->id_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "bounds: ";
pr_debug(os, flags.sub_lo(), x->bounds_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "is_top: ";
pr_debug(os, flags.sub_lo(), x->is_top_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "sym: ";
pr_debug(os, flags.sub_lo(), x->sym_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "attr: ";
pr_debug(os, flags.sub_lo(), x->attr_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "first_k: ";
pr_debug(os, flags.sub_lo(), x->first_k_);
os << ",";
flags.advance_lines(1, os);
os << "}";
}
lang::calc::Node::Expr::BinOp2::op::Mul::_T::_T() : lang::calc::Node::Expr::BinOp2::op::_T(lang::calc::Node::Expr::BinOp2::op::_W::Mul) {
}
__attribute__((always_inline)) lang::calc::Node::Expr::BinOp2::op::Mul_T lang::calc::Node::Expr::BinOp2::op::Mul::make(Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp2::op::Mul::_T>();
ret->id_ = id;
ret->bounds_ = bounds;
ret->is_top_ = is_top;
ret->sym_ = sym;
ret->attr_ = attr;
ret->first_k_ = first_k;
return ret;
}
__attribute__((always_inline)) lang::calc::Node::Expr::BinOp2::op::Mul_T lang::calc::Node::Expr::BinOp2::op::Mul::make_ext(ArenaPtr arena, Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k) {
auto ret1 = make_rc_ext<lang::calc::Node::Expr::BinOp2::op::Mul::_T>(arena);
ret1->id_ = id;
ret1->bounds_ = bounds;
ret1->is_top_ = is_top;
ret1->sym_ = sym;
ret1->attr_ = attr;
ret1->first_k_ = first_k;
return ret1;
}
lang::calc::Node::Expr::BinOp2::op::Mul_T lang::calc::Node::Expr::BinOp2::op::Mul::_T::with_id(Int id) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp2::op::Mul::_T>();
ret->id_ = id;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp2::op::Mul_T lang::calc::Node::Expr::BinOp2::op::Mul::_T::with_bounds(lang_rt::TokenBounds bounds) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp2::op::Mul::_T>();
ret->id_ = this->id_;
ret->bounds_ = bounds;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp2::op::Mul_T lang::calc::Node::Expr::BinOp2::op::Mul::_T::with_is_top(bool is_top) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp2::op::Mul::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = is_top;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp2::op::Mul_T lang::calc::Node::Expr::BinOp2::op::Mul::_T::with_sym(lang_rt::ParserSymId sym) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp2::op::Mul::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = sym;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp2::op::Mul_T lang::calc::Node::Expr::BinOp2::op::Mul::_T::with_attr(lang_rt::ParserAttrMask attr) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp2::op::Mul::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = attr;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp2::op::Mul_T lang::calc::Node::Expr::BinOp2::op::Mul::_T::with_first_k(lang_rt::ParserLookahead first_k) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp2::op::Mul::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = first_k;
return ret;
}
void lang::calc::Node::Expr::BinOp2::op::Mul::_T::hash_ser_acc_lang_calc_Node_Expr_BinOp2_op_Mul(SerBuf& buf) const {
this->hash_ser_acc_lang_calc_Node_Expr_BinOp2_op(buf);
hash_ser(buf, is_top_);
hash_ser(buf, sym_);
hash_ser(buf, attr_);
hash_ser(buf, first_k_);
}
void lang::calc::Node::Expr::BinOp2::op::Mul::_T::hash_ser_acc(SerBuf& buf) const {
this->lang::calc::Node::Expr::BinOp2::op::Mul::_T::hash_ser_acc_lang_calc_Node_Expr_BinOp2_op_Mul(buf);
}
void pr_debug(ostream& os, FmtFlags flags, lang::calc::Node::Expr::BinOp2::op::Div_T x) {
os << "lang::calc::Node::Expr::BinOp2::op::Div {";
flags.sub_lo().advance_lines(1, os);
os << "id: ";
pr_debug(os, flags.sub_lo(), x->id_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "bounds: ";
pr_debug(os, flags.sub_lo(), x->bounds_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "is_top: ";
pr_debug(os, flags.sub_lo(), x->is_top_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "sym: ";
pr_debug(os, flags.sub_lo(), x->sym_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "attr: ";
pr_debug(os, flags.sub_lo(), x->attr_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "first_k: ";
pr_debug(os, flags.sub_lo(), x->first_k_);
os << ",";
flags.advance_lines(1, os);
os << "}";
}
lang::calc::Node::Expr::BinOp2::op::Div::_T::_T() : lang::calc::Node::Expr::BinOp2::op::_T(lang::calc::Node::Expr::BinOp2::op::_W::Div) {
}
__attribute__((always_inline)) lang::calc::Node::Expr::BinOp2::op::Div_T lang::calc::Node::Expr::BinOp2::op::Div::make(Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp2::op::Div::_T>();
ret->id_ = id;
ret->bounds_ = bounds;
ret->is_top_ = is_top;
ret->sym_ = sym;
ret->attr_ = attr;
ret->first_k_ = first_k;
return ret;
}
__attribute__((always_inline)) lang::calc::Node::Expr::BinOp2::op::Div_T lang::calc::Node::Expr::BinOp2::op::Div::make_ext(ArenaPtr arena, Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k) {
auto ret1 = make_rc_ext<lang::calc::Node::Expr::BinOp2::op::Div::_T>(arena);
ret1->id_ = id;
ret1->bounds_ = bounds;
ret1->is_top_ = is_top;
ret1->sym_ = sym;
ret1->attr_ = attr;
ret1->first_k_ = first_k;
return ret1;
}
lang::calc::Node::Expr::BinOp2::op::Div_T lang::calc::Node::Expr::BinOp2::op::Div::_T::with_id(Int id) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp2::op::Div::_T>();
ret->id_ = id;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp2::op::Div_T lang::calc::Node::Expr::BinOp2::op::Div::_T::with_bounds(lang_rt::TokenBounds bounds) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp2::op::Div::_T>();
ret->id_ = this->id_;
ret->bounds_ = bounds;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp2::op::Div_T lang::calc::Node::Expr::BinOp2::op::Div::_T::with_is_top(bool is_top) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp2::op::Div::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = is_top;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp2::op::Div_T lang::calc::Node::Expr::BinOp2::op::Div::_T::with_sym(lang_rt::ParserSymId sym) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp2::op::Div::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = sym;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp2::op::Div_T lang::calc::Node::Expr::BinOp2::op::Div::_T::with_attr(lang_rt::ParserAttrMask attr) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp2::op::Div::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = attr;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp2::op::Div_T lang::calc::Node::Expr::BinOp2::op::Div::_T::with_first_k(lang_rt::ParserLookahead first_k) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp2::op::Div::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = first_k;
return ret;
}
void lang::calc::Node::Expr::BinOp2::op::Div::_T::hash_ser_acc_lang_calc_Node_Expr_BinOp2_op_Div(SerBuf& buf) const {
this->hash_ser_acc_lang_calc_Node_Expr_BinOp2_op(buf);
hash_ser(buf, is_top_);
hash_ser(buf, sym_);
hash_ser(buf, attr_);
hash_ser(buf, first_k_);
}
void lang::calc::Node::Expr::BinOp2::op::Div::_T::hash_ser_acc(SerBuf& buf) const {
this->lang::calc::Node::Expr::BinOp2::op::Div::_T::hash_ser_acc_lang_calc_Node_Expr_BinOp2_op_Div(buf);
}
void pr_debug(ostream& os, FmtFlags flags, lang::calc::Node::Expr::BinOp3::op::Pow_T x) {
os << "lang::calc::Node::Expr::BinOp3::op::Pow {";
flags.sub_lo().advance_lines(1, os);
os << "id: ";
pr_debug(os, flags.sub_lo(), x->id_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "bounds: ";
pr_debug(os, flags.sub_lo(), x->bounds_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "is_top: ";
pr_debug(os, flags.sub_lo(), x->is_top_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "sym: ";
pr_debug(os, flags.sub_lo(), x->sym_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "attr: ";
pr_debug(os, flags.sub_lo(), x->attr_);
os << ",";
flags.sub_lo().advance_lines(1, os);
os << "first_k: ";
pr_debug(os, flags.sub_lo(), x->first_k_);
os << ",";
flags.advance_lines(1, os);
os << "}";
}
lang::calc::Node::Expr::BinOp3::op::Pow::_T::_T() : lang::calc::Node::Expr::BinOp3::op::_T(lang::calc::Node::Expr::BinOp3::op::_W::Pow) {
}
__attribute__((always_inline)) lang::calc::Node::Expr::BinOp3::op::Pow_T lang::calc::Node::Expr::BinOp3::op::Pow::make(Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp3::op::Pow::_T>();
ret->id_ = id;
ret->bounds_ = bounds;
ret->is_top_ = is_top;
ret->sym_ = sym;
ret->attr_ = attr;
ret->first_k_ = first_k;
return ret;
}
__attribute__((always_inline)) lang::calc::Node::Expr::BinOp3::op::Pow_T lang::calc::Node::Expr::BinOp3::op::Pow::make_ext(ArenaPtr arena, Int id, lang_rt::TokenBounds bounds, bool is_top, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr, lang_rt::ParserLookahead first_k) {
auto ret1 = make_rc_ext<lang::calc::Node::Expr::BinOp3::op::Pow::_T>(arena);
ret1->id_ = id;
ret1->bounds_ = bounds;
ret1->is_top_ = is_top;
ret1->sym_ = sym;
ret1->attr_ = attr;
ret1->first_k_ = first_k;
return ret1;
}
lang::calc::Node::Expr::BinOp3::op::Pow_T lang::calc::Node::Expr::BinOp3::op::Pow::_T::with_id(Int id) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp3::op::Pow::_T>();
ret->id_ = id;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp3::op::Pow_T lang::calc::Node::Expr::BinOp3::op::Pow::_T::with_bounds(lang_rt::TokenBounds bounds) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp3::op::Pow::_T>();
ret->id_ = this->id_;
ret->bounds_ = bounds;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp3::op::Pow_T lang::calc::Node::Expr::BinOp3::op::Pow::_T::with_is_top(bool is_top) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp3::op::Pow::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = is_top;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp3::op::Pow_T lang::calc::Node::Expr::BinOp3::op::Pow::_T::with_sym(lang_rt::ParserSymId sym) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp3::op::Pow::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = sym;
ret->attr_ = this->attr_;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp3::op::Pow_T lang::calc::Node::Expr::BinOp3::op::Pow::_T::with_attr(lang_rt::ParserAttrMask attr) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp3::op::Pow::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = attr;
ret->first_k_ = this->first_k_;
return ret;
}
lang::calc::Node::Expr::BinOp3::op::Pow_T lang::calc::Node::Expr::BinOp3::op::Pow::_T::with_first_k(lang_rt::ParserLookahead first_k) {
auto ret = make_rc<lang::calc::Node::Expr::BinOp3::op::Pow::_T>();
ret->id_ = this->id_;
ret->bounds_ = this->bounds_;
ret->is_top_ = this->is_top_;
ret->sym_ = this->sym_;
ret->attr_ = this->attr_;
ret->first_k_ = first_k;
return ret;
}
void lang::calc::Node::Expr::BinOp3::op::Pow::_T::hash_ser_acc_lang_calc_Node_Expr_BinOp3_op_Pow(SerBuf& buf) const {
this->hash_ser_acc_lang_calc_Node_Expr_BinOp3_op(buf);
hash_ser(buf, is_top_);
hash_ser(buf, sym_);
hash_ser(buf, attr_);
hash_ser(buf, first_k_);
}
void lang::calc::Node::Expr::BinOp3::op::Pow::_T::hash_ser_acc(SerBuf& buf) const {
this->lang::calc::Node::Expr::BinOp3::op::Pow::_T::hash_ser_acc_lang_calc_Node_Expr_BinOp3_op_Pow(buf);
}
void visit_lang_calc_Node(lang::calc::Node::Expr::UnaryPre::op::Neg_T x, function<void(lang::calc::Node_T)> f) {
f(x);
}
void visit_lang_calc_Node(lang::calc::Node::Expr::UnaryPre::op_T x, function<void(lang::calc::Node_T)> f) {
switch (x->w_) {
case lang::calc::Node::Expr::UnaryPre::op::_W::Neg: {
visit_lang_calc_Node(x->as_Neg(), f);
break;
}
default: {
AX();
}
}
}
void visit_lang_calc_Node(lang::calc::Node::Expr::BinOp1::op::Add_T x, function<void(lang::calc::Node_T)> f) {
f(x);
}
void visit_lang_calc_Node(lang::calc::Node::Expr::BinOp1::op::Sub_T x, function<void(lang::calc::Node_T)> f) {
f(x);
}
void visit_lang_calc_Node(lang::calc::Node::Expr::BinOp1::op_T x, function<void(lang::calc::Node_T)> f) {
switch (x->w_) {
case lang::calc::Node::Expr::BinOp1::op::_W::Add: {
visit_lang_calc_Node(x->as_Add(), f);
break;
}
case lang::calc::Node::Expr::BinOp1::op::_W::Sub: {
visit_lang_calc_Node(x->as_Sub(), f);
break;
}
default: {
AX();
}
}
}
void visit_lang_calc_Node(lang::calc::Node::Expr::BinOp2::op::Mul_T x, function<void(lang::calc::Node_T)> f) {
f(x);
}
void visit_lang_calc_Node(lang::calc::Node::Expr::BinOp2::op::Div_T x, function<void(lang::calc::Node_T)> f) {
f(x);
}
void visit_lang_calc_Node(lang::calc::Node::Expr::BinOp2::op_T x, function<void(lang::calc::Node_T)> f) {
switch (x->w_) {
case lang::calc::Node::Expr::BinOp2::op::_W::Mul: {
visit_lang_calc_Node(x->as_Mul(), f);
break;
}
case lang::calc::Node::Expr::BinOp2::op::_W::Div: {
visit_lang_calc_Node(x->as_Div(), f);
break;
}
default: {
AX();
}
}
}
void visit_lang_calc_Node(lang::calc::Node::Expr::BinOp3::op::Pow_T x, function<void(lang::calc::Node_T)> f) {
f(x);
}
void visit_lang_calc_Node(lang::calc::Node::Expr::BinOp3::op_T x, function<void(lang::calc::Node_T)> f) {
switch (x->w_) {
case lang::calc::Node::Expr::BinOp3::op::_W::Pow: {
visit_lang_calc_Node(x->as_Pow(), f);
break;
}
default: {
AX();
}
}
}
void visit_lang_calc_Node(lang::calc::Node::Expr::Id_T x, function<void(lang::calc::Node_T)> f) {
f(x);
}
void visit_lang_calc_Node(lang::calc::Node::Expr::UnaryPre_T x, function<void(lang::calc::Node_T)> f) {
visit_lang_calc_Node(x->op_, f);
visit_lang_calc_Node(x->x_, f);
f(x);
}
void visit_lang_calc_Node(lang::calc::Node::Expr::BinOp1_T x, function<void(lang::calc::Node_T)> f) {
visit_lang_calc_Node(x->x_, f);
visit_lang_calc_Node(x->op_, f);
visit_lang_calc_Node(x->y_, f);
f(x);
}
void visit_lang_calc_Node(lang::calc::Node::Expr::BinOp2_T x, function<void(lang::calc::Node_T)> f) {
visit_lang_calc_Node(x->x_, f);
visit_lang_calc_Node(x->op_, f);
visit_lang_calc_Node(x->y_, f);
f(x);
}
void visit_lang_calc_Node(lang::calc::Node::Expr::BinOp3_T x, function<void(lang::calc::Node_T)> f) {
visit_lang_calc_Node(x->x_, f);
visit_lang_calc_Node(x->op_, f);
visit_lang_calc_Node(x->y_, f);
f(x);
}
void visit_lang_calc_Node(lang::calc::Node::Expr::Paren_T x, function<void(lang::calc::Node_T)> f) {
visit_lang_calc_Node(x->x_, f);
f(x);
}
void visit_lang_calc_Node(lang::calc::Node::Expr::Lit::Int__T x, function<void(lang::calc::Node_T)> f) {
f(x);
}
void visit_lang_calc_Node(lang::calc::Node::Expr::Lit_T x, function<void(lang::calc::Node_T)> f) {
switch (x->w_) {
case lang::calc::Node::Expr::Lit::_W::Int_: {
visit_lang_calc_Node(x->as_Int_(), f);
break;
}
default: {
AX();
}
}
}
void visit_lang_calc_Node(lang::calc::Node::Expr_T x, function<void(lang::calc::Node_T)> f) {
switch (x->w_) {
case lang::calc::Node::Expr::_W::Id: {
visit_lang_calc_Node(x->as_Id(), f);
break;
}
case lang::calc::Node::Expr::_W::UnaryPre: {
visit_lang_calc_Node(x->as_UnaryPre(), f);
break;
}
case lang::calc::Node::Expr::_W::BinOp1: {
visit_lang_calc_Node(x->as_BinOp1(), f);
break;
}
case lang::calc::Node::Expr::_W::BinOp2: {
visit_lang_calc_Node(x->as_BinOp2(), f);
break;
}
case lang::calc::Node::Expr::_W::BinOp3: {
visit_lang_calc_Node(x->as_BinOp3(), f);
break;
}
case lang::calc::Node::Expr::_W::Paren: {
visit_lang_calc_Node(x->as_Paren(), f);
break;
}
case lang::calc::Node::Expr::_W::Lit: {
visit_lang_calc_Node(x->as_Lit(), f);
break;
}
default: {
AX();
}
}
}
void visit_lang_calc_Node(lang::calc::Node::Stmt::Assign_T x, function<void(lang::calc::Node_T)> f) {
visit_lang_calc_Node(x->x_, f);
visit_lang_calc_Node(x->y_, f);
f(x);
}
void visit_lang_calc_Node(lang::calc::Node::Stmt::Expr_T x, function<void(lang::calc::Node_T)> f) {
visit_lang_calc_Node(x->x_, f);
f(x);
}
void visit_lang_calc_Node(lang::calc::Node::Stmt_T x, function<void(lang::calc::Node_T)> f) {
switch (x->w_) {
case lang::calc::Node::Stmt::_W::Assign: {
visit_lang_calc_Node(x->as_Assign(), f);
break;
}
case lang::calc::Node::Stmt::_W::Expr: {
visit_lang_calc_Node(x->as_Expr(), f);
break;
}
default: {
AX();
}
}
}
void visit_lang_calc_Node(lang::calc::Node_T x, function<void(lang::calc::Node_T)> f) {
switch (x->w_) {
case lang::calc::Node::_W::Expr__UnaryPre__op: {
visit_lang_calc_Node(x->as_Expr__UnaryPre__op(), f);
break;
}
case lang::calc::Node::_W::Expr__BinOp1__op: {
visit_lang_calc_Node(x->as_Expr__BinOp1__op(), f);
break;
}
case lang::calc::Node::_W::Expr__BinOp2__op: {
visit_lang_calc_Node(x->as_Expr__BinOp2__op(), f);
break;
}
case lang::calc::Node::_W::Expr__BinOp3__op: {
visit_lang_calc_Node(x->as_Expr__BinOp3__op(), f);
break;
}
case lang::calc::Node::_W::Stmt: {
visit_lang_calc_Node(x->as_Stmt(), f);
break;
}
case lang::calc::Node::_W::Expr: {
visit_lang_calc_Node(x->as_Expr(), f);
break;
}
default: {
AX();
}
}
}
lang::calc::Node_T xformT_lang_calc_Node(lang::calc::Node::Expr::UnaryPre::op::Neg_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node::Expr::UnaryPre::op::Neg_T z = lang::calc::Node::Expr::UnaryPre::op::Neg::make(x->id_, x->bounds_, x->is_top_, x->sym_, x->attr_, x->first_k_);
return f(z);
}
lang::calc::Node_T xformT_lang_calc_Node(lang::calc::Node::Expr::UnaryPre::op_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
switch (x->w_) {
case lang::calc::Node::Expr::UnaryPre::op::_W::Neg: {
auto ret = xformT_lang_calc_Node(x->as_Neg(), f);
return ret;
break;
}
default: {
AX();
}
}
}
lang::calc::Node_T xformT_lang_calc_Node(lang::calc::Node::Expr::BinOp1::op::Add_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node::Expr::BinOp1::op::Add_T z = lang::calc::Node::Expr::BinOp1::op::Add::make(x->id_, x->bounds_, x->is_top_, x->sym_, x->attr_, x->first_k_);
return f(z);
}
lang::calc::Node_T xformT_lang_calc_Node(lang::calc::Node::Expr::BinOp1::op::Sub_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node::Expr::BinOp1::op::Sub_T z = lang::calc::Node::Expr::BinOp1::op::Sub::make(x->id_, x->bounds_, x->is_top_, x->sym_, x->attr_, x->first_k_);
return f(z);
}
lang::calc::Node_T xformT_lang_calc_Node(lang::calc::Node::Expr::BinOp1::op_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
switch (x->w_) {
case lang::calc::Node::Expr::BinOp1::op::_W::Add: {
auto ret = xformT_lang_calc_Node(x->as_Add(), f);
return ret;
break;
}
case lang::calc::Node::Expr::BinOp1::op::_W::Sub: {
auto ret1 = xformT_lang_calc_Node(x->as_Sub(), f);
return ret1;
break;
}
default: {
AX();
}
}
}
lang::calc::Node_T xformT_lang_calc_Node(lang::calc::Node::Expr::BinOp2::op::Mul_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node::Expr::BinOp2::op::Mul_T z = lang::calc::Node::Expr::BinOp2::op::Mul::make(x->id_, x->bounds_, x->is_top_, x->sym_, x->attr_, x->first_k_);
return f(z);
}
lang::calc::Node_T xformT_lang_calc_Node(lang::calc::Node::Expr::BinOp2::op::Div_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node::Expr::BinOp2::op::Div_T z = lang::calc::Node::Expr::BinOp2::op::Div::make(x->id_, x->bounds_, x->is_top_, x->sym_, x->attr_, x->first_k_);
return f(z);
}
lang::calc::Node_T xformT_lang_calc_Node(lang::calc::Node::Expr::BinOp2::op_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
switch (x->w_) {
case lang::calc::Node::Expr::BinOp2::op::_W::Mul: {
auto ret = xformT_lang_calc_Node(x->as_Mul(), f);
return ret;
break;
}
case lang::calc::Node::Expr::BinOp2::op::_W::Div: {
auto ret1 = xformT_lang_calc_Node(x->as_Div(), f);
return ret1;
break;
}
default: {
AX();
}
}
}
lang::calc::Node_T xformT_lang_calc_Node(lang::calc::Node::Expr::BinOp3::op::Pow_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node::Expr::BinOp3::op::Pow_T z = lang::calc::Node::Expr::BinOp3::op::Pow::make(x->id_, x->bounds_, x->is_top_, x->sym_, x->attr_, x->first_k_);
return f(z);
}
lang::calc::Node_T xformT_lang_calc_Node(lang::calc::Node::Expr::BinOp3::op_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
switch (x->w_) {
case lang::calc::Node::Expr::BinOp3::op::_W::Pow: {
auto ret = xformT_lang_calc_Node(x->as_Pow(), f);
return ret;
break;
}
default: {
AX();
}
}
}
lang::calc::Node_T xformT_lang_calc_Node(lang::calc::Node::Expr::Id_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node::Expr::Id_T z = lang::calc::Node::Expr::Id::make(x->id_, x->bounds_, x->is_top_, x->sym_, x->attr_, x->first_k_, x->name_);
return f(z);
}
lang::calc::Node_T xformT_lang_calc_Node(lang::calc::Node::Expr::UnaryPre_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node::Expr::UnaryPre::op_T y = xform_lang_calc_Node(x->op_, f);
lang::calc::Node::Expr_T y1 = xform_lang_calc_Node(x->x_, f);
lang::calc::Node::Expr::UnaryPre_T z = lang::calc::Node::Expr::UnaryPre::make(x->id_, x->bounds_, x->is_top_, x->sym_, x->attr_, x->first_k_, y, y1);
return f(z);
}
lang::calc::Node_T xformT_lang_calc_Node(lang::calc::Node::Expr::BinOp1_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node::Expr_T y = xform_lang_calc_Node(x->x_, f);
lang::calc::Node::Expr::BinOp1::op_T y1 = xform_lang_calc_Node(x->op_, f);
lang::calc::Node::Expr_T y2 = xform_lang_calc_Node(x->y_, f);
lang::calc::Node::Expr::BinOp1_T z = lang::calc::Node::Expr::BinOp1::make(x->id_, x->bounds_, x->is_top_, x->sym_, x->attr_, x->first_k_, y, y1, y2);
return f(z);
}
lang::calc::Node_T xformT_lang_calc_Node(lang::calc::Node::Expr::BinOp2_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node::Expr_T y = xform_lang_calc_Node(x->x_, f);
lang::calc::Node::Expr::BinOp2::op_T y1 = xform_lang_calc_Node(x->op_, f);
lang::calc::Node::Expr_T y2 = xform_lang_calc_Node(x->y_, f);
lang::calc::Node::Expr::BinOp2_T z = lang::calc::Node::Expr::BinOp2::make(x->id_, x->bounds_, x->is_top_, x->sym_, x->attr_, x->first_k_, y, y1, y2);
return f(z);
}
lang::calc::Node_T xformT_lang_calc_Node(lang::calc::Node::Expr::BinOp3_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node::Expr_T y = xform_lang_calc_Node(x->x_, f);
lang::calc::Node::Expr::BinOp3::op_T y1 = xform_lang_calc_Node(x->op_, f);
lang::calc::Node::Expr_T y2 = xform_lang_calc_Node(x->y_, f);
lang::calc::Node::Expr::BinOp3_T z = lang::calc::Node::Expr::BinOp3::make(x->id_, x->bounds_, x->is_top_, x->sym_, x->attr_, x->first_k_, y, y1, y2);
return f(z);
}
lang::calc::Node_T xformT_lang_calc_Node(lang::calc::Node::Expr::Paren_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node::Expr_T y = xform_lang_calc_Node(x->x_, f);
lang::calc::Node::Expr::Paren_T z = lang::calc::Node::Expr::Paren::make(x->id_, x->bounds_, x->is_top_, x->sym_, x->attr_, x->first_k_, y);
return f(z);
}
lang::calc::Node_T xformT_lang_calc_Node(lang::calc::Node::Expr::Lit::Int__T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node::Expr::Lit::Int__T z = lang::calc::Node::Expr::Lit::Int_::make(x->id_, x->bounds_, x->is_top_, x->sym_, x->attr_, x->first_k_, x->val_);
return f(z);
}
lang::calc::Node_T xformT_lang_calc_Node(lang::calc::Node::Expr::Lit_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
switch (x->w_) {
case lang::calc::Node::Expr::Lit::_W::Int_: {
auto ret = xformT_lang_calc_Node(x->as_Int_(), f);
return ret;
break;
}
default: {
AX();
}
}
}
lang::calc::Node_T xformT_lang_calc_Node(lang::calc::Node::Expr_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
switch (x->w_) {
case lang::calc::Node::Expr::_W::Id: {
auto ret = xformT_lang_calc_Node(x->as_Id(), f);
return ret;
break;
}
case lang::calc::Node::Expr::_W::UnaryPre: {
auto ret1 = xformT_lang_calc_Node(x->as_UnaryPre(), f);
return ret1;
break;
}
case lang::calc::Node::Expr::_W::BinOp1: {
auto ret2 = xformT_lang_calc_Node(x->as_BinOp1(), f);
return ret2;
break;
}
case lang::calc::Node::Expr::_W::BinOp2: {
auto ret3 = xformT_lang_calc_Node(x->as_BinOp2(), f);
return ret3;
break;
}
case lang::calc::Node::Expr::_W::BinOp3: {
auto ret4 = xformT_lang_calc_Node(x->as_BinOp3(), f);
return ret4;
break;
}
case lang::calc::Node::Expr::_W::Paren: {
auto ret5 = xformT_lang_calc_Node(x->as_Paren(), f);
return ret5;
break;
}
case lang::calc::Node::Expr::_W::Lit: {
auto ret6 = xformT_lang_calc_Node(x->as_Lit(), f);
return ret6;
break;
}
default: {
AX();
}
}
}
lang::calc::Node_T xformT_lang_calc_Node(lang::calc::Node::Stmt::Assign_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node::Expr_T y = xform_lang_calc_Node(x->x_, f);
lang::calc::Node::Expr_T y1 = xform_lang_calc_Node(x->y_, f);
lang::calc::Node::Stmt::Assign_T z = lang::calc::Node::Stmt::Assign::make(x->id_, x->bounds_, x->is_top_, x->sym_, x->attr_, x->first_k_, y, y1);
return f(z);
}
lang::calc::Node_T xformT_lang_calc_Node(lang::calc::Node::Stmt::Expr_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node::Expr_T y = xform_lang_calc_Node(x->x_, f);
lang::calc::Node::Stmt::Expr_T z = lang::calc::Node::Stmt::Expr::make(x->id_, x->bounds_, x->is_top_, x->sym_, x->attr_, x->first_k_, y);
return f(z);
}
lang::calc::Node_T xformT_lang_calc_Node(lang::calc::Node::Stmt_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
switch (x->w_) {
case lang::calc::Node::Stmt::_W::Assign: {
auto ret = xformT_lang_calc_Node(x->as_Assign(), f);
return ret;
break;
}
case lang::calc::Node::Stmt::_W::Expr: {
auto ret1 = xformT_lang_calc_Node(x->as_Expr(), f);
return ret1;
break;
}
default: {
AX();
}
}
}
lang::calc::Node_T xformT_lang_calc_Node(lang::calc::Node_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
switch (x->w_) {
case lang::calc::Node::_W::Expr__UnaryPre__op: {
auto ret = xformT_lang_calc_Node(x->as_Expr__UnaryPre__op(), f);
return ret;
break;
}
case lang::calc::Node::_W::Expr__BinOp1__op: {
auto ret1 = xformT_lang_calc_Node(x->as_Expr__BinOp1__op(), f);
return ret1;
break;
}
case lang::calc::Node::_W::Expr__BinOp2__op: {
auto ret2 = xformT_lang_calc_Node(x->as_Expr__BinOp2__op(), f);
return ret2;
break;
}
case lang::calc::Node::_W::Expr__BinOp3__op: {
auto ret3 = xformT_lang_calc_Node(x->as_Expr__BinOp3__op(), f);
return ret3;
break;
}
case lang::calc::Node::_W::Stmt: {
auto ret4 = xformT_lang_calc_Node(x->as_Stmt(), f);
return ret4;
break;
}
case lang::calc::Node::_W::Expr: {
auto ret5 = xformT_lang_calc_Node(x->as_Expr(), f);
return ret5;
break;
}
default: {
AX();
}
}
}
lang::calc::Node_T xform_lang_calc_Node(lang::calc::Node_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node_T ret = xformT_lang_calc_Node(x, f);
return ret;
}
lang::calc::Node::Expr::UnaryPre::op_T xform_lang_calc_Node(lang::calc::Node::Expr::UnaryPre::op_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node_T ret = xformT_lang_calc_Node(x, f);
return ret->as_Expr__UnaryPre__op();
}
lang::calc::Node::Expr::UnaryPre::op::Neg_T xform_lang_calc_Node(lang::calc::Node::Expr::UnaryPre::op::Neg_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node_T ret = xformT_lang_calc_Node(x, f);
return ret->as_Expr__UnaryPre__op()->as_Neg();
}
lang::calc::Node::Expr::BinOp1::op_T xform_lang_calc_Node(lang::calc::Node::Expr::BinOp1::op_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node_T ret = xformT_lang_calc_Node(x, f);
return ret->as_Expr__BinOp1__op();
}
lang::calc::Node::Expr::BinOp1::op::Add_T xform_lang_calc_Node(lang::calc::Node::Expr::BinOp1::op::Add_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node_T ret = xformT_lang_calc_Node(x, f);
return ret->as_Expr__BinOp1__op()->as_Add();
}
lang::calc::Node::Expr::BinOp1::op::Sub_T xform_lang_calc_Node(lang::calc::Node::Expr::BinOp1::op::Sub_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node_T ret = xformT_lang_calc_Node(x, f);
return ret->as_Expr__BinOp1__op()->as_Sub();
}
lang::calc::Node::Expr::BinOp2::op_T xform_lang_calc_Node(lang::calc::Node::Expr::BinOp2::op_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node_T ret = xformT_lang_calc_Node(x, f);
return ret->as_Expr__BinOp2__op();
}
lang::calc::Node::Expr::BinOp2::op::Mul_T xform_lang_calc_Node(lang::calc::Node::Expr::BinOp2::op::Mul_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node_T ret = xformT_lang_calc_Node(x, f);
return ret->as_Expr__BinOp2__op()->as_Mul();
}
lang::calc::Node::Expr::BinOp2::op::Div_T xform_lang_calc_Node(lang::calc::Node::Expr::BinOp2::op::Div_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node_T ret = xformT_lang_calc_Node(x, f);
return ret->as_Expr__BinOp2__op()->as_Div();
}
lang::calc::Node::Expr::BinOp3::op_T xform_lang_calc_Node(lang::calc::Node::Expr::BinOp3::op_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node_T ret = xformT_lang_calc_Node(x, f);
return ret->as_Expr__BinOp3__op();
}
lang::calc::Node::Expr::BinOp3::op::Pow_T xform_lang_calc_Node(lang::calc::Node::Expr::BinOp3::op::Pow_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node_T ret = xformT_lang_calc_Node(x, f);
return ret->as_Expr__BinOp3__op()->as_Pow();
}
lang::calc::Node::Stmt_T xform_lang_calc_Node(lang::calc::Node::Stmt_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node_T ret = xformT_lang_calc_Node(x, f);
return ret->as_Stmt();
}
lang::calc::Node::Stmt::Assign_T xform_lang_calc_Node(lang::calc::Node::Stmt::Assign_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node_T ret = xformT_lang_calc_Node(x, f);
return ret->as_Stmt()->as_Assign();
}
lang::calc::Node::Expr_T xform_lang_calc_Node(lang::calc::Node::Expr_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node_T ret = xformT_lang_calc_Node(x, f);
return ret->as_Expr();
}
lang::calc::Node::Expr::Id_T xform_lang_calc_Node(lang::calc::Node::Expr::Id_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node_T ret = xformT_lang_calc_Node(x, f);
return ret->as_Expr()->as_Id();
}
lang::calc::Node::Expr::UnaryPre_T xform_lang_calc_Node(lang::calc::Node::Expr::UnaryPre_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node_T ret = xformT_lang_calc_Node(x, f);
return ret->as_Expr()->as_UnaryPre();
}
lang::calc::Node::Expr::BinOp1_T xform_lang_calc_Node(lang::calc::Node::Expr::BinOp1_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node_T ret = xformT_lang_calc_Node(x, f);
return ret->as_Expr()->as_BinOp1();
}
lang::calc::Node::Expr::BinOp2_T xform_lang_calc_Node(lang::calc::Node::Expr::BinOp2_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node_T ret = xformT_lang_calc_Node(x, f);
return ret->as_Expr()->as_BinOp2();
}
lang::calc::Node::Expr::BinOp3_T xform_lang_calc_Node(lang::calc::Node::Expr::BinOp3_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node_T ret = xformT_lang_calc_Node(x, f);
return ret->as_Expr()->as_BinOp3();
}
lang::calc::Node::Expr::Paren_T xform_lang_calc_Node(lang::calc::Node::Expr::Paren_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node_T ret = xformT_lang_calc_Node(x, f);
return ret->as_Expr()->as_Paren();
}
lang::calc::Node::Expr::Lit_T xform_lang_calc_Node(lang::calc::Node::Expr::Lit_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node_T ret = xformT_lang_calc_Node(x, f);
return ret->as_Expr()->as_Lit();
}
lang::calc::Node::Expr::Lit::Int__T xform_lang_calc_Node(lang::calc::Node::Expr::Lit::Int__T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node_T ret = xformT_lang_calc_Node(x, f);
return ret->as_Expr()->as_Lit()->as_Int_();
}
lang::calc::Node::Stmt::Expr_T xform_lang_calc_Node(lang::calc::Node::Stmt::Expr_T x, function<lang::calc::Node_T(lang::calc::Node_T)> f) {
lang::calc::Node_T ret = xformT_lang_calc_Node(x, f);
return ret->as_Stmt()->as_Expr();
}
void lang::calc::Node::Stmt::Assign::_T::write(ostream& os, FmtFlags flags) {
auto x = this->rc_from_this_poly<lang::calc::Node::Stmt::Assign::_T>();
x->x_->write(os, flags);
pr(os, flags, "\040");
pr(os, flags, "=");
pr(os, flags, "\040");
x->y_->write(os, flags);
}
void lang::calc::Node::Stmt::Expr::_T::write(ostream& os, FmtFlags flags) {
auto x = this->rc_from_this_poly<lang::calc::Node::Stmt::Expr::_T>();
x->x_->write(os, flags);
}
void lang::calc::Node::Expr::Id::_T::write(ostream& os, FmtFlags flags) {
auto x = this->rc_from_this_poly<lang::calc::Node::Expr::Id::_T>();
pr(os, flags, x->name_);
}
void lang::calc::Node::Expr::Lit::Int_::_T::write(ostream& os, FmtFlags flags) {
auto x = this->rc_from_this_poly<lang::calc::Node::Expr::Lit::Int_::_T>();
pr(os, flags, x->val_);
}
void lang::calc::Node::Expr::UnaryPre::op::Neg::_T::write(ostream& os, FmtFlags flags) {
auto x = this->rc_from_this_poly<lang::calc::Node::Expr::UnaryPre::op::Neg::_T>();
pr(os, flags, "-");
}
void lang::calc::Node::Expr::UnaryPre::op::_T::write(ostream& os, FmtFlags flags) {
auto x = this->rc_from_this_poly<lang::calc::Node::Expr::UnaryPre::op::_T>();
switch (x->w_) {
case lang::calc::Node::Expr::UnaryPre::op::_W::Neg: {
x->as_Neg()->write(os, flags);
break;
}
default: {
AX();
}
}
}
void lang::calc::Node::Expr::UnaryPre::_T::write(ostream& os, FmtFlags flags) {
auto x = this->rc_from_this_poly<lang::calc::Node::Expr::UnaryPre::_T>();
x->op_->write(os, flags);
x->x_->write(os, flags);
}
void lang::calc::Node::Expr::BinOp1::op::Add::_T::write(ostream& os, FmtFlags flags) {
auto x = this->rc_from_this_poly<lang::calc::Node::Expr::BinOp1::op::Add::_T>();
pr(os, flags, "+");
}
void lang::calc::Node::Expr::BinOp1::op::Sub::_T::write(ostream& os, FmtFlags flags) {
auto x = this->rc_from_this_poly<lang::calc::Node::Expr::BinOp1::op::Sub::_T>();
pr(os, flags, "-");
}
void lang::calc::Node::Expr::BinOp1::op::_T::write(ostream& os, FmtFlags flags) {
auto x = this->rc_from_this_poly<lang::calc::Node::Expr::BinOp1::op::_T>();
switch (x->w_) {
case lang::calc::Node::Expr::BinOp1::op::_W::Add: {
x->as_Add()->write(os, flags);
break;
}
case lang::calc::Node::Expr::BinOp1::op::_W::Sub: {
x->as_Sub()->write(os, flags);
break;
}
default: {
AX();
}
}
}
void lang::calc::Node::Expr::BinOp1::_T::write(ostream& os, FmtFlags flags) {
auto x = this->rc_from_this_poly<lang::calc::Node::Expr::BinOp1::_T>();
x->x_->write(os, flags);
pr(os, flags, "\040");
x->op_->write(os, flags);
pr(os, flags, "\040");
x->y_->write(os, flags);
}
void lang::calc::Node::Expr::BinOp2::op::Mul::_T::write(ostream& os, FmtFlags flags) {
auto x = this->rc_from_this_poly<lang::calc::Node::Expr::BinOp2::op::Mul::_T>();
pr(os, flags, "*");
}
void lang::calc::Node::Expr::BinOp2::op::Div::_T::write(ostream& os, FmtFlags flags) {
auto x = this->rc_from_this_poly<lang::calc::Node::Expr::BinOp2::op::Div::_T>();
pr(os, flags, "/");
}
void lang::calc::Node::Expr::BinOp2::op::_T::write(ostream& os, FmtFlags flags) {
auto x = this->rc_from_this_poly<lang::calc::Node::Expr::BinOp2::op::_T>();
switch (x->w_) {
case lang::calc::Node::Expr::BinOp2::op::_W::Mul: {
x->as_Mul()->write(os, flags);
break;
}
case lang::calc::Node::Expr::BinOp2::op::_W::Div: {
x->as_Div()->write(os, flags);
break;
}
default: {
AX();
}
}
}
void lang::calc::Node::Expr::BinOp2::_T::write(ostream& os, FmtFlags flags) {
auto x = this->rc_from_this_poly<lang::calc::Node::Expr::BinOp2::_T>();
x->x_->write(os, flags);
pr(os, flags, "\040");
x->op_->write(os, flags);
pr(os, flags, "\040");
x->y_->write(os, flags);
}
void lang::calc::Node::Expr::BinOp3::op::Pow::_T::write(ostream& os, FmtFlags flags) {
auto x = this->rc_from_this_poly<lang::calc::Node::Expr::BinOp3::op::Pow::_T>();
pr(os, flags, "^");
}
void lang::calc::Node::Expr::BinOp3::op::_T::write(ostream& os, FmtFlags flags) {
auto x = this->rc_from_this_poly<lang::calc::Node::Expr::BinOp3::op::_T>();
switch (x->w_) {
case lang::calc::Node::Expr::BinOp3::op::_W::Pow: {
x->as_Pow()->write(os, flags);
break;
}
default: {
AX();
}
}
}
void lang::calc::Node::Expr::BinOp3::_T::write(ostream& os, FmtFlags flags) {
auto x = this->rc_from_this_poly<lang::calc::Node::Expr::BinOp3::_T>();
x->x_->write(os, flags);
x->op_->write(os, flags);
x->y_->write(os, flags);
}
void lang::calc::Node::Expr::Paren::_T::write(ostream& os, FmtFlags flags) {
auto x = this->rc_from_this_poly<lang::calc::Node::Expr::Paren::_T>();
pr(os, flags, "(");
x->x_->write(os, flags);
pr(os, flags, ")");
}
void lang::calc::Node::Stmt::_T::write(ostream& os, FmtFlags flags) {
auto x = this->rc_from_this_poly<lang::calc::Node::Stmt::_T>();
switch (x->w_) {
case lang::calc::Node::Stmt::_W::Assign: {
x->as_Assign()->write(os, flags);
break;
}
case lang::calc::Node::Stmt::_W::Expr: {
x->as_Expr()->write(os, flags);
break;
}
default: {
AX();
}
}
}
void lang::calc::Node::Expr::_T::write(ostream& os, FmtFlags flags) {
auto x = this->rc_from_this_poly<lang::calc::Node::Expr::_T>();
switch (x->w_) {
case lang::calc::Node::Expr::_W::Id: {
x->as_Id()->write(os, flags);
break;
}
case lang::calc::Node::Expr::_W::Lit: {
x->as_Lit()->write(os, flags);
break;
}
case lang::calc::Node::Expr::_W::UnaryPre: {
x->as_UnaryPre()->write(os, flags);
break;
}
case lang::calc::Node::Expr::_W::BinOp1: {
x->as_BinOp1()->write(os, flags);
break;
}
case lang::calc::Node::Expr::_W::BinOp2: {
x->as_BinOp2()->write(os, flags);
break;
}
case lang::calc::Node::Expr::_W::BinOp3: {
x->as_BinOp3()->write(os, flags);
break;
}
case lang::calc::Node::Expr::_W::Paren: {
x->as_Paren()->write(os, flags);
break;
}
default: {
AX();
}
}
}
void lang::calc::Node::Expr::Lit::_T::write(ostream& os, FmtFlags flags) {
auto x = this->rc_from_this_poly<lang::calc::Node::Expr::Lit::_T>();
switch (x->w_) {
case lang::calc::Node::Expr::Lit::_W::Int_: {
x->as_Int_()->write(os, flags);
break;
}
default: {
AX();
}
}
}
void lang::calc::Node::_T::write(ostream& os, FmtFlags flags) {
auto x = this->rc_from_this_poly<lang::calc::Node::_T>();
switch (x->w_) {
case lang::calc::Node::_W::Stmt: {
x->as_Stmt()->write(os, flags);
break;
}
case lang::calc::Node::_W::Expr: {
x->as_Expr()->write(os, flags);
break;
}
case lang::calc::Node::_W::Expr__UnaryPre__op: {
x->as_Expr__UnaryPre__op()->write(os, flags);
break;
}
case lang::calc::Node::_W::Expr__BinOp1__op: {
x->as_Expr__BinOp1__op()->write(os, flags);
break;
}
case lang::calc::Node::_W::Expr__BinOp2__op: {
x->as_Expr__BinOp2__op()->write(os, flags);
break;
}
case lang::calc::Node::_W::Expr__BinOp3__op: {
x->as_Expr__BinOp3__op()->write(os, flags);
break;
}
default: {
AX();
}
}
}
__attribute__((always_inline)) IntPair lang::calc::parser::action_by_vertex(lang_rt::ParserVertexId v, lang_rt::ParserLookahead la) {
static const u16_array tt_acc_raw = {0x0304, 0x0404, 0x0401, 0x0401, 0x0103, 0x0104, 0x0303, 0x0103, 0x0401, 0x0404, 0x0404, 0x0403, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0401, 0x0104, 0x0401, 0x0401, 0x0101, 0x0304, 0x0103, 0x0303, 0x0403, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0202, 0x0204, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0204, 0x0102, 0x0201, 0x0204, 0x0202, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0204, 0x0402, 0x0402, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0202, 0x0101, 0x0402, 0x0202, 0x0102, 0x0101, 0x0101, 0x0101, 0x0101, 0x0401, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0104, 0x0401, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0401, 0x0404, 0x0401, 0x0401, 0x0101, 0x0304, 0x0103, 0x0303, 0x0403, 0x0204, 0x0402, 0x0402, 0x0404, 0x0404, 0x0404, 0x0404, 0x0101, 0x0202, 0x0101, 0x0402, 0x0202, 0x0102, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0404, 0x0104, 0x0104, 0x0104, 0x0401, 0x0303, 0x0301, 0x0303, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0104, 0x0401, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0401, 0x0404, 0x0404, 0x0401, 0x0101, 0x0304, 0x0103, 0x0404, 0x0403, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0101, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0104, 0x0404, 0x0404, 0x0104, 0x0104, 0x0401, 0x0303, 0x0401, 0x0304, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0104, 0x0401, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0401, 0x0404, 0x0104, 0x0404, 0x0403, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0401, 0x0404, 0x0404, 0x0304, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0202, 0x0204, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0204, 0x0102, 0x0201, 0x0204, 0x0202, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0304, 0x0303, 0x0101, 0x0404, 0x0404, 0x0304, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0104, 0x0404, 0x0104, 0x0104, 0x0104, 0x0401, 0x0303, 0x0301, 0x0303, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404, 0x0404};
static const u16_array tt_arg = {0x0000, 0x0001, 0x0000, 0x0000, 0x0009, 0x0000, 0x000a, 0x0000, 0x000e, 0x0001, 0x0000, 0x0001, 0x000f, 0x000f, 0x000f, 0x0002, 0x0003, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, 0x0000, 0x0000, 0x0000, 0x0005, 0x0000, 0x0006, 0x0000, 0x0007, 0x0007, 0x0000, 0x000f, 0x000f, 0x0008, 0x000f, 0x000f, 0x000f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000e, 0x000f, 0x0000, 0x000f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000f, 0x000f, 0x000b, 0x000c, 0x000f, 0x0000, 0x000f, 0x000f, 0x000f, 0x000d, 0x000e, 0x0011, 0x0012, 0x0015, 0x000f, 0x0010, 0x0013, 0x0014, 0x0016, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000e, 0x000f, 0x0000, 0x000f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000f, 0x000f, 0x000b, 0x000c, 0x000f, 0x0000, 0x000f, 0x000f, 0x000f, 0x000d, 0x000e, 0x0011, 0x0012, 0x0015, 0x000f, 0x0010, 0x0013, 0x0014, 0x0016, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0003, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, 0x0000, 0x0000, 0x0000, 0x0005, 0x0000, 0x0006, 0x0000, 0x0007, 0x0007, 0x0000, 0x000f, 0x000f, 0x0008, 0x000f, 0x000f, 0x000f, 0x0000, 0x0000, 0x000e, 0x000f, 0x0000, 0x000f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0003, 0x000f, 0x000f, 0x000b, 0x000c, 0x000f, 0x0000, 0x000f, 0x000f, 0x000f, 0x000d, 0x000e, 0x0011, 0x0012, 0x0015, 0x000f, 0x0010, 0x0013, 0x0014, 0x0016, 0x0004, 0x0000, 0x0000, 0x0000, 0x0005, 0x0000, 0x0006, 0x0000, 0x0007, 0x0007, 0x0000, 0x000f, 0x000f, 0x0008, 0x000f, 0x000f, 0x000f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0003, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0006, 0x0000, 0x0007, 0x0007, 0x0000, 0x000f, 0x000f, 0x0008, 0x0000, 0x0000, 0x000f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0003, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0006, 0x0000, 0x0007, 0x0007, 0x0000, 0x000f, 0x000f, 0x0008, 0x0000, 0x0000, 0x000f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0003, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0007, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0000, 0x0000, 0x000f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000e, 0x000f, 0x0000, 0x000f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000f, 0x000f, 0x000b, 0x000c, 0x000f, 0x0000, 0x000f, 0x000f, 0x000f, 0x000d, 0x000e, 0x0011, 0x0012, 0x0015, 0x000f, 0x0010, 0x0013, 0x0014, 0x0016, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000f, 0x000f, 0x000f, 0x0002, 0x0003, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, 0x0000, 0x0000, 0x0000, 0x0005, 0x0000, 0x0006, 0x0000, 0x0007, 0x0007, 0x0000, 0x000f, 0x000f, 0x0008, 0x000f, 0x000f, 0x000f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000};
auto tt_acc = lang_rt::table_u16_array_as_u8_array(tt_acc_raw);
Int ind = la.v_[0] * 53 + v;
Int ret_acc = tt_acc[ind];
Int ret_arg = tt_arg[ind];
return make_pair(ret_acc, ret_arg);
}
__attribute__((always_inline)) lang_rt::ParserVertexId lang::calc::parser::vertex_dfa_step(lang_rt::ParserVertexId v, lang_rt::ParserSymId sym, lang_rt::ParserAttrMask attr) {
static const u16_array tt = {0x0002, 0x0000, 0x0035, 0x006a, 0x0000, 0x007c, 0x0000, 0x0082, 0x0000, 0x0090, 0x0000, 0x009e, 0x0000, 0x00a4, 0x0000, 0x00c2, 0x0000, 0x00c8, 0x0000, 0x0102, 0x0000, 0x0108, 0x0000, 0x0112, 0x0000, 0x0158, 0x0000, 0x015e, 0x0000, 0x0198, 0x0000, 0x01c6, 0x0000, 0x01e0, 0x0000, 0x01e6, 0x0000, 0x01ec, 0x0000, 0x01fa, 0x0000, 0x0208, 0x0000, 0x020e, 0x0000, 0x0214, 0x0000, 0x0222, 0x0000, 0x025c, 0x0000, 0x026a, 0x0000, 0x0278, 0x0000, 0x0292, 0x0000, 0x0298, 0x0000, 0x029e, 0x0000, 0x02a4, 0x0000, 0x02aa, 0x0000, 0x02b0, 0x0000, 0x02b6, 0x0000, 0x02bc, 0x0000, 0x02c2, 0x0000, 0x02c8, 0x0000, 0x02ce, 0x0000, 0x02d4, 0x0000, 0x0306, 0x0000, 0x0310, 0x0000, 0x0316, 0x0000, 0x031c, 0x0000, 0x0352, 0x0000, 0x0358, 0x0000, 0x038a, 0x0000, 0x0390, 0x0000, 0x0396, 0x0000, 0x03c4, 0x0000, 0x03d6, 0x0000, 0x03dc, 0x0000, 0x03e2, 0x0000, 0x0408, 0x0000, 0x0422, 0x0000, 0x0001, 0x0001, 0x0003, 0x0001, 0x000c, 0x000d, 0x0007, 0x0009, 0x000b, 0x000d, 0x0000, 0x0001, 0x0000, 0x0002, 0x0000, 0x0003, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0002, 0x000e, 0x001a, 0x0005, 0x0007, 0x0009, 0x0000, 0x0004, 0x0000, 0x0005, 0x0000, 0xffff, 0x0001, 0x0001, 0x0002, 0x000f, 0x001b, 0x0005, 0x0007, 0x0009, 0x0000, 0x0006, 0x0000, 0x0007, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0003, 0x000e, 0x000f, 0x001b, 0x0007, 0x0009, 0x0017, 0x0019, 0x0000, 0x0008, 0x0001, 0x0002, 0x0002, 0x0001, 0x0000, 0x0005, 0x0007, 0x0009, 0x0000, 0x0009, 0x0000, 0x000b, 0x0000, 0xffff, 0x0000, 0x000a, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0007, 0x000f, 0x0002, 0x0003, 0x0010, 0x000a, 0x0011, 0x0005, 0x000f, 0x0029, 0x002b, 0x002d, 0x002f, 0x0031, 0x0033, 0x0035, 0x0001, 0x0004, 0x0005, 0x0004, 0x0000, 0x0001, 0x0003, 0x0002, 0x000b, 0x000d, 0x000f, 0x0011, 0x0013, 0x0015, 0x0000, 0x000c, 0x0000, 0x000e, 0x0000, 0x000d, 0x0000, 0x000c, 0x0000, 0x000d, 0x0000, 0xffff, 0x0000, 0x000f, 0x0000, 0x0010, 0x0000, 0x0011, 0x0000, 0x0012, 0x0000, 0x0013, 0x0000, 0x0014, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0001, 0x0009, 0x0003, 0x0005, 0x0000, 0x0015, 0x0000, 0xffff, 0x0001, 0x0001, 0x0007, 0x000f, 0x0002, 0x0003, 0x0010, 0x000a, 0x0011, 0x0005, 0x000f, 0x0035, 0x0037, 0x0039, 0x003b, 0x003d, 0x003f, 0x0041, 0x0001, 0x0004, 0x0005, 0x0004, 0x0000, 0x0001, 0x0003, 0x0002, 0x000b, 0x0019, 0x001b, 0x001d, 0x001f, 0x0021, 0x0001, 0x0002, 0x0002, 0x0001, 0x0000, 0x0005, 0x0007, 0x0009, 0x0000, 0x0016, 0x0000, 0x000c, 0x0000, 0xffff, 0x0000, 0x000e, 0x0000, 0x000d, 0x0000, 0x000c, 0x0000, 0x000d, 0x0000, 0xffff, 0x0000, 0x000f, 0x0000, 0x0010, 0x0000, 0x0011, 0x0000, 0x0012, 0x0000, 0x0013, 0x0000, 0x0014, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x000d, 0x0012, 0x0015, 0x0018, 0x0013, 0x0014, 0x0016, 0x0017, 0x0019, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x001b, 0x001d, 0x001f, 0x0021, 0x0023, 0x0025, 0x0027, 0x0029, 0x002b, 0x002d, 0x002f, 0x0031, 0x0033, 0x0035, 0x0000, 0x0017, 0x0000, 0x0018, 0x0000, 0x0019, 0x0000, 0x001a, 0x0000, 0x001b, 0x0000, 0x001c, 0x0000, 0x001d, 0x0000, 0x001e, 0x0000, 0x001f, 0x0000, 0x0020, 0x0000, 0x0021, 0x0000, 0x0022, 0x0000, 0x0023, 0x0000, 0xffff, 0x0001, 0x0001, 0x000a, 0x0012, 0x0015, 0x0013, 0x0014, 0x0016, 0x0017, 0x0004, 0x0005, 0x0006, 0x0007, 0x0015, 0x0017, 0x0019, 0x001b, 0x001d, 0x001f, 0x0021, 0x0023, 0x0025, 0x0027, 0x0029, 0x0000, 0x0017, 0x0000, 0x0018, 0x0000, 0x001a, 0x0000, 0x001b, 0x0000, 0x001c, 0x0000, 0x001d, 0x0000, 0x001f, 0x0000, 0x0020, 0x0000, 0x0021, 0x0000, 0x0022, 0x0000, 0xffff, 0x0001, 0x0001, 0x0005, 0x0012, 0x0013, 0x0014, 0x0004, 0x0005, 0x000b, 0x000d, 0x000f, 0x0011, 0x0013, 0x0015, 0x0000, 0x0017, 0x0000, 0x001a, 0x0000, 0x001b, 0x0000, 0x001f, 0x0000, 0x0020, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0002, 0x000f, 0x001b, 0x0005, 0x0007, 0x0009, 0x0000, 0x0024, 0x0000, 0x0025, 0x0000, 0xffff, 0x0001, 0x0001, 0x0002, 0x000f, 0x001b, 0x0005, 0x0007, 0x0009, 0x0000, 0x0026, 0x0000, 0x0007, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0002, 0x000f, 0x001b, 0x0005, 0x0007, 0x0009, 0x0000, 0x0027, 0x0000, 0x0007, 0x0000, 0xffff, 0x0001, 0x0001, 0x000d, 0x0012, 0x0015, 0x0018, 0x0013, 0x0014, 0x0016, 0x0017, 0x0019, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x001b, 0x001d, 0x001f, 0x0021, 0x0023, 0x0025, 0x0027, 0x0029, 0x002b, 0x002d, 0x002f, 0x0031, 0x0033, 0x0035, 0x0000, 0x0017, 0x0000, 0x0018, 0x0000, 0x0019, 0x0000, 0x001a, 0x0000, 0x001b, 0x0000, 0x001c, 0x0000, 0x001d, 0x0000, 0x001e, 0x0000, 0x001f, 0x0000, 0x0020, 0x0000, 0x0021, 0x0000, 0x0022, 0x0000, 0x0023, 0x0000, 0xffff, 0x0001, 0x0001, 0x0002, 0x000f, 0x001b, 0x0005, 0x0007, 0x0009, 0x0000, 0x0028, 0x0000, 0x0029, 0x0000, 0xffff, 0x0001, 0x0001, 0x0002, 0x000f, 0x001b, 0x0005, 0x0007, 0x0009, 0x0000, 0x002a, 0x0000, 0x002b, 0x0000, 0xffff, 0x0001, 0x0001, 0x0002, 0x000f, 0x001b, 0x0005, 0x0013, 0x0015, 0x0001, 0x0004, 0x0002, 0x0004, 0x0002, 0x0005, 0x0007, 0x0009, 0x0000, 0x002c, 0x0000, 0x002d, 0x0000, 0xffff, 0x0000, 0x002e, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0007, 0x000f, 0x0002, 0x0003, 0x0010, 0x000a, 0x0011, 0x0005, 0x000f, 0x0021, 0x0023, 0x0025, 0x0027, 0x0029, 0x002b, 0x002d, 0x0001, 0x0004, 0x0003, 0x0004, 0x0003, 0x0002, 0x0007, 0x0009, 0x000b, 0x000d, 0x0000, 0x002f, 0x0000, 0x002f, 0x0000, 0x0030, 0x0000, 0xffff, 0x0000, 0x000f, 0x0000, 0x0010, 0x0000, 0x0011, 0x0000, 0x0012, 0x0000, 0x0013, 0x0000, 0x0014, 0x0000, 0xffff, 0x0001, 0x0001, 0x0001, 0x000b, 0x0003, 0x0005, 0x0000, 0x0031, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0007, 0x000f, 0x0002, 0x0003, 0x0010, 0x000a, 0x0011, 0x0005, 0x000f, 0x0025, 0x0027, 0x0029, 0x002b, 0x002d, 0x002f, 0x0031, 0x0001, 0x0004, 0x0004, 0x0004, 0x0001, 0x0003, 0x0002, 0x0009, 0x000b, 0x000d, 0x000f, 0x0011, 0x0000, 0x0032, 0x0000, 0x0033, 0x0000, 0x0032, 0x0000, 0x0033, 0x0000, 0xffff, 0x0000, 0x000f, 0x0000, 0x0010, 0x0000, 0x0011, 0x0000, 0x0012, 0x0000, 0x0013, 0x0000, 0x0014, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0007, 0x000f, 0x0002, 0x0003, 0x0010, 0x000a, 0x0011, 0x0005, 0x000f, 0x0021, 0x0023, 0x0025, 0x0027, 0x0029, 0x002b, 0x002d, 0x0001, 0x0004, 0x0003, 0x0004, 0x0003, 0x0002, 0x0007, 0x0009, 0x000b, 0x000d, 0x0000, 0x002f, 0x0000, 0x002f, 0x0000, 0x0030, 0x0000, 0xffff, 0x0000, 0x000f, 0x0000, 0x0010, 0x0000, 0x0011, 0x0000, 0x0012, 0x0000, 0x0013, 0x0000, 0x0014, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0007, 0x000f, 0x0002, 0x0003, 0x0010, 0x000a, 0x0011, 0x0005, 0x000f, 0x001d, 0x001f, 0x0021, 0x0023, 0x0025, 0x0027, 0x0029, 0x0001, 0x0004, 0x0002, 0x0004, 0x0002, 0x0005, 0x0007, 0x0009, 0x0000, 0x0034, 0x0000, 0x0030, 0x0000, 0xffff, 0x0000, 0x000f, 0x0000, 0x0010, 0x0000, 0x0011, 0x0000, 0x0012, 0x0000, 0x0013, 0x0000, 0x0014, 0x0000, 0xffff, 0x0001, 0x0001, 0x0003, 0x0018, 0x0019, 0x0008, 0x0007, 0x0009, 0x000b, 0x000d, 0x0000, 0x0019, 0x0000, 0x001e, 0x0000, 0x0023, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff, 0x0001, 0x0001, 0x0008, 0x0015, 0x0018, 0x0016, 0x0017, 0x0019, 0x0006, 0x0007, 0x0008, 0x0011, 0x0013, 0x0015, 0x0017, 0x0019, 0x001b, 0x001d, 0x001f, 0x0021, 0x0000, 0x0018, 0x0000, 0x0019, 0x0000, 0x001c, 0x0000, 0x001d, 0x0000, 0x001e, 0x0000, 0x0021, 0x0000, 0x0022, 0x0000, 0x0023, 0x0000, 0xffff, 0x0001, 0x0001, 0x0005, 0x0015, 0x0016, 0x0017, 0x0006, 0x0007, 0x000b, 0x000d, 0x000f, 0x0011, 0x0013, 0x0015, 0x0000, 0x0018, 0x0000, 0x001c, 0x0000, 0x001d, 0x0000, 0x0021, 0x0000, 0x0022, 0x0000, 0xffff, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0xffff};
return lang_rt::table_decode_r2_vec<i16, u16>(tt, v, sym, attr);
}
namespace lang::calc::parser {
__attribute__((noinline)) lang_rt::SymItem _parse_proc_0_0_0(lang_rt::ParserProcStatePtr st) {
Int ss_len = st->Ss_len_;
Int sr_len = st->Sr_len_;
Int sb_len = st->Sb_len_;
Int sv_len = st->Sv_len_;
sv_len = sv_len - 3;
Int start_pos = st->Sv_addr_[sv_len - 1].pos_;
auto sym0 = st->Ss_addr_[ss_len - 1];
auto sym1 = st->Ss_addr_[ss_len - 2];
auto sym2 = st->Ss_addr_[ss_len - 3];
ss_len = ss_len - 3;
auto res0 = st->Sr_addr_[sr_len - 1];
auto res1 = st->Sr_addr_[sr_len - 2];
auto res2 = st->Sr_addr_[sr_len - 3];
sr_len = sr_len - 3;
auto x = reinterpret_cast<ptr<lang::calc::Node::Expr::_T>>(res2.v_)->rc_from_this_poly<lang::calc::Node::Expr::_T>();
x.decref();
auto x1 = reinterpret_cast<ptr<lang::calc::Node::Expr::_T>>(res0.v_)->rc_from_this_poly<lang::calc::Node::Expr::_T>();
x1.decref();
auto ret = lang::calc::Node::Stmt::Assign::make_ext(st->unw_arena_, st->gen()->gen(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_), false, -1, lang_rt::ParserAttrMask(), lang_rt::ParserLookahead(), x, x1);
ret.incref();
auto res_item = lang_rt::Result_T(ret.get(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_));
st->Sr_addr_[sr_len] = res_item;
++sr_len;
lang_rt::SymItem ret_sym = {14, start_pos};
st->Ss_len_ = ss_len;
st->Sr_len_ = sr_len;
st->Sb_len_ = sb_len;
st->Sv_len_ = sv_len;
return ret_sym;
}
}
namespace lang::calc::parser {
__attribute__((noinline)) lang_rt::SymItem _parse_proc_1_0_0(lang_rt::ParserProcStatePtr st) {
Int ss_len = st->Ss_len_;
Int sr_len = st->Sr_len_;
Int sb_len = st->Sb_len_;
Int sv_len = st->Sv_len_;
sv_len = sv_len - 1;
Int start_pos = st->Sv_addr_[sv_len - 1].pos_;
auto sym0 = st->Ss_addr_[ss_len - 1];
ss_len = ss_len - 1;
auto res0 = st->Sr_addr_[sr_len - 1];
sr_len = sr_len - 1;
auto x = reinterpret_cast<ptr<lang::calc::Node::Expr::_T>>(res0.v_)->rc_from_this_poly<lang::calc::Node::Expr::_T>();
x.decref();
auto ret = lang::calc::Node::Stmt::Expr::make_ext(st->unw_arena_, st->gen()->gen(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_), false, -1, lang_rt::ParserAttrMask(), lang_rt::ParserLookahead(), x);
ret.incref();
auto res_item = lang_rt::Result_T(ret.get(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_));
st->Sr_addr_[sr_len] = res_item;
++sr_len;
lang_rt::SymItem ret_sym = {14, start_pos};
st->Ss_len_ = ss_len;
st->Sr_len_ = sr_len;
st->Sb_len_ = sb_len;
st->Sv_len_ = sv_len;
return ret_sym;
}
}
namespace lang::calc::parser {
__attribute__((noinline)) lang_rt::SymItem _parse_proc_2_0_0(lang_rt::ParserProcStatePtr st) {
Int ss_len = st->Ss_len_;
Int sr_len = st->Sr_len_;
Int sb_len = st->Sb_len_;
Int sv_len = st->Sv_len_;
sv_len = sv_len - 1;
Int start_pos = st->Sv_addr_[sv_len - 1].pos_;
auto sym0 = st->Ss_addr_[ss_len - 1];
ss_len = ss_len - 1;
auto res0 = st->Sr_addr_[sr_len - 1];
sr_len = sr_len - 1;
auto x_site = lang_rt::result_decode_token_bounds(res0);
auto x = st->fetch_token(x_site.lo_);
auto ret = lang::calc::Node::Expr::Id::make_ext(st->unw_arena_, st->gen()->gen(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_), false, -1, lang_rt::ParserAttrMask(), lang_rt::ParserLookahead(), x);
ret.incref();
auto res_item = lang_rt::Result_T(ret.get(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_));
st->Sr_addr_[sr_len] = res_item;
++sr_len;
lang_rt::SymItem ret_sym = {15, start_pos};
ret_sym.attr_.v_[0] = 1;
ret_sym.attr_.v_[1] = 4;
ret_sym.attr_.v_[1] = min<Int>(ret_sym.attr_.v_[1], 4);
ret_sym.attr_.v_[2] = 4;
ret_sym.attr_.v_[2] = min<Int>(ret_sym.attr_.v_[2], 4);
st->Ss_len_ = ss_len;
st->Sr_len_ = sr_len;
st->Sb_len_ = sb_len;
st->Sv_len_ = sv_len;
return ret_sym;
}
}
namespace lang::calc::parser {
__attribute__((noinline)) lang_rt::SymItem _parse_proc_3_0_0(lang_rt::ParserProcStatePtr st) {
Int ss_len = st->Ss_len_;
Int sr_len = st->Sr_len_;
Int sb_len = st->Sb_len_;
Int sv_len = st->Sv_len_;
sv_len = sv_len - 1;
Int start_pos = st->Sv_addr_[sv_len - 1].pos_;
auto sym0 = st->Ss_addr_[ss_len - 1];
ss_len = ss_len - 1;
auto res0 = st->Sr_addr_[sr_len - 1];
sr_len = sr_len - 1;
auto x_site = lang_rt::result_decode_token_bounds(res0);
auto x = st->fetch_token(x_site.lo_);
auto ret = lang::calc::Node::Expr::Lit::Int_::make_ext(st->unw_arena_, st->gen()->gen(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_), false, -1, lang_rt::ParserAttrMask(), lang_rt::ParserLookahead(), x);
ret.incref();
auto res_item = lang_rt::Result_T(ret.get(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_));
st->Sr_addr_[sr_len] = res_item;
++sr_len;
lang_rt::SymItem ret_sym = {15, start_pos};
ret_sym.attr_.v_[0] = 1;
ret_sym.attr_.v_[0] = min<Int>(ret_sym.attr_.v_[0], 0);
ret_sym.attr_.v_[1] = 4;
ret_sym.attr_.v_[1] = min<Int>(ret_sym.attr_.v_[1], 4);
ret_sym.attr_.v_[2] = 4;
ret_sym.attr_.v_[2] = min<Int>(ret_sym.attr_.v_[2], 4);
st->Ss_len_ = ss_len;
st->Sr_len_ = sr_len;
st->Sb_len_ = sb_len;
st->Sv_len_ = sv_len;
return ret_sym;
}
}
namespace lang::calc::parser {
__attribute__((noinline)) lang_rt::SymItem _parse_proc_4_2_0(lang_rt::ParserProcStatePtr st) {
Int ss_len = st->Ss_len_;
Int sr_len = st->Sr_len_;
Int sb_len = st->Sb_len_;
Int sv_len = st->Sv_len_;
sv_len = sv_len - 2;
Int start_pos = st->Sv_addr_[sv_len - 1].pos_;
auto sym0 = st->Ss_addr_[ss_len - 1];
auto sym1 = st->Ss_addr_[ss_len - 2];
ss_len = ss_len - 2;
auto res0 = st->Sr_addr_[sr_len - 1];
auto res1 = st->Sr_addr_[sr_len - 2];
sr_len = sr_len - 2;
auto x = reinterpret_cast<ptr<lang::calc::Node::Expr::UnaryPre::op::_T>>(res1.v_)->rc_from_this_poly<lang::calc::Node::Expr::UnaryPre::op::_T>();
x.decref();
auto x1 = reinterpret_cast<ptr<lang::calc::Node::Expr::_T>>(res0.v_)->rc_from_this_poly<lang::calc::Node::Expr::_T>();
x1.decref();
auto ret = lang::calc::Node::Expr::UnaryPre::make_ext(st->unw_arena_, st->gen()->gen(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_), false, -1, lang_rt::ParserAttrMask(), lang_rt::ParserLookahead(), x, x1);
ret.incref();
auto res_item = lang_rt::Result_T(ret.get(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_));
st->Sr_addr_[sr_len] = res_item;
++sr_len;
lang_rt::SymItem ret_sym = {15, start_pos};
ret_sym.attr_.v_[0] = 1;
ret_sym.attr_.v_[0] = min<Int>(ret_sym.attr_.v_[0], 0);
ret_sym.attr_.v_[1] = 4;
ret_sym.attr_.v_[2] = 4;
ret_sym.attr_.v_[2] = min<Int>(ret_sym.attr_.v_[2], 2);
ret_sym.attr_.v_[2] = min<Int>(ret_sym.attr_.v_[2], sym0.attr_.v_[2]);
st->Ss_len_ = ss_len;
st->Sr_len_ = sr_len;
st->Sb_len_ = sb_len;
st->Sv_len_ = sv_len;
return ret_sym;
}
}
namespace lang::calc::parser {
__attribute__((noinline)) lang_rt::SymItem _parse_proc_5_4_0(lang_rt::ParserProcStatePtr st) {
Int ss_len = st->Ss_len_;
Int sr_len = st->Sr_len_;
Int sb_len = st->Sb_len_;
Int sv_len = st->Sv_len_;
sv_len = sv_len - 3;
Int start_pos = st->Sv_addr_[sv_len - 1].pos_;
auto sym0 = st->Ss_addr_[ss_len - 1];
auto sym1 = st->Ss_addr_[ss_len - 2];
auto sym2 = st->Ss_addr_[ss_len - 3];
ss_len = ss_len - 3;
auto res0 = st->Sr_addr_[sr_len - 1];
auto res1 = st->Sr_addr_[sr_len - 2];
auto res2 = st->Sr_addr_[sr_len - 3];
sr_len = sr_len - 3;
auto x = reinterpret_cast<ptr<lang::calc::Node::Expr::_T>>(res2.v_)->rc_from_this_poly<lang::calc::Node::Expr::_T>();
x.decref();
auto x1 = reinterpret_cast<ptr<lang::calc::Node::Expr::BinOp1::op::_T>>(res1.v_)->rc_from_this_poly<lang::calc::Node::Expr::BinOp1::op::_T>();
x1.decref();
auto x2 = reinterpret_cast<ptr<lang::calc::Node::Expr::_T>>(res0.v_)->rc_from_this_poly<lang::calc::Node::Expr::_T>();
x2.decref();
auto ret = lang::calc::Node::Expr::BinOp1::make_ext(st->unw_arena_, st->gen()->gen(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_), false, -1, lang_rt::ParserAttrMask(), lang_rt::ParserLookahead(), x, x1, x2);
ret.incref();
auto res_item = lang_rt::Result_T(ret.get(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_));
st->Sr_addr_[sr_len] = res_item;
++sr_len;
lang_rt::SymItem ret_sym = {15, start_pos};
ret_sym.attr_.v_[0] = 1;
ret_sym.attr_.v_[0] = min<Int>(ret_sym.attr_.v_[0], 0);
ret_sym.attr_.v_[1] = 4;
ret_sym.attr_.v_[1] = min<Int>(ret_sym.attr_.v_[1], 0);
ret_sym.attr_.v_[1] = min<Int>(ret_sym.attr_.v_[1], sym2.attr_.v_[1]);
ret_sym.attr_.v_[2] = 4;
ret_sym.attr_.v_[2] = min<Int>(ret_sym.attr_.v_[2], 0);
ret_sym.attr_.v_[2] = min<Int>(ret_sym.attr_.v_[2], sym0.attr_.v_[2]);
st->Ss_len_ = ss_len;
st->Sr_len_ = sr_len;
st->Sb_len_ = sb_len;
st->Sv_len_ = sv_len;
return ret_sym;
}
}
namespace lang::calc::parser {
__attribute__((noinline)) lang_rt::SymItem _parse_proc_6_4_0(lang_rt::ParserProcStatePtr st) {
Int ss_len = st->Ss_len_;
Int sr_len = st->Sr_len_;
Int sb_len = st->Sb_len_;
Int sv_len = st->Sv_len_;
sv_len = sv_len - 3;
Int start_pos = st->Sv_addr_[sv_len - 1].pos_;
auto sym0 = st->Ss_addr_[ss_len - 1];
auto sym1 = st->Ss_addr_[ss_len - 2];
auto sym2 = st->Ss_addr_[ss_len - 3];
ss_len = ss_len - 3;
auto res0 = st->Sr_addr_[sr_len - 1];
auto res1 = st->Sr_addr_[sr_len - 2];
auto res2 = st->Sr_addr_[sr_len - 3];
sr_len = sr_len - 3;
auto x = reinterpret_cast<ptr<lang::calc::Node::Expr::_T>>(res2.v_)->rc_from_this_poly<lang::calc::Node::Expr::_T>();
x.decref();
auto x1 = reinterpret_cast<ptr<lang::calc::Node::Expr::BinOp2::op::_T>>(res1.v_)->rc_from_this_poly<lang::calc::Node::Expr::BinOp2::op::_T>();
x1.decref();
auto x2 = reinterpret_cast<ptr<lang::calc::Node::Expr::_T>>(res0.v_)->rc_from_this_poly<lang::calc::Node::Expr::_T>();
x2.decref();
auto ret = lang::calc::Node::Expr::BinOp2::make_ext(st->unw_arena_, st->gen()->gen(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_), false, -1, lang_rt::ParserAttrMask(), lang_rt::ParserLookahead(), x, x1, x2);
ret.incref();
auto res_item = lang_rt::Result_T(ret.get(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_));
st->Sr_addr_[sr_len] = res_item;
++sr_len;
lang_rt::SymItem ret_sym = {15, start_pos};
ret_sym.attr_.v_[0] = 1;
ret_sym.attr_.v_[0] = min<Int>(ret_sym.attr_.v_[0], 0);
ret_sym.attr_.v_[1] = 4;
ret_sym.attr_.v_[1] = min<Int>(ret_sym.attr_.v_[1], 1);
ret_sym.attr_.v_[1] = min<Int>(ret_sym.attr_.v_[1], sym2.attr_.v_[1]);
ret_sym.attr_.v_[2] = 4;
ret_sym.attr_.v_[2] = min<Int>(ret_sym.attr_.v_[2], 1);
ret_sym.attr_.v_[2] = min<Int>(ret_sym.attr_.v_[2], sym0.attr_.v_[2]);
st->Ss_len_ = ss_len;
st->Sr_len_ = sr_len;
st->Sb_len_ = sb_len;
st->Sv_len_ = sv_len;
return ret_sym;
}
}
namespace lang::calc::parser {
__attribute__((noinline)) lang_rt::SymItem _parse_proc_7_2_0(lang_rt::ParserProcStatePtr st) {
Int ss_len = st->Ss_len_;
Int sr_len = st->Sr_len_;
Int sb_len = st->Sb_len_;
Int sv_len = st->Sv_len_;
sv_len = sv_len - 3;
Int start_pos = st->Sv_addr_[sv_len - 1].pos_;
auto sym0 = st->Ss_addr_[ss_len - 1];
auto sym1 = st->Ss_addr_[ss_len - 2];
auto sym2 = st->Ss_addr_[ss_len - 3];
ss_len = ss_len - 3;
auto res0 = st->Sr_addr_[sr_len - 1];
auto res1 = st->Sr_addr_[sr_len - 2];
auto res2 = st->Sr_addr_[sr_len - 3];
sr_len = sr_len - 3;
auto x = reinterpret_cast<ptr<lang::calc::Node::Expr::_T>>(res2.v_)->rc_from_this_poly<lang::calc::Node::Expr::_T>();
x.decref();
auto x1 = reinterpret_cast<ptr<lang::calc::Node::Expr::BinOp3::op::_T>>(res1.v_)->rc_from_this_poly<lang::calc::Node::Expr::BinOp3::op::_T>();
x1.decref();
auto x2 = reinterpret_cast<ptr<lang::calc::Node::Expr::_T>>(res0.v_)->rc_from_this_poly<lang::calc::Node::Expr::_T>();
x2.decref();
auto ret = lang::calc::Node::Expr::BinOp3::make_ext(st->unw_arena_, st->gen()->gen(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_), false, -1, lang_rt::ParserAttrMask(), lang_rt::ParserLookahead(), x, x1, x2);
ret.incref();
auto res_item = lang_rt::Result_T(ret.get(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_));
st->Sr_addr_[sr_len] = res_item;
++sr_len;
lang_rt::SymItem ret_sym = {15, start_pos};
ret_sym.attr_.v_[0] = 1;
ret_sym.attr_.v_[0] = min<Int>(ret_sym.attr_.v_[0], 0);
ret_sym.attr_.v_[1] = 4;
ret_sym.attr_.v_[1] = min<Int>(ret_sym.attr_.v_[1], 3);
ret_sym.attr_.v_[1] = min<Int>(ret_sym.attr_.v_[1], sym2.attr_.v_[1]);
ret_sym.attr_.v_[2] = 4;
ret_sym.attr_.v_[2] = min<Int>(ret_sym.attr_.v_[2], 3);
ret_sym.attr_.v_[2] = min<Int>(ret_sym.attr_.v_[2], sym0.attr_.v_[2]);
st->Ss_len_ = ss_len;
st->Sr_len_ = sr_len;
st->Sb_len_ = sb_len;
st->Sv_len_ = sv_len;
return ret_sym;
}
}
namespace lang::calc::parser {
__attribute__((noinline)) lang_rt::SymItem _parse_proc_8_0_0(lang_rt::ParserProcStatePtr st) {
Int ss_len = st->Ss_len_;
Int sr_len = st->Sr_len_;
Int sb_len = st->Sb_len_;
Int sv_len = st->Sv_len_;
sv_len = sv_len - 3;
Int start_pos = st->Sv_addr_[sv_len - 1].pos_;
auto sym0 = st->Ss_addr_[ss_len - 1];
auto sym1 = st->Ss_addr_[ss_len - 2];
auto sym2 = st->Ss_addr_[ss_len - 3];
ss_len = ss_len - 3;
auto res0 = st->Sr_addr_[sr_len - 1];
auto res1 = st->Sr_addr_[sr_len - 2];
auto res2 = st->Sr_addr_[sr_len - 3];
sr_len = sr_len - 3;
auto x = reinterpret_cast<ptr<lang::calc::Node::Expr::_T>>(res1.v_)->rc_from_this_poly<lang::calc::Node::Expr::_T>();
x.decref();
auto ret = lang::calc::Node::Expr::Paren::make_ext(st->unw_arena_, st->gen()->gen(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_), false, -1, lang_rt::ParserAttrMask(), lang_rt::ParserLookahead(), x);
ret.incref();
auto res_item = lang_rt::Result_T(ret.get(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_));
st->Sr_addr_[sr_len] = res_item;
++sr_len;
lang_rt::SymItem ret_sym = {15, start_pos};
ret_sym.attr_.v_[0] = 1;
ret_sym.attr_.v_[0] = min<Int>(ret_sym.attr_.v_[0], 0);
ret_sym.attr_.v_[1] = 4;
ret_sym.attr_.v_[1] = min<Int>(ret_sym.attr_.v_[1], 4);
ret_sym.attr_.v_[2] = 4;
ret_sym.attr_.v_[2] = min<Int>(ret_sym.attr_.v_[2], 4);
st->Ss_len_ = ss_len;
st->Sr_len_ = sr_len;
st->Sb_len_ = sb_len;
st->Sv_len_ = sv_len;
return ret_sym;
}
}
namespace lang::calc::parser {
__attribute__((noinline)) lang_rt::SymItem _parse_proc_start_14_0(lang_rt::ParserProcStatePtr st) {
Int ss_len = st->Ss_len_;
Int sr_len = st->Sr_len_;
Int sb_len = st->Sb_len_;
Int sv_len = st->Sv_len_;
sv_len = sv_len - 2;
Int start_pos = st->Sv_addr_[sv_len - 1].pos_;
auto sym0 = st->Ss_addr_[ss_len - 1];
auto sym1 = st->Ss_addr_[ss_len - 2];
ss_len = ss_len - 2;
auto res0 = st->Sr_addr_[sr_len - 1];
auto res1 = st->Sr_addr_[sr_len - 2];
sr_len = sr_len - 2;
st->enroll_final_sym(sym0);
st->Sr_addr_[sr_len] = res0;
++sr_len;
lang_rt::SymItem ret_sym = {1, start_pos};
st->Ss_len_ = ss_len;
st->Sr_len_ = sr_len;
st->Sb_len_ = sb_len;
st->Sv_len_ = sv_len;
return ret_sym;
}
}
namespace lang::calc::parser {
__attribute__((noinline)) lang_rt::SymItem _parse_proc_start_15_0(lang_rt::ParserProcStatePtr st) {
Int ss_len = st->Ss_len_;
Int sr_len = st->Sr_len_;
Int sb_len = st->Sb_len_;
Int sv_len = st->Sv_len_;
sv_len = sv_len - 2;
Int start_pos = st->Sv_addr_[sv_len - 1].pos_;
auto sym0 = st->Ss_addr_[ss_len - 1];
auto sym1 = st->Ss_addr_[ss_len - 2];
ss_len = ss_len - 2;
auto res0 = st->Sr_addr_[sr_len - 1];
auto res1 = st->Sr_addr_[sr_len - 2];
sr_len = sr_len - 2;
st->enroll_final_sym(sym0);
st->Sr_addr_[sr_len] = res0;
++sr_len;
lang_rt::SymItem ret_sym = {1, start_pos};
st->Ss_len_ = ss_len;
st->Sr_len_ = sr_len;
st->Sb_len_ = sb_len;
st->Sv_len_ = sv_len;
return ret_sym;
}
}
namespace lang::calc::parser {
__attribute__((noinline)) lang_rt::SymItem _parse_proc_4_1_0(lang_rt::ParserProcStatePtr st) {
Int ss_len = st->Ss_len_;
Int sr_len = st->Sr_len_;
Int sb_len = st->Sb_len_;
Int sv_len = st->Sv_len_;
sv_len = sv_len - 1;
Int start_pos = st->Sv_addr_[sv_len - 1].pos_;
auto sym0 = st->Ss_addr_[ss_len - 1];
ss_len = ss_len - 1;
auto res0 = st->Sr_addr_[sr_len - 1];
sr_len = sr_len - 1;
st->Sr_addr_[sr_len] = res0;
++sr_len;
lang_rt::SymItem ret_sym = {16, start_pos};
st->Ss_len_ = ss_len;
st->Sr_len_ = sr_len;
st->Sb_len_ = sb_len;
st->Sv_len_ = sv_len;
return ret_sym;
}
}
namespace lang::calc::parser {
__attribute__((noinline)) lang_rt::SymItem _parse_proc_4_0_0(lang_rt::ParserProcStatePtr st) {
Int ss_len = st->Ss_len_;
Int sr_len = st->Sr_len_;
Int sb_len = st->Sb_len_;
Int sv_len = st->Sv_len_;
sv_len = sv_len - 1;
Int start_pos = st->Sv_addr_[sv_len - 1].pos_;
auto sym0 = st->Ss_addr_[ss_len - 1];
ss_len = ss_len - 1;
auto res0 = st->Sr_addr_[sr_len - 1];
sr_len = sr_len - 1;
auto ret = lang::calc::Node::Expr::UnaryPre::op::Neg::make_ext(st->unw_arena_, st->gen()->gen(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_), false, -1, lang_rt::ParserAttrMask(), lang_rt::ParserLookahead());
ret.incref();
auto res_item = lang_rt::Result_T(ret.get(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_));
st->Sr_addr_[sr_len] = res_item;
++sr_len;
lang_rt::SymItem ret_sym = {17, start_pos};
st->Ss_len_ = ss_len;
st->Sr_len_ = sr_len;
st->Sb_len_ = sb_len;
st->Sv_len_ = sv_len;
return ret_sym;
}
}
namespace lang::calc::parser {
__attribute__((noinline)) lang_rt::SymItem _parse_proc_5_1_0(lang_rt::ParserProcStatePtr st) {
Int ss_len = st->Ss_len_;
Int sr_len = st->Sr_len_;
Int sb_len = st->Sb_len_;
Int sv_len = st->Sv_len_;
sv_len = sv_len - 1;
Int start_pos = st->Sv_addr_[sv_len - 1].pos_;
auto sym0 = st->Ss_addr_[ss_len - 1];
ss_len = ss_len - 1;
auto res0 = st->Sr_addr_[sr_len - 1];
sr_len = sr_len - 1;
st->Sr_addr_[sr_len] = res0;
++sr_len;
lang_rt::SymItem ret_sym = {18, start_pos};
st->Ss_len_ = ss_len;
st->Sr_len_ = sr_len;
st->Sb_len_ = sb_len;
st->Sv_len_ = sv_len;
return ret_sym;
}
}
namespace lang::calc::parser {
__attribute__((noinline)) lang_rt::SymItem _parse_proc_5_3_0(lang_rt::ParserProcStatePtr st) {
Int ss_len = st->Ss_len_;
Int sr_len = st->Sr_len_;
Int sb_len = st->Sb_len_;
Int sv_len = st->Sv_len_;
sv_len = sv_len - 1;
Int start_pos = st->Sv_addr_[sv_len - 1].pos_;
auto sym0 = st->Ss_addr_[ss_len - 1];
ss_len = ss_len - 1;
auto res0 = st->Sr_addr_[sr_len - 1];
sr_len = sr_len - 1;
st->Sr_addr_[sr_len] = res0;
++sr_len;
lang_rt::SymItem ret_sym = {18, start_pos};
st->Ss_len_ = ss_len;
st->Sr_len_ = sr_len;
st->Sb_len_ = sb_len;
st->Sv_len_ = sv_len;
return ret_sym;
}
}
namespace lang::calc::parser {
__attribute__((noinline)) lang_rt::SymItem _parse_proc_5_0_0(lang_rt::ParserProcStatePtr st) {
Int ss_len = st->Ss_len_;
Int sr_len = st->Sr_len_;
Int sb_len = st->Sb_len_;
Int sv_len = st->Sv_len_;
sv_len = sv_len - 1;
Int start_pos = st->Sv_addr_[sv_len - 1].pos_;
auto sym0 = st->Ss_addr_[ss_len - 1];
ss_len = ss_len - 1;
auto res0 = st->Sr_addr_[sr_len - 1];
sr_len = sr_len - 1;
auto ret = lang::calc::Node::Expr::BinOp1::op::Add::make_ext(st->unw_arena_, st->gen()->gen(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_), false, -1, lang_rt::ParserAttrMask(), lang_rt::ParserLookahead());
ret.incref();
auto res_item = lang_rt::Result_T(ret.get(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_));
st->Sr_addr_[sr_len] = res_item;
++sr_len;
lang_rt::SymItem ret_sym = {19, start_pos};
st->Ss_len_ = ss_len;
st->Sr_len_ = sr_len;
st->Sb_len_ = sb_len;
st->Sv_len_ = sv_len;
return ret_sym;
}
}
namespace lang::calc::parser {
__attribute__((noinline)) lang_rt::SymItem _parse_proc_5_2_0(lang_rt::ParserProcStatePtr st) {
Int ss_len = st->Ss_len_;
Int sr_len = st->Sr_len_;
Int sb_len = st->Sb_len_;
Int sv_len = st->Sv_len_;
sv_len = sv_len - 1;
Int start_pos = st->Sv_addr_[sv_len - 1].pos_;
auto sym0 = st->Ss_addr_[ss_len - 1];
ss_len = ss_len - 1;
auto res0 = st->Sr_addr_[sr_len - 1];
sr_len = sr_len - 1;
auto ret = lang::calc::Node::Expr::BinOp1::op::Sub::make_ext(st->unw_arena_, st->gen()->gen(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_), false, -1, lang_rt::ParserAttrMask(), lang_rt::ParserLookahead());
ret.incref();
auto res_item = lang_rt::Result_T(ret.get(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_));
st->Sr_addr_[sr_len] = res_item;
++sr_len;
lang_rt::SymItem ret_sym = {20, start_pos};
st->Ss_len_ = ss_len;
st->Sr_len_ = sr_len;
st->Sb_len_ = sb_len;
st->Sv_len_ = sv_len;
return ret_sym;
}
}
namespace lang::calc::parser {
__attribute__((noinline)) lang_rt::SymItem _parse_proc_6_1_0(lang_rt::ParserProcStatePtr st) {
Int ss_len = st->Ss_len_;
Int sr_len = st->Sr_len_;
Int sb_len = st->Sb_len_;
Int sv_len = st->Sv_len_;
sv_len = sv_len - 1;
Int start_pos = st->Sv_addr_[sv_len - 1].pos_;
auto sym0 = st->Ss_addr_[ss_len - 1];
ss_len = ss_len - 1;
auto res0 = st->Sr_addr_[sr_len - 1];
sr_len = sr_len - 1;
st->Sr_addr_[sr_len] = res0;
++sr_len;
lang_rt::SymItem ret_sym = {21, start_pos};
st->Ss_len_ = ss_len;
st->Sr_len_ = sr_len;
st->Sb_len_ = sb_len;
st->Sv_len_ = sv_len;
return ret_sym;
}
}
namespace lang::calc::parser {
__attribute__((noinline)) lang_rt::SymItem _parse_proc_6_3_0(lang_rt::ParserProcStatePtr st) {
Int ss_len = st->Ss_len_;
Int sr_len = st->Sr_len_;
Int sb_len = st->Sb_len_;
Int sv_len = st->Sv_len_;
sv_len = sv_len - 1;
Int start_pos = st->Sv_addr_[sv_len - 1].pos_;
auto sym0 = st->Ss_addr_[ss_len - 1];
ss_len = ss_len - 1;
auto res0 = st->Sr_addr_[sr_len - 1];
sr_len = sr_len - 1;
st->Sr_addr_[sr_len] = res0;
++sr_len;
lang_rt::SymItem ret_sym = {21, start_pos};
st->Ss_len_ = ss_len;
st->Sr_len_ = sr_len;
st->Sb_len_ = sb_len;
st->Sv_len_ = sv_len;
return ret_sym;
}
}
namespace lang::calc::parser {
__attribute__((noinline)) lang_rt::SymItem _parse_proc_6_0_0(lang_rt::ParserProcStatePtr st) {
Int ss_len = st->Ss_len_;
Int sr_len = st->Sr_len_;
Int sb_len = st->Sb_len_;
Int sv_len = st->Sv_len_;
sv_len = sv_len - 1;
Int start_pos = st->Sv_addr_[sv_len - 1].pos_;
auto sym0 = st->Ss_addr_[ss_len - 1];
ss_len = ss_len - 1;
auto res0 = st->Sr_addr_[sr_len - 1];
sr_len = sr_len - 1;
auto ret = lang::calc::Node::Expr::BinOp2::op::Mul::make_ext(st->unw_arena_, st->gen()->gen(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_), false, -1, lang_rt::ParserAttrMask(), lang_rt::ParserLookahead());
ret.incref();
auto res_item = lang_rt::Result_T(ret.get(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_));
st->Sr_addr_[sr_len] = res_item;
++sr_len;
lang_rt::SymItem ret_sym = {22, start_pos};
st->Ss_len_ = ss_len;
st->Sr_len_ = sr_len;
st->Sb_len_ = sb_len;
st->Sv_len_ = sv_len;
return ret_sym;
}
}
namespace lang::calc::parser {
__attribute__((noinline)) lang_rt::SymItem _parse_proc_6_2_0(lang_rt::ParserProcStatePtr st) {
Int ss_len = st->Ss_len_;
Int sr_len = st->Sr_len_;
Int sb_len = st->Sb_len_;
Int sv_len = st->Sv_len_;
sv_len = sv_len - 1;
Int start_pos = st->Sv_addr_[sv_len - 1].pos_;
auto sym0 = st->Ss_addr_[ss_len - 1];
ss_len = ss_len - 1;
auto res0 = st->Sr_addr_[sr_len - 1];
sr_len = sr_len - 1;
auto ret = lang::calc::Node::Expr::BinOp2::op::Div::make_ext(st->unw_arena_, st->gen()->gen(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_), false, -1, lang_rt::ParserAttrMask(), lang_rt::ParserLookahead());
ret.incref();
auto res_item = lang_rt::Result_T(ret.get(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_));
st->Sr_addr_[sr_len] = res_item;
++sr_len;
lang_rt::SymItem ret_sym = {23, start_pos};
st->Ss_len_ = ss_len;
st->Sr_len_ = sr_len;
st->Sb_len_ = sb_len;
st->Sv_len_ = sv_len;
return ret_sym;
}
}
namespace lang::calc::parser {
__attribute__((noinline)) lang_rt::SymItem _parse_proc_7_1_0(lang_rt::ParserProcStatePtr st) {
Int ss_len = st->Ss_len_;
Int sr_len = st->Sr_len_;
Int sb_len = st->Sb_len_;
Int sv_len = st->Sv_len_;
sv_len = sv_len - 1;
Int start_pos = st->Sv_addr_[sv_len - 1].pos_;
auto sym0 = st->Ss_addr_[ss_len - 1];
ss_len = ss_len - 1;
auto res0 = st->Sr_addr_[sr_len - 1];
sr_len = sr_len - 1;
st->Sr_addr_[sr_len] = res0;
++sr_len;
lang_rt::SymItem ret_sym = {24, start_pos};
st->Ss_len_ = ss_len;
st->Sr_len_ = sr_len;
st->Sb_len_ = sb_len;
st->Sv_len_ = sv_len;
return ret_sym;
}
}
namespace lang::calc::parser {
__attribute__((noinline)) lang_rt::SymItem _parse_proc_7_0_0(lang_rt::ParserProcStatePtr st) {
Int ss_len = st->Ss_len_;
Int sr_len = st->Sr_len_;
Int sb_len = st->Sb_len_;
Int sv_len = st->Sv_len_;
sv_len = sv_len - 1;
Int start_pos = st->Sv_addr_[sv_len - 1].pos_;
auto sym0 = st->Ss_addr_[ss_len - 1];
ss_len = ss_len - 1;
auto res0 = st->Sr_addr_[sr_len - 1];
sr_len = sr_len - 1;
auto ret = lang::calc::Node::Expr::BinOp3::op::Pow::make_ext(st->unw_arena_, st->gen()->gen(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_), false, -1, lang_rt::ParserAttrMask(), lang_rt::ParserLookahead());
ret.incref();
auto res_item = lang_rt::Result_T(ret.get(), lang_rt::TokenBounds(start_pos, res0.bounds_.hi_));
st->Sr_addr_[sr_len] = res_item;
++sr_len;
lang_rt::SymItem ret_sym = {25, start_pos};
st->Ss_len_ = ss_len;
st->Sr_len_ = sr_len;
st->Sb_len_ = sb_len;
st->Sv_len_ = sv_len;
return ret_sym;
}
}
lang_rt::ParserProcXforms lang::calc::parser::proc_xform_by_prod_id() {
auto ret = make_rc<Vec<lang_rt::ParserProcXform>>();
ret->push_back(_parse_proc_0_0_0);
ret->push_back(_parse_proc_1_0_0);
ret->push_back(_parse_proc_2_0_0);
ret->push_back(_parse_proc_3_0_0);
ret->push_back(_parse_proc_4_2_0);
ret->push_back(_parse_proc_5_4_0);
ret->push_back(_parse_proc_6_4_0);
ret->push_back(_parse_proc_7_2_0);
ret->push_back(_parse_proc_8_0_0);
ret->push_back(_parse_proc_start_14_0);
ret->push_back(_parse_proc_start_15_0);
ret->push_back(_parse_proc_4_1_0);
ret->push_back(_parse_proc_4_0_0);
ret->push_back(_parse_proc_5_1_0);
ret->push_back(_parse_proc_5_3_0);
ret->push_back(_parse_proc_5_0_0);
ret->push_back(_parse_proc_5_2_0);
ret->push_back(_parse_proc_6_1_0);
ret->push_back(_parse_proc_6_3_0);
ret->push_back(_parse_proc_6_0_0);
ret->push_back(_parse_proc_6_2_0);
ret->push_back(_parse_proc_7_1_0);
ret->push_back(_parse_proc_7_0_0);
return ret;
}
lang_rt::ParserSymByName lang::calc::parser::start_marker_by_name() {
lang_rt::ParserSymByName ret;
ret.insert(make_pair("Stmt", 12));
ret.insert(make_pair("Expr", 13));
return ret;
}
lang_rt::ParserSymId lang::calc::parser::term_tok_to_sym(lang_rt::TokenId tok) {
switch (tok) {
case 0: {
return 2;
}
case 1: {
return 3;
}
case 2: {
return 4;
}
case 3: {
return 5;
}
case 4: {
return 6;
}
case 5: {
return 7;
}
case 6: {
return 8;
}
case 7: {
return 9;
}
case 8: {
return 10;
}
case 9: {
return 11;
}
default: {
AX();
}
}
}
lang_rt::ParserSymId lang::calc::parser::sym_to_recur_step(lang_rt::ParserSymId sym) {
switch (sym) {
case 14: {
return 26;
}
case 15: {
return 27;
}
case 1: {
return 28;
}
case 16: {
return 29;
}
case 17: {
return 30;
}
case 18: {
return 31;
}
case 19: {
return 32;
}
case 20: {
return 33;
}
case 21: {
return 34;
}
case 22: {
return 35;
}
case 23: {
return 36;
}
case 24: {
return 37;
}
case 25: {
return 38;
}
default: {
AX();
}
}
}
string lang::calc::parser::sym_to_debug_string(lang_rt::ParserSymId sym) {
switch (sym) {
case 0: {
return "$$";
}
case 1: {
return "&&";
}
case 2: {
return "id";
}
case 3: {
return "int_lit";
}
case 4: {
return "`+`";
}
case 5: {
return "`-`";
}
case 6: {
return "`*`";
}
case 7: {
return "`/`";
}
case 8: {
return "`^`";
}
case 9: {
return "`=`";
}
case 10: {
return "`(`";
}
case 11: {
return "`)`";
}
case 12: {
return "&Stmt";
}
case 13: {
return "&Expr";
}
case 14: {
return "Stmt";
}
case 15: {
return "Expr";
}
case 16: {
return "X0=(`-`)";
}
case 17: {
return "X1=(`-`)";
}
case 18: {
return "X2=(`+`\040|\040`-`)";
}
case 19: {
return "X3=(`+`)";
}
case 20: {
return "X4=(`-`)";
}
case 21: {
return "X5=(`*`\040|\040`/`)";
}
case 22: {
return "X6=(`*`)";
}
case 23: {
return "X7=(`/`)";
}
case 24: {
return "X8=(`^`)";
}
case 25: {
return "X9=(`^`)";
}
case 26: {
return "RecurStep(Stmt)";
}
case 27: {
return "RecurStep(Expr)";
}
case 28: {
return "RecurStep(&&)";
}
case 29: {
return "RecurStep(X0=(`-`))";
}
case 30: {
return "RecurStep(X1=(`-`))";
}
case 31: {
return "RecurStep(X2=(`+`\040|\040`-`))";
}
case 32: {
return "RecurStep(X3=(`+`))";
}
case 33: {
return "RecurStep(X4=(`-`))";
}
case 34: {
return "RecurStep(X5=(`*`\040|\040`/`))";
}
case 35: {
return "RecurStep(X6=(`*`))";
}
case 36: {
return "RecurStep(X7=(`/`))";
}
case 37: {
return "RecurStep(X8=(`^`))";
}
case 38: {
return "RecurStep(X9=(`^`))";
}
default: {
AX();
}
}
}
Int lang::calc::parser::sym_to_num_attrs(lang_rt::ParserSymId sym) {
switch (sym) {
case 1: {
return 0;
}
case 2: {
return 0;
}
case 3: {
return 0;
}
case 4: {
return 0;
}
case 5: {
return 0;
}
case 6: {
return 0;
}
case 7: {
return 0;
}
case 8: {
return 0;
}
case 9: {
return 0;
}
case 10: {
return 0;
}
case 11: {
return 0;
}
case 12: {
return 0;
}
case 13: {
return 0;
}
case 14: {
return 0;
}
case 15: {
return 3;
}
case 16: {
return 0;
}
case 17: {
return 0;
}
case 18: {
return 0;
}
case 19: {
return 0;
}
case 20: {
return 0;
}
case 21: {
return 0;
}
case 22: {
return 0;
}
case 23: {
return 0;
}
case 24: {
return 0;
}
case 25: {
return 0;
}
default: {
AX();
}
}
}
string lang::calc::parser::attr_to_debug_string(lang_rt::ParserSymId sym, Int attr_ind) {
switch (sym) {
case 1: {
switch (attr_ind) {
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
case 2: {
switch (attr_ind) {
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
case 3: {
switch (attr_ind) {
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
case 4: {
switch (attr_ind) {
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
case 5: {
switch (attr_ind) {
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
case 6: {
switch (attr_ind) {
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
case 7: {
switch (attr_ind) {
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
case 8: {
switch (attr_ind) {
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
case 9: {
switch (attr_ind) {
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
case 10: {
switch (attr_ind) {
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
case 11: {
switch (attr_ind) {
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
case 12: {
switch (attr_ind) {
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
case 13: {
switch (attr_ind) {
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
case 14: {
switch (attr_ind) {
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
case 15: {
switch (attr_ind) {
case 0: {
return "I";
}
case 1: {
return "prL";
}
case 2: {
return "prR";
}
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
case 16: {
switch (attr_ind) {
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
case 17: {
switch (attr_ind) {
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
case 18: {
switch (attr_ind) {
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
case 19: {
switch (attr_ind) {
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
case 20: {
switch (attr_ind) {
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
case 21: {
switch (attr_ind) {
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
case 22: {
switch (attr_ind) {
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
case 23: {
switch (attr_ind) {
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
case 24: {
switch (attr_ind) {
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
case 25: {
switch (attr_ind) {
default: {
AX("Not found: {}, {}", sym, attr_ind);
}
}
break;
}
default: {
AX();
}
}
}
inline __attribute__((always_inline)) Int lang::calc::lexer::body::proc_mode_loop_opt(ptr<lang_rt::LexerModeDesc> mode, ptr<lang_rt::LexerState> st, ptr<lang_rt::SymItemVec> emit_dst, Int mode_start_pos, Int mode_buf_pos) {
lang_rt::SymItemVec emit_dst_sub;
bool read_eof = false;
Int in_i = mode_start_pos;
ptr<Ch> in_data = st->in_->data_.begin();
Int in_data_len = st->in_->data_len_;
auto label_ids_ascii = st->label_ids_ascii_->begin();
Int tok_lo;
Int tok_hi;
rc_ptr<lang_rt::LexWhitespaceState> ws_state_rc;
lang_rt::LexWhitespaceState * ws_state = nullptr;
if (mode->ws_sig_) {
ws_state_rc = make_rc<lang_rt::LexWhitespaceState>(st, st->tok_to_sym_, mode_buf_pos, in_data, mode->ws_newline_ind_, mode->ws_indent_ind_, mode->ws_dedent_ind_, mode->ws_err_mixed_indent_ind_, mode->ws_err_text_after_lc_ind_, mode->ws_err_delim_mismatch_ind_);
ws_state = ws_state_rc.get();
}
for (cc_nop(); true; cc_nop()) {
tok_lo = in_i;
lang_rt::DFAVertexId v = 0;
lang_rt::DFAActionId best_act = lang_rt::DFATable::NO_ACTION;
lang_rt::TokenId best_tok;
for (cc_nop(); true; cc_nop()) {
lang_rt::TokenId cl = lang_rt::lexer_char_to_label(in_data, in_i, in_data_len, label_ids_ascii, st);
v = step(v, cl);
if (__builtin_expect(v == lang_rt::DFATable::NO_VERTEX, 0)) {
break;
}
if (__builtin_expect(cl == lang_rt::DFATable::EOF_LABEL, 0)) {
read_eof = true;
}
if (__builtin_expect(!read_eof, 1)) {
in_i++;
}
auto acc_tok = acc(v);
if (acc_tok.first != lang_rt::DFATable::NO_ACTION) {
tok_hi = in_i;
best_act = acc_tok.first;
best_tok = acc_tok.second;
}
}
in_i = tok_lo;
lang_rt::lexer_state_proc_update_pre(best_act, best_tok, tok_lo, tok_hi, in_i, read_eof, st);
IntPair new_mode_dir = step_exec(st, emit_dst, ws_state, best_act, best_tok, in_i, tok_lo, tok_hi);
if (__builtin_expect(new_mode_dir.first == lang_rt::DFATable::NEW_MODE_POP_EMIT, 0)) {
st->enqueue_emit_ext(emit_dst, ws_state, new_mode_dir.second, mode_buf_pos, in_i, true);
if (!!ws_state) {
ws_state->finish(tok_hi, emit_dst);
}
return in_i;
}
if (__builtin_expect(new_mode_dir.first == lang_rt::DFATable::NEW_MODE_POP_EXTRACT, 0)) {
st->extract_comment(mode_buf_pos, in_i);
if (!!ws_state) {
ws_state->finish(tok_hi, emit_dst);
}
return in_i;
}
if (__builtin_expect(new_mode_dir.first == lang_rt::DFATable::NEW_MODE_POP, 0)) {
if (!!ws_state) {
ws_state->finish(tok_hi, emit_dst);
}
return in_i;
}
if (__builtin_expect(new_mode_dir.first >= 0, 0)) {
auto desc_new = st->mode_descs_->operator[](new_mode_dir.first);
in_i = lexer_proc_mode_loop(desc_new.get(), st, &emit_dst_sub, in_i, new_mode_dir.second);
lang_rt::lex_queue_pull_sub(st, emit_dst, &emit_dst_sub, ws_state);
}
if (__builtin_expect(read_eof, 0)) {
lang_rt::lexer_raise_nonempty_mode_stack(st, in_i);
}
}
}
inline __attribute__((always_inline)) Int lang::calc::lexer::comment_single::proc_mode_loop_opt(ptr<lang_rt::LexerModeDesc> mode, ptr<lang_rt::LexerState> st, ptr<lang_rt::SymItemVec> emit_dst, Int mode_start_pos, Int mode_buf_pos) {
lang_rt::SymItemVec emit_dst_sub;
Int in_i = mode_start_pos;
ptr<Ch> in_data = st->in_->data_.begin();
Int in_data_len = st->in_->data_len_;
Int tok_lo;
Int tok_hi;
ptr<lang_rt::LexWhitespaceState> ws_state = nullptr;
for (cc_nop(); true; cc_nop()) {
tok_lo = in_i;
lang_rt::DFAActionId best_act = lang_rt::DFATable::NO_ACTION;
lang_rt::TokenId best_tok;
for (cc_nop(); true; cc_nop()) {
Ch curr = -1;
if (__builtin_expect(in_i == in_data_len, 0)) {
{
tok_lo = in_i;
tok_hi = in_i;
best_act = 1;
best_tok = lang_rt::NO_TOKEN;
break;
}
} else {
curr = in_data[in_i];
}
if (__builtin_expect(curr == 10, 0)) {
{
tok_lo = in_i;
tok_hi = in_i + 1;
best_act = 0;
best_tok = lang_rt::NO_TOKEN;
break;
}
}
++in_i;
}
IntPair new_mode_dir = mode->step_exec_fn_(st, emit_dst, ws_state, best_act, best_tok, in_i, tok_lo, tok_hi);
if (__builtin_expect(new_mode_dir.first == lang_rt::DFATable::NEW_MODE_POP_EMIT, 0)) {
st->enqueue_emit_ext(emit_dst, ws_state, new_mode_dir.second, mode_buf_pos, in_i, true);
return in_i;
}
if (__builtin_expect(new_mode_dir.first == lang_rt::DFATable::NEW_MODE_POP_EXTRACT, 0)) {
st->extract_comment(mode_buf_pos, in_i);
return in_i;
}
if (__builtin_expect(new_mode_dir.first == lang_rt::DFATable::NEW_MODE_POP, 0)) {
return in_i;
}
if (__builtin_expect(new_mode_dir.first >= 0, 0)) {
auto desc_new = st->mode_descs_->operator[](new_mode_dir.first);
in_i = lexer_proc_mode_loop(desc_new.get(), st, &emit_dst_sub, in_i, new_mode_dir.second);
lang_rt::lex_queue_pull_sub(st, emit_dst, &emit_dst_sub, ws_state);
}
}
}
lang::calc::LangDesc_T lang::calc::init() {
auto ret = make_rc<lang::calc::LangDesc>();
ret->lexer_mode_descs_ = make_rc<Vec<lang_rt::LexerModeDesc_T>>();
auto body = make_rc<lang_rt::LexerModeDesc>();
body->step_fn_ = lexer::body::step;
body->acc_fn_ = lexer::body::acc;
body->step_exec_fn_ = lexer::body::step_exec;
body->proc_mode_loop_opt_fn_ = lexer::body::proc_mode_loop_opt;
ret->lexer_mode_descs_->push(body);
body->ws_sig_ = false;
auto comment_single = make_rc<lang_rt::LexerModeDesc>();
comment_single->step_fn_ = lexer::comment_single::step;
comment_single->acc_fn_ = lexer::comment_single::acc;
comment_single->step_exec_fn_ = lexer::comment_single::step_exec;
comment_single->proc_mode_loop_opt_fn_ = lexer::comment_single::proc_mode_loop_opt;
ret->lexer_mode_descs_->push(comment_single);
comment_single->ws_sig_ = false;
ret->label_ids_ascii_ = lexer::label_ids_ascii();
ret->label_ids_unicode_ = lexer::label_ids_unicode();
ret->lexer_main_mode_ = 0;
ret->parser_desc_ = make_rc<lang_rt::ParserDesc>();
ret->parser_desc_->start_vertex_ = 0;
ret->parser_desc_->main_sym_ = "Stmt";
ret->parser_desc_->start_full_sym_ = 1;
ret->parser_desc_->right_end_marker_ = 0;
ret->parser_desc_->lr_k_ = 1;
ret->parser_desc_->term_tok_to_sym_ = parser::term_tok_to_sym;
ret->parser_desc_->sym_to_recur_step_ = parser::sym_to_recur_step;
ret->parser_desc_->start_marker_by_name_ = parser::start_marker_by_name();
ret->parser_desc_->proc_xform_by_prod_id_ = parser::proc_xform_by_prod_id();
ret->parser_desc_->sym_to_debug_string_ = parser::sym_to_debug_string;
ret->parser_desc_->sym_to_num_attrs_ = parser::sym_to_num_attrs;
ret->parser_desc_->attr_to_debug_string_ = parser::attr_to_debug_string;
ret->parser_desc_->cps_flat_diff_max_ = 0;
return ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment