private void traverseBranch ( Node n , Node parent ) { switch ( n . getToken ( ) ) { case SCRIPT : handleScript ( n , parent ) ; return ; case FUNCTION : handleFunction ( n , parent ) ; return ; case MODULE_BODY : handleModule ( n , parent ) ; return ; default : break ; } curNode = n ; if ( ! callback . shouldTraverse ( this , n , parent ) ) { return ; } Token type = n . getToken ( ) ; if ( type == Token . CLASS ) { traverseClass ( n ) ; } else if ( type == Token . CLASS_MEMBERS ) { traverseClassMembers ( n ) ; } else if ( useBlockScope && NodeUtil . createsBlockScope ( n ) ) { traverseBlockScope ( n ) ; } else { traverseChildren ( n ) ; } curNode = n ; callback . visit ( this , n , parent ) ; }
Traverses a branch .