PUMA Library Reference Manual
|
#include <Puma/CTranslationUnit.h>
Abstraction of a translation unit.
A translation unit is a single implementation file that a compiler can translate to an object file. In particular it contains all the code from included header files.
A translation unit is created by the parser (see Puma::Parser). It encapsulates the input file and the parse results (syntax trees, semantic database). When it is destroyed, it also destroys the parse results.
Public Member Functions | |
CTranslationUnit (Unit &u, CProject &p) | |
Constructor. | |
~CTranslationUnit () | |
Destructor. | |
void | tree (CTree *t) |
Set the C/C++ syntax tree. | |
void | cpp_tree (PreTree *t) |
Set the preprocessor syntax tree. | |
CTree * | tree () const |
Get the C/C++ syntax tree. | |
PreTree * | cpp_tree () const |
Get the C preprocessor syntax tree. | |
Unit * | unit () const |
Get the token unit of the input file. | |
CSemDatabase & | db () const |
Get the semantic information database. | |
UnitManager & | local_units () const |
Get the unit manager for local units (macro expansions etc). | |
Constructor.
u | The token unit of the input file. |
p | The project information object. |
Puma::CTranslationUnit::~CTranslationUnit | ( | ) |
Destructor.
Destroys the C/C++ syntax tree and the preprocessor syntax tree. The semantic information objects are destroyed when the semantic database member object is destroyed. If this is a template instance translation unit then destroy the unit too.
|
inline |
Get the C preprocessor syntax tree.
|
inline |
Set the preprocessor syntax tree.
t | The root node of the syntax tree. |
|
inline |
Get the semantic information database.
|
inline |
Get the unit manager for local units (macro expansions etc).
|
inline |
Get the C/C++ syntax tree.
|
inline |
Set the C/C++ syntax tree.
t | The root node of the syntax tree. |
|
inline |
Get the token unit of the input file.