if (LOG.isDebugEnabled()) {
LOG.debug("TRAVERSING: " + ast.getType());
}
// traverse all children
JavaNode child = (JavaNode) ast.getFirstChild();
if (child != null) {
traverseAst(child, context, depth + 1);
}
context.postProcess(ast);
// print if a type was detected
if (ast.getType() == IDENT) {
context.addToCurrentTypeContext(ast);
if (LOG.isDebugEnabled()) {
LOG.debug(preparePrintln(depth)+context.getCurrentTypeContext());
}
}
// continue visiting the tree (traverse siblings)
JavaNode next = (JavaNode) ast.getNextSibling();
while (next != null) {
traverseAst(next, context, depth);
next = (JavaNode) next.getNextSibling();
}
return -1;
}