| 182 | typedef yard::TreeBuildingParser<char>::Node Node; |
| 183 | |
| 184 | void printNode(Node* n, int depth = 0) { |
| 185 | std::cout << std::string(depth, '+') << n->GetRuleTypeInfo().name(); |
| 186 | if (n->IsCompleted()) { |
| 187 | std::cout << ": [" << std::string(n->GetFirstToken(), n->GetLastToken()) |
| 188 | << ']'; |
| 189 | } |
| 190 | std::cout << std::endl; |
| 191 | for (Node* c = n->GetFirstChild(); c; c = c->GetSibling()) { |
| 192 | printNode(c, depth + 1); |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | void callback(yard::SimpleTextParser& p) { |
| 197 | printNode(p.GetAstRoot()); |
no test coverage detected