Puma Reference Manual Puma: Puma::CSemDatabase Class Reference



Puma::CSemDatabase Class Reference

Semantic information database. More...

#include <Puma/CSemDatabase.h>

List of all members.

Public Member Functions

 CSemDatabase (CProject &prj, int size=997)
 Constructor.
virtual ~CSemDatabase ()
 Destructor.
unsigned ObjectInfos () const
 Get the number of semantic objects.
unsigned ClassInfos () const
 Get the number of semantic objects for classes.
unsigned UnionInfos () const
 Get the number of semantic objects for unions.
unsigned EnumInfos () const
 Get the number of semantic objects for enumerations.
unsigned TypedefInfos () const
 Get the number of semantic objects for typedefs.
unsigned FunctionInfos () const
 Get the number of semantic objects for functions.
unsigned FileInfos () const
 Get the number of semantic objects for translation units (file scope).
CObjectInfoObjectInfo (unsigned n) const
 Get the n-th semantic object.
CClassInfoClassInfo (unsigned n) const
 Get the n-th semantic object for classes.
CUnionInfoUnionInfo (unsigned n) const
 Get the n-th semantic object for unions.
CEnumInfoEnumInfo (unsigned n) const
 Get the n-th semantic object for enumerations.
CTypedefInfoTypedefInfo (unsigned n) const
 Get the n-th semantic object for typedefs.
CFunctionInfoFunctionInfo (unsigned n) const
 Get the n-th semantic object for functions.
CFileInfoFileInfo (unsigned n) const
 Get the n-th semantic object for translation units (file scope).
CObjectInfoObjectInfo (Token *pos) const
 Get the semantic object for the entity at the given source code position (token).
CObjectInfoObjectInfo (CT_Token *pos) const
 Get the semantic object for the entity at the given source code position (token).
void Insert (CObjectInfo *info)
 Insert a new semantic object into the database.
void Remove (CObjectInfo *info)
 Remove the given semantic object from the database.
CFunctionInfoBuiltinOperator (const char *name, int tok, CTypeInfo *rtype, CTypeInfo *t0, CTypeInfo *t1)
 Get the semantic object for the given built-in operator.
void Dump (ostream &out, int depth=0, bool dump_builtins=true) const
 Dump the contents of the database.
CProjectProject () const
 Get the project information.

Detailed Description

Semantic information database.

Contains all semantic objects created during the semantic analysis for one translation unit.


Constructor & Destructor Documentation

Puma::CSemDatabase::CSemDatabase ( CProject prj,
int  size = 997 
) [inline]

Constructor.

Parameters:
prj The project information.
size Initial size of the database (not yet used!).
virtual Puma::CSemDatabase::~CSemDatabase (  )  [virtual]

Destructor.

Destroys all semantic information objects in the database.


Member Function Documentation

CFunctionInfo* Puma::CSemDatabase::BuiltinOperator ( const char *  name,
int  tok,
CTypeInfo rtype,
CTypeInfo t0,
CTypeInfo t1 
)

Get the semantic object for the given built-in operator.

Parameters:
name The operator name/symbol.
tok The operator token type.
rtype The result type of the operator.
t0 Type of the first operand.
t1 Type of the second operand, or NULL if only one operand.
CClassInfo * Puma::CSemDatabase::ClassInfo ( unsigned  n  )  const [inline]

Get the n-th semantic object for classes.

Parameters:
n The index of the object.
Returns:
The object or NULL if n is invalid.
unsigned Puma::CSemDatabase::ClassInfos (  )  const [inline]

Get the number of semantic objects for classes.

void Puma::CSemDatabase::Dump ( ostream &  out,
int  depth = 0,
bool  dump_builtins = true 
) const

Dump the contents of the database.

The dump is indented as tree corresponding to the nesting of the semantic objects.

Parameters:
out The output stream.
depth The maximum indentation depth (0 means infinite).
dump_builtins Dump or ignore builtin function, types and objects.
CEnumInfo * Puma::CSemDatabase::EnumInfo ( unsigned  n  )  const [inline]

Get the n-th semantic object for enumerations.

Parameters:
n The index of the object.
Returns:
The object or NULL if n is invalid.
unsigned Puma::CSemDatabase::EnumInfos (  )  const [inline]

Get the number of semantic objects for enumerations.

CFileInfo * Puma::CSemDatabase::FileInfo ( unsigned  n  )  const [inline]

Get the n-th semantic object for translation units (file scope).

Parameters:
n The index of the object.
Returns:
The object or NULL if n is invalid.
unsigned Puma::CSemDatabase::FileInfos (  )  const [inline]

Get the number of semantic objects for translation units (file scope).

CFunctionInfo * Puma::CSemDatabase::FunctionInfo ( unsigned  n  )  const [inline]

Get the n-th semantic object for functions.

Parameters:
n The index of the object.
Returns:
The object or NULL if n is invalid.
unsigned Puma::CSemDatabase::FunctionInfos (  )  const [inline]

Get the number of semantic objects for functions.

void Puma::CSemDatabase::Insert ( CObjectInfo info  ) 

Insert a new semantic object into the database.

Parameters:
info The semantic object.
CObjectInfo* Puma::CSemDatabase::ObjectInfo ( CT_Token pos  )  const

Get the semantic object for the entity at the given source code position (token).

Parameters:
pos The token of the entity.
Returns:
The semantic object or NULL.
CObjectInfo* Puma::CSemDatabase::ObjectInfo ( Token pos  )  const

Get the semantic object for the entity at the given source code position (token).

Parameters:
pos The token of the entity.
Returns:
The semantic object or NULL.
CObjectInfo* Puma::CSemDatabase::ObjectInfo ( unsigned  n  )  const

Get the n-th semantic object.

Parameters:
n The index of the object.
Returns:
The object or NULL if n is invalid.
unsigned Puma::CSemDatabase::ObjectInfos (  )  const [inline]

Get the number of semantic objects.

CProject * Puma::CSemDatabase::Project (  )  const [inline]

Get the project information.

void Puma::CSemDatabase::Remove ( CObjectInfo info  ) 

Remove the given semantic object from the database.

Parameters:
info The semantic object.
CTypedefInfo * Puma::CSemDatabase::TypedefInfo ( unsigned  n  )  const [inline]

Get the n-th semantic object for typedefs.

Parameters:
n The index of the object.
Returns:
The object or NULL if n is invalid.
unsigned Puma::CSemDatabase::TypedefInfos (  )  const [inline]

Get the number of semantic objects for typedefs.

CUnionInfo * Puma::CSemDatabase::UnionInfo ( unsigned  n  )  const [inline]

Get the n-th semantic object for unions.

Parameters:
n The index of the object.
Returns:
The object or NULL if n is invalid.
unsigned Puma::CSemDatabase::UnionInfos (  )  const [inline]

Get the number of semantic objects for unions.




Puma Reference Manual. Created on 18 Sep 2009.