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

Represents a switch statement. More...

#include <bond/compiler/parsenodes.h>

Inheritance diagram for Bond::SwitchStatement:
Bond::ListParseNode Bond::ParseNode

Public Member Functions

 SwitchStatement (const Token *keyword, Expression *control, SwitchSection *sectionList)
 Constructs a switch statement.
virtual ~SwitchStatement ()
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 switch keyword token.
Expression * GetControl ()
 Returns the switch control expression.
const Expression * GetControl () const
 Returns the switch control expression.
SwitchSection * GetSectionList ()
 Returns the list of switch sections.
const SwitchSection * GetSectionList () const
 Returns the list of switch sections.
const ResolvedSwitchLabel * GetResolvedLabelList () const
 Returns the resolved linearized label list.
void SetResolvedLabelList (const ResolvedSwitchLabel *labelList)
 Sets the resolved linearized label list.
uint32_t GetNumMatches () const
 Returns number of non-default case matches.
void SetNumMatches (uint32_t numMatches)
 Sets number of non-default case matches.
int32_t GetMinMatch () const
 Returns smallest case match value.
void SetMinMatch (int32_t minMatch)
 Sets smallest case match value.
int32_t GetMaxMatch () const
 Returns largest case match value.
void SetMaxMatch (int32_t maxMatch)
 Sets largest case match value.
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 switch statement.

Constructor & Destructor Documentation

◆ SwitchStatement()

Bond::SwitchStatement::SwitchStatement ( const Token * keyword,
Expression * control,
SwitchSection * sectionList )
inline

Constructs a switch statement.

Parameters
keywordSwitch keyword token.
controlSwitch control expression.
sectionListList of switch sections.

◆ ~SwitchStatement()

virtual Bond::SwitchStatement::~SwitchStatement ( )
inlinevirtual

Member Function Documentation

◆ Accept() [1/2]

virtual void Bond::SwitchStatement::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::SwitchStatement::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::SwitchStatement::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.

◆ GetControl() [1/2]

Expression * Bond::SwitchStatement::GetControl ( )
inline

Returns the switch control expression.

◆ GetControl() [2/2]

const Expression * Bond::SwitchStatement::GetControl ( ) const
inline

Returns the switch control expression.

◆ GetKeyword()

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

Returns the switch keyword token.

◆ GetMaxMatch()

int32_t Bond::SwitchStatement::GetMaxMatch ( ) const
inline

Returns largest case match value.

◆ GetMinMatch()

int32_t Bond::SwitchStatement::GetMinMatch ( ) const
inline

Returns smallest case match value.

◆ GetNumMatches()

uint32_t Bond::SwitchStatement::GetNumMatches ( ) const
inline

Returns number of non-default case matches.

◆ GetResolvedLabelList()

const ResolvedSwitchLabel * Bond::SwitchStatement::GetResolvedLabelList ( ) const
inline

Returns the resolved linearized label list.

◆ GetSectionList() [1/2]

SwitchSection * Bond::SwitchStatement::GetSectionList ( )
inline

Returns the list of switch sections.

◆ GetSectionList() [2/2]

const SwitchSection * Bond::SwitchStatement::GetSectionList ( ) const
inline

Returns the list of switch sections.

◆ SetMaxMatch()

void Bond::SwitchStatement::SetMaxMatch ( int32_t maxMatch)
inline

Sets largest case match value.

Parameters
maxMatchLargest match value.

◆ SetMinMatch()

void Bond::SwitchStatement::SetMinMatch ( int32_t minMatch)
inline

Sets smallest case match value.

Parameters
minMatchSmallest match value.

◆ SetNumMatches()

void Bond::SwitchStatement::SetNumMatches ( uint32_t numMatches)
inline

Sets number of non-default case matches.

Parameters
numMatchesNumber of case matches.

◆ SetResolvedLabelList()

void Bond::SwitchStatement::SetResolvedLabelList ( const ResolvedSwitchLabel * labelList)
inline

Sets the resolved linearized label list.

Parameters
labelListHead of resolved switch labels.

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