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

Represents an array subscript expression. More...

#include <bond/compiler/parsenodes.h>

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

Public Member Functions

 ArraySubscriptExpression (const Token *op, Expression *lhs, Expression *index)
 Constructs an array subscript expression.
virtual ~ArraySubscriptExpression ()
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 * GetOperator () const
 Returns the subscript operator context token.
Expression * GetLhs ()
 Returns the array or pointer expression.
const Expression * GetLhs () const
 Returns the array or pointer expression.
Expression * GetIndex ()
 Returns the index expression.
const Expression * GetIndex () const
 Returns the index expression.
Public Member Functions inherited from Bond::Expression
virtual ~Expression ()
const TypeDescriptor & GetTypeDescriptor () const
 Returns the expression's type descriptor.
void SetTypeDescriptor (const TypeDescriptor &descriptor)
 Sets the expression's type descriptor.
const TypeAndValue & GetTypeAndValue () const
 Returns type and value metadata for the expression.
TypeAndValue & GetTypeAndValue ()
 Returns mutable type and value metadata for the expression.
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::Expression
 Expression ()
Protected Member Functions inherited from Bond::ListParseNode
 ListParseNode ()
Protected Member Functions inherited from Bond::ParseNode
 ParseNode ()

Detailed Description

Represents an array subscript expression.

Constructor & Destructor Documentation

◆ ArraySubscriptExpression()

Bond::ArraySubscriptExpression::ArraySubscriptExpression ( const Token * op,
Expression * lhs,
Expression * index )
inline

Constructs an array subscript expression.

Parameters
opSubscript operator context token.
lhsArray or pointer expression.
indexIndex expression.

◆ ~ArraySubscriptExpression()

virtual Bond::ArraySubscriptExpression::~ArraySubscriptExpression ( )
inlinevirtual

Member Function Documentation

◆ Accept() [1/2]

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

◆ GetIndex() [1/2]

Expression * Bond::ArraySubscriptExpression::GetIndex ( )
inline

Returns the index expression.

◆ GetIndex() [2/2]

const Expression * Bond::ArraySubscriptExpression::GetIndex ( ) const
inline

Returns the index expression.

◆ GetLhs() [1/2]

Expression * Bond::ArraySubscriptExpression::GetLhs ( )
inline

Returns the array or pointer expression.

◆ GetLhs() [2/2]

const Expression * Bond::ArraySubscriptExpression::GetLhs ( ) const
inline

Returns the array or pointer expression.

◆ GetOperator()

const Token * Bond::ArraySubscriptExpression::GetOperator ( ) const
inline

Returns the subscript operator context token.


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