com.go.tea.parsetree
Class RelationalExpression

java.lang.Object
  |
  +--com.go.tea.parsetree.Node
        |
        +--com.go.tea.parsetree.Expression
              |
              +--com.go.tea.parsetree.BinaryExpression
                    |
                    +--com.go.tea.parsetree.BinaryLogicalExpression
                          |
                          +--com.go.tea.parsetree.RelationalExpression
All Implemented Interfaces:
java.lang.Cloneable, Logical, java.io.Serializable

public class RelationalExpression
extends BinaryLogicalExpression

RelationalExpression defines seven operations, "==", "!=", "<", ">", "<=" ">=" and "isa". The type of a RelationalExpression is a Boolean, set by a type checker if there are no errors.

Operator returned is one of Token.EQ, Token.NE, Token.LT, Token.GT, Token.LE, Token.GE or Token.ISA.

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
RelationalExpression(SourceInfo info, Token operator, Expression left, Expression right)
           
RelationalExpression(SourceInfo info, Token operator, Expression left, TypeName typeName)
          Used to construct an "isa" RelationalExpression.
 
Method Summary
 java.lang.Object accept(NodeVisitor visitor)
          Every subclass of Node must override this method with the following: return visitor.visit(this).
 TypeName getIsaTypeName()
          Only applies if token is "isa".
 Expression getRightExpression()
           
 boolean isExceptionPossible()
          Returns true if an exception can be thrown while executing this Expression.
 
Methods inherited from class com.go.tea.parsetree.BinaryLogicalExpression
convertTo
 
Methods inherited from class com.go.tea.parsetree.BinaryExpression
clone, getLeftExpression, getOperator, setLeftExpression, setRightExpression, setType
 
Methods inherited from class com.go.tea.parsetree.Expression
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

RelationalExpression

public RelationalExpression(SourceInfo info,
                            Token operator,
                            Expression left,
                            Expression right)

RelationalExpression

public RelationalExpression(SourceInfo info,
                            Token operator,
                            Expression left,
                            TypeName typeName)
Used to construct an "isa" RelationalExpression.
Method Detail

accept

public java.lang.Object accept(NodeVisitor visitor)
Description copied from class: Node
Every subclass of Node must override this method with the following: return visitor.visit(this).
Overrides:
accept in class Expression
Following copied from class: com.go.tea.parsetree.Node
Parameters:
visitor - A visitor of this Node
Returns:
Node The Node returned by the visitor
See Also:
NodeVisitor

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 BinaryExpression

getRightExpression

public Expression getRightExpression()
Overrides:
getRightExpression in class BinaryExpression
Returns:
null if an "isa" RelationalExpression

getIsaTypeName

public TypeName getIsaTypeName()
Only applies if token is "isa".