use of mb.nabl2.stratego.StrategoTerms in project nabl by metaborg.
the class AnalysisPrimitive method call.
public Optional<? extends IStrategoTerm> call(IScopeGraphUnit unit, IStrategoTerm sterm, List<IStrategoTerm> sterms, ITermFactory factory) throws InterpreterException {
final StrategoTerms strategoTerms = new StrategoTerms(factory);
final List<ITerm> terms = sterms.stream().skip(1).map(strategoTerms::fromStratego).map(ConstraintTerms::specialize).collect(Collectors.toList());
final ITerm term = ConstraintTerms.specialize(strategoTerms.fromStratego(sterm));
Optional<? extends ITerm> result = call(unit, term, terms);
return result.map(ConstraintTerms::explicate).map(strategoTerms::toStratego);
}
use of mb.nabl2.stratego.StrategoTerms in project nabl by metaborg.
the class ScopeGraphContextPrimitive method call.
public Optional<? extends IStrategoTerm> call(IScopeGraphContext<?> context, IStrategoTerm sterm, List<IStrategoTerm> sterms, ITermFactory factory) throws InterpreterException {
StrategoTerms strategoTerms = new StrategoTerms(factory);
ITerm term = ConstraintTerms.specialize(strategoTerms.fromStratego(sterm));
List<ITerm> terms = sterms.stream().map(strategoTerms::fromStratego).map(ConstraintTerms::specialize).collect(Collectors.toList());
Optional<? extends ITerm> result = call(context, term, terms);
return result.map(ConstraintTerms::explicate).map(strategoTerms::toStratego);
}
use of mb.nabl2.stratego.StrategoTerms in project nabl by metaborg.
the class AnalysisNoTermPrimitive method call.
@Override
public Optional<? extends IStrategoTerm> call(IScopeGraphUnit unit, IStrategoTerm sterm, List<IStrategoTerm> sterms, ITermFactory factory) throws InterpreterException {
StrategoTerms strategoTerms = new StrategoTerms(factory);
Optional<? extends ITerm> result = call(unit);
return result.map(ConstraintTerms::explicate).map(strategoTerms::toStratego);
}
Aggregations