use of org.whole.lang.scheme.model.Branches in project whole by wholeplatform.
the class SchemeInterpreterVisitor method visit.
public void visit(CondExpression entity) {
boolean prune = false;
Branches branches = (Branches) entity.getBranches();
if (!branches.wGetEntityDescriptor().equals(SchemeEntityDescriptorEnum.Branches))
throw new VisitException("expected a " + SchemeEntityDescriptorEnum.Branches);
for (int i = 0; i < branches.wSize() && !prune; i++) {
Branch branch = (Branch) entity.wGet(i);
if (booleanValue(branch.getTest())) {
branch.getBody().accept(this);
return;
}
}
entity.getElseBody().accept(this);
}
Aggregations