use of org.metaborg.spoofax.core.unit.ISpoofaxTransformUnit in project spoofax by metaborg.
the class StrategoTransformer method transformAllParsed.
@Override
public Collection<ISpoofaxTransformUnit<ISpoofaxParseUnit>> transformAllParsed(Iterable<ISpoofaxParseUnit> inputs, IContext context, TransformActionContrib action, ITransformConfig config) throws TransformException {
final int size = Iterables.size(inputs);
final Collection<ISpoofaxTransformUnit<ISpoofaxParseUnit>> transformUnits = Lists.newArrayListWithCapacity(size);
for (ISpoofaxParseUnit input : inputs) {
transformUnits.add(transform(input, context, action, input.source(), input.ast(), config));
}
return transformUnits;
}
use of org.metaborg.spoofax.core.unit.ISpoofaxTransformUnit in project spoofax by metaborg.
the class StrategoTransformer method transformAllAnalyzed.
@Override
public Collection<ISpoofaxTransformUnit<ISpoofaxAnalyzeUnit>> transformAllAnalyzed(Iterable<ISpoofaxAnalyzeUnit> inputs, IContext context, TransformActionContrib action, ITransformConfig config) throws TransformException {
final int size = Iterables.size(inputs);
final Collection<ISpoofaxTransformUnit<ISpoofaxAnalyzeUnit>> transformUnits = Lists.newArrayListWithCapacity(size);
for (ISpoofaxAnalyzeUnit input : inputs) {
if (!input.valid()) {
throw new TransformException("Cannot transform analyze unit " + input + ", it is not valid");
}
if (!input.hasAst()) {
throw new TransformException("Cannot transform analyze unit " + input + ", it has no AST");
}
transformUnits.add(transform(input, context, action, input.source(), input.ast(), config));
}
return transformUnits;
}
Aggregations