private static class ControlFlowAnalysis.AstControlFlowGraph extends ControlFlowGraph<Node>
ControlFlowGraph which provides a node comparator based on the
pre-order traversal of the AST.ControlFlowGraph.AbstractCfgNodeTraversalCallback, ControlFlowGraph.BranchLinkedDirectedGraph.LinkedDirectedGraphNode<N,E>DiGraph.DiGraphEdge<N,E>, DiGraph.DiGraphNode<N,E>Graph.GraphEdge<N,E>GraphvizGraph.GraphvizEdge, GraphvizGraph.GraphvizNode| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<DiGraph.DiGraphNode<Node,ControlFlowGraph.Branch>,java.lang.Integer> |
priorities |
nodes| Modifier | Constructor and Description |
|---|---|
private |
AstControlFlowGraph(Node entry,
java.util.Map<DiGraph.DiGraphNode<Node,ControlFlowGraph.Branch>,java.lang.Integer> priorities,
boolean edgeAnnotations)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Comparator<DiGraph.DiGraphNode<Node,ControlFlowGraph.Branch>> |
getOptionalNodeComparator(boolean isForward)
Gets a comparator for the nodes.
|
private int |
getPosition(DiGraph.DiGraphNode<Node,ControlFlowGraph.Branch> n)
Gets the pre-order traversal position of the given node.
|
getEntry, getImplicitReturn, isEnteringNewCfgNode, isImplicitReturn, toStringconnect, connect, connectIfNotConnectedInDirection, create, createDirectedGraphNode, createNode, createWithoutAnnotations, disconnect, disconnectInDirection, getDirectedGraphEdges, getDirectedGraphNode, getDirectedGraphNodes, getDirectedPredNodes, getDirectedPredNodes, getDirectedSuccNodes, getDirectedSuccNodes, getEdges, getEdges, getFirstEdge, getGraphvizEdges, getGraphvizNodes, getInEdges, getName, getNeighborNodes, getNode, getNodeDegree, getNodes, getOutEdges, isConnectedInDirection, isConnectedInDirection, isConnectedInDirection, isDirected, newSubGraphisConnected, isConnectedclearEdgeAnnotations, clearNodeAnnotations, connectIfNotFound, getWeight, hasNode, popEdgeAnnotations, popNodeAnnotations, pushEdgeAnnotations, pushNodeAnnotationsprivate final java.util.Map<DiGraph.DiGraphNode<Node,ControlFlowGraph.Branch>,java.lang.Integer> priorities
private AstControlFlowGraph(Node entry, java.util.Map<DiGraph.DiGraphNode<Node,ControlFlowGraph.Branch>,java.lang.Integer> priorities, boolean edgeAnnotations)
entry - The entry node.priorities - The map from nodes to position in the AST (to be
filled by the ControlFlowAnalysis.shouldTraverse(com.google.javascript.jscomp.NodeTraversal, com.google.javascript.rhino.Node, com.google.javascript.rhino.Node)).public java.util.Comparator<DiGraph.DiGraphNode<Node,ControlFlowGraph.Branch>> getOptionalNodeComparator(boolean isForward)
ControlFlowGraphnull. See ControlFlowGraph.getOptionalNodeComparator(boolean).getOptionalNodeComparator in class ControlFlowGraph<Node>isForward - Whether the comparator sorts the nodes in the direction of
the flow.private int getPosition(DiGraph.DiGraphNode<Node,ControlFlowGraph.Branch> n)