use of org.metaborg.spoofax.core.analysis.AnalysisFacet in project spoofax by metaborg.
the class TaskEngineAnalyzer method analyzeAll.
@Override
public ISpoofaxAnalyzeResults analyzeAll(Iterable<ISpoofaxParseUnit> inputs, IContext context, IProgress progress, ICancel cancel) throws AnalysisException, InterruptedException {
cancel.throwIfCancelled();
final ILanguageImpl langImpl = context.language();
final ITermFactory termFactory = termFactoryService.getGeneric();
final FacetContribution<AnalysisFacet> facetContribution = langImpl.facetContribution(AnalysisFacet.class);
if (facetContribution == null) {
logger.debug("No analysis required for {}", langImpl);
return new SpoofaxAnalyzeResults(context);
}
final AnalysisFacet facet = facetContribution.facet;
cancel.throwIfCancelled();
final HybridInterpreter runtime;
try {
runtime = runtimeService.runtime(facetContribution.contributor, context, false);
} catch (MetaborgException e) {
throw new AnalysisException(context, "Failed to get Stratego runtime", e);
}
cancel.throwIfCancelled();
return analyzeAll(inputs, context, runtime, facet.strategyName, termFactory);
}
Aggregations