org.overturetool.vdmj.expressions
Class SubtractExpression
java.lang.Object
org.overturetool.vdmj.expressions.Expression
org.overturetool.vdmj.expressions.BinaryExpression
org.overturetool.vdmj.expressions.NumericBinaryExpression
org.overturetool.vdmj.expressions.SubtractExpression
- All Implemented Interfaces:
- java.io.Serializable
public class SubtractExpression
- extends NumericBinaryExpression
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SubtractExpression
public SubtractExpression(Expression left,
LexToken op,
Expression right)
typeCheck
public Type typeCheck(Environment env,
TypeList qualifiers,
NameScope scope)
- Description copied from class:
Expression
- Perform a type check of the expression. The method returns the
Type of the expression it checked, and is used
recursively across an expression tree. For example, a boolean "and"
expression would type check its left and right hand sides, check that the
types returned were both compatible with BooleanType
and then return a BooleanType (regardless of any errors).
The qualifiers argument is passed when checking function and operation
application. It contains the list of argument types of the application,
and is used to choose between overloaded function/operation definitions.
- Overrides:
typeCheck in class NumericBinaryExpression
- Parameters:
env - The static environment for resolving names.qualifiers - The argument type qualifiers for overloading.scope - The scope of applicable names from the environment.
- Returns:
- The type of the expression.
eval
public Value eval(Context ctxt)
- Description copied from class:
Expression
- Evaluate the expression in the given runtime context. The
Value object
returned can hold any type of value (int, bool, sequences, sets etc).
- Specified by:
eval in class Expression
- Parameters:
ctxt - The context in which to evaluate the expression.
- Returns:
- The value of the expression.
kind
public java.lang.String kind()
- Description copied from class:
Expression
- A short descriptive string for the expression. An example would
be "forall" or "map comprehension".
- Specified by:
kind in class Expression
- Returns:
- A short name for the expression.
Copyright © 2009. All Rights Reserved.