public class AssignmentDetector extends java.lang.Object implements IConstraintTreeVisitor
clear() after use.| Modifier and Type | Field and Description |
|---|---|
private boolean |
isAssignment |
private int |
level |
static int |
LEVEL_UNLIMITED
The level specification to be used if traversal shall not be limited.
|
private int |
maxLevel |
static int |
NO_DEEP_TRAVERSAL
The level specification to be used if no deep traversal shall happen (just the top level).
|
| Constructor and Description |
|---|
AssignmentDetector() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears this visitor for reuse.
|
private boolean |
continueTraversal()
Returns whether the traversal of the given constraint shall be continued
in case of nested trees.
|
boolean |
isAssignment()
Returns whether the expression is an assignment at maximum at the given
level.
|
void |
setMaxLevel(int level)
Defines the maximum search level.
|
void |
visitAnnotationVariable(AttributeVariable variable)
Visits a
AttributeVariable. |
void |
visitBlockExpression(BlockExpression block)
Visits the block.
|
void |
visitComment(Comment comment)
Visits a comment.
|
void |
visitCompoundAccess(CompoundAccess access)
Visits a compound access node.
|
void |
visitCompoundInitializer(CompoundInitializer initializer)
Visits a compound initializer.
|
void |
visitConstantValue(ConstantValue value)
Visits a constant value.
|
void |
visitContainerInitializer(ContainerInitializer initializer)
Visits a container initializer.
|
void |
visitContainerOperationCall(ContainerOperationCall call)
Visits a container operation call (e.g. quantors, iterators).
|
void |
visitIfThen(IfThen ifThen)
Visits an if-then-else expression.
|
void |
visitLet(Let let)
Visits a let expression.
|
void |
visitMultiAndExpression(MultiAndExpression expression)
Visits a multi-and expression.
|
void |
visitOclFeatureCall(OCLFeatureCall call)
Visits an OCL feature call.
|
void |
visitParenthesis(Parenthesis parenthesis)
Visits a parenthesis.
|
void |
visitSelf(Self self)
Visits self.
|
void |
visitUnresolvedExpression(UnresolvedExpression expression)
Visits an unresolved expression.
|
void |
visitVariable(Variable variable)
Visits a variable.
|
public static final int LEVEL_UNLIMITED
public static final int NO_DEEP_TRAVERSAL
private boolean isAssignment
private int maxLevel
private int level
public void setMaxLevel(int level)
level - the maximum search level, may be LEVEL_UNLIMITED in order
to avoid any level limitation or NO_DEEP_TRAVERSAL in order to avoidpublic boolean isAssignment()
true if it is an assignment, false elsepublic void clear()
public void visitConstantValue(ConstantValue value)
IConstraintTreeVisitorvisitConstantValue in interface IConstraintTreeVisitorvalue - the value which should be visitedpublic void visitVariable(Variable variable)
IConstraintTreeVisitorvisitVariable in interface IConstraintTreeVisitorvariable - the variable which should be visitedpublic void visitAnnotationVariable(AttributeVariable variable)
IConstraintTreeVisitorAttributeVariable.visitAnnotationVariable in interface IConstraintTreeVisitorvariable - the attribute variable which should be visitedprivate boolean continueTraversal()
true if the traversal shall be continued, false elsepublic void visitParenthesis(Parenthesis parenthesis)
IConstraintTreeVisitorvisitParenthesis in interface IConstraintTreeVisitorparenthesis - the parenthesis which should be visitedpublic void visitComment(Comment comment)
IConstraintTreeVisitorvisitComment in interface IConstraintTreeVisitorcomment - the comment node which should be visitedpublic void visitOclFeatureCall(OCLFeatureCall call)
IConstraintTreeVisitorvisitOclFeatureCall in interface IConstraintTreeVisitorcall - the feature call which should be visitedpublic void visitMultiAndExpression(MultiAndExpression expression)
IConstraintTreeVisitorvisitMultiAndExpression in interface IConstraintTreeVisitorexpression - the expression to be visitedpublic void visitLet(Let let)
IConstraintTreeVisitorvisitLet in interface IConstraintTreeVisitorlet - the let expression which should be visitedpublic void visitIfThen(IfThen ifThen)
IConstraintTreeVisitorvisitIfThen in interface IConstraintTreeVisitorifThen - the if-then-else expression which should be visitedpublic void visitContainerOperationCall(ContainerOperationCall call)
IConstraintTreeVisitorvisitContainerOperationCall in interface IConstraintTreeVisitorcall - the container operation callpublic void visitCompoundAccess(CompoundAccess access)
IConstraintTreeVisitorvisitCompoundAccess in interface IConstraintTreeVisitoraccess - the compound access nodepublic void visitUnresolvedExpression(UnresolvedExpression expression)
IConstraintTreeVisitorUnresolvedExpression.getActualExpression().visitUnresolvedExpression in interface IConstraintTreeVisitorexpression - the expressionpublic void visitCompoundInitializer(CompoundInitializer initializer)
IConstraintTreeVisitorvisitCompoundInitializer in interface IConstraintTreeVisitorinitializer - the compound initializer nodepublic void visitContainerInitializer(ContainerInitializer initializer)
IConstraintTreeVisitorvisitContainerInitializer in interface IConstraintTreeVisitorinitializer - the container initializer nodepublic void visitSelf(Self self)
IConstraintTreeVisitorvisitSelf in interface IConstraintTreeVisitorself - the self object to visitpublic void visitBlockExpression(BlockExpression block)
IConstraintTreeVisitorvisitBlockExpression in interface IConstraintTreeVisitorblock - the block to be visitedCopyright © 2009 - 2018 SSE. All Rights Reserved.