1 22 23 24 package org.xquark.xquery.parser; 25 26 27 28 30 public abstract class XQueryBinaryOperatorExpression extends XQueryExpression implements Cloneable { 31 private static final String RCSRevision = "$Revision: 1.5 $"; 32 private static final String RCSName = "$Name: $"; 33 34 XQueryExpression expression1 = null; 35 XQueryExpression expression2 = null; 36 37 41 public void accept(ParserVisitor visitor) throws XQueryException { 42 visitor.visit(this); 43 } 44 45 49 53 public XQueryBinaryOperatorExpression(XQueryExpression expression1, XQueryExpression expression2) throws XQueryException { 54 setExpression1(expression1); 55 setExpression2(expression2); 56 } 57 58 62 public XQueryExpression getExpression1() { return expression1; } 63 public void setExpression1(XQueryExpression expression1) throws XQueryException { 64 if (expression1 == null) throw new XQueryException("expression1 of XQueryBinaryOperatorExpression cannot be null"); 65 this.expression1 = expression1; 66 this.expression1.setParentModule(parentModule); 67 this.expression1.setParentExpression(this); 68 } 69 70 public XQueryExpression getExpression2() { return expression2; } 71 public void setExpression2(XQueryExpression expression2) throws XQueryException { 72 if (expression2 == null) throw new XQueryException("expression2 of XQueryBinaryOperatorExpression cannot be null"); 73 this.expression2 = expression2; 74 this.expression2.setParentModule(parentModule); 75 this.expression2.setParentExpression(this); 76 } 77 78 public XQueryExpression getLeftOperand() { return expression1; } 79 80 public XQueryExpression getRightOperand() { return expression2; } 81 82 public void addParentExpression(XQueryExpression parentExpression) { 86 addParentExpression(parentExpression) ; 87 expression1.addParentExpression(parentExpression); 88 expression2.addParentExpression(parentExpression); 89 } 90 91 92 } 93 94 95 96 | Popular Tags |