MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / printNode

Function printNode

tests/DCPS/FilterExpression/FilterExpression.cpp:184–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182typedef yard::TreeBuildingParser<char>::Node Node;
183
184void 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
196void callback(yard::SimpleTextParser& p) {
197 printNode(p.GetAstRoot());

Callers 1

callbackFunction · 0.70

Calls 6

IsCompletedMethod · 0.80
GetFirstTokenMethod · 0.80
GetLastTokenMethod · 0.80
GetFirstChildMethod · 0.80
GetSiblingMethod · 0.80
nameMethod · 0.45

Tested by

no test coverage detected