edu.mit.ai.psg.jevaES
Class JNELiteralExpression
java.lang.Object
|
+--edu.mit.ai.psg.jevaES.SimpleNode
|
+--edu.mit.ai.psg.jevaES.JevaNode
|
+--edu.mit.ai.psg.jevaES.ExpressionNode
|
+--edu.mit.ai.psg.jevaES.JNELiteralExpression
- public class JNELiteralExpression
- extends ExpressionNode
Jeva parse node for literal expressions (1, 3.14, "Hi", etc.)
| Methods inherited from class edu.mit.ai.psg.jevaES.JevaNode |
getBeginToken,
getEndToken,
notVerified,
print,
print,
printToken,
printToString,
printToString,
setBeginToken,
setEndToken,
shouldNotHappen,
shouldNotHappen,
shouldNotHappen |
setValue
public void setValue(Object val,
Class literalType)
computeIsConstant
public boolean computeIsConstant(IEnv env)
- Description copied from class: ExpressionNode
- Compute whether this expression is a constant (nodes should not call
this method directly). Called by the isConstant method.
- Overrides:
- computeIsConstant in class ExpressionNode
- Tags copied from class: ExpressionNode
- Parameters:
env - environment of name bindings, etc.- Throws:
- VerifyingException - if expression is illegal.
- See Also:
ExpressionNode.isConstant(edu.mit.ai.psg.jevaES.IEnv),
EvalMethods.isConstant(IExpressionNode, IEnv)
computeType
public Class computeType(IEnv env)
- Description copied from class: ExpressionNode
- Compute the static type of the expression (nodes should not call
this method directly). Called by getType.
- Overrides:
- computeType in class ExpressionNode
- Tags copied from class: ExpressionNode
- Parameters:
env - environment of name bindings, etc.- Throws:
- VerifyingException - if expression is illegal
- See Also:
EvalMethods.getType(IExpressionNode, IEnv)
eval
public Object eval(IEnv env)
- This should never be called. EvalMethods.eval calls getValue, which
calls eval only if it isn't a constant already computed. Literals are
computed at parse time, so they are always computed.
- Overrides:
- eval in class ExpressionNode
- Tags copied from class: ExpressionNode
- Parameters:
env - environment of name bindings, etc.- Throws:
- ThrowException - if abruptly completed with an exception
- See Also:
ExpressionNode.getValue(edu.mit.ai.psg.jevaES.IEnv),
EvalMethods.eval(IExpressionNode, IEnv)