Class ExpressionCopyVisitor
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.expressions.CopyVisitor
-
- net.ssehub.easy.instantiation.core.model.buildlangModel.ExpressionCopyVisitor
-
- All Implemented Interfaces:
IVisitor,IMatchVisitor,IVisitor,IExpressionVisitor
public class ExpressionCopyVisitor extends CopyVisitor implements IVisitor
The copy visitor for VIL expressions.- Author:
- Holger Eichelberger
-
-
Constructor Summary
Constructors Constructor Description ExpressionCopyVisitor(java.util.Map<VariableDeclaration,VariableDeclaration> mapping, boolean reuse)Creates a new copy visitor.ExpressionCopyVisitor(java.util.Map<VariableDeclaration,VariableDeclaration> mapping, boolean reuse, IVersionRestriction.IVariableMapper mapper)Creates a new copy visitor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectvisitAdvice(Advice advice)Visits an advice.java.lang.ObjectvisitAlternativeExpression(AlternativeExpression alt)Visits an alternative.java.lang.ObjectvisitArtifactMatchExpression(ArtifactMatchExpression expression)Visits an artifact match expression.java.lang.ObjectvisitBooleanMatchExpression(BooleanMatchExpression expression)Visits a boolean match expression.java.lang.ObjectvisitCollectionMatchExpression(CollectionMatchExpression expression)Visits a collection match expression.java.lang.ObjectvisitCompound(Compound compound)Visits a compound.java.lang.ObjectvisitCompoundMatchExpression(CompoundMatchExpression expression)Visits a compound match expression.java.lang.ObjectvisitExpressionStatement(ExpressionStatement statement)Visits a statement.java.lang.ObjectvisitForStatement(ForStatement stmt)Visits a for statement.java.lang.ObjectvisitInstantiateExpression(InstantiateExpression inst)Visits an instantiate expression.java.lang.ObjectvisitJoinExpression(JoinExpression ex)Visits a join expression.java.lang.ObjectvisitJoinVariableDeclaration(JoinVariableDeclaration decl)Visits a join variable declaration.java.lang.ObjectvisitLoadProperties(LoadProperties properties)Visits a load properties directive.java.lang.ObjectvisitMapExpression(MapExpression map)Visits a map expression.java.lang.ObjectvisitPathMatchExpression(PathMatchExpression expression)Visits a path match expression.java.lang.ObjectvisitRule(Rule rule)Visits a rule.java.lang.ObjectvisitRule(VtlRule rule)Visits a VTL mapping rule.java.lang.ObjectvisitRuleCallExpression(RuleCallExpression ex)Visits a rule call expression.java.lang.ObjectvisitScript(Script script)Visits a script.java.lang.ObjectvisitStrategyCallExpression(StrategyCallExpression call)Visits a strategy call node.java.lang.ObjectvisitStringMatchExpression(StringMatchExpression expression)Visits a string match expression.java.lang.ObjectvisitTypedef(Typedef typedef)Visits a typedef.java.lang.ObjectvisitVariableDeclaration(VariableDeclaration var)Visits a variable declaration.java.lang.ObjectvisitWhileStatement(WhileStatement stmt)Visits a while statement.-
Methods inherited from class net.ssehub.easy.instantiation.core.model.expressions.CopyVisitor
copyCallArguments, copyExpression, copyExpressions, getMapper, map, visitCallExpression, visitCompositeExpression, visitConstantExpression, visitContainerInitializerExpression, visitExpression, visitExpressionEvaluator, visitFieldAccessExpression, visitMultiAndExpression, visitParenthesisExpression, visitResolvableOperationCallExpression, visitResolvableOperationExpression, visitStringExpression, visitValueAssignmentExpression, visitVariableExpression, visitVarModelIdentifierExpression, visitVilTypeExpression
-
-
-
-
Constructor Detail
-
ExpressionCopyVisitor
public ExpressionCopyVisitor(java.util.Map<VariableDeclaration,VariableDeclaration> mapping, boolean reuse)
Creates a new copy visitor.- Parameters:
mapping- the variable mapping to be considered while copying (may be null for no mapping)reuse- whether leaves shall be reused rather than created again
-
ExpressionCopyVisitor
public ExpressionCopyVisitor(java.util.Map<VariableDeclaration,VariableDeclaration> mapping, boolean reuse, IVersionRestriction.IVariableMapper mapper)
Creates a new copy visitor.- Parameters:
mapping- the variable mapping to be considered while copying (may be null for no mapping)reuse- whether leaves shall be reused rather than created againmapper- an optional variable mapper (may be null if absent)
-
-
Method Detail
-
visitVariableDeclaration
public java.lang.Object visitVariableDeclaration(VariableDeclaration var) throws VilException
Description copied from interface:IVisitorVisits a variable declaration.- Specified by:
visitVariableDeclarationin interfaceIVisitor- Parameters:
var- the variable declaration- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitCompound
public java.lang.Object visitCompound(Compound compound) throws VilException
Description copied from interface:IVisitorVisits a compound.- Specified by:
visitCompoundin interfaceIVisitor- Parameters:
compound- the compound- Returns:
- the result of visiting (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitAdvice
public java.lang.Object visitAdvice(Advice advice) throws VilException
Description copied from interface:IVisitorVisits an advice.- Specified by:
visitAdvicein interfaceIVisitor- Parameters:
advice- the advice to be visited- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitExpressionStatement
public java.lang.Object visitExpressionStatement(ExpressionStatement statement) throws VilException
Description copied from interface:IVisitorVisits a statement.- Specified by:
visitExpressionStatementin interfaceIVisitor- Parameters:
statement- the statement- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitPathMatchExpression
public java.lang.Object visitPathMatchExpression(PathMatchExpression expression) throws VilException
Description copied from interface:IMatchVisitorVisits a path match expression.- Specified by:
visitPathMatchExpressionin interfaceIMatchVisitor- Parameters:
expression- the expression- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitBooleanMatchExpression
public java.lang.Object visitBooleanMatchExpression(BooleanMatchExpression expression) throws VilException
Description copied from interface:IMatchVisitorVisits a boolean match expression.- Specified by:
visitBooleanMatchExpressionin interfaceIMatchVisitor- Parameters:
expression- the expression- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitStringMatchExpression
public java.lang.Object visitStringMatchExpression(StringMatchExpression expression) throws VilException
Description copied from interface:IMatchVisitorVisits a string match expression.- Specified by:
visitStringMatchExpressionin interfaceIMatchVisitor- Parameters:
expression- the expression- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitArtifactMatchExpression
public java.lang.Object visitArtifactMatchExpression(ArtifactMatchExpression expression) throws VilException
Description copied from interface:IMatchVisitorVisits an artifact match expression.- Specified by:
visitArtifactMatchExpressionin interfaceIMatchVisitor- Parameters:
expression- the expression- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitCollectionMatchExpression
public java.lang.Object visitCollectionMatchExpression(CollectionMatchExpression expression) throws VilException
Description copied from interface:IMatchVisitorVisits a collection match expression.- Specified by:
visitCollectionMatchExpressionin interfaceIMatchVisitor- Parameters:
expression- the expression- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitScript
public java.lang.Object visitScript(Script script) throws VilException
Description copied from interface:IVisitorVisits a script.- Specified by:
visitScriptin interfaceIVisitor- Parameters:
script- the project instance- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitLoadProperties
public java.lang.Object visitLoadProperties(LoadProperties properties) throws VilException
Description copied from interface:IVisitorVisits a load properties directive.- Specified by:
visitLoadPropertiesin interfaceIVisitor- Parameters:
properties- the load properties representation- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitStrategyCallExpression
public java.lang.Object visitStrategyCallExpression(StrategyCallExpression call) throws VilException
Description copied from interface:IVisitorVisits a strategy call node.- Specified by:
visitStrategyCallExpressionin interfaceIVisitor- Parameters:
call- the node- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitRuleCallExpression
public java.lang.Object visitRuleCallExpression(RuleCallExpression ex) throws VilException
Description copied from interface:IVisitorVisits a rule call expression.- Specified by:
visitRuleCallExpressionin interfaceIVisitor- Parameters:
ex- the expression- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitJoinExpression
public java.lang.Object visitJoinExpression(JoinExpression ex) throws VilException
Description copied from interface:IVisitorVisits a join expression.- Specified by:
visitJoinExpressionin interfaceIVisitor- Parameters:
ex- the join expression- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitJoinVariableDeclaration
public java.lang.Object visitJoinVariableDeclaration(JoinVariableDeclaration decl) throws VilException
Description copied from interface:IVisitorVisits a join variable declaration.- Specified by:
visitJoinVariableDeclarationin interfaceIVisitor- Parameters:
decl- the declaration- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitRule
public java.lang.Object visitRule(Rule rule) throws VilException
Description copied from interface:IVisitorVisits a rule.- Specified by:
visitRulein interfaceIVisitor- Parameters:
rule- the rule- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitRule
public java.lang.Object visitRule(VtlRule rule) throws VilException
Description copied from interface:IVisitorVisits a VTL mapping rule.- Specified by:
visitRulein interfaceIVisitor- Parameters:
rule- the rule- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitMapExpression
public java.lang.Object visitMapExpression(MapExpression map) throws VilException
Description copied from interface:IVisitorVisits a map expression.- Specified by:
visitMapExpressionin interfaceIVisitor- Parameters:
map- the expression to be visited- Returns:
- the result of visiting the given expression (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitInstantiateExpression
public java.lang.Object visitInstantiateExpression(InstantiateExpression inst) throws VilException
Description copied from interface:IVisitorVisits an instantiate expression.- Specified by:
visitInstantiateExpressionin interfaceIVisitor- Parameters:
inst- the instantiation expression- Returns:
- the result of visiting the given expression (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitAlternativeExpression
public java.lang.Object visitAlternativeExpression(AlternativeExpression alt) throws VilException
Description copied from interface:IVisitorVisits an alternative.- Specified by:
visitAlternativeExpressionin interfaceIVisitor- Parameters:
alt- the alternative- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitCompoundMatchExpression
public java.lang.Object visitCompoundMatchExpression(CompoundMatchExpression expression) throws VilException
Description copied from interface:IMatchVisitorVisits a compound match expression.- Specified by:
visitCompoundMatchExpressionin interfaceIMatchVisitor- Parameters:
expression- the expression- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitTypedef
public java.lang.Object visitTypedef(Typedef typedef) throws VilException
Description copied from interface:IVisitorVisits a typedef.- Specified by:
visitTypedefin interfaceIVisitor- Parameters:
typedef- the typedef- Returns:
- the result of visiting (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitWhileStatement
public java.lang.Object visitWhileStatement(WhileStatement stmt) throws VilException
Description copied from interface:IVisitorVisits a while statement.- Specified by:
visitWhileStatementin interfaceIVisitor- Parameters:
stmt- the statement to be visited- Returns:
- the result of visiting the given expression (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitForStatement
public java.lang.Object visitForStatement(ForStatement stmt) throws VilException
Description copied from interface:IVisitorVisits a for statement.- Specified by:
visitForStatementin interfaceIVisitor- Parameters:
stmt- the statement to be visited- Returns:
- the result of visiting the given expression (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
-