| 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 | { |