Skip to content

Commit 366a16f

Browse files
committed
rename the V class to WriteSuccessorsVisitor
1 parent c059cea commit 366a16f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

javascript/extractor/src/com/semmle/js/extractor/CFGExtractor.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
import java.util.ArrayList;
112112
import java.util.Arrays;
113113
import java.util.Collections;
114+
import java.util.function.IntFunction;
114115
import java.util.HashMap;
115116
import java.util.Iterator;
116117
import java.util.LinkedHashMap;
@@ -737,7 +738,11 @@ public <Q, A> A accept(Visitor<Q, A> v, Q q) {
737738
return result;
738739
}
739740

740-
private class V extends DefaultVisitor<SuccessorInfo, Void> {
741+
/**
742+
* A visitor that recursively visits all the nodes in the CFG (starting with the top-level `Program`) and writes the `successor` relation for each of the nodes.
743+
* Depends on the `First` visitor to compute which CFG-node is first in the CFG for a given parent-node.
744+
*/
745+
private class WriteSuccessorsVisitor extends DefaultVisitor<SuccessorInfo, Void> {
741746
/**
742747
* The context stores relevant bits of syntactic context to be able to resolve jumps.
743748
*
@@ -1990,7 +1995,7 @@ public Void visit(XMLDotDotExpression nd, SuccessorInfo c) {
19901995

19911996
public void extract(Node nd) {
19921997
metrics.startPhase(ExtractionPhase.CFGExtractor_extract);
1993-
nd.accept(new V(), new SimpleSuccessorInfo(null));
1998+
nd.accept(new WriteSuccessorsVisitor(), new SimpleSuccessorInfo(null));
19941999
metrics.stopPhase(ExtractionPhase.CFGExtractor_extract);
19952000
}
19962001
}

0 commit comments

Comments
 (0)