junc.ast
Class ReturnStatementNode

java.lang.Object
  |
  +--antlr.BaseAST
        |
        +--antlr.CommonAST
              |
              +--junc.ast.JUnCASTNode
                    |
                    +--junc.ast.StatementNode
                          |
                          +--junc.ast.ReturnStatementNode
All Implemented Interfaces:
antlr.collections.AST, java.io.Serializable

public class ReturnStatementNode
extends StatementNode

See Also:
Serialized Form

Field Summary
 junc.ast.ExpressionNode expression
           
 junc.types.JUnCBaseType returnType
           
 
Fields inherited from class antlr.BaseAST
down, right
 
Constructor Summary
ReturnStatementNode()
           
 
Method Summary
 void fetchResultType(junc.symtab.Symbol methodName, junc.symtab.SymbolTable symbolTable)
          Gets the result type of the method in which this return statement occurs (the last in the symbol table entry).
 void translate(org.apache.bcel.generic.ClassGen classGen, org.apache.bcel.generic.MethodGen methodGen)
           
 junc.types.JUnCBaseType typeCheck(junc.symtab.SymbolTable symbolTable)
           
 
Methods inherited from class junc.ast.JUnCASTNode
getColumnNumber, getLineNumber, setColumnNumber, setLineNumber
 
Methods inherited from class antlr.CommonAST
getText, getType, initialize, initialize, initialize, setText, setType
 
Methods inherited from class antlr.BaseAST
addChild, decode, encode, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getFirstChild, getNextSibling, removeChildren, setFirstChild, setNextSibling, setVerboseStringConversion, toString, toStringList, toStringTree, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

returnType

public junc.types.JUnCBaseType returnType

expression

public junc.ast.ExpressionNode expression
Constructor Detail

ReturnStatementNode

public ReturnStatementNode()
Method Detail

fetchResultType

public void fetchResultType(junc.symtab.Symbol methodName,
                            junc.symtab.SymbolTable symbolTable)
Gets the result type of the method in which this return statement occurs (the last in the symbol table entry). This info is needed for type checking.


typeCheck

public junc.types.JUnCBaseType typeCheck(junc.symtab.SymbolTable symbolTable)
                                  throws TypeCheckError
Specified by:
typeCheck in class StatementNode
TypeCheckError

translate

public void translate(org.apache.bcel.generic.ClassGen classGen,
                      org.apache.bcel.generic.MethodGen methodGen)
Overrides:
translate in class StatementNode