PUMA Library Reference Manual
|
#include <Puma/CSemDatabase.h>
Semantic information database.
Contains all semantic objects created during the semantic analysis for one translation unit.
Public Types | |
typedef std::set< CObjectInfo * > | ObjectSet |
Public Member Functions | |
CSemDatabase (CProject &prj, int size=997) | |
Constructor. | |
virtual | ~CSemDatabase () |
Destructor. | |
ObjectSet & | Objects () |
Get the set of all semantic objects. | |
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). | |
CObjectInfo * | ObjectInfo (unsigned n) const |
Get the n-th semantic object. | |
CClassInfo * | ClassInfo (unsigned n) const |
Get the n-th semantic object for classes. | |
CUnionInfo * | UnionInfo (unsigned n) const |
Get the n-th semantic object for unions. | |
CEnumInfo * | EnumInfo (unsigned n) const |
Get the n-th semantic object for enumerations. | |
CTypedefInfo * | TypedefInfo (unsigned n) const |
Get the n-th semantic object for typedefs. | |
CFunctionInfo * | FunctionInfo (unsigned n) const |
Get the n-th semantic object for functions. | |
CFileInfo * | FileInfo (unsigned n) const |
Get the n-th semantic object for translation units (file scope). | |
CObjectInfo * | ObjectInfo (Token *pos) const |
Get the semantic object for the entity at the given source code position (token). | |
CObjectInfo * | ObjectInfo (CT_Token *pos) const |
Get the semantic object for the entity at the given source code position (token). | |
CArgumentInfo * | newArgument () |
CAttributeInfo * | newAttribute () |
CBaseClassInfo * | newBaseClass () |
CClassInfo * | newClass () |
CClassInstance * | newClassInstance () |
CEnumInfo * | newEnum () |
CEnumeratorInfo * | newEnumerator () |
CFunctionInfo * | newFunction () |
CFctInstance * | newFctInstance () |
CLabelInfo * | newLabel () |
CLocalScope * | newLocalScope () |
CMemberAliasInfo * | newMemberAlias () |
CNamespaceInfo * | newNamespace () |
CTemplateInfo * | newTemplate () |
CTemplateParamInfo * | newTemplateParam () |
CTypedefInfo * | newTypedef () |
CUnionInfo * | newUnion () |
CUnionInstance * | newUnionInstance () |
CUsingInfo * | newUsing () |
CFileInfo * | newFile () |
void | Insert (CObjectInfo *info) |
Insert a new semantic object into the database. | |
void | Remove (CObjectInfo *info) |
Remove the given semantic object from the database. | |
CFunctionInfo * | BuiltinOperator (const char *name, int tok, CTypeInfo *rtype, CTypeInfo *t0, CTypeInfo *t1) |
Get the semantic object for the given built-in operator. | |
void | Dump (std::ostream &out, int depth=0, bool dump_builtins=true) const |
Dump the contents of the database. | |
CProject * | Project () const |
Get the project information. | |
typedef std::set<CObjectInfo*> Puma::CSemDatabase::ObjectSet |
|
inline |
Constructor.
prj | The project information. |
size | Initial size of the database (not yet used!). |
|
virtual |
Destructor.
Destroys all semantic information objects in the database.
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.
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. |
|
inline |
Get the n-th semantic object for classes.
n | The index of the object. |
|
inline |
Get the number of semantic objects for classes.
void Puma::CSemDatabase::Dump | ( | std::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.
out | The output stream. |
depth | The maximum indentation depth (0 means infinite). |
dump_builtins | Dump or ignore builtin function, types and objects. |
|
inline |
Get the n-th semantic object for enumerations.
n | The index of the object. |
|
inline |
Get the number of semantic objects for enumerations.
|
inline |
Get the n-th semantic object for translation units (file scope).
n | The index of the object. |
|
inline |
Get the number of semantic objects for translation units (file scope).
|
inline |
Get the n-th semantic object for functions.
n | The index of the object. |
|
inline |
Get the number of semantic objects for functions.
void Puma::CSemDatabase::Insert | ( | CObjectInfo * | info | ) |
Insert a new semantic object into the database.
info | The semantic object. |
CArgumentInfo * Puma::CSemDatabase::newArgument | ( | ) |
CAttributeInfo * Puma::CSemDatabase::newAttribute | ( | ) |
CBaseClassInfo * Puma::CSemDatabase::newBaseClass | ( | ) |
CClassInfo * Puma::CSemDatabase::newClass | ( | ) |
CClassInstance * Puma::CSemDatabase::newClassInstance | ( | ) |
CEnumInfo * Puma::CSemDatabase::newEnum | ( | ) |
CEnumeratorInfo * Puma::CSemDatabase::newEnumerator | ( | ) |
CFctInstance * Puma::CSemDatabase::newFctInstance | ( | ) |
CFileInfo * Puma::CSemDatabase::newFile | ( | ) |
CFunctionInfo * Puma::CSemDatabase::newFunction | ( | ) |
CLabelInfo * Puma::CSemDatabase::newLabel | ( | ) |
CLocalScope * Puma::CSemDatabase::newLocalScope | ( | ) |
CMemberAliasInfo * Puma::CSemDatabase::newMemberAlias | ( | ) |
CNamespaceInfo * Puma::CSemDatabase::newNamespace | ( | ) |
CTemplateInfo * Puma::CSemDatabase::newTemplate | ( | ) |
CTemplateParamInfo * Puma::CSemDatabase::newTemplateParam | ( | ) |
CTypedefInfo * Puma::CSemDatabase::newTypedef | ( | ) |
CUnionInfo * Puma::CSemDatabase::newUnion | ( | ) |
CUnionInstance * Puma::CSemDatabase::newUnionInstance | ( | ) |
CUsingInfo * Puma::CSemDatabase::newUsing | ( | ) |
CObjectInfo * Puma::CSemDatabase::ObjectInfo | ( | CT_Token * | pos | ) | const |
Get the semantic object for the entity at the given source code position (token).
pos | The token of the entity. |
CObjectInfo * Puma::CSemDatabase::ObjectInfo | ( | Token * | pos | ) | const |
Get the semantic object for the entity at the given source code position (token).
pos | The token of the entity. |
CObjectInfo * Puma::CSemDatabase::ObjectInfo | ( | unsigned | n | ) | const |
Get the n-th semantic object.
n | The index of the object. |
|
inline |
Get the number of semantic objects.
|
inline |
Get the set of all semantic objects.
|
inline |
Get the project information.
void Puma::CSemDatabase::Remove | ( | CObjectInfo * | info | ) |
Remove the given semantic object from the database.
info | The semantic object. |
|
inline |
Get the n-th semantic object for typedefs.
n | The index of the object. |
|
inline |
Get the number of semantic objects for typedefs.
|
inline |
Get the n-th semantic object for unions.
n | The index of the object. |
|
inline |
Get the number of semantic objects for unions.