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

Represents an explicit cast expression. More...

#include <bond/compiler/parsenodes.h>

Inheritance diagram for Bond::CastExpression:
Bond::Expression Bond::ListParseNode Bond::ParseNode

Public Member Functions

 CastExpression (const Token *op, TypeDescriptor *targetTypeDescriptor, Expression *rhs)
 Constructs a cast expression.
virtual ~CastExpression ()
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.
const TypeDescriptorGetTargetTypeDescriptor () const
 Returns the cast target type descriptor.
TypeDescriptorGetTargetTypeDescriptor ()
 Returns the cast target type descriptor.
ExpressionGetRhs ()
 Returns the source expression.
const ExpressionGetRhs () const
 Returns the source expression.
Public Member Functions inherited from Bond::Expression
virtual ~Expression ()
const TypeDescriptorGetTypeDescriptor () const
 Returns the expression's type descriptor.
void SetTypeDescriptor (const TypeDescriptor &descriptor)
 Sets the expression's type descriptor.
const TypeAndValueGetTypeAndValue () const
 Returns type and value metadata for the expression.
TypeAndValueGetTypeAndValue ()
 Returns mutable type and value metadata for the expression.
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::Expression
 Expression ()
Protected Member Functions inherited from Bond::ListParseNode
 ListParseNode ()
Protected Member Functions inherited from Bond::ParseNode
 ParseNode ()

Detailed Description

Represents an explicit cast expression.

Constructor & Destructor Documentation

◆ CastExpression()

Bond::CastExpression::CastExpression ( const Token * op,
TypeDescriptor * targetTypeDescriptor,
Expression * rhs )
inline

Constructs a cast expression.

Parameters
opCast operator token.
targetTypeDescriptorTarget type descriptor.
rhsSource expression.

◆ ~CastExpression()

virtual Bond::CastExpression::~CastExpression ( )
inlinevirtual

Member Function Documentation

◆ Accept() [1/2]

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

◆ GetRhs() [1/2]

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

Returns the source expression.

◆ GetRhs() [2/2]

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

Returns the source expression.

◆ GetTargetTypeDescriptor() [1/2]

TypeDescriptor * Bond::CastExpression::GetTargetTypeDescriptor ( )
inline

Returns the cast target type descriptor.

◆ GetTargetTypeDescriptor() [2/2]

const TypeDescriptor * Bond::CastExpression::GetTargetTypeDescriptor ( ) const
inline

Returns the cast target type descriptor.


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