Search in sources :

Example 1 with SymbolSwitch

use of com.sri.ai.grinder.rewriter.core.SymbolSwitch in project aic-expresso by aic-sri-international.

the class ProceduralAttachments method registerProceduralAttachment.

/**
 * Same as {@link #registerProceduralAttachment(Expression, List, TopRewriter, Context)},
 * but for a symbol.
 * @param symbol
 * @param topRewriter
 * @param context
 * @return
 */
public static void registerProceduralAttachment(Expression symbol, TopRewriter topRewriter, Context context) {
    TopRewriter proceduralAttachment = new SymbolSwitch(symbol.toString(), topRewriter);
    context.updateInplaceGlobalObject(PROCEDURAL_ATTACHEMENTS_KEY, EMPTY_REWRITER_MAKER, combine(proceduralAttachment));
}
Also used : SymbolSwitch(com.sri.ai.grinder.rewriter.core.SymbolSwitch) TopRewriter(com.sri.ai.grinder.rewriter.api.TopRewriter) CombiningTopRewriter(com.sri.ai.grinder.rewriter.core.CombiningTopRewriter)

Aggregations

TopRewriter (com.sri.ai.grinder.rewriter.api.TopRewriter)1 CombiningTopRewriter (com.sri.ai.grinder.rewriter.core.CombiningTopRewriter)1 SymbolSwitch (com.sri.ai.grinder.rewriter.core.SymbolSwitch)1