Class ExpressionStatement
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.common.ExpressionStatement
-
- net.ssehub.easy.instantiation.core.model.templateModel.ExpressionStatement
-
- All Implemented Interfaces:
ILanguageElement,ITemplateElement,ITemplateLangElement
public class ExpressionStatement extends ExpressionStatement implements ITemplateElement
Represents a statement which contains just of an expression.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private ILanguageElementparent
-
Constructor Summary
Constructors Constructor Description ExpressionStatement()Constructor for serialization.ExpressionStatement(Expression expression, ILanguageElement parent)Creates an expression statement.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectaccept(IVisitor visitor)Accepts the visitor for visiting.booleanendsWithContentStatement()Returns whether this element ends with a content statement.ILanguageElementgetParent()Returns the parent element.TypeDescriptor<?>inferType()Infers the type of this language element.booleanisBlock()Returns whether this element is a block (opposite is a single statement).-
Methods inherited from class net.ssehub.easy.instantiation.core.model.common.ExpressionStatement
accept, applyConversionTo, getExpression
-
-
-
-
Field Detail
-
parent
private ILanguageElement parent
-
-
Constructor Detail
-
ExpressionStatement
public ExpressionStatement()
Constructor for serialization.
-
ExpressionStatement
public ExpressionStatement(Expression expression, ILanguageElement parent)
Creates an expression statement.- Parameters:
expression- the expressionparent- the parent template
-
-
Method Detail
-
accept
public java.lang.Object accept(IVisitor visitor) throws VilException
Description copied from interface:ITemplateLangElementAccepts the visitor for visiting.- Specified by:
acceptin interfaceITemplateLangElement- Parameters:
visitor- the visitor to be used- Returns:
- the result of visiting this instance (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
isBlock
public boolean isBlock()
Description copied from interface:ITemplateElementReturns whether this element is a block (opposite is a single statement).- Specified by:
isBlockin interfaceITemplateElement- Returns:
trueif it is a block,falseelse
-
inferType
public TypeDescriptor<?> inferType() throws VilException
Description copied from interface:ITemplateElementInfers the type of this language element.- Specified by:
inferTypein interfaceITemplateElement- Returns:
- the type of this language element
- Throws:
VilException- in case that type errors occur
-
getParent
public ILanguageElement getParent()
Description copied from interface:ILanguageElementReturns the parent element.- Specified by:
getParentin interfaceILanguageElement- Returns:
- the parent element (may be null if unknown)
-
endsWithContentStatement
public boolean endsWithContentStatement()
Description copied from interface:ITemplateElementReturns whether this element ends with a content statement.- Specified by:
endsWithContentStatementin interfaceITemplateElement- Returns:
truefor end with content statement,falseelse
-
-