Search in sources :

Example 1 with Context

use of org.strategoxt.lang.Context in project spoofax by metaborg.

the class StrategoCommon method prettyPrint.

@Override
public IStrategoString prettyPrint(IStrategoTerm term) {
    final Context context = strategoRuntimeService.genericRuntime().getCompiledContext();
    final ITermFactory termFactory = termFactoryService.getGeneric();
    org.strategoxt.stratego_aterm.Main.init(context);
    term = aterm_escape_strings_0_0.instance.invoke(context, term);
    term = pp_aterm_box_0_0.instance.invoke(context, term);
    term = box2text_string_0_1.instance.invoke(context, term, termFactory.makeInt(120));
    return (IStrategoString) term;
}
Also used : Context(org.strategoxt.lang.Context) IContext(org.metaborg.core.context.IContext) IStrategoString(org.spoofax.interpreter.terms.IStrategoString) ITermFactory(org.spoofax.interpreter.terms.ITermFactory)

Aggregations

IContext (org.metaborg.core.context.IContext)1 IStrategoString (org.spoofax.interpreter.terms.IStrategoString)1 ITermFactory (org.spoofax.interpreter.terms.ITermFactory)1 Context (org.strategoxt.lang.Context)1