Class WhileStatement

    • Constructor Detail

      • WhileStatement

        public WhileStatement​(Expression condition,
                              ITemplateElement statement)
                       throws VilException
        Create a loop-statement.
        Parameters:
        condition - the condition determining the end of the loop (Boolean expression)
        statement - the loop-statement which may subsumes a set of template elements that will be processed multiple times.
        Throws:
        VilException - in case of semantic problems while creating this loop object
    • Method Detail

      • getConditionExpression

        public Expression getConditionExpression()
        Get the condition of this loop.
        Returns:
        The condition of this loop.
      • getLoopStatement

        public ITemplateElement getLoopStatement()
        Get the loop-statement which may subsume a set of template elements that will be processed multiple times.
        Returns:
        The template element that represents the loop-statement/block.
      • accept

        public java.lang.Object accept​(IVisitor visitor)
                                throws VilException
        Description copied from interface: ITemplateLangElement
        Accepts the visitor for visiting.
        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: ITemplateElement
        Returns whether this element is a block (opposite is a single statement).
        Returns:
        true if it is a block, false else
      • endsWithContentStatement

        public boolean endsWithContentStatement()
        Description copied from interface: ITemplateElement
        Returns whether this element ends with a content statement.
        Returns:
        true for end with content statement, false else