/** * visit. * * @param obj a {@link lupos.rif.model.Rule} object. * @param arg a {@link lupos.rif.IRuleNode} object. * @return a {@link lupos.rif.IRuleNode} object. * @throws lupos.rif.RIFException if any. */ public IRuleNode visit(Rule obj, IRuleNode arg) throws RIFException { listCtr = 0; obj.setParent(arg); currentVariableScope = obj; obj.setBody((IExpression) obj.getBody().accept(this, obj)); List<IExpression> listOfNots = new ArrayList<IExpression>(obj.getNots().size()); for (IExpression iExpression : obj.getNots()) { listOfNots.add((IExpression) iExpression.accept(this, obj)); } obj.setNots(listOfNots); currentVariableScope = null; return obj; }
/** * visit. * * @param obj a {@link lupos.rif.model.Document} object. * @param arg a {@link lupos.rif.IRuleNode} object. * @return a {@link lupos.rif.IRuleNode} object. * @throws lupos.rif.RIFException if any. */ public IRuleNode visit(Document obj, IRuleNode arg) throws RIFException { for (Rule rule : obj.getRules()) if (rule.isImplication()) rule.accept(this, obj); return obj; }