Gyoji Compiler
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Gyoji::frontend::tree::TranslationUnit Class Reference

Represents the top-level syntax unit for a source file. More...

#include <tree.hpp>

Inheritance diagram for Gyoji::frontend::tree::TranslationUnit:
Inheritance graph
[legend]
Collaboration diagram for Gyoji::frontend::tree::TranslationUnit:
Collaboration graph
[legend]

Public Member Functions

 ~TranslationUnit ()
 
const std::vector< Gyoji::owned< FileStatement > > & get_statements () const
 
- Public Member Functions inherited from Gyoji::frontend::ast::SyntaxNode
 SyntaxNode (Gyoji::context::TokenID _type, specific_type_t _data, const Gyoji::context::SourceReference &_source_ref)
 
const std::vector< std::reference_wrapper< const SyntaxNode > > & get_children () const
 
const Gyoji::context::TokenID & get_type () const
 
template<class T >
bool has_data () const
 
template<class T >
const T & get_data () const
 
const SyntaxNodeget_syntax_node () const
 
const Gyoji::context::SourceReferenceget_source_ref () const
 

Detailed Description

Represents the top-level syntax unit for a source file.

This class represents a translation unit, the top-level result of parsing a source-file. A translation unit normally corresponds to a unit that will ultimately be compiled into a binary object file (.o) and linked later into an executable.

A translation unit consists of zero or more file-level statements that represent the file's content. At this level, the statements may be one of:

All syntax information about the file appears in a tree-like structure beneath this node.

Constructor & Destructor Documentation

◆ ~TranslationUnit()

TranslationUnit::~TranslationUnit ( )

Destructor, nothing special.

Member Function Documentation

◆ get_statements()

const std::vector< Gyoji::owned< FileStatement > > & TranslationUnit::get_statements ( ) const

This method returns a list of 'const' owned pointers to the statements defined in this translation unit.


The documentation for this class was generated from the following files: