com.go.tea.parsetree
Class BinaryExpression

java.lang.Object
  |
  +--com.go.tea.parsetree.Node
        |
        +--com.go.tea.parsetree.Expression
              |
              +--com.go.tea.parsetree.BinaryExpression
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
ArithmeticExpression, BinaryLogicalExpression, ConcatenateExpression

public abstract class BinaryExpression
extends Expression

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

Version:
25 , 9/07/00
Author:
Brian S O'Neill
See Also:
Serialized Form

Inner classes inherited from class com.go.tea.parsetree.Expression
Expression.Conversion
 
Constructor Summary
BinaryExpression(SourceInfo info, Token operator, Expression left, Expression right)
           
 
Method Summary
 java.lang.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 com.go.tea.parsetree.Expression
accept, convertTo, convertTo, getConversionChain, getInitialType, getType, getValue, isValueKnown, setInitialType
 
Methods inherited from class com.go.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 java.lang.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)