|
Bond 0.9
C++ Bond Runtime Library API Documentation
|
Base class for named entities that participate in symbol lookup. More...
#include <bond/compiler/parsenodes.h>
Public Types | |
| enum | SymbolType { TYPE_NAMESPACE , TYPE_STRUCT , TYPE_ENUM , TYPE_LOCALSCOPE , TYPE_VALUE , TYPE_FUNCTION } |
| Identifies the concrete symbol category. More... | |
Public Member Functions | |
| virtual | ~Symbol () |
| virtual const Token * | GetContextToken () const override |
| Returns the token used as source context for diagnostics. | |
| virtual SymbolType | GetSymbolType () const =0 |
| Returns the concrete symbol type. | |
| virtual const Token * | GetName () const |
| Returns the symbol name token. | |
| virtual TypeAndValue * | GetTypeAndValue () |
| Returns the symbol's type-and-value metadata. | |
| virtual const TypeAndValue * | GetTypeAndValue () const |
| Returns the symbol's type-and-value metadata. | |
| virtual bool | IsResolved () const |
| Returns true when symbol resolution has completed for this symbol. | |
| bool | IsTypeDefinition () const |
| Returns true if this symbol defines a type. | |
| Symbol * | GetParentSymbol () |
| Returns the enclosing symbol. | |
| const Symbol * | GetParentSymbol () const |
| Returns the enclosing symbol. | |
| void | SetParentSymbol (Symbol *parent) |
| Sets the enclosing symbol. | |
| Symbol * | FindSymbol (const StringView &name) |
| Finds a directly contained symbol by name. | |
| const Symbol * | FindSymbol (const StringView &name) const |
| Finds a directly contained symbol by name. | |
| Symbol * | FindSymbol (const Token *name) |
| Finds a directly contained symbol by token text. | |
| const Symbol * | FindSymbol (const Token *name) const |
| Finds a directly contained symbol by token text. | |
| Symbol * | FindSymbol (const QualifiedIdentifier *identifier) |
| Finds a symbol referenced by a qualified identifier. | |
| const Symbol * | FindSymbol (const QualifiedIdentifier *identifier) const |
| Finds a symbol referenced by a qualified identifier. | |
| void | InsertSymbol (Symbol *symbol) |
| Inserts a symbol into this symbol's child list. | |
| bool | IsAnonymous () const |
| Returns true if this symbol has no explicit name. | |
| bool | Matches (const StringView &name) const |
| Returns true if this symbol's name matches the given text. | |
| 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 () |
| virtual void | Accept (ParseNodeVisitor &visitor)=0 |
| Dispatches this node to the given visitor. | |
| virtual void | Accept (ParseNodeVisitor &visitor) const =0 |
| Dispatches this node to the given visitor. | |
Protected Member Functions | |
| Symbol () | |
| Protected Member Functions inherited from Bond::ListParseNode | |
| ListParseNode () | |
| Protected Member Functions inherited from Bond::ParseNode | |
| ParseNode () | |
Base class for named entities that participate in symbol lookup.
|
inlinevirtual |
|
inlineprotected |
| Symbol * Bond::Symbol::FindSymbol | ( | const QualifiedIdentifier * | identifier | ) |
Finds a symbol referenced by a qualified identifier.
| identifier | Qualified identifier to resolve. |
| const Symbol * Bond::Symbol::FindSymbol | ( | const QualifiedIdentifier * | identifier | ) | const |
Finds a symbol referenced by a qualified identifier.
| identifier | Qualified identifier to resolve. |
| Symbol * Bond::Symbol::FindSymbol | ( | const StringView & | name | ) |
Finds a directly contained symbol by name.
| name | Name to search for. |
| const Symbol * Bond::Symbol::FindSymbol | ( | const StringView & | name | ) | const |
Finds a directly contained symbol by name.
| name | Name to search for. |
Finds a directly contained symbol by token text.
| name | Name token to search for. |
Finds a directly contained symbol by token text.
| name | Name token to search for. |
|
inlineoverridevirtual |
Returns the token used as source context for diagnostics.
Implements Bond::ParseNode.
Reimplemented in Bond::ForStatement.
|
inlinevirtual |
Returns the symbol name token.
Reimplemented in Bond::EnumDeclaration, Bond::Enumerator, Bond::FunctionDefinition, Bond::NamedInitializer, Bond::NamespaceDefinition, Bond::Parameter, and Bond::StructDeclaration.
|
inline |
Returns the enclosing symbol.
|
inline |
Returns the enclosing symbol.
|
pure virtual |
Returns the concrete symbol type.
Implemented in Bond::CompoundStatement, Bond::EnumDeclaration, Bond::Enumerator, Bond::ForStatement, Bond::FunctionDefinition, Bond::NamedInitializer, Bond::NamespaceDefinition, Bond::Parameter, Bond::StructDeclaration, and Bond::SwitchSection.
|
inlinevirtual |
Returns the symbol's type-and-value metadata.
Reimplemented in Bond::Enumerator, Bond::FunctionDefinition, Bond::NamedInitializer, and Bond::Parameter.
|
inlinevirtual |
Returns the symbol's type-and-value metadata.
Reimplemented in Bond::Enumerator, Bond::FunctionDefinition, Bond::NamedInitializer, and Bond::Parameter.
| void Bond::Symbol::InsertSymbol | ( | Symbol * | symbol | ) |
Inserts a symbol into this symbol's child list.
| symbol | Symbol to insert. |
|
inline |
Returns true if this symbol has no explicit name.
|
inlinevirtual |
Returns true when symbol resolution has completed for this symbol.
Reimplemented in Bond::StructDeclaration.
| bool Bond::Symbol::IsTypeDefinition | ( | ) | const |
Returns true if this symbol defines a type.
| bool Bond::Symbol::Matches | ( | const StringView & | name | ) | const |
Returns true if this symbol's name matches the given text.
| name | Name to compare against. |
| void Bond::Symbol::SetParentSymbol | ( | Symbol * | parent | ) |
Sets the enclosing symbol.
| parent | Parent symbol to assign. |