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

Represents a resolved switch label used for code generation. More...

#include <bond/compiler/parsenodes.h>

Inheritance diagram for Bond::ResolvedSwitchLabel:
Bond::ListParseNode Bond::ParseNode

Public Member Functions

 ResolvedSwitchLabel ()
 Constructs a resolved switch label with default values.
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 TokenGetContextToken () const override
 Returns the token used as source context for diagnostics.
int32_t GetMatch () const
 Returns the resolved match value.
void SetMatch (int32_t match)
 Sets the resolved match value.
size_t GetJumpTargetId () const
 Returns the jump target ID associated with this label.
void SetJumpTargetId (size_t targetId)
 Sets the jump target ID associated with this label.
bool IsDefault () const
 Returns true if this is the default label.
void SetIsDefault (bool isDefault)
 Sets whether this is the default label.
bool operator== (const ResolvedSwitchLabel &other) const
 Compares two resolved labels by default flag and match value.
Public Member Functions inherited from Bond::ListParseNode
virtual ~ListParseNode ()
ListParseNodeGetNextNode ()
 Returns the next node in the list.
const ListParseNodeGetNextNode () 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 resolved switch label used for code generation.

Constructor & Destructor Documentation

◆ ResolvedSwitchLabel()

Bond::ResolvedSwitchLabel::ResolvedSwitchLabel ( )
inline

Constructs a resolved switch label with default values.

Member Function Documentation

◆ Accept() [1/2]

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

◆ GetJumpTargetId()

size_t Bond::ResolvedSwitchLabel::GetJumpTargetId ( ) const
inline

Returns the jump target ID associated with this label.

◆ GetMatch()

int32_t Bond::ResolvedSwitchLabel::GetMatch ( ) const
inline

Returns the resolved match value.

◆ IsDefault()

bool Bond::ResolvedSwitchLabel::IsDefault ( ) const
inline

Returns true if this is the default label.

◆ operator==()

bool Bond::ResolvedSwitchLabel::operator== ( const ResolvedSwitchLabel & other) const
inline

Compares two resolved labels by default flag and match value.

Parameters
otherLabel to compare against.
Returns
True if labels represent the same match semantics.

◆ SetIsDefault()

void Bond::ResolvedSwitchLabel::SetIsDefault ( bool isDefault)
inline

Sets whether this is the default label.

Parameters
isDefaultTrue to mark this label as default.

◆ SetJumpTargetId()

void Bond::ResolvedSwitchLabel::SetJumpTargetId ( size_t targetId)
inline

Sets the jump target ID associated with this label.

Parameters
targetIdJump target identifier.

◆ SetMatch()

void Bond::ResolvedSwitchLabel::SetMatch ( int32_t match)
inline

Sets the resolved match value.

Parameters
matchCase match value.

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