edu.ksu.cis.projects.bogor.ast.checker
Class ConstIntExpEvaluator

java.lang.Object
  extended by edu.ksu.cis.projects.bogor.ast.ASTVisitor
      extended by edu.ksu.cis.projects.bogor.ast.checker.ConstIntExpEvaluator

public class ConstIntExpEvaluator
extends ASTVisitor

Utility class to evaluate a very simple "const" or literal integer expression.

Version:
CVS $Revision: 1.2 $ $Date: 2005/05/04 17:28:25 $
Author:
Matt Hoosier

Nested Class Summary
protected  class ConstIntExpEvaluator.ConstIntExpEnforcer
           
 
Constructor Summary
ConstIntExpEvaluator(SymbolTable st)
           
 
Method Summary
 Integer getValue(Exp exp)
          Retrieve the integer value of the expression, or null if it wasn't either a const reference or literal.
protected  void visitFieldAccessExp(FieldAccessExp node)
           
protected  void visitIdExp(IdExp node)
           
protected  void visitIntLiteral(IntLiteral node)
           
protected  void visitLiteralExp(LiteralExp node)
           
 
Methods inherited from class edu.ksu.cis.projects.bogor.ast.ASTVisitor
visitActionExtension, visitActionStatement, visitApplyExp, visitArrayAccessExp, visitAssertAction, visitAssignAction, visitAssumeAction, visitASTArrayType, visitASTBooleanType, visitASTDoubleType, visitASTExtType, visitASTFloatType, visitASTFunType, visitASTIntRangeType, visitASTIntType, visitASTLockType, visitASTLongRangeType, visitASTLongType, visitASTStringType, visitASTThreadIdType, visitAtomicActionStatement, visitAtomicExp, visitAtomicStatement, visitBinaryExp, visitBlockStatement, visitBlockTransformation, visitBooleanConstant, visitBooleanLiteral, visitCastExp, visitCatch, visitChooseStatement, visitConditionalExp, visitConstantDefinition, visitDoubleConstant, visitDoubleLiteral, visitEnumDefinition, visitExitThreadAction, visitExpAction, visitExpExtension, visitExtensionDefinition, visitExtExp, visitField, visitFloatConstant, visitFloatLiteral, visitFSM, visitFun, visitGlobal, visitGotoNextState, visitIdPrintArg, visitIdType, visitIfStatement, visitInitialValue, visitInstanceofExp, visitIntConstant, visitInvokeAction, visitInvokeExp, visitInvokeTransformation, visitKindofExp, visitLetExp, visitLiveSet, visitLocal, visitLocation, visitLockAction, visitLockTestExp, visitLongConstant, visitLongLiteral, visitNewArrayExp, visitNewLockExp, visitNewRecordExp, visitNullLiteral, visitParam, visitParenExp, visitPrintAction, visitRecordDefinition, visitReturnNextState, visitReturnStatement, visitSkipStatement, visitStartThreadExp, visitStringConstant, visitStringLiteral, visitStringPrintArg, visitSystem, visitThreadTestExp, visitThrowAction, visitTryCatchStatement, visitTypeAliasDefinition, visitTypedId, visitTypeExtension, visitUnaryExp, visitVirtualTableDefinition, visitWhileStatement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstIntExpEvaluator

public ConstIntExpEvaluator(SymbolTable st)
Method Detail

getValue

public Integer getValue(Exp exp)
Retrieve the integer value of the expression, or null if it wasn't either a const reference or literal.


visitFieldAccessExp

protected void visitFieldAccessExp(FieldAccessExp node)
Overrides:
visitFieldAccessExp in class ASTVisitor

visitIdExp

protected void visitIdExp(IdExp node)
Overrides:
visitIdExp in class ASTVisitor

visitIntLiteral

protected void visitIntLiteral(IntLiteral node)
Overrides:
visitIntLiteral in class ASTVisitor

visitLiteralExp

protected void visitLiteralExp(LiteralExp node)
Overrides:
visitLiteralExp in class ASTVisitor