Puma Reference Manual | Puma: Puma::CScopeInfo Class Reference |
Semantic information about a scope. More...
#include <Puma/CScopeInfo.h>
Inherits Puma::CObjectInfo.
Inherited by Puma::CStructure.
Public Member Functions | |
~CScopeInfo () | |
Destructor. | |
unsigned | Children () const |
Get the number of child scopes (nested scopes). | |
CScopeInfo * | Child (unsigned) const |
Get the n-th child scope. | |
CScopeInfo * | Parent () const |
Get the parent scope of this scope. | |
bool | isFile () const |
Check if this is a file (file scope). | |
bool | isNamespace () const |
Check if this is namespace. | |
bool | isRecord () const |
Check if this is class or union. | |
bool | isClass () const |
Check if this is a class. | |
bool | isUnion () const |
Check if this is a union. | |
bool | isFunction () const |
Check if this is a function. | |
bool | isMethod () const |
Check if this is a class method. | |
bool | isClassTemplate () const |
Check if this is a class template. | |
bool | isFctTemplate () const |
Check if this is a function template. | |
bool | isLocalScope () const |
Check if this is a local scope. | |
bool | isLocalRecord () const |
Check if this is a local class or union. | |
bool | isLocalClass () const |
Check if this is a local class. | |
bool | isLocalUnion () const |
Check if this is a local union. | |
bool | GlobalScope () const |
Check if this is the global (file) scope. | |
bool | insideTemplate () const |
Check if this scope is inside a class or function template scope. | |
bool | insideRecord () const |
Check if this scope is inside a class or union scope. | |
bool | insideClass () const |
Check if this scope is inside a class scope. | |
bool | insideUnion () const |
Check if this scope is inside a union scope. | |
bool | insideFunction () const |
Check if this scope is inside a function scope. | |
bool | insideMethod () const |
Check if this scope is inside a class method scope. | |
void | Parent (const CScopeInfo *scope) |
Set the parent scope of this scope. | |
void | addChild (CScopeInfo *scope) |
Add a child scope to this scope. | |
void | removeChild (const CScopeInfo *scope) |
Remove a child scope. | |
CLocalScope * | newLocalScope () |
Create a new local scope information object. | |
CFunctionInfo * | newFunction (bool inst=false) |
Create a new function or function template instance semantic object. | |
CClassInfo * | newClass (bool inst=false) |
Create a new class or class template instance semantic object. | |
CUnionInfo * | newUnion (bool inst=false) |
Create a new union or union template instance semantic object. | |
CNamespaceInfo * | newNamespace () |
Create a new namespace semantic object. | |
CTemplateInfo * | newTemplate () |
Create a new template semantic object. | |
void | deleteLocalScope (const CLocalScope *scope) |
Delete the given local scope semantic object. | |
void | deleteFunction (const CFunctionInfo *fct) |
Delete the given function semantic object. | |
void | deleteClass (const CClassInfo *c) |
Delete the given class semantic object. | |
void | deleteUnion (const CUnionInfo *u) |
Delete the given union semantic object. | |
void | deleteNamespace (const CNamespaceInfo *ns) |
Delete the given namespace semantic object. | |
void | deleteTemplate (const CTemplateInfo *tpl) |
Delete the given template semantic object. | |
Protected Member Functions | |
CScopeInfo (ObjectId id) | |
Constructor. |
Semantic information about a scope.
Several syntactic constructs have its own scope, such as class definitions, functions, and compound statements.
Puma::CScopeInfo::CScopeInfo | ( | CObjectInfo::ObjectId | id | ) | [inline, protected] |
Constructor.
id | The object type. |
Puma::CScopeInfo::~CScopeInfo | ( | ) |
Destructor.
void Puma::CScopeInfo::addChild | ( | CScopeInfo * | scope | ) |
Add a child scope to this scope.
scope | The child scope. |
CScopeInfo * Puma::CScopeInfo::Child | ( | unsigned | n | ) | const [inline] |
Get the n-th child scope.
n | The index of the child scope. |
unsigned Puma::CScopeInfo::Children | ( | ) | const [inline] |
Get the number of child scopes (nested scopes).
void Puma::CScopeInfo::deleteClass | ( | const CClassInfo * | c | ) |
Delete the given class semantic object.
c | The class. |
void Puma::CScopeInfo::deleteFunction | ( | const CFunctionInfo * | fct | ) |
Delete the given function semantic object.
fct | The function. |
void Puma::CScopeInfo::deleteLocalScope | ( | const CLocalScope * | scope | ) |
Delete the given local scope semantic object.
scope | The local scope. |
void Puma::CScopeInfo::deleteNamespace | ( | const CNamespaceInfo * | ns | ) |
Delete the given namespace semantic object.
ns | The namespace. |
void Puma::CScopeInfo::deleteTemplate | ( | const CTemplateInfo * | tpl | ) |
Delete the given template semantic object.
tpl | The template. |
void Puma::CScopeInfo::deleteUnion | ( | const CUnionInfo * | u | ) |
Delete the given union semantic object.
u | The union. |
bool Puma::CScopeInfo::GlobalScope | ( | ) | const [inline] |
Check if this is the global (file) scope.
bool Puma::CScopeInfo::insideClass | ( | ) | const [inline] |
Check if this scope is inside a class scope.
bool Puma::CScopeInfo::insideFunction | ( | ) | const [inline] |
Check if this scope is inside a function scope.
bool Puma::CScopeInfo::insideMethod | ( | ) | const [inline] |
Check if this scope is inside a class method scope.
bool Puma::CScopeInfo::insideRecord | ( | ) | const [inline] |
Check if this scope is inside a class or union scope.
bool Puma::CScopeInfo::insideTemplate | ( | ) | const [inline] |
Check if this scope is inside a class or function template scope.
bool Puma::CScopeInfo::insideUnion | ( | ) | const [inline] |
Check if this scope is inside a union scope.
bool Puma::CScopeInfo::isClass | ( | ) | const [inline] |
Check if this is a class.
Reimplemented in Puma::CTemplateInfo.
bool Puma::CScopeInfo::isClassTemplate | ( | ) | const |
Check if this is a class template.
bool Puma::CScopeInfo::isFctTemplate | ( | ) | const |
Check if this is a function template.
bool Puma::CScopeInfo::isFile | ( | ) | const [inline] |
Check if this is a file (file scope).
bool Puma::CScopeInfo::isFunction | ( | ) | const [inline] |
Check if this is a function.
Reimplemented in Puma::CTemplateInfo.
bool Puma::CScopeInfo::isLocalClass | ( | ) | const [inline] |
Check if this is a local class.
bool Puma::CScopeInfo::isLocalRecord | ( | ) | const [inline] |
Check if this is a local class or union.
bool Puma::CScopeInfo::isLocalScope | ( | ) | const [inline] |
Check if this is a local scope.
bool Puma::CScopeInfo::isLocalUnion | ( | ) | const [inline] |
Check if this is a local union.
bool Puma::CScopeInfo::isMethod | ( | ) | const |
Check if this is a class method.
Reimplemented in Puma::CFunctionInfo.
bool Puma::CScopeInfo::isNamespace | ( | ) | const [inline] |
Check if this is namespace.
bool Puma::CScopeInfo::isRecord | ( | ) | const [inline] |
Check if this is class or union.
bool Puma::CScopeInfo::isUnion | ( | ) | const [inline] |
Check if this is a union.
CClassInfo* Puma::CScopeInfo::newClass | ( | bool | inst = false |
) |
Create a new class or class template instance semantic object.
inst | true if to a class template instance. |
CFunctionInfo* Puma::CScopeInfo::newFunction | ( | bool | inst = false |
) |
Create a new function or function template instance semantic object.
inst | true if to a function template instance. |
CLocalScope* Puma::CScopeInfo::newLocalScope | ( | ) |
Create a new local scope information object.
CNamespaceInfo* Puma::CScopeInfo::newNamespace | ( | ) |
Create a new namespace semantic object.
CTemplateInfo* Puma::CScopeInfo::newTemplate | ( | ) |
Create a new template semantic object.
CUnionInfo* Puma::CScopeInfo::newUnion | ( | bool | inst = false |
) |
Create a new union or union template instance semantic object.
inst | true if to a union template instance. |
void Puma::CScopeInfo::Parent | ( | const CScopeInfo * | scope | ) |
Set the parent scope of this scope.
scope | The parent scope. |
CScopeInfo * Puma::CScopeInfo::Parent | ( | ) | const [inline] |
Get the parent scope of this scope.
The top scope is the file scope.
void Puma::CScopeInfo::removeChild | ( | const CScopeInfo * | scope | ) |
Remove a child scope.
scope | The child scope. |