org.teatrove.tea.parsetree
Class BinaryExpression

java.lang.Object
  extended by org.teatrove.tea.parsetree.Node
      extended by org.teatrove.tea.parsetree.Expression
          extended by org.teatrove.tea.parsetree.BinaryExpression
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
ArithmeticExpression, BinaryLogicalExpression, CompareExpression, ConcatenateExpression

public abstract class BinaryExpression
extends Expression

A BinaryExpression contains a left expression, a right expression and an operator. BinaryExpressions never evaluate to null.

Author:
Brian S O'Neill
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.teatrove.tea.parsetree.Expression
Expression.Conversion
 
Constructor Summary
BinaryExpression(SourceInfo info, Token operator, Expression left, Expression right)
           
 
Method Summary
 Object clone()
          Returns a clone of this Node and all its children.
 Expression getLeftExpression()
           
 Token getOperator()
           
 Expression getRightExpression()
           
 boolean isExceptionPossible()
          Returns true if an exception can be thrown while executing this Expression.
 void setLeftExpression(Expression left)
           
 void setRightExpression(Expression right)
           
 void setType(Type type)
          Sets the type of this expression, clearing the conversion chain.
 
Methods inherited from class org.teatrove.tea.parsetree.Expression
accept, convertTo, convertTo, forceConversion, getConversionChain, getInitialType, getType, getValue, isValueKnown, setInitialType
 
Methods inherited from class org.teatrove.tea.parsetree.Node
getSourceInfo, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BinaryExpression

public BinaryExpression(SourceInfo info,
                        Token operator,
                        Expression left,
                        Expression right)
Method Detail

clone

public Object clone()
Description copied from class: Node
Returns a clone of this Node and all its children. Immutable child objects are not necessarily cloned

Overrides:
clone in class Expression

isExceptionPossible

public boolean isExceptionPossible()
Description copied from class: Expression
Returns true if an exception can be thrown while executing this Expression. By default, returns true only if a type conversion could cause an exception.

Overrides:
isExceptionPossible in class Expression

setType

public void setType(Type type)
Description copied from class: Expression
Sets the type of this expression, clearing the conversion chain.

Overrides:
setType in class Expression

getOperator

public Token getOperator()

getLeftExpression

public Expression getLeftExpression()

getRightExpression

public Expression getRightExpression()

setLeftExpression

public void setLeftExpression(Expression left)

setRightExpression

public void setRightExpression(Expression right)


Copyright © 1997-2012 TeaTrove.org. All Rights Reserved.