MCPcopy Create free account
hub / github.com/covscript/covscript / dump_expr

Method dump_expr

sources/compiler/compiler.cpp:1134–1157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1132 }
1133
1134 void compiler_type::dump_expr(tree_type<token_base *>::iterator it, std::ostream &stream)
1135 {
1136 if (!it.usable()) {
1137 stream << "< Empty Expression >";
1138 return;
1139 }
1140 stream << "<";
1141 bool cutoff = false;
1142 if (it.data() != nullptr) {
1143 stream << " Tree Node = ";
1144 cutoff = it.data()->dump(stream);
1145 }
1146 if (!cutoff) {
1147 if (it.left().usable()) {
1148 stream << " Left Leaf = ";
1149 dump_expr(it.left(), stream);
1150 }
1151 if (it.right().usable()) {
1152 stream << " Right Leaf = ";
1153 dump_expr(it.right(), stream);
1154 }
1155 }
1156 stream << " >";
1157 }
1158
1159 void translator_type::match_grammar(const context_t &context, std::deque<token_base *> &raw)
1160 {

Callers

nothing calls this directly

Calls 5

dataMethod · 0.80
leftMethod · 0.80
rightMethod · 0.80
usableMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected