use of org.whole.lang.semantics.model.FunctionBody in project whole by wholeplatform.
the class SemanticsDynamicCompilerVisitor method visit.
@Override
public void visit(SemanticFunction entity) {
FunctionBody rules = entity.getRules();
if (Matcher.match(SemanticsEntityDescriptorEnum.InferenceRules, rules)) {
// TODO not supported yet
setResultIterator(IteratorFactory.emptyIterator().withSourceEntity(entity));
return;
}
IEntityIterator<?> ac = new ActionCallIterator("whole:org.whole.lang.semantics:SemanticsActions:1.0.0#Translate Normalized Function to Query", null);
stagedVisit(ac.evaluate(entity, getBindings()));
IEntityIterator<?> functionBehavior = getResultIterator();
FunctionLibraryRegistry.instance().putFunctionCode(getLibraryUri(entity) + "#" + entity.getName().getValue(), functionBehavior);
}
use of org.whole.lang.semantics.model.FunctionBody in project whole by wholeplatform.
the class SemanticsInterpreterVisitor method visit.
@Override
public void visit(SemanticFunction entity) {
FunctionBody rules = entity.getRules();
if (Matcher.match(SemanticsEntityDescriptorEnum.InferenceRules, rules))
return;
FunctionLibraryRegistry.instance().putFunctionModel(getLibraryUri(entity) + "#" + entity.getName().getValue(), entity);
IBindingManager bm = getBindings();
if (!bm.wIsSet("LazyInterpretation") || !bm.wBooleanValue("LazyInterpretation"))
DynamicCompilerOperation.compile(entity, getBindings());
}
Aggregations