Class AssignmentReducer
java.lang.Object
net.ssehub.easy.varModel.cst.AbstractConstraintTreeVisitor
net.ssehub.easy.varModel.model.rewrite.AssignmentReducer
- All Implemented Interfaces:
IConstraintTreeVisitor
Part of the
Visiting should be started with
ProjectRewriteVisitor to remove sub values of a RHS of an assignment, if declarations
of this assignments have been removed.Visiting should be started with
reduce(OCLFeatureCall) instead of using the usual
accept methods.- Author:
- El-Sharkawy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate RewriteContextprivate booleanprivate ConstraintSyntaxTree -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) booleanReturns whether the given assignment was filtered or not.protected ConstraintSyntaxTreereduce(OCLFeatureCall assignment) Start method for reducing assignments.voidvisitCompoundInitializer(CompoundInitializer initializer) Visits a compound initializer.voidvisitConstantValue(ConstantValue constValue) Visits a constant value.voidvisitContainerInitializer(ContainerInitializer initializer) Visits a container initializer.Methods inherited from class net.ssehub.easy.varModel.cst.AbstractConstraintTreeVisitor
visitAnnotationVariable, visitBlockExpression, visitComment, visitCompoundAccess, visitContainerOperationCall, visitDeferInitExpression, visitIfThen, visitLet, visitMultiAndExpression, visitOclFeatureCall, visitParenthesis, visitSelf, visitUnresolvedExpression, visitVariable
-
Field Details
-
context
-
result
-
filtered
private boolean filtered
-
-
Constructor Details
-
AssignmentReducer
AssignmentReducer(RewriteContext context) Default constructor.- Parameters:
context- The context, containing information about filtered elements.
-
-
Method Details
-
reduce
Start method for reducing assignments.- Parameters:
assignment- And assignment constraint.- Returns:
- Will return
- The passed call, if if was not an assignment or if nothing was to filter
- The filtered assignment, if some of the used elements were removed
- null, if all elements or necessary elements have been removed.
-
hasFiltered
boolean hasFiltered()Returns whether the given assignment was filtered or not.- Returns:
trueSomething was filtered,falseassignment is at it was before.
-
visitConstantValue
Description copied from interface:IConstraintTreeVisitorVisits a constant value.- Specified by:
visitConstantValuein interfaceIConstraintTreeVisitor- Overrides:
visitConstantValuein classAbstractConstraintTreeVisitor- Parameters:
constValue- the value which should be visited
-
visitCompoundInitializer
Description copied from interface:IConstraintTreeVisitorVisits a compound initializer.- Specified by:
visitCompoundInitializerin interfaceIConstraintTreeVisitor- Overrides:
visitCompoundInitializerin classAbstractConstraintTreeVisitor- Parameters:
initializer- the compound initializer node
-
visitContainerInitializer
Description copied from interface:IConstraintTreeVisitorVisits a container initializer.- Specified by:
visitContainerInitializerin interfaceIConstraintTreeVisitor- Overrides:
visitContainerInitializerin classAbstractConstraintTreeVisitor- Parameters:
initializer- the container initializer node
-