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

Represents a complete parsed source file. More...

#include <bond/compiler/parsenodes.h>

Inheritance diagram for Bond::TranslationUnit:
Bond::ListParseNode Bond::ParseNode

Public Member Functions

 TranslationUnit (IncludeDirective *includeDirectiveList, ListParseNode *declarationList)
 Constructs a translation unit.
virtual ~TranslationUnit ()
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.
IncludeDirectiveGetIncludeDirectiveList ()
 Returns the include directive list.
const IncludeDirectiveGetIncludeDirectiveList () const
 Returns the include directive list.
ListParseNodeGetExternalDeclarationList ()
 Returns the list of top-level declarations.
const ListParseNodeGetExternalDeclarationList () const
 Returns the list of top-level declarations.
bool RequiresCodeGeneration () const
 Returns true if this unit should produce code.
void SetRequiresCodeGeneration (bool required)
 Sets whether this translation unit should produce code.
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 complete parsed source file.

Constructor & Destructor Documentation

◆ TranslationUnit()

Bond::TranslationUnit::TranslationUnit ( IncludeDirective * includeDirectiveList,
ListParseNode * declarationList )
inline

Constructs a translation unit.

Parameters
includeDirectiveListList of include directives.
declarationListList of top-level declarations.

◆ ~TranslationUnit()

virtual Bond::TranslationUnit::~TranslationUnit ( )
inlinevirtual

Member Function Documentation

◆ Accept() [1/2]

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

◆ GetExternalDeclarationList() [1/2]

ListParseNode * Bond::TranslationUnit::GetExternalDeclarationList ( )
inline

Returns the list of top-level declarations.

◆ GetExternalDeclarationList() [2/2]

const ListParseNode * Bond::TranslationUnit::GetExternalDeclarationList ( ) const
inline

Returns the list of top-level declarations.

◆ GetIncludeDirectiveList() [1/2]

IncludeDirective * Bond::TranslationUnit::GetIncludeDirectiveList ( )
inline

Returns the include directive list.

◆ GetIncludeDirectiveList() [2/2]

const IncludeDirective * Bond::TranslationUnit::GetIncludeDirectiveList ( ) const
inline

Returns the include directive list.

◆ RequiresCodeGeneration()

bool Bond::TranslationUnit::RequiresCodeGeneration ( ) const
inline

Returns true if this unit should produce code.

◆ SetRequiresCodeGeneration()

void Bond::TranslationUnit::SetRequiresCodeGeneration ( bool required)
inline

Sets whether this translation unit should produce code.

Parameters
requiredTrue to enable code generation.

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