Class VariablesInNotSimpleAssignmentConstraintsFinder
- java.lang.Object
-
- net.ssehub.easy.reasoning.sseReasoner.model.VariablesInNotSimpleAssignmentConstraintsFinder
-
- All Implemented Interfaces:
IConstraintTreeVisitor
public class VariablesInNotSimpleAssignmentConstraintsFinder extends java.lang.Object implements IConstraintTreeVisitor
A visitor to retrieve variables from constraints.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanaddprivate Configurationconfigprivate Constraintconstraintprivate VariablesMapconstraintMapprivate EvaluationVisitorevaluator
-
Constructor Summary
Constructors Constructor Description VariablesInNotSimpleAssignmentConstraintsFinder(VariablesMap constraintMap)Creates a visitor instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(Constraint constraint, Configuration config)Accepts and visits a constraint.voidacceptAndClear(java.util.List<Constraint> constraints, Configuration config, boolean add)Combines#accept(Constraint)andclear()for an iterable of constraints.voidacceptAndClear(Constraint constraint, Configuration config)Combines#accept(Constraint)andclear().voidacceptAndClear(Constraint constraint, Configuration config, boolean add)Combines#accept(Constraint)andclear().voidclear()Clears this visitor for reuse.VariablesInNotSimpleAssignmentConstraintsFinderforRemove()Turns this finder into remove mode.private booleanisConstraint(ConstraintSyntaxTree cst)Returns whether the type ofcstis a constraint type.private voidmodifyRelation(AbstractVariable variable, Constraint constraint)voidvisitAnnotationVariable(AttributeVariable variable)Visits aAttributeVariable.voidvisitBlockExpression(BlockExpression block)Visits the block.voidvisitComment(Comment comment)Visits a comment.voidvisitCompoundAccess(CompoundAccess access)Visits a compound access node.voidvisitCompoundInitializer(CompoundInitializer initializer)Visits a compound initializer.voidvisitConstantValue(ConstantValue value)Visits a constant value.voidvisitContainerInitializer(ContainerInitializer initializer)Visits a container initializer.voidvisitContainerOperationCall(ContainerOperationCall call)Visits a container operation call (e.g.voidvisitIfThen(IfThen ifThen)Visits an if-then-else expression.voidvisitLet(Let let)Visits a let expression.voidvisitMultiAndExpression(MultiAndExpression expression)Visits a multi-and expression.voidvisitOclFeatureCall(OCLFeatureCall call)Visits an OCL feature call.voidvisitParenthesis(Parenthesis parenthesis)Visits a parenthesis.voidvisitSelf(Self self)Visits self.voidvisitUnresolvedExpression(UnresolvedExpression expression)Visits an unresolved expression.voidvisitVariable(Variable variable)Visits a variable.
-
-
-
Field Detail
-
config
private Configuration config
-
constraintMap
private VariablesMap constraintMap
-
constraint
private Constraint constraint
-
add
private boolean add
-
evaluator
private EvaluationVisitor evaluator
-
-
Constructor Detail
-
VariablesInNotSimpleAssignmentConstraintsFinder
public VariablesInNotSimpleAssignmentConstraintsFinder(VariablesMap constraintMap)
Creates a visitor instance.- Parameters:
constraintMap- the constraint map to use for storing results
-
-
Method Detail
-
accept
public void accept(Constraint constraint, Configuration config)
Accepts and visits a constraint.- Parameters:
constraint- the constraint to acceptconfig- the configuration used to resolve expressions
-
acceptAndClear
public void acceptAndClear(Constraint constraint, Configuration config)
Combines#accept(Constraint)andclear().- Parameters:
constraint- the constraint to acceptconfig- the configuration used to resolve expressions
-
acceptAndClear
public void acceptAndClear(Constraint constraint, Configuration config, boolean add)
Combines#accept(Constraint)andclear().- Parameters:
constraint- the constraint to acceptconfig- the configuration used to resolve expressionsadd- addtrueor removefalse
-
acceptAndClear
public void acceptAndClear(java.util.List<Constraint> constraints, Configuration config, boolean add)
Combines#accept(Constraint)andclear()for an iterable of constraints.- Parameters:
constraints- the constraints to acceptconfig- the configuration used to resolve expressionsadd- addtrueor removefalse
-
clear
public void clear()
Clears this visitor for reuse.
-
forRemove
public VariablesInNotSimpleAssignmentConstraintsFinder forRemove()
Turns this finder into remove mode.- Returns:
- this
-
visitConstantValue
public void visitConstantValue(ConstantValue value)
Description copied from interface:IConstraintTreeVisitorVisits a constant value.- Specified by:
visitConstantValuein interfaceIConstraintTreeVisitor- Parameters:
value- the value which should be visited
-
visitVariable
public void visitVariable(Variable variable)
Description copied from interface:IConstraintTreeVisitorVisits a variable.- Specified by:
visitVariablein interfaceIConstraintTreeVisitor- Parameters:
variable- the variable which should be visited
-
modifyRelation
private void modifyRelation(AbstractVariable variable, Constraint constraint)
- Parameters:
variable- the variableconstraint- the constraint
-
visitAnnotationVariable
public void visitAnnotationVariable(AttributeVariable variable)
Description copied from interface:IConstraintTreeVisitorVisits aAttributeVariable.- Specified by:
visitAnnotationVariablein interfaceIConstraintTreeVisitor- Parameters:
variable- the attribute variable which should be visited
-
visitParenthesis
public void visitParenthesis(Parenthesis parenthesis)
Description copied from interface:IConstraintTreeVisitorVisits a parenthesis.- Specified by:
visitParenthesisin interfaceIConstraintTreeVisitor- Parameters:
parenthesis- the parenthesis which should be visited
-
visitComment
public void visitComment(Comment comment)
Description copied from interface:IConstraintTreeVisitorVisits a comment.- Specified by:
visitCommentin interfaceIConstraintTreeVisitor- Parameters:
comment- the comment node which should be visited
-
isConstraint
private boolean isConstraint(ConstraintSyntaxTree cst)
Returns whether the type ofcstis a constraint type.- Parameters:
cst- the constraint syntax tree to look for- Returns:
truefor constraint type,falseelse
-
visitOclFeatureCall
public void visitOclFeatureCall(OCLFeatureCall call)
Description copied from interface:IConstraintTreeVisitorVisits an OCL feature call.- Specified by:
visitOclFeatureCallin interfaceIConstraintTreeVisitor- Parameters:
call- the feature call which should be visited
-
visitMultiAndExpression
public void visitMultiAndExpression(MultiAndExpression expression)
Description copied from interface:IConstraintTreeVisitorVisits a multi-and expression.- Specified by:
visitMultiAndExpressionin interfaceIConstraintTreeVisitor- Parameters:
expression- the expression to be visited
-
visitLet
public void visitLet(Let let)
Description copied from interface:IConstraintTreeVisitorVisits a let expression.- Specified by:
visitLetin interfaceIConstraintTreeVisitor- Parameters:
let- the let expression which should be visited
-
visitIfThen
public void visitIfThen(IfThen ifThen)
Description copied from interface:IConstraintTreeVisitorVisits an if-then-else expression.- Specified by:
visitIfThenin interfaceIConstraintTreeVisitor- Parameters:
ifThen- the if-then-else expression which should be visited
-
visitContainerOperationCall
public void visitContainerOperationCall(ContainerOperationCall call)
Description copied from interface:IConstraintTreeVisitorVisits a container operation call (e.g. quantors, iterators).- Specified by:
visitContainerOperationCallin interfaceIConstraintTreeVisitor- Parameters:
call- the container operation call
-
visitCompoundAccess
public void visitCompoundAccess(CompoundAccess access)
Description copied from interface:IConstraintTreeVisitorVisits a compound access node.- Specified by:
visitCompoundAccessin interfaceIConstraintTreeVisitor- Parameters:
access- the compound access node
-
visitUnresolvedExpression
public void visitUnresolvedExpression(UnresolvedExpression expression)
Description copied from interface:IConstraintTreeVisitorVisits an unresolved expression. Please note that an unresolved expression may represent a leaf as well as an inner tree node. Typically, visitors shall continue visiting transparently atUnresolvedExpression.getActualExpression().- Specified by:
visitUnresolvedExpressionin interfaceIConstraintTreeVisitor- Parameters:
expression- the expression
-
visitCompoundInitializer
public void visitCompoundInitializer(CompoundInitializer initializer)
Description copied from interface:IConstraintTreeVisitorVisits a compound initializer.- Specified by:
visitCompoundInitializerin interfaceIConstraintTreeVisitor- Parameters:
initializer- the compound initializer node
-
visitContainerInitializer
public void visitContainerInitializer(ContainerInitializer initializer)
Description copied from interface:IConstraintTreeVisitorVisits a container initializer.- Specified by:
visitContainerInitializerin interfaceIConstraintTreeVisitor- Parameters:
initializer- the container initializer node
-
visitSelf
public void visitSelf(Self self)
Description copied from interface:IConstraintTreeVisitorVisits self.- Specified by:
visitSelfin interfaceIConstraintTreeVisitor- Parameters:
self- the self object to visit
-
visitBlockExpression
public void visitBlockExpression(BlockExpression block)
Description copied from interface:IConstraintTreeVisitorVisits the block.- Specified by:
visitBlockExpressionin interfaceIConstraintTreeVisitor- Parameters:
block- the block to be visited
-
-