Class WhileStatement
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.buildlangModel.ProjectElement
-
- net.ssehub.easy.instantiation.core.model.buildlangModel.RuleBlock
-
- net.ssehub.easy.instantiation.core.model.buildlangModel.WhileStatement
-
- All Implemented Interfaces:
IBuildlangElement,IRuleBlock,IRuleElement,ILanguageElement
public class WhileStatement extends RuleBlock implements IRuleElement
Implements a VIL while statement.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private Expressioncondition
-
Constructor Summary
Constructors Constructor Description WhileStatement(Expression condition, IRuleElement[] body)Creates a while statement.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectaccept(IVisitor visitor)Accepts the visitor for visiting.ExpressiongetCondition()Returns the condition of the while statement.booleanisVirtual()Returns whether this block is a real block or consists just of a block element without brackets.booleanreturnActualValue()Returns whether this body shall return an actual value (function) or a rule execution result.-
Methods inherited from class net.ssehub.easy.instantiation.core.model.buildlangModel.RuleBlock
addBodyElement, addBodyElement, append, getBodyElement, getBodyElementCount, setBody, setParent
-
Methods inherited from class net.ssehub.easy.instantiation.core.model.buildlangModel.ProjectElement
getName, getParent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.ssehub.easy.instantiation.core.model.common.ILanguageElement
getParent
-
-
-
-
Field Detail
-
condition
private Expression condition
-
-
Constructor Detail
-
WhileStatement
public WhileStatement(Expression condition, IRuleElement[] body) throws VilException
Creates a while statement.- Parameters:
condition- the condition of the while (Boolean expression)body- the body of the while- Throws:
VilException- in case of initialization problems
-
-
Method Detail
-
getCondition
public Expression getCondition()
Returns the condition of the while statement.- Returns:
- the condition
-
accept
public java.lang.Object accept(IVisitor visitor) throws VilException
Description copied from interface:IBuildlangElementAccepts the visitor for visiting.- Specified by:
acceptin interfaceIBuildlangElement- 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)
-
isVirtual
public boolean isVirtual()
Description copied from interface:IRuleBlockReturns whether this block is a real block or consists just of a block element without brackets.- Specified by:
isVirtualin interfaceIRuleBlock- Returns:
trueif this block is virtual,falseelse
-
returnActualValue
public boolean returnActualValue()
Description copied from interface:IRuleBlockReturns whether this body shall return an actual value (function) or a rule execution result.- Specified by:
returnActualValuein interfaceIRuleBlock- Returns:
truein case of an actual value,falseelse
-
-