edu.mit.ai.psg.jevaES
Interface IStatementNode
- All Known Implementing Classes:
- JNDImportDeclaration, JNDPackageDeclaration, JNSBlock, JNSBreakStatement, JNSContinueStatement, JNSDoStatement, JNSEmptyStatement, JNSExpressionStatement, JNSForStatement, JNSLabeledStatement, JNSLocalVariableDeclaration, JNSReturnStatement, JNSSwitchStatement, JNSSynchronizedStatement, JNSThrowStatement, JNSTryStatement, JNSWhileStatement, JNSExpressionStatementList, JNSIfStatement
- public abstract interface IStatementNode
- extends IJevaNode
Interface to parse nodes for Java statements.
Don't call this interface's methods directly, but instead use
EvalMethods to capture errors.
- Author:
- CarlManning, caroma@ai.mit.edu
Copyright (c) 1997, 1998 Massachusetts Institute of Technology
- See Also:
EvalMethods
verifyTypes
public IEnv verifyTypes(IEnv env)
throws VerifyingException
- Verify types within this statement (don't call this directly,
use EvalMethods.verifyTypes). Also 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 verified Statement (don't call this directly,
use EvalMethods.eval).
- 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)