edu.mit.ai.psg.jeva
Class JNDConstructorDeclaration

java.lang.Object
  |
  +--edu.mit.ai.psg.jeva.SimpleNode
        |
        +--edu.mit.ai.psg.jeva.JevaNode
              |
              +--edu.mit.ai.psg.jeva.JNDConstructorDeclaration

public class JNDConstructorDeclaration
extends JevaNode
implements IClassBodyDeclaration, JevaParserConstants

JNDConstructorDeclaration: parse node for constructors. Body is not a simple block, since first statement may be an ExplicitConstructorInvocation which must be treated specially.

Author:
CarlManning, caroma@ai.mit.edu
Copyright (c) 1997, 1998, 1999 Massachusetts Institute of Technology

Fields inherited from class edu.mit.ai.psg.jeva.SimpleNode
children, id, parent
 
Method Summary
protected  InterpretedConstructor computeConstructor(IEnv env)
          Create constructor.
 void evalConstructorBody(Object target, Object[] arguments, IEnv classEnv)
          eval constructor body AFTER explicit constructor invocation
 Object evalExplicitConstructorCallParameter(int paramIndex, Object[] arguments, IEnv classEnv)
           
 InterpretedConstructor getConstructor()
           
 int getFirstStatementIndex()
          return index at which first statement can be inserted
 int getNumStatementNodes()
           
 JNFormalParameterList getParametersNode()
           
 IStatementNode getStatementNode(int i)
           
 Object jjtAccept(IJevaVisitor visitor, Object data)
           
 IEnv verifyTypes(IEnv staticEnv, IEnv objectEnv)
           
 
Methods inherited from class edu.mit.ai.psg.jeva.JevaNode
checkInsertionPoint, find2ndTokenBeforeEndBody, findChildIndex, findPrecedingToken, findTokenBeforeChild, findTokenBeforeChild, findTokenBeforeEnd, getBeginToken, getEndToken, insertChildTokens, insertNewChildAfter, insertNewChildAt, insertNewChildBefore, jnGetChild, jnGetParent, print, print, printToken, printToString, printToString, removeChild, removeChildTokens, replaceChild, replaceChild, setBeginToken, setEndToken, updateEndTokens, updateEndTokensPriorChild, updateEndTokensPriorNode, updateEndTokensPriorNode
 
Methods inherited from class edu.mit.ai.psg.jeva.SimpleNode
dump, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

jjtAccept

public Object jjtAccept(IJevaVisitor visitor,
                        Object data)
Overrides:
jjtAccept in class JevaNode

getConstructor

public InterpretedConstructor getConstructor()
                                      throws IllegalStateException

getParametersNode

public JNFormalParameterList getParametersNode()

getNumStatementNodes

public int getNumStatementNodes()

getStatementNode

public IStatementNode getStatementNode(int i)

getFirstStatementIndex

public int getFirstStatementIndex()
return index at which first statement can be inserted

computeConstructor

protected InterpretedConstructor computeConstructor(IEnv env)
                                             throws VerifyingException
Create constructor. Also initializes this node, adding default explicit constructor invocation "super();" if missing.

verifyTypes

public IEnv verifyTypes(IEnv staticEnv,
                        IEnv objectEnv)
                 throws VerifyingException

evalExplicitConstructorCallParameter

public Object evalExplicitConstructorCallParameter(int paramIndex,
                                                   Object[] arguments,
                                                   IEnv classEnv)
                                            throws ThrowException

evalConstructorBody

public void evalConstructorBody(Object target,
                                Object[] arguments,
                                IEnv classEnv)
                         throws ThrowException
eval constructor body AFTER explicit constructor invocation

Copyright (c) 1996-1999
Massachusetts Institute of Technology

Feedback: jeva-bugs@ai.mit.edu