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

Represents a break, continue, or return statement. More...

#include <bond/compiler/parsenodes.h>

Inheritance diagram for Bond::JumpStatement:
Bond::ListParseNode Bond::ParseNode

Public Member Functions

 JumpStatement (const Token *keyword, Expression *rhs)
 Constructs a jump statement.
virtual ~JumpStatement ()
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 jump keyword token.
Expression * GetRhs ()
 Returns the right-hand-side expression.
const Expression * GetRhs () const
 Returns the right-hand-side expression.
bool IsBreak () const
 Returns true if this is a break statement.
bool IsContinue () const
 Returns true if this is a continue statement.
bool IsReturn () const
 Returns true if this is a return statement.
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 break, continue, or return statement.

Constructor & Destructor Documentation

◆ JumpStatement()

Bond::JumpStatement::JumpStatement ( const Token * keyword,
Expression * rhs )
inline

Constructs a jump statement.

Parameters
keywordJump keyword token.
rhsOptional return expression.

◆ ~JumpStatement()

virtual Bond::JumpStatement::~JumpStatement ( )
inlinevirtual

Member Function Documentation

◆ Accept() [1/2]

virtual void Bond::JumpStatement::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::JumpStatement::Accept ( ParseNodeVisitor & visitor)
inlineoverridevirtual

Dispatches this node to the given visitor.

Parameters
visitorVisitor that handles this node type.

Implements Bond::ParseNode.

◆ GetContextToken()

virtual const Token * Bond::JumpStatement::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::JumpStatement::GetKeyword ( ) const
inline

Returns the jump keyword token.

◆ GetRhs() [1/2]

Expression * Bond::JumpStatement::GetRhs ( )
inline

Returns the right-hand-side expression.

◆ GetRhs() [2/2]

const Expression * Bond::JumpStatement::GetRhs ( ) const
inline

Returns the right-hand-side expression.

◆ IsBreak()

bool Bond::JumpStatement::IsBreak ( ) const
inline

Returns true if this is a break statement.

◆ IsContinue()

bool Bond::JumpStatement::IsContinue ( ) const
inline

Returns true if this is a continue statement.

◆ IsReturn()

bool Bond::JumpStatement::IsReturn ( ) const
inline

Returns true if this is a return statement.


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