public class AssignmentDetector
extends java.lang.Object
implements net.ssehub.easy.varModel.cst.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(net.ssehub.easy.varModel.cst.AttributeVariable variable) |
void |
visitBlockExpression(net.ssehub.easy.varModel.cst.BlockExpression block) |
void |
visitComment(net.ssehub.easy.varModel.cst.Comment comment) |
void |
visitCompoundAccess(net.ssehub.easy.varModel.cst.CompoundAccess access) |
void |
visitCompoundInitializer(net.ssehub.easy.varModel.cst.CompoundInitializer initializer) |
void |
visitConstantValue(net.ssehub.easy.varModel.cst.ConstantValue value) |
void |
visitContainerInitializer(net.ssehub.easy.varModel.cst.ContainerInitializer initializer) |
void |
visitContainerOperationCall(net.ssehub.easy.varModel.cst.ContainerOperationCall call) |
void |
visitIfThen(net.ssehub.easy.varModel.cst.IfThen ifThen) |
void |
visitLet(net.ssehub.easy.varModel.cst.Let let) |
void |
visitMultiAndExpression(net.ssehub.easy.varModel.cst.MultiAndExpression expression) |
void |
visitOclFeatureCall(net.ssehub.easy.varModel.cst.OCLFeatureCall call) |
void |
visitParenthesis(net.ssehub.easy.varModel.cst.Parenthesis parenthesis) |
void |
visitSelf(net.ssehub.easy.varModel.cst.Self self) |
void |
visitUnresolvedExpression(net.ssehub.easy.varModel.cst.UnresolvedExpression expression) |
void |
visitVariable(net.ssehub.easy.varModel.cst.Variable 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(net.ssehub.easy.varModel.cst.ConstantValue value)
visitConstantValue in interface net.ssehub.easy.varModel.cst.IConstraintTreeVisitorpublic void visitVariable(net.ssehub.easy.varModel.cst.Variable variable)
visitVariable in interface net.ssehub.easy.varModel.cst.IConstraintTreeVisitorpublic void visitAnnotationVariable(net.ssehub.easy.varModel.cst.AttributeVariable variable)
visitAnnotationVariable in interface net.ssehub.easy.varModel.cst.IConstraintTreeVisitorprivate boolean continueTraversal()
true if the traversal shall be continued, false elsepublic void visitParenthesis(net.ssehub.easy.varModel.cst.Parenthesis parenthesis)
visitParenthesis in interface net.ssehub.easy.varModel.cst.IConstraintTreeVisitorpublic void visitComment(net.ssehub.easy.varModel.cst.Comment comment)
visitComment in interface net.ssehub.easy.varModel.cst.IConstraintTreeVisitorpublic void visitOclFeatureCall(net.ssehub.easy.varModel.cst.OCLFeatureCall call)
visitOclFeatureCall in interface net.ssehub.easy.varModel.cst.IConstraintTreeVisitorpublic void visitMultiAndExpression(net.ssehub.easy.varModel.cst.MultiAndExpression expression)
visitMultiAndExpression in interface net.ssehub.easy.varModel.cst.IConstraintTreeVisitorpublic void visitLet(net.ssehub.easy.varModel.cst.Let let)
visitLet in interface net.ssehub.easy.varModel.cst.IConstraintTreeVisitorpublic void visitIfThen(net.ssehub.easy.varModel.cst.IfThen ifThen)
visitIfThen in interface net.ssehub.easy.varModel.cst.IConstraintTreeVisitorpublic void visitContainerOperationCall(net.ssehub.easy.varModel.cst.ContainerOperationCall call)
visitContainerOperationCall in interface net.ssehub.easy.varModel.cst.IConstraintTreeVisitorpublic void visitCompoundAccess(net.ssehub.easy.varModel.cst.CompoundAccess access)
visitCompoundAccess in interface net.ssehub.easy.varModel.cst.IConstraintTreeVisitorpublic void visitUnresolvedExpression(net.ssehub.easy.varModel.cst.UnresolvedExpression expression)
visitUnresolvedExpression in interface net.ssehub.easy.varModel.cst.IConstraintTreeVisitorpublic void visitCompoundInitializer(net.ssehub.easy.varModel.cst.CompoundInitializer initializer)
visitCompoundInitializer in interface net.ssehub.easy.varModel.cst.IConstraintTreeVisitorpublic void visitContainerInitializer(net.ssehub.easy.varModel.cst.ContainerInitializer initializer)
visitContainerInitializer in interface net.ssehub.easy.varModel.cst.IConstraintTreeVisitorpublic void visitSelf(net.ssehub.easy.varModel.cst.Self self)
visitSelf in interface net.ssehub.easy.varModel.cst.IConstraintTreeVisitorpublic void visitBlockExpression(net.ssehub.easy.varModel.cst.BlockExpression block)
visitBlockExpression in interface net.ssehub.easy.varModel.cst.IConstraintTreeVisitorCopyright © 2009 - 2018 SSE. All Rights Reserved.