Class CSTCopyVisitor
java.lang.Object
net.ssehub.easy.varModel.cst.BasicCopyVisitor
net.ssehub.easy.varModel.cst.CopyVisitor
net.ssehub.easy.varModel.model.rewrite.CSTCopyVisitor
- All Implemented Interfaces:
IConstraintTreeVisitor
Special
CopyVisitor as needed by the ProjectCopyVisitor.- Author:
- El-Sharkawy
-
Nested Class Summary
Nested classes/interfaces inherited from class net.ssehub.easy.varModel.cst.CopyVisitor
CopyVisitor.IVariableReplacer -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate ProjectCopyVisitorprivate booleanprivate boolean -
Constructor Summary
ConstructorsConstructorDescriptionCSTCopyVisitor(Map<AbstractVariable, AbstractVariable> mapping, ProjectCopyVisitor copyier) Creates a copy visitor with explicit mapping. -
Method Summary
Modifier and TypeMethodDescriptionprivate AbstractVariablemapAnnotation(Attribute var) Part ofmapVariable(AbstractVariable)to mapAttributes.protected AbstractVariableMaps a variable.protected DecisionVariableDeclarationMaps a variable.(package private) voidsetForceaccessors(boolean forceAccessors) Specification whether this visitor should try to fix brokenICustomOperationAccessors.protected voidAllows inherited classed to overwrite visiting method and to return a partially translated cst.(package private) booleanSpecifies whether the constraint could be translated completely.voidvisitCompoundInitializer(CompoundInitializer initializer) Visits a compound initializer.voidvisitConstantValue(ConstantValue constantValue) Visits a constant value.voidvisitContainerInitializer(ContainerInitializer initializer) Visits a container initializer.voidVisits a container operation call (e.g.voidVisits an OCL feature call.voidVisits self.Methods inherited from class net.ssehub.easy.varModel.cst.CopyVisitor
getMapping, visitAnnotationVariable, visitVariableMethods inherited from class net.ssehub.easy.varModel.cst.BasicCopyVisitor
clear, getCopyExpressions, getCopyVariables, getLogger, getResult, inferDatatype, setCopyConstants, setCopyExpressions, setCopyVariables, setDoInferDatatype, visitBlockExpression, visitComment, visitCompoundAccess, visitDeferInitExpression, visitIfThen, visitLet, visitMultiAndExpression, visitParenthesis, visitUnresolvedExpression
-
Field Details
-
visitItrExpression
private boolean visitItrExpression -
complete
private boolean complete -
copyier
-
forceAccessors
private boolean forceAccessors
-
-
Constructor Details
-
CSTCopyVisitor
CSTCopyVisitor(Map<AbstractVariable, AbstractVariable> mapping, ProjectCopyVisitor copyier) Creates a copy visitor with explicit mapping. This is for the final round of translation, where all projects have been translated.- Parameters:
mapping- a mapping from old variable declarations to new variable declarations, existing variable declarations are taken over if no mapping is given, may be null in case of no mapping at allcopyier- The callingProjectCopyVisitor, containing the list of currently translated projects.
-
-
Method Details
-
setForceaccessors
void setForceaccessors(boolean forceAccessors) Specification whether this visitor should try to fix brokenICustomOperationAccessors. These are usuallyProjects.- Parameters:
forceAccessors-trueIf an accessor could not be found, a fallback (unprezise) mechanism is used, this should only be used at the end of the translation if all projects are surely copied,falseis the default option for this.
-
translatedCompletely
boolean translatedCompletely()Specifies whether the constraint could be translated completely.- Returns:
trueconstraint was translated completely,falseuntranslated declarations have been used and must be translated at a later point.
-
mapVariable
Description copied from class:BasicCopyVisitorMaps a variable.- Overrides:
mapVariablein classCopyVisitor- Parameters:
var- the variable to be mapped- Returns:
- the mapped variable or
var
-
mapAnnotation
Part ofmapVariable(AbstractVariable)to mapAttributes.- Parameters:
var- the annotation to be mapped- Returns:
- the mapped variable or
var
-
visitOclFeatureCall
Description copied from interface:IConstraintTreeVisitorVisits an OCL feature call.- Specified by:
visitOclFeatureCallin interfaceIConstraintTreeVisitor- Overrides:
visitOclFeatureCallin classBasicCopyVisitor- Parameters:
call- the feature call which should be visited
-
visitCompoundInitializer
Description copied from interface:IConstraintTreeVisitorVisits a compound initializer.- Specified by:
visitCompoundInitializerin interfaceIConstraintTreeVisitor- Overrides:
visitCompoundInitializerin classBasicCopyVisitor- Parameters:
initializer- the compound initializer node
-
visitContainerInitializer
Description copied from interface:IConstraintTreeVisitorVisits a container initializer.- Specified by:
visitContainerInitializerin interfaceIConstraintTreeVisitor- Overrides:
visitContainerInitializerin classBasicCopyVisitor- Parameters:
initializer- the container initializer node
-
visitContainerOperationCall
Description copied from interface:IConstraintTreeVisitorVisits a container operation call (e.g. quantors, iterators).- Specified by:
visitContainerOperationCallin interfaceIConstraintTreeVisitor- Overrides:
visitContainerOperationCallin classBasicCopyVisitor- Parameters:
call- the container operation call
-
mapVariable
Description copied from class:BasicCopyVisitorMaps a variable.- Overrides:
mapVariablein classCopyVisitor- Parameters:
var- the variable to be mapped- Returns:
- the mapped variable or
var
-
visitConstantValue
Description copied from interface:IConstraintTreeVisitorVisits a constant value.- Specified by:
visitConstantValuein interfaceIConstraintTreeVisitor- Overrides:
visitConstantValuein classBasicCopyVisitor- Parameters:
constantValue- the value which should be visited
-
visitSelf
Description copied from interface:IConstraintTreeVisitorVisits self.- Specified by:
visitSelfin interfaceIConstraintTreeVisitor- Overrides:
visitSelfin classCopyVisitor- Parameters:
self- the self object to visit
-
setResult
Description copied from class:BasicCopyVisitorAllows inherited classed to overwrite visiting method and to return a partially translated cst.- Overrides:
setResultin classBasicCopyVisitor- Parameters:
cst- A partially copied cst.
-