1 22 23 package org.xquark.xquery.normalize; 24 25 27 import java.util.ArrayList ; 28 29 import org.xquark.xquery.parser.*; 30 31 public class EraseSkolemIDVisitor extends DefaultParserVisitor { 32 33 private static final String RCSRevision = "$Revision: 1.1 $"; 34 private static final String RCSName = "$Name: $"; 35 36 private Variable var = null; 37 38 public EraseSkolemIDVisitor(Variable var) { 39 this.var = var; 40 } 41 42 50 public void visit(Element arg) throws XQueryException { 51 if (arg.getSkolemIDs() != null) 52 arg.getSkolemIDs().remove(var); 53 ArrayList subExpressions = arg.getSubExpressions(); 54 if (subExpressions != null) 55 for (int i = 0; i < subExpressions.size(); i++) 56 ((XQueryExpression) subExpressions.get(i)).accept(this); 57 } 58 59 public void visit(ITEExpression arg) throws XQueryException { 65 if (arg.getSkolemIDs() != null) 66 arg.getSkolemIDs().remove(var); 67 } 68 public void visit(XQueryBinaryOperatorExpression arg) throws XQueryException { 101 if (arg.getSkolemIDs() != null) 102 arg.getSkolemIDs().remove(var); 103 arg.getExpression1().accept(this); 104 arg.getExpression2().accept(this); 105 } 106 109 public void visit(XQueryExpressionSequence arg) throws XQueryException { 110 if (arg.getSkolemIDs() != null) 111 arg.getSkolemIDs().remove(var); 112 ArrayList subExpressions = arg.getSubExpressions(); 113 for (int i = 0; i < subExpressions.size(); i++) 114 ((XQueryExpression) subExpressions.get(i)).accept(this); 115 } 116 117 public void visit(XQueryUnaryOperatorExpression arg) throws XQueryException { 121 if (arg.getSkolemIDs() != null) 122 arg.getSkolemIDs().remove(var); 123 arg.getExpression().accept(this); 124 } 125 128 130 } 131 | Popular Tags |