junc.ast
Class AllocationExpNode

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

public class AllocationExpNode
extends ExpressionNode

See Also:
Serialized Form

Field Summary
 java.util.Vector args
          An ExpressionNode vector for each dimension or for each actual parameter of the class constructor.
 boolean array
          This flag determines if the parameters in the args vector correspond to an array allocation or a constructor call.
 junc.symtab.Symbol className
          Here we keep the type name to which the invoked constructor belongs.
 int dims
          The number of non-empty dimensions being specified.
 junc.types.JUnCBaseType etype
          Type of elements allocated.
 junc.ast.MethodDeclarationNode mnode
          A pointer to the constructor's declaration node.
 
Fields inherited from class junc.ast.ExpressionNode
falseList, leftValue, statementExpression, trueList, type
 
Fields inherited from class antlr.BaseAST
down, right
 
Constructor Summary
AllocationExpNode(junc.types.JUnCBaseType type, java.util.Vector args, boolean array)
           
 
Method Summary
 void translate(org.apache.bcel.generic.ClassGen classGen, org.apache.bcel.generic.MethodGen methodGen)
          Describe translate method here.
 junc.types.JUnCBaseType typeCheck(junc.symtab.SymbolTable stable)
          Describe typeCheck method here.
 
Methods inherited from class junc.ast.ExpressionNode
addFalseList, addTrueList, appendToFalseList, appendToTrueList, backPatch, desynthesize, evaluate, evaluateExp, leftValue, lookupPrimop, superExp, synthesize, thisExp, thisOrSuperExp, translateSynthesized, type, typeExp, variableExp
 
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

etype

public junc.types.JUnCBaseType etype
Type of elements allocated. The final type is determined by typeCheck() and set in the corresponding base class field.


args

public java.util.Vector args
An ExpressionNode vector for each dimension or for each actual parameter of the class constructor. Empty expressions in array allocations like a[4][][] are filled with refs to the NullLiteral.


dims

public int dims
The number of non-empty dimensions being specified. This is calculated by the typeCheck() method.


array

public boolean array
This flag determines if the parameters in the args vector correspond to an array allocation or a constructor call.


mnode

public junc.ast.MethodDeclarationNode mnode
A pointer to the constructor's declaration node.


className

public junc.symtab.Symbol className
Here we keep the type name to which the invoked constructor belongs.

Constructor Detail

AllocationExpNode

public AllocationExpNode(junc.types.JUnCBaseType type,
                         java.util.Vector args,
                         boolean array)
Method Detail

typeCheck

public junc.types.JUnCBaseType typeCheck(junc.symtab.SymbolTable stable)
                                  throws TypeCheckError
Description copied from class: ExpressionNode
Describe typeCheck method here.

Specified by:
typeCheck in class ExpressionNode
Parameters:
stable - a SymbolTable value
Returns:
a JUnCBaseType value
Throws:
TypeCheckError - if an error occurs

translate

public void translate(org.apache.bcel.generic.ClassGen classGen,
                      org.apache.bcel.generic.MethodGen methodGen)
Description copied from class: ExpressionNode
Describe translate method here.

Overrides:
translate in class ExpressionNode
Parameters:
classGen - a ClassGen value
methodGen - a MethodGen value