Class ConstraintClassifier
- java.lang.Object
-
- net.ssehub.easy.varModel.model.filter.ConstraintClassifier
-
- All Implemented Interfaces:
IConstraintTreeVisitor
class ConstraintClassifier extends java.lang.Object implements IConstraintTreeVisitor
This class is able to classify a constraint in one of the following categories.- AssignmentConstraints - Assigning one value to exactly one variable
- Constraints - all other constraints without the AssignmentConstraints
- Author:
- El-Sharkawy
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classConstraintClassifier.ExpectedTypeWith the aid of this enum is it possible to tell the Classifier which part of a constraint is expected to be next.
-
Field Summary
Fields Modifier and Type Field Description private booleanisAssingmentConstraintprivate ConstraintClassifier.ExpectedTypenextType
-
Constructor Summary
Constructors Constructor Description ConstraintClassifier(ConstraintSyntaxTree tree)Sole constructor for this class, classifies exactly one constraint, whether it is an AssignmentConstraint.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) booleanisAssingmentConstraint()Returns whether the given ConstraintTree is an AssignmentConstraint or not.voidvisitAnnotationVariable(AttributeVariable variable)Visits aAttributeVariable.voidvisitBlockExpression(BlockExpression block)Visits the block.voidvisitComment(Comment parenthesis)Visits a comment.voidvisitCompoundAccess(CompoundAccess access)Visits a compound access node.voidvisitCompoundInitializer(CompoundInitializer init)Visits a compound initializer.voidvisitConstantValue(ConstantValue value)Visits a constant value.voidvisitContainerInitializer(ContainerInitializer init)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
-
nextType
private ConstraintClassifier.ExpectedType nextType
-
isAssingmentConstraint
private boolean isAssingmentConstraint
-
-
Constructor Detail
-
ConstraintClassifier
ConstraintClassifier(ConstraintSyntaxTree tree)
Sole constructor for this class, classifies exactly one constraint, whether it is an AssignmentConstraint.- Parameters:
tree- The constraint which should be classified.
-
-
Method Detail
-
isAssingmentConstraint
boolean isAssingmentConstraint()
Returns whether the given ConstraintTree is an AssignmentConstraint or not.- Returns:
trueif the given constraint is an AssignmentConstraint, otherwisefalse.
-
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
-
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
-
visitContainerInitializer
public void visitContainerInitializer(ContainerInitializer init)
Description copied from interface:IConstraintTreeVisitorVisits a container initializer.- Specified by:
visitContainerInitializerin interfaceIConstraintTreeVisitor- Parameters:
init- the container initializer node
-
visitCompoundInitializer
public void visitCompoundInitializer(CompoundInitializer init)
Description copied from interface:IConstraintTreeVisitorVisits a compound initializer.- Specified by:
visitCompoundInitializerin interfaceIConstraintTreeVisitor- Parameters:
init- the compound initializer node
-
visitComment
public void visitComment(Comment parenthesis)
Description copied from interface:IConstraintTreeVisitorVisits a comment.- Specified by:
visitCommentin interfaceIConstraintTreeVisitor- Parameters:
parenthesis- the comment node which should be visited
-
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
-
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
-
-