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

Represents a scalar or aggregate initializer. More...

#include <bond/compiler/parsenodes.h>

Inheritance diagram for Bond::Initializer:
Bond::ListParseNode Bond::ParseNode

Public Member Functions

 Initializer (Expression *expression)
 Constructs a scalar initializer.
 Initializer (const Token *openBrace, Initializer *initializerList)
 Constructs an aggregate initializer.
virtual ~Initializer ()
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 TypeDescriptorGetTypeDescriptor () const
 Returns the evaluated type descriptor for this initializer.
void SetTypeDescriptor (const TypeDescriptor &descriptor)
 Sets the evaluated type descriptor for this initializer.
ExpressionGetExpression ()
 Returns the scalar initializer expression.
const ExpressionGetExpression () const
 Returns the scalar initializer expression.
InitializerGetInitializerList ()
 Returns nested initializer list for aggregates.
const InitializerGetInitializerList () const
 Returns nested initializer list for aggregates.
virtual bool IsResolved () const
 Returns true if this initializer and sub-initializers are resolved.
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 scalar or aggregate initializer.

Constructor & Destructor Documentation

◆ Initializer() [1/2]

Bond::Initializer::Initializer ( Expression * expression)
inlineexplicit

Constructs a scalar initializer.

Parameters
expressionInitializer expression.

◆ Initializer() [2/2]

Bond::Initializer::Initializer ( const Token * openBrace,
Initializer * initializerList )
inlineexplicit

Constructs an aggregate initializer.

Parameters
openBraceToken that opens the initializer list.
initializerListNested initializer list.

◆ ~Initializer()

virtual Bond::Initializer::~Initializer ( )
inlinevirtual

Member Function Documentation

◆ Accept() [1/2]

virtual void Bond::Initializer::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::Initializer::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::Initializer::GetContextToken ( ) const
overridevirtual

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]

Expression * Bond::Initializer::GetExpression ( )
inline

Returns the scalar initializer expression.

◆ GetExpression() [2/2]

const Expression * Bond::Initializer::GetExpression ( ) const
inline

Returns the scalar initializer expression.

◆ GetInitializerList() [1/2]

Initializer * Bond::Initializer::GetInitializerList ( )
inline

Returns nested initializer list for aggregates.

◆ GetInitializerList() [2/2]

const Initializer * Bond::Initializer::GetInitializerList ( ) const
inline

Returns nested initializer list for aggregates.

◆ GetTypeDescriptor()

const TypeDescriptor & Bond::Initializer::GetTypeDescriptor ( ) const
inline

Returns the evaluated type descriptor for this initializer.

◆ IsResolved()

virtual bool Bond::Initializer::IsResolved ( ) const
virtual

Returns true if this initializer and sub-initializers are resolved.

◆ SetTypeDescriptor()

void Bond::Initializer::SetTypeDescriptor ( const TypeDescriptor & descriptor)
inline

Sets the evaluated type descriptor for this initializer.

Parameters
descriptorType descriptor to assign.

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