ast
Class ConstIntExpr

java.lang.Object
  extended by ast.ASTNode
      extended by ast.Expr
          extended by ast.ConstExpr
              extended by ast.ConstIntExpr

public class ConstIntExpr
extends ConstExpr

The ConstIntExpr class represents an integer constant expression. It extends constant expressions so it contains a constant value (represented as a String). It also stores the constant as an int (intConstant). Since this class is similar to other subclasses most of the functionality can be implemented in the visitor method for the parent class.

See Also:
ASTNode, ConstExpr

Field Summary
 
Fields inherited from class ast.ConstExpr
constant
 
Fields inherited from class ast.ASTNode
charNum, lineNum, lineStr
 
Constructor Summary
ConstIntExpr(int lineNum, java.lang.String constant)
          ConstIntExpr constructor
 
Method Summary
 java.lang.Object accept(visitor.Visitor v, java.lang.Object o)
          Visitor method
 int getIntConstant()
          Get the constant value represented as an int
 
Methods inherited from class ast.ConstExpr
getConstant
 
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
 

Constructor Detail

ConstIntExpr

public ConstIntExpr(int lineNum,
                    java.lang.String constant)
ConstIntExpr constructor

Parameters:
lineNum - source line number corresponding to this AST node
constant - constant value (as a String)
Method Detail

getIntConstant

public int getIntConstant()
Get the constant value represented as an int

Returns:
the constant value

accept

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

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