Class AbstractStateVariablesInConstraintFinder
java.lang.Object
net.ssehub.easy.varModel.model.filter.AbstractVariableInConstraintFinder
net.ssehub.easy.varModel.model.filter.AbstractStateVariablesInConstraintFinder
- All Implemented Interfaces:
IConstraintTreeVisitor
- Direct Known Subclasses:
VariablesInConstraintFinder
public abstract class AbstractStateVariablesInConstraintFinder
extends AbstractVariableInConstraintFinder
Searches for used
IDecisionVariables and their states inside a ConstraintSyntaxTree. For reuse,
call setConfiguration(Configuration) first, then visit the respective constraint,
and finally clear().- Author:
- El-Sharkawy, Holger Eichelberger
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a constraint finder for reuse.Creates a constraint finder for single use directly oncst. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidAdds the relatedIDecisionVariableand their state to the result.protected voidaddVariable(AbstractVariable declaration) Adds the relatedIDecisionVariableand their state to the result.voidclear()Clears this visitor for reuse.protected ConfigurationReturns the assigned configuration.protected EvaluationVisitorReturns the evaluator.voidsetConfiguration(Configuration config) Defines the configuration to work on.voidvisitAnnotationVariable(AttributeVariable variable) Visits aAttributeVariable.voidvisitCompoundAccess(CompoundAccess access) Visits a compound access node.voidVisits a container operation call (e.g.voidVisits a let expression.voidvisitVariable(Variable variable) Visits a variable.Methods inherited from class net.ssehub.easy.varModel.model.filter.AbstractVariableInConstraintFinder
visitBlockExpression, visitComment, visitCompoundInitializer, visitConstantValue, visitContainerInitializer, visitDeferInitExpression, visitIfThen, visitMultiAndExpression, visitOclFeatureCall, visitParenthesis, visitSelf, visitUnresolvedExpression, visitValue
-
Field Details
-
config
-
evaluator
-
-
Constructor Details
-
AbstractStateVariablesInConstraintFinder
public AbstractStateVariablesInConstraintFinder()Creates a constraint finder for reuse. CallsetConfiguration(Configuration)first, accept then the constraint to be analyzed and callclear()afterwards to make the visitor instance ready for reuse. (must not be null). -
AbstractStateVariablesInConstraintFinder
Creates a constraint finder for single use directly oncst.- Parameters:
cst- A constraint where all nestedIDecisionVariable's should be found.config- The related Configuration of the project to where thecstbelongs to (must not be null).
-
-
Method Details
-
setConfiguration
Defines the configuration to work on.- Parameters:
config- the configuration
-
clear
public void clear()Clears this visitor for reuse. -
visitVariable
Description copied from interface:IConstraintTreeVisitorVisits a variable.- Specified by:
visitVariablein interfaceIConstraintTreeVisitor- Overrides:
visitVariablein classAbstractVariableInConstraintFinder- Parameters:
variable- the variable which should be visited
-
visitAnnotationVariable
Description copied from interface:IConstraintTreeVisitorVisits aAttributeVariable.- Parameters:
variable- the attribute variable which should be visited
-
addVariable
Adds the relatedIDecisionVariableand their state to the result.- Specified by:
addVariablein classAbstractVariableInConstraintFinder- Parameters:
declaration- A discovered declaration for which theIDecisionVariableand its state should be saved.- See Also:
-
addVariable
Adds the relatedIDecisionVariableand their state to the result.- Parameters:
var- the variable to be added, may be null, ignored then
-
visitLet
Description copied from interface:IConstraintTreeVisitorVisits a let expression.- Parameters:
let- the let expression which should be visited
-
visitContainerOperationCall
Description copied from interface:IConstraintTreeVisitorVisits a container operation call (e.g. quantors, iterators).- Parameters:
call- the container operation call
-
visitCompoundAccess
Description copied from interface:IConstraintTreeVisitorVisits a compound access node.- Parameters:
access- the compound access node
-
getEvaluator
Returns the evaluator. Only initialized aftersetConfiguration(Configuration)and beforeclear().- Returns:
- the evaluator
-
getConfiguration
Returns the assigned configuration. Only initialized aftersetConfiguration(Configuration)and beforeclear().- Returns:
- the configuration
-