Interface MICalculation
- All Known Subinterfaces:
MICalculationBoolean,MICalculationDouble,MICalculationInt,MICalculationValue,MICalculationVoid
public interface MICalculation
Represents a calculation of the interpreter.
A calculation is the actual execution that happens during interpretation, used for phase two of the interpreter. Phase one is the creation of these calculations to avoid traversing the AST more than once. Any static decisions (e.g., which types to use) are done during phase one, so these calculations are as simple as possible to rely on Java's runtime optimization.
Calculations may have a return value (e.g., for expressions) and may have side effects.
-
Method Summary
Modifier and TypeMethodDescriptiondefault MICalculationBooleandefault MICalculationDoubledefault MICalculationIntdefault MICalculationValueReturns this as a calculation without return value.default booleandefault booleandefault booleandefault booleandefault boolean
-
Method Details
-
isCalculationBoolean
default boolean isCalculationBoolean() -
isCalculationInt
default boolean isCalculationInt() -
isCalculationDouble
default boolean isCalculationDouble() -
isCalculationValue
default boolean isCalculationValue() -
isCalculationVoid
default boolean isCalculationVoid() -
asCalculationBoolean
-
asCalculationInt
-
asCalculationDouble
-
asCalculationValue
-
asCalculationVoid
MICalculationVoid asCalculationVoid()Returns this as a calculation without return value. EveryMICalculationcan be converted to aMICalculationVoid.- Returns:
- This, but without return value if there was any.
-