@ -456,6 +456,16 @@ public abstract class ASTElement
return ( ASTElement ) accept ( visitor ) ;
}
/ * *
* Evaluate partially : replace some constants with actual values .
* Constants are specified as a Values object .
* Warning : Unlike evaluate ( ) , evaluatePartially ( ) methods modify ( and return ) the expression .
* /
public ASTElement evaluatePartially ( Values constantValues ) throws PrismLangException
{
return evaluatePartially ( new EvaluateContextValues ( constantValues , null ) ) ;
}
/ * *
* Evaluate partially : replace some constants and variables with actual values .
* Constants / variables are specified as Values objects ; either can be left null .
@ -466,6 +476,25 @@ public abstract class ASTElement
return evaluatePartially ( new EvaluateContextValues ( constantValues , varValues ) ) ;
}
/ * *
* Evaluate partially : replace variables with actual values , specified as a State object .
* Warning : Unlike evaluate ( ) , evaluatePartially ( ) methods modify ( and return ) the expression .
* /
public ASTElement evaluatePartially ( State state ) throws PrismLangException
{
return evaluatePartially ( new EvaluateContextState ( state ) ) ;
}
/ * *
* Evaluate partially : replace variables with actual values , specified as a State object .
* Constant values are supplied as a Values object .
* Warning : Unlike evaluate ( ) , evaluatePartially ( ) methods modify ( and return ) the expression .
* /
public ASTElement evaluatePartially ( Values constantValues , State state ) throws PrismLangException
{
return evaluatePartially ( new EvaluateContextState ( constantValues , state ) ) ;
}
/ * *
* Evaluate partially : replace some variables with actual values .
* Variables are specified as a State object , indexed over a subset of all variables ,