1 22 23 24 package org.xquark.xquery.parser; 25 26 import org.xquark.xquery.typing.TypeException; 27 28 public class BinOpANDExpression extends XQueryBooleanOperatorExpression implements Cloneable { 29 30 private static final String RCSRevision = "$Revision: 1.7 $"; 31 private static final String RCSName = "$Name: $"; 32 33 37 public void accept(ParserVisitor visitor) throws XQueryException { 38 visitor.visit(this); 39 } 40 41 45 public BinOpANDExpression(XQueryExpression expression1, XQueryExpression expression2, XQueryModule parentModule) throws TypeException, XQueryException { 46 super(expression1,expression2); 47 setParentModule(parentModule); 48 if (parentModule != null && parentModule.getStaticContext().getTypeVisitor() != null) 49 accept(parentModule.getStaticContext().getTypeVisitor()); 50 } 51 52 public XQueryExpression erasePart(XQueryExpression expr) throws XQueryException { 57 if (this == expr) 58 return null; 59 if (expression1 == expr) 60 return expression2; 61 if (expression2 == expr) 62 return expression1; 63 XQueryExpression resexpr = expression1.erasePart(expr); 64 if (resexpr != expression1) 65 this.setExpression1(resexpr); 66 else { 67 resexpr = expression2.erasePart(expr); 68 if (resexpr != expression2) 69 this.setExpression2(resexpr); 70 } 71 return this; 72 } 73 74 } 75 | Popular Tags |