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

Function printNode

tests/DCPS/TopicExpression/TopicExpression.cpp:35–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33typedef yard::TreeBuildingParser<char>::Node Node;
34
35void printNode(Node* n, int depth = 0) {
36 std::cout << std::string(depth, '+') << n->GetRuleTypeInfo().name();
37 if (n->IsCompleted()) {
38 std::cout << ": [" << std::string(n->GetFirstToken(), n->GetLastToken())
39 << ']';
40 }
41 std::cout << std::endl;
42 for (Node* c = n->GetFirstChild(); c; c = c->GetSibling()) {
43 printNode(c, depth + 1);
44 }
45}
46
47void callback(yard::SimpleTextParser& p) {
48 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