use of com.sri.ai.grinder.rewriter.core.FunctorSwitch in project aic-expresso by aic-sri-international.
the class ProceduralAttachments method registerProceduralAttachment.
/**
* This method registers a procedural attachment top rewriter to a function with a given arity;
* the check of functor and arity will be added to the given top rewriter, so it does not need to do that.
* @param functor
* @param proceduralAttachmentParameters
* @param topRewriter
* @param context
* @return
*/
public static void registerProceduralAttachment(Expression functor, int arity, TopRewriter topRewriter, Context context) {
TopRewriter proceduralAttachment = new FunctorSwitch(functor.toString(), arity, topRewriter);
context.updateInplaceGlobalObject(PROCEDURAL_ATTACHEMENTS_KEY, EMPTY_REWRITER_MAKER, combine(proceduralAttachment));
}
Aggregations