// visitor: voidfunc(node, parent, parentField) svoid nlLogic_visitWithParent(IfThen rule, VF3 visitor) { if (rule == null) ret; callF(visitor, rule); nlLogic_visitWithParent(rule.in, rule, 'in, visitor); nlLogic_visitWithParent(rule.out, rule, 'out, visitor); } svoid nlLogic_visitWithParent(Exp e, O parent, S parentField, VF3 visitor) { if (e == null) ret; callF(visitor, e, parent, parentField); if (e cast And) { nlLogic_visitWithParent(e.a, e, 'a, visitor); nlLogic_visitWithParent(e.b, e, 'b, visitor); } else if (e cast ExpNot) nlLogic_visitWithParent(e.a, e, 'a, visitor); else if (e cast Func) nlLogic_visitWithParent(e.arg, e, 'arg, visitor); }