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,VariablesInConstraintFinder
public abstract class AbstractStateVariablesInConstraintFinder extends AbstractVariableInConstraintFinder
Searches for usedIDecisionVariables and their states inside aConstraintSyntaxTree. For reuse, callsetConfiguration(Configuration)first, then visit the respective constraint, and finallyclear().- Author:
- El-Sharkawy, Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private Configurationconfigprivate EvaluationVisitorevaluator
-
Constructor Summary
Constructors Constructor Description AbstractStateVariablesInConstraintFinder()Creates a constraint finder for reuse.AbstractStateVariablesInConstraintFinder(ConstraintSyntaxTree cst, Configuration config)Creates a constraint finder for single use directly oncst.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidaddVariable(IDecisionVariable var)Adds 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 ConfigurationgetConfiguration()Returns the assigned configuration.protected EvaluationVisitorgetEvaluator()Returns the evaluator.voidsetConfiguration(Configuration config)Defines the configuration to work on.voidvisitAnnotationVariable(AttributeVariable variable)Visits aAttributeVariable.voidvisitCompoundAccess(CompoundAccess access)Visits a compound access node.voidvisitContainerOperationCall(ContainerOperationCall call)Visits a container operation call (e.g.voidvisitLet(Let let)Visits 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, visitIfThen, visitMultiAndExpression, visitOclFeatureCall, visitParenthesis, visitSelf, visitUnresolvedExpression, visitValue
-
-
-
-
Field Detail
-
config
private Configuration config
-
evaluator
private EvaluationVisitor evaluator
-
-
Constructor Detail
-
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
public AbstractStateVariablesInConstraintFinder(ConstraintSyntaxTree cst, Configuration config)
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 the cst belongs to (must not be null).
-
-
Method Detail
-
setConfiguration
public void setConfiguration(Configuration config)
Defines the configuration to work on.- Parameters:
config- the configuration
-
clear
public void clear()
Clears this visitor for reuse.
-
visitVariable
public void visitVariable(Variable variable)
Description copied from interface:IConstraintTreeVisitorVisits a variable.- Specified by:
visitVariablein interfaceIConstraintTreeVisitor- Overrides:
visitVariablein classAbstractVariableInConstraintFinder- Parameters:
variable- the variable which should be visited
-
visitAnnotationVariable
public void visitAnnotationVariable(AttributeVariable variable)
Description copied from interface:IConstraintTreeVisitorVisits aAttributeVariable.- Parameters:
variable- the attribute variable which should be visited
-
addVariable
protected void addVariable(AbstractVariable declaration)
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(IDecisionVariable)
-
addVariable
protected abstract void addVariable(IDecisionVariable var)
Adds the relatedIDecisionVariableand their state to the result.- Parameters:
var- the variable to be added, may be null, ignored then
-
visitLet
public void visitLet(Let let)
Description copied from interface:IConstraintTreeVisitorVisits a let expression.- Parameters:
let- the let expression which should be visited
-
visitContainerOperationCall
public void visitContainerOperationCall(ContainerOperationCall call)
Description copied from interface:IConstraintTreeVisitorVisits a container operation call (e.g. quantors, iterators).- Parameters:
call- the container operation call
-
visitCompoundAccess
public void visitCompoundAccess(CompoundAccess access)
Description copied from interface:IConstraintTreeVisitorVisits a compound access node.- Parameters:
access- the compound access node
-
getEvaluator
protected EvaluationVisitor getEvaluator()
Returns the evaluator. Only initialized aftersetConfiguration(Configuration)and beforeclear().- Returns:
- the evaluator
-
getConfiguration
protected Configuration getConfiguration()
Returns the assigned configuration. Only initialized aftersetConfiguration(Configuration)and beforeclear().- Returns:
- the configuration
-
-