Search in sources :

Example 1 with AllNodesAndEdgesPrintVisitor

use of org.eclipse.n4js.flowgraphs.analysers.AllNodesAndEdgesPrintVisitor in project n4js by eclipse.

the class FlowgraphsXpectMethod method allEdges.

/**
 * This xpect method can evaluate all edges of the containing function.
 */
@ParameterParser(syntax = "('from' arg1=OFFSET)?")
@Xpect
public void allEdges(@N4JSCommaSeparatedValuesExpectation IN4JSCommaSeparatedValuesExpectation expectation, IEObjectCoveringRegion offset) {
    ControlFlowElement cfe = null;
    if (offset != null) {
        cfe = getCFE(offset);
    }
    cfe = FGUtils.getCFContainer(cfe);
    AllNodesAndEdgesPrintVisitor anaepw = new AllNodesAndEdgesPrintVisitor(cfe);
    getFlowAnalyzer(cfe).accept(anaepw);
    List<String> pathStrings = anaepw.getAllEdgeStrings();
    expectation.assertEquals(pathStrings);
}
Also used : AllNodesAndEdgesPrintVisitor(org.eclipse.n4js.flowgraphs.analysers.AllNodesAndEdgesPrintVisitor) ControlFlowElement(org.eclipse.n4js.n4JS.ControlFlowElement) Xpect(org.eclipse.xpect.runner.Xpect) ParameterParser(org.eclipse.xpect.parameter.ParameterParser)

Aggregations

AllNodesAndEdgesPrintVisitor (org.eclipse.n4js.flowgraphs.analysers.AllNodesAndEdgesPrintVisitor)1 ControlFlowElement (org.eclipse.n4js.n4JS.ControlFlowElement)1 ParameterParser (org.eclipse.xpect.parameter.ParameterParser)1 Xpect (org.eclipse.xpect.runner.Xpect)1