use of org.eclipse.n4js.flowgraphs.analysers.AllBranchPrintVisitor in project n4js by eclipse.
the class FlowgraphsXpectMethod method performBranchAnalysis.
private AllBranchPrintVisitor performBranchAnalysis(IEObjectCoveringRegion offset, String directionName, IEObjectCoveringRegion referenceOffset) {
EObjectCoveringRegion offsetImpl = (EObjectCoveringRegion) offset;
EObjectCoveringRegion referenceOffsetImpl = (EObjectCoveringRegion) referenceOffset;
ControlFlowElement startCFE = getCFEWithReference(offsetImpl, referenceOffsetImpl);
ControlFlowElement referenceCFE = getCFE(referenceOffset);
TraverseDirection direction = getDirection(directionName);
ControlFlowElement container = FGUtils.getCFContainer(referenceCFE);
AllBranchPrintVisitor appw = new AllBranchPrintVisitor(container, startCFE, direction);
getFlowAnalyzer(referenceCFE).accept(appw);
return appw;
}
use of org.eclipse.n4js.flowgraphs.analysers.AllBranchPrintVisitor in project n4js by eclipse.
the class FlowgraphsXpectMethod method allPaths.
/**
* This xpect method can evaluate all paths from a given start code element. If no start code element is specified,
* the first code element of the containing function.
*/
@ParameterParser(syntax = "('from' arg1=OFFSET)? ('direction' arg2=STRING)? ('pleaseNeverUseThisParameterSinceItExistsOnlyToGetAReferenceOffset' arg3=OFFSET)?")
@Xpect
public void allPaths(@N4JSCommaSeparatedValuesExpectation IN4JSCommaSeparatedValuesExpectation expectation, IEObjectCoveringRegion offset, String directionName, IEObjectCoveringRegion referenceOffset) {
AllBranchPrintVisitor appw = performBranchAnalysis(offset, directionName, referenceOffset);
List<String> pathStrings = appw.getPathStrings();
expectation.assertEquals(pathStrings);
}
use of org.eclipse.n4js.flowgraphs.analysers.AllBranchPrintVisitor in project n4js by eclipse.
the class FlowgraphsXpectMethod method allBranches.
/**
* This xpect method can evaluate all branches from a given start code element. If no start code element is
* specified, the first code element of the containing function.
*/
@ParameterParser(syntax = "('from' arg1=OFFSET)? ('direction' arg2=STRING)? ('pleaseNeverUseThisParameterSinceItExistsOnlyToGetAReferenceOffset' arg3=OFFSET)?")
@Xpect
public void allBranches(@N4JSCommaSeparatedValuesExpectation IN4JSCommaSeparatedValuesExpectation expectation, IEObjectCoveringRegion offset, String directionName, IEObjectCoveringRegion referenceOffset) {
AllBranchPrintVisitor appw = performBranchAnalysis(offset, directionName, referenceOffset);
List<String> branchStrings = appw.getBranchStrings();
expectation.assertEquals(branchStrings);
}
Aggregations