Class InPlaceVarDeclCommand<I extends VariableDeclaration>
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.expressions.Expression
-
- net.ssehub.easy.instantiation.core.model.expressions.InPlaceCommand<I>
-
- net.ssehub.easy.instantiation.core.model.expressions.InPlaceVarDeclCommand<I>
-
- Type Parameters:
I- the variable declaration type
public class InPlaceVarDeclCommand<I extends VariableDeclaration> extends InPlaceCommand<I>
Represents an in-place variable declaration command.- Author:
- Holger Eichelberger
-
-
Constructor Summary
Constructors Constructor Description InPlaceVarDeclCommand(I decl)Creates an in-place variable declaration command.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappend(java.util.List<Expression> exprs)Appends the sub-expressions in parse sequence toexprsleaving out this command as fallback.protected voidappend(Expression ex)Appends a sub-expression.protected Expressionclose(IStringParserFactory<I> factory)Closes this in-place command by creating the real expression.IgetDeclaration()Returns the declaration.protected voidreplace(InPlaceCommand<I> cmd, Expression expr)Replacescmdbyexpr.-
Methods inherited from class net.ssehub.easy.instantiation.core.model.expressions.InPlaceCommand
accept, advanceState, holdsResolverLevel, inferType, replace
-
Methods inherited from class net.ssehub.easy.instantiation.core.model.expressions.Expression
getFormattingHint, replaceEmptyLine
-
-
-
-
Field Detail
-
decl
private I extends VariableDeclaration decl
-
-
Constructor Detail
-
InPlaceVarDeclCommand
public InPlaceVarDeclCommand(I decl)
Creates an in-place variable declaration command.- Parameters:
decl- the variable declaration
-
-
Method Detail
-
append
protected void append(Expression ex)
Description copied from class:InPlaceCommandAppends a sub-expression. An in-place command can have multiple sub-structures, that are sequentially switched to active viaInPlaceCommand.advanceState().- Specified by:
appendin classInPlaceCommand<I extends VariableDeclaration>- Parameters:
ex- the expression to append
-
close
protected Expression close(IStringParserFactory<I> factory) throws VilException
Description copied from class:InPlaceCommandCloses this in-place command by creating the real expression.- Specified by:
closein classInPlaceCommand<I extends VariableDeclaration>- Parameters:
factory- the factory used to create the real expression- Returns:
- the real expression, may be null if optional / none shall be created
- Throws:
VilException- if the provided information is not sufficient for creating an expression
-
append
protected void append(java.util.List<Expression> exprs)
Description copied from class:InPlaceCommandAppends the sub-expressions in parse sequence toexprsleaving out this command as fallback.- Specified by:
appendin classInPlaceCommand<I extends VariableDeclaration>- Parameters:
exprs- the expressions to add the sub-expressions to
-
replace
protected void replace(InPlaceCommand<I> cmd, Expression expr)
Description copied from class:InPlaceCommandReplacescmdbyexpr.- Specified by:
replacein classInPlaceCommand<I extends VariableDeclaration>- Parameters:
cmd- the command to be replacedexpr- the replacing expression
-
getDeclaration
public I getDeclaration()
Returns the declaration.- Returns:
- the declaration
-
-