Class ExpressionCopyVisitor
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.expressions.CopyVisitor
-
- net.ssehub.easy.instantiation.core.model.templateModel.ExpressionCopyVisitor
-
- All Implemented Interfaces:
IVisitor,IExpressionVisitor,IVisitor
public class ExpressionCopyVisitor extends CopyVisitor implements IVisitor
The copy visitor for VTL 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.ObjectvisitAlternative(AlternativeStatement alternative)Visits an alternative statement.java.lang.ObjectvisitCompound(Compound compound)Visits a compound.java.lang.ObjectvisitContentAlternativeExpression(ContentAlternativeExpression ex)Visits a content alternative expression.java.lang.ObjectvisitContentImportExpression(ContentImportExpression ex)Visits a content import expression.java.lang.ObjectvisitContentLoopExpression(ContentLoopExpression ex)Visits a content loop expression.java.lang.ObjectvisitContentStatement(ContentStatement cnt)Visits a content statement.java.lang.ObjectvisitContentVarDeclExpression(ContentVarDeclExpression ex)Visits a content variable declaration expression.java.lang.ObjectvisitDef(Def def)Visits a sub-template definition.java.lang.ObjectvisitExpressionStatement(ExpressionStatement statement)Visits a statement.java.lang.ObjectvisitFlush(FlushStatement stmt)Visits a flush statement.java.lang.ObjectvisitJavaExtension(JavaExtension ext)Visits a java extension.java.lang.ObjectvisitLoop(LoopStatement loop)Visits a loop statement.java.lang.ObjectvisitSwitch(SwitchStatement swtch)Visits a switch statement.java.lang.ObjectvisitTemplate(Template template)Visits a template.java.lang.ObjectvisitTemplateBlock(TemplateBlock block)Visits a template block.java.lang.ObjectvisitTemplateCallExpression(TemplateCallExpression call)Visits a template call expression.java.lang.ObjectvisitTypedef(Typedef typedef)Visits a typedef.java.lang.ObjectvisitVariableDeclaration(VariableDeclaration var)Visits a variable declaration.java.lang.ObjectvisitWhile(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
-
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)
-
visitTemplate
public java.lang.Object visitTemplate(Template template) throws VilException
Description copied from interface:IVisitorVisits a template.- Specified by:
visitTemplatein interfaceIVisitor- Parameters:
template- the template to visit- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitDef
public java.lang.Object visitDef(Def def) throws VilException
Description copied from interface:IVisitorVisits a sub-template definition.- Specified by:
visitDefin interfaceIVisitor- Parameters:
def- the sub-template definition to visit- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitTemplateBlock
public java.lang.Object visitTemplateBlock(TemplateBlock block) throws VilException
Description copied from interface:IVisitorVisits a template block.- Specified by:
visitTemplateBlockin interfaceIVisitor- Parameters:
block- the template block to visit- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitAlternative
public java.lang.Object visitAlternative(AlternativeStatement alternative) throws VilException
Description copied from interface:IVisitorVisits an alternative statement.- Specified by:
visitAlternativein interfaceIVisitor- Parameters:
alternative- the alternative to visit- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitLoop
public java.lang.Object visitLoop(LoopStatement loop) throws VilException
Description copied from interface:IVisitorVisits a loop statement.- Specified by:
visitLoopin interfaceIVisitor- Parameters:
loop- the loop statement to visit- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitSwitch
public java.lang.Object visitSwitch(SwitchStatement swtch) throws VilException
Description copied from interface:IVisitorVisits a switch statement.- Specified by:
visitSwitchin interfaceIVisitor- Parameters:
swtch- the switch statement to visit- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitContentStatement
public java.lang.Object visitContentStatement(ContentStatement cnt) throws VilException
Description copied from interface:IVisitorVisits a content statement.- Specified by:
visitContentStatementin interfaceIVisitor- Parameters:
cnt- the content statement- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitJavaExtension
public java.lang.Object visitJavaExtension(JavaExtension ext) throws VilException
Description copied from interface:IVisitorVisits a java extension.- Specified by:
visitJavaExtensionin interfaceIVisitor- Parameters:
ext- the java extension- Returns:
- the result of visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitTemplateCallExpression
public java.lang.Object visitTemplateCallExpression(TemplateCallExpression call) throws VilException
Description copied from interface:IVisitorVisits a template call expression.- Specified by:
visitTemplateCallExpressionin interfaceIVisitor- Parameters:
call- the call expression- Returns:
- the result of visiting the given expression (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitFlush
public java.lang.Object visitFlush(FlushStatement stmt) throws VilException
Description copied from interface:IVisitorVisits a flush statement.- Specified by:
visitFlushin interfaceIVisitor- Parameters:
stmt- the flush statement- Returns:
- the result visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitWhile
public java.lang.Object visitWhile(WhileStatement stmt) throws VilException
Description copied from interface:IVisitorVisits a while statement.- Specified by:
visitWhilein interfaceIVisitor- Parameters:
stmt- the while statement to visit- 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)
-
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)
-
visitContentAlternativeExpression
public java.lang.Object visitContentAlternativeExpression(ContentAlternativeExpression ex) throws VilException
Description copied from interface:IVisitorVisits a content alternative expression.- Specified by:
visitContentAlternativeExpressionin interfaceIVisitor- Parameters:
ex- the expression- Returns:
- the result visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitContentLoopExpression
public java.lang.Object visitContentLoopExpression(ContentLoopExpression ex) throws VilException
Description copied from interface:IVisitorVisits a content loop expression.- Specified by:
visitContentLoopExpressionin interfaceIVisitor- Parameters:
ex- the expression- Returns:
- the result visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitContentVarDeclExpression
public java.lang.Object visitContentVarDeclExpression(ContentVarDeclExpression ex) throws VilException
Description copied from interface:IVisitorVisits a content variable declaration expression.- Specified by:
visitContentVarDeclExpressionin interfaceIVisitor- Parameters:
ex- the expression- Returns:
- the result visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
visitContentImportExpression
public java.lang.Object visitContentImportExpression(ContentImportExpression ex) throws VilException
Description copied from interface:IVisitorVisits a content import expression.- Specified by:
visitContentImportExpressionin interfaceIVisitor- Parameters:
ex- the expression- Returns:
- the result visiting the given statement (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
-