ast
Class InstanceofExpr

java.lang.Object
  extended by ast.ASTNode
      extended by ast.Expr
          extended by ast.InstanceofExpr

public class InstanceofExpr
extends Expr

The InstanceofExpr class represents an instanceof expression. It contains a lefthand expression (expr), a righthand type name (type), and a flag indicating whether the instanceof is an upcheck (upcheck).

See Also:
ASTNode, Expr

Field Summary
protected  Expr expr
          The lefthand expression
protected  java.lang.String type
          The righthand type
protected  boolean upcheck
          Boolean indicating whether this is an upcheck (checking whether one type is instanceof a super type -- always true
 
Fields inherited from class ast.ASTNode
charNum, lineNum, lineStr
 
Constructor Summary
InstanceofExpr(int lineNum, Expr expr, java.lang.String type)
          InstanceofExpr constructor
 
Method Summary
 java.lang.Object accept(visitor.Visitor v, java.lang.Object o)
          Visitor method
 Expr getExpr()
          Get the lefthand expression
 java.lang.String getType()
          Get the righthand type
 boolean getUpCheck()
          Is this an upcheck? i.e., checking whether one type is an instanceof a super type (always true)
 void setUpCheck(boolean upcheck)
          Set whether the instanceof is an upcheck i.e., checking whether one type is an instanceof a super type (always true)
 
Methods inherited from class ast.Expr
getExprType, setExprType
 
Methods inherited from class ast.ASTNode
getLineNum
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

expr

protected Expr expr
The lefthand expression


type

protected java.lang.String type
The righthand type


upcheck

protected boolean upcheck
Boolean indicating whether this is an upcheck (checking whether one type is instanceof a super type -- always true

Constructor Detail

InstanceofExpr

public InstanceofExpr(int lineNum,
                      Expr expr,
                      java.lang.String type)
InstanceofExpr constructor

Parameters:
lineNum - source line number corresponding to this AST node
expr - the lefthand expression
type - the righthand type
Method Detail

getExpr

public Expr getExpr()
Get the lefthand expression

Returns:
expression

getType

public java.lang.String getType()
Get the righthand type

Returns:
type

getUpCheck

public boolean getUpCheck()
Is this an upcheck? i.e., checking whether one type is an instanceof a super type (always true)

Returns:
boolean indicating whether this cast is an upcheck

setUpCheck

public void setUpCheck(boolean upcheck)
Set whether the instanceof is an upcheck i.e., checking whether one type is an instanceof a super type (always true)

Parameters:
upcheck - boolean indicating whether check is an upcheck

accept

public java.lang.Object accept(visitor.Visitor v,
                               java.lang.Object o)
Visitor method

Specified by:
accept in class Expr
Parameters:
v - visitor object
o - object to pass down
Returns:
result of visiting this node
See Also:
Visitor