Represents a case or default label in a switch section.
More...
#include <bond/compiler/parsenodes.h>
Represents a case or default label in a switch section.
◆ SwitchLabel() [1/2]
| Bond::SwitchLabel::SwitchLabel |
( |
const Token * | label | ) |
|
|
inlineexplicit |
Constructs a default-style switch label with no expression.
- Parameters
-
◆ SwitchLabel() [2/2]
| Bond::SwitchLabel::SwitchLabel |
( |
const Token * | label, |
|
|
Expression * | expression ) |
|
inline |
Constructs a case label with an expression.
- Parameters
-
| label | Label token. |
| expression | Case match expression. |
◆ ~SwitchLabel()
| virtual Bond::SwitchLabel::~SwitchLabel |
( |
| ) |
|
|
inlinevirtual |
◆ Accept() [1/2]
Dispatches this node to the given visitor.
- Parameters
-
| visitor | Visitor that handles this node type. |
Implements Bond::ParseNode.
◆ Accept() [2/2]
Dispatches this node to the given visitor.
- Parameters
-
| visitor | Visitor that handles this node type. |
Implements Bond::ParseNode.
◆ GetContextToken()
| virtual const Token * Bond::SwitchLabel::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.
◆ GetExpression() [1/2]
Returns the case expression.
◆ GetExpression() [2/2]
| const Expression * Bond::SwitchLabel::GetExpression |
( |
| ) |
const |
|
inline |
Returns the case expression.
◆ GetLabel()
| const Token * Bond::SwitchLabel::GetLabel |
( |
| ) |
const |
|
inline |
◆ GetResolvedLabel() [1/2]
Returns resolved label metadata.
◆ GetResolvedLabel() [2/2]
Returns resolved label metadata.
◆ IsDefaultLabel()
| bool Bond::SwitchLabel::IsDefaultLabel |
( |
| ) |
const |
|
inline |
Returns true if this label is a default label.
The documentation for this class was generated from the following file:
- include/bond/compiler/parsenodes.h