com.google.javascript.jscomp
Class NodeTraversal.AbstractScopedCallback

java.lang.Object
  extended by com.google.javascript.jscomp.NodeTraversal.AbstractScopedCallback
All Implemented Interfaces:
NodeTraversal.Callback, NodeTraversal.ScopedCallback
Enclosing class:
NodeTraversal

public abstract static class NodeTraversal.AbstractScopedCallback
extends Object
implements NodeTraversal.ScopedCallback

Abstract scoped callback to visit all nodes in post order.


Constructor Summary
NodeTraversal.AbstractScopedCallback()
           
 
Method Summary
 void enterScope(NodeTraversal t)
          Called immediately after entering a new scope.
 void exitScope(NodeTraversal t)
          Called immediately before exiting a scope.
 boolean shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent)
          Visits a node in pre order (before visiting its children) and decides whether this node's children should be traversed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.javascript.jscomp.NodeTraversal.Callback
visit
 

Constructor Detail

NodeTraversal.AbstractScopedCallback

public NodeTraversal.AbstractScopedCallback()
Method Detail

shouldTraverse

public final boolean shouldTraverse(NodeTraversal nodeTraversal,
                                    Node n,
                                    Node parent)
Description copied from interface: NodeTraversal.Callback

Visits a node in pre order (before visiting its children) and decides whether this node's children should be traversed. If children are traversed, they will be visited by NodeTraversal.Callback.visit(NodeTraversal, Node, Node) in post order.

Implementations can have side effects (e.g. modifying the parse tree).

Specified by:
shouldTraverse in interface NodeTraversal.Callback
Returns:
whether the children of this node should be visited

enterScope

public void enterScope(NodeTraversal t)
Description copied from interface: NodeTraversal.ScopedCallback
Called immediately after entering a new scope. The new scope can be accessed through t.getScope()

Specified by:
enterScope in interface NodeTraversal.ScopedCallback

exitScope

public void exitScope(NodeTraversal t)
Description copied from interface: NodeTraversal.ScopedCallback
Called immediately before exiting a scope. The ending scope can be accessed through t.getScope()

Specified by:
exitScope in interface NodeTraversal.ScopedCallback