Package net.ssehub.easy.varModel.cst
Class CopyVisitor
java.lang.Object
net.ssehub.easy.varModel.cst.BasicCopyVisitor
net.ssehub.easy.varModel.cst.CopyVisitor
- All Implemented Interfaces:
IConstraintTreeVisitor
- Direct Known Subclasses:
CSTCopyVisitor
Copies a constraint syntax tree possibly mapping the variables. May be
reused after calling
BasicCopyVisitor.clear()- Author:
- Holger Eichelberger
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDefines a common variable replacer. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate net.ssehub.easy.basics.modelManagement.IVersionRestriction.IVariableMapperprivate Map<AbstractVariable, AbstractVariable> private CopyVisitor.IVariableReplacer -
Constructor Summary
ConstructorsConstructorDescriptionCreates a copy visitor without mapping.CopyVisitor(Map<AbstractVariable, AbstractVariable> mapping) Creates a copy visitor with explicit mapping.CopyVisitor(net.ssehub.easy.basics.modelManagement.IVersionRestriction.IVariableMapper mapper) Creates a copy visitor with explicit mapping. -
Method Summary
Modifier and TypeMethodDescriptionprotected Map<AbstractVariable, AbstractVariable> Returns the specified variable mapping.protected AbstractVariableMaps a variable.protected DecisionVariableDeclarationMaps a variable.voidvisitAnnotationVariable(AttributeVariable variable) Visits aAttributeVariable.voidVisits self.voidvisitVariable(Variable variable) Visits a variable.Methods inherited from class net.ssehub.easy.varModel.cst.BasicCopyVisitor
clear, getCopyExpressions, getCopyVariables, getLogger, getResult, inferDatatype, setCopyConstants, setCopyExpressions, setCopyVariables, setDoInferDatatype, setResult, visitBlockExpression, visitComment, visitCompoundAccess, visitCompoundInitializer, visitConstantValue, visitContainerInitializer, visitContainerOperationCall, visitDeferInitExpression, visitIfThen, visitLet, visitMultiAndExpression, visitOclFeatureCall, visitParenthesis, visitUnresolvedExpression
-
Field Details
-
mapping
-
mapper
private net.ssehub.easy.basics.modelManagement.IVersionRestriction.IVariableMapper mapper -
replacer
-
-
Constructor Details
-
CopyVisitor
public CopyVisitor()Creates a copy visitor without mapping. -
CopyVisitor
Creates a copy visitor with explicit mapping.- 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 all
-
CopyVisitor
public CopyVisitor(net.ssehub.easy.basics.modelManagement.IVersionRestriction.IVariableMapper mapper) Creates a copy visitor with explicit mapping.- Parameters:
mapper- the variable mapper (may be null)
-
-
Method Details
-
getMapping
Returns the specified variable mapping.- Returns:
- A mapping from old variable declarations to new variable declarations, existing variable declarations are taken over if no mapping is given, may be null
-
visitVariable
Description copied from interface:IConstraintTreeVisitorVisits a variable.- Specified by:
visitVariablein interfaceIConstraintTreeVisitor- Overrides:
visitVariablein classBasicCopyVisitor- Parameters:
variable- the variable which should be visited
-
mapVariable
Description copied from class:BasicCopyVisitorMaps a variable.- Overrides:
mapVariablein classBasicCopyVisitor- Parameters:
var- the variable to be mapped- Returns:
- the mapped variable or
var
-
mapVariable
Description copied from class:BasicCopyVisitorMaps a variable.- Overrides:
mapVariablein classBasicCopyVisitor- Parameters:
var- the variable to be mapped- Returns:
- the mapped variable or
var
-
visitAnnotationVariable
Description copied from interface:IConstraintTreeVisitorVisits aAttributeVariable.- Specified by:
visitAnnotationVariablein interfaceIConstraintTreeVisitor- Overrides:
visitAnnotationVariablein classBasicCopyVisitor- Parameters:
variable- the attribute variable which should be visited
-
visitSelf
Description copied from interface:IConstraintTreeVisitorVisits self.- Specified by:
visitSelfin interfaceIConstraintTreeVisitor- Overrides:
visitSelfin classBasicCopyVisitor- Parameters:
self- the self object to visit
-