Puma Reference Manual Puma::CScopeInfo Class Reference



Puma::CScopeInfo Class Reference

Semantic information about a scope. More...

#include <Puma/CScopeInfo.h>

Inheritance diagram for Puma::CScopeInfo:
Inheritance graph

List of all members.

Public Member Functions

 ~CScopeInfo ()
 Destructor.
unsigned Children () const
 Get the number of child scopes (nested scopes).
CScopeInfoChild (unsigned) const
 Get the n-th child scope.
CScopeInfoParent () 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.
CLocalScopenewLocalScope ()
 Create a new local scope information object.
CFunctionInfonewFunction (bool inst=false)
 Create a new function or function template instance semantic object.
CClassInfonewClass (bool inst=false)
 Create a new class or class template instance semantic object.
CUnionInfonewUnion (bool inst=false)
 Create a new union or union template instance semantic object.
CNamespaceInfonewNamespace ()
 Create a new namespace semantic object.
CTemplateInfonewTemplate ()
 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.

Detailed Description

Semantic information about a scope.

Several syntactic constructs have its own scope, such as class definitions, functions, and compound statements.


Constructor & Destructor Documentation

Constructor.

Parameters:
idThe object type.

Member Function Documentation

Add a child scope to this scope.

Parameters:
scopeThe child scope.
CScopeInfo * Puma::CScopeInfo::Child ( unsigned  n) const [inline]

Get the n-th child scope.

Parameters:
nThe index of the child scope.
Returns:
The n-th child scope or NULL.
unsigned Puma::CScopeInfo::Children ( ) const [inline]

Get the number of child scopes (nested scopes).

Delete the given class semantic object.

Parameters:
cThe class.

Delete the given function semantic object.

Parameters:
fctThe function.

Delete the given local scope semantic object.

Parameters:
scopeThe local scope.

Delete the given namespace semantic object.

Parameters:
nsThe namespace.

Delete the given template semantic object.

Parameters:
tplThe template.

Delete the given union semantic object.

Parameters:
uThe 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.

Check if this is a class template.

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.

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.

Parameters:
insttrue if to a class template instance.

Create a new function or function template instance semantic object.

Parameters:
insttrue if to a function template instance.

Create a new local scope information object.

Create a new namespace semantic object.

Create a new template semantic object.

CUnionInfo* Puma::CScopeInfo::newUnion ( bool  inst = false)

Create a new union or union template instance semantic object.

Parameters:
insttrue if to a union template instance.
CScopeInfo * Puma::CScopeInfo::Parent ( ) const [inline]

Get the parent scope of this scope.

The top scope is the file scope.

Returns:
The parent scope, or this scope if no parent.
void Puma::CScopeInfo::Parent ( const CScopeInfo scope)

Set the parent scope of this scope.

Parameters:
scopeThe parent scope.
void Puma::CScopeInfo::removeChild ( const CScopeInfo scope)

Remove a child scope.

Parameters:
scopeThe child scope.