net.sourceforge.pmd.cpd.cppast
Class SymtabManager

java.lang.Object
  extended bynet.sourceforge.pmd.cpd.cppast.SymtabManager

public class SymtabManager
extends java.lang.Object

Manages the symbol table and scopes within a given compilation unit.


Field Summary
(package private) static int depth
          Current depth of scope nesting.
(package private) static Scope[] scopeStack
          Stack of scopes.
(package private) static java.util.Hashtable scopeTable
          Global symbol table indexed by the name of the scope (class/function).
 
Constructor Summary
SymtabManager()
           
 
Method Summary
static void CloseScope()
           
static Scope GetCurScope()
           
static Scope GetScope(java.lang.String name)
           
static Scope GetScopeOfFullyScopedName(java.lang.String name)
          Returns the Scope of B in A::B::C.
static boolean IsCtor(java.lang.String name)
          For now, we just say if it is a class name, it is OK to call it a constructor.
static boolean IsFullyScopedTypeName(java.lang.String name)
           
static boolean IsGlobalScope()
           
static boolean IsTypeName(java.lang.String name)
           
static void OpenScope(Scope sc)
           
static Scope OpenScope(java.lang.String scopeName, boolean isType)
          Opens a new scope (with optional name and type flag).
static void PutTypeName(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scopeTable

static java.util.Hashtable scopeTable
Global symbol table indexed by the name of the scope (class/function).


scopeStack

static Scope[] scopeStack
Stack of scopes. Currently max. nesting allowed is 100.


depth

static int depth
Current depth of scope nesting.

Constructor Detail

SymtabManager

public SymtabManager()
Method Detail

OpenScope

public static Scope OpenScope(java.lang.String scopeName,
                              boolean isType)
Opens a new scope (with optional name and type flag).


OpenScope

public static void OpenScope(Scope sc)

PutTypeName

public static void PutTypeName(java.lang.String name)

IsFullyScopedTypeName

public static boolean IsFullyScopedTypeName(java.lang.String name)

IsTypeName

public static boolean IsTypeName(java.lang.String name)

CloseScope

public static void CloseScope()

IsCtor

public static boolean IsCtor(java.lang.String name)
For now, we just say if it is a class name, it is OK to call it a constructor.


GetCurScope

public static Scope GetCurScope()

GetScope

public static Scope GetScope(java.lang.String name)

GetScopeOfFullyScopedName

public static Scope GetScopeOfFullyScopedName(java.lang.String name)
Returns the Scope of B in A::B::C.


IsGlobalScope

public static boolean IsGlobalScope()