Puma Reference Manual Puma: Puma::CTranslationUnit Class Reference



Puma::CTranslationUnit Class Reference

#include <Puma/CTranslationUnit.h>

List of all members.


Detailed Description

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.
CTreetree () const
 Get the C/C++ syntax tree.
PreTreecpp_tree () const
 Get the C preprocessor syntax tree.
Unitunit () const
 Get the token unit of the input file.
CSemDatabasedb () const
 Get the semantic information database.
UnitManagerlocal_units () const
 Get the unit manager for local units (macro expansions etc).


Constructor & Destructor Documentation

Puma::CTranslationUnit::CTranslationUnit ( Unit u,
CProject p 
) [inline]

Constructor.

Parameters:
u The token unit of the input file.
p The project information object.

Puma::CTranslationUnit::~CTranslationUnit (  )  [inline]

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.


Member Function Documentation

void Puma::CTranslationUnit::tree ( CTree t  )  [inline]

Set the C/C++ syntax tree.

Parameters:
t The root node of the syntax tree.

void Puma::CTranslationUnit::cpp_tree ( PreTree t  )  [inline]

Set the preprocessor syntax tree.

Parameters:
t The root node of the syntax tree.

CTree* Puma::CTranslationUnit::tree (  )  const [inline]

Get the C/C++ syntax tree.

PreTree* Puma::CTranslationUnit::cpp_tree (  )  const [inline]

Get the C preprocessor syntax tree.

Unit* Puma::CTranslationUnit::unit (  )  const [inline]

Get the token unit of the input file.

CSemDatabase& Puma::CTranslationUnit::db (  )  const [inline]

Get the semantic information database.

UnitManager& Puma::CTranslationUnit::local_units (  )  const [inline]

Get the unit manager for local units (macro expansions etc).




Puma Reference Manual. Created on 5 Nov 2008.