use of org.whole.lang.scheme.model.Definitions in project whole by wholeplatform.
the class SchemeInterpreterVisitor method visit.
public void visit(LocalExpression entity) {
getBindings().wEnterScope();
Definitions defs = entity.getDefinitions();
if (!defs.wGetEntityDescriptor().equals(SchemeEntityDescriptorEnum.Definitions))
throw new VisitException("expected a " + SchemeEntityDescriptorEnum.Definitions);
for (int i = 0; i < defs.wSize(); i++) {
IEntity e = defs.wGet(i);
if (e.wGetEntityDescriptor().equals(SchemeEntityDescriptorEnum.Definition)) {
Definition def = ((Definition) e);
getBindings().wDef(def.getName().wStringValue(), def.getExpression());
}
}
entity.getBody().accept(this);
getBindings().wExitScope();
}
Aggregations