edu.mit.ai.psg.jeva
Interface IStatementNode
- All Known Subinterfaces:
- IDeclarationNode
- All Known Implementing Classes:
- JNSBlock, JNSBreakStatement, JNSContinueStatement, JNSDoStatement, JNSEmptyStatement, JNSExplicitConstructorInvocation, JNSExpressionStatement, JNSExpressionStatementList, JNSForStatement, JNSIfStatement, JNSLocalVariableDeclaration, JNSReturnStatement, JNSSwitchStatement, JNSSynchronizedStatement, JNSThrowStatement, JNSTryStatement, JNSWhileStatement, JNSLabeledStatement
- public abstract interface IStatementNode
- extends IJevaNode
Interface to parse nodes for Java statements.
- Author:
- CarlManning, caroma@ai.mit.edu
Copyright (c) 1997, 1998, 1999 Massachusetts Institute of Technology
| Methods inherited from interface edu.mit.ai.psg.jeva.IJevaNode |
getBeginToken,
getEndToken,
insertNewChildAfter,
insertNewChildAt,
insertNewChildBefore,
jjtAccept,
jnGetChild,
jnGetParent,
print,
print,
printToString,
printToString,
removeChild,
replaceChild,
replaceChild,
setBeginToken,
setEndToken |
verifyTypes
public IEnv verifyTypes(IEnv env)
throws VerifyingException
- Verify types within this statement; don't call this directly,
use
EvalMethods.verifyTypes(IStatementNode, IEnv).
Builds env without evaluating anything with side effects, for the
purpose of verifying types of later statements. May be used by
preprocessors which must find the type of an expression in order
to assign it to a new variable.
- Parameters:
env - environment of names bindings.- Returns:
- env or possibly extended env
- Throws:
- VerifyingException - if statement is illegal
- See Also:
EvalMethods.verifyTypes(IStatementNode, IEnv)
eval
public IEnv eval(IEnv env)
throws AbruptCompletionException
- Evaluate this Statement; don't call this directly, use
EvalMethods.eval(IStatementNode, IEnv)
Every statement needs to implement an eval method.
- Parameters:
env - environment of names bindings.- Returns:
- env or possibly extended env
- Throws:
- AbruptCompletionException - if abruptly completed with
return, throw, break, or continue.
- See Also:
EvalMethods.eval(IStatementNode, IEnv)