ast
Class ConstIntExpr
java.lang.Object
ast.ASTNode
ast.Expr
ast.ConstExpr
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
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConstIntExpr
public ConstIntExpr(int lineNum,
java.lang.String constant)
- ConstIntExpr constructor
- Parameters:
lineNum
- source line number corresponding to this AST nodeconstant
- constant value (as a String)
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 objecto
- object to pass down
- Returns:
- result of visiting this node
- See Also:
Visitor