Bond 0.9
C++ Bond Runtime Library API Documentation
Loading...
Searching...
No Matches
Bond::WhileStatement Class Reference

Represents a while or do-while loop. More...

#include <bond/compiler/parsenodes.h>

Inheritance diagram for Bond::WhileStatement:
Bond::ListParseNode Bond::ParseNode

Public Member Functions

 WhileStatement (const Token *keyword, Expression *condition, ParseNode *body)
 Constructs a while/do-while statement.
virtual ~WhileStatement ()
virtual void Accept (ParseNodeVisitor &visitor) override
 Dispatches this node to the given visitor.
virtual void Accept (ParseNodeVisitor &visitor) const override
 Dispatches this node to the given visitor.
virtual const Token * GetContextToken () const override
 Returns the token used as source context for diagnostics.
const Token * GetKeyword () const
 Returns the loop keyword token.
Expression * GetCondition ()
 Returns the loop condition expression.
const Expression * GetCondition () const
 Returns the loop condition expression.
ParseNode * GetBody ()
 Returns the loop body.
const ParseNode * GetBody () const
 Returns the loop body.
bool IsDoLoop () const
 Returns true when this node represents a do-while loop.
Public Member Functions inherited from Bond::ListParseNode
virtual ~ListParseNode ()
ListParseNode * GetNextNode ()
 Returns the next node in the list.
const ListParseNode * GetNextNode () const
 Returns the next node in the list.
void SetNextNode (ListParseNode *next)
 Sets the next node in the list.
Public Member Functions inherited from Bond::ParseNode
virtual ~ParseNode ()

Additional Inherited Members

Protected Member Functions inherited from Bond::ListParseNode
 ListParseNode ()
Protected Member Functions inherited from Bond::ParseNode
 ParseNode ()

Detailed Description

Represents a while or do-while loop.

Constructor & Destructor Documentation

◆ WhileStatement()

Bond::WhileStatement::WhileStatement ( const Token * keyword,
Expression * condition,
ParseNode * body )
inline

Constructs a while/do-while statement.

Parameters
keywordLoop keyword token.
conditionLoop condition expression.
bodyLoop body.

◆ ~WhileStatement()

virtual Bond::WhileStatement::~WhileStatement ( )
inlinevirtual

Member Function Documentation

◆ Accept() [1/2]

virtual void Bond::WhileStatement::Accept ( ParseNodeVisitor & visitor) const
inlineoverridevirtual

Dispatches this node to the given visitor.

Parameters
visitorVisitor that handles this node type.

Implements Bond::ParseNode.

◆ Accept() [2/2]

virtual void Bond::WhileStatement::Accept ( ParseNodeVisitor & visitor)
inlineoverridevirtual

Dispatches this node to the given visitor.

Parameters
visitorVisitor that handles this node type.

Implements Bond::ParseNode.

◆ GetBody() [1/2]

ParseNode * Bond::WhileStatement::GetBody ( )
inline

Returns the loop body.

◆ GetBody() [2/2]

const ParseNode * Bond::WhileStatement::GetBody ( ) const
inline

Returns the loop body.

◆ GetCondition() [1/2]

Expression * Bond::WhileStatement::GetCondition ( )
inline

Returns the loop condition expression.

◆ GetCondition() [2/2]

const Expression * Bond::WhileStatement::GetCondition ( ) const
inline

Returns the loop condition expression.

◆ GetContextToken()

virtual const Token * Bond::WhileStatement::GetContextToken ( ) const
inlineoverridevirtual

Returns the token used as source context for diagnostics.

Returns
A token associated with this node, or null if no token applies.

Implements Bond::ParseNode.

◆ GetKeyword()

const Token * Bond::WhileStatement::GetKeyword ( ) const
inline

Returns the loop keyword token.

◆ IsDoLoop()

bool Bond::WhileStatement::IsDoLoop ( ) const
inline

Returns true when this node represents a do-while loop.


The documentation for this class was generated from the following file:
  • include/bond/compiler/parsenodes.h