syntax
Class SymtabManager

java.lang.Object
  extended bysyntax.SymtabManager

public class SymtabManager
extends java.lang.Object

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


Constructor Summary
SymtabManager()
           
 
Method Summary
static void AddSuspendedVarName(java.lang.String name)
          When encountering parameter names, they are put into a suspended list until scope is opened.
static void ClearSuspendedVarName()
          Removes all parameter names.
static void CloseScope()
           
static Scope GetCurScope()
           
static int getDepth()
           
static java.lang.String GetFullyScopedClassName()
           
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 IsMethod(java.lang.String name)
          It splits the parameter name into method name and type name (first parameter), using the left parenthesis as separator.
static boolean IsTypeName(java.lang.String name)
           
static void OpenScope(Scope sc)
           
static Scope OpenScope(java.lang.String scopeName, boolean isType, boolean nameSpaceScope)
          Opens a new scope (with optional name and type flag).
static void PutSuspendedVarName()
          Transfers parameter names into proper scope.
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
 

Constructor Detail

SymtabManager

public SymtabManager()
Method Detail

OpenScope

public static Scope OpenScope(java.lang.String scopeName,
                              boolean isType,
                              boolean nameSpaceScope)
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.


IsMethod

public static boolean IsMethod(java.lang.String name)
It splits the parameter name into method name and type name (first parameter), using the left parenthesis as separator. Then it opens the scope associated to the method name and it checks whether the type name is really a type or not.


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()

getDepth

public static int getDepth()

AddSuspendedVarName

public static void AddSuspendedVarName(java.lang.String name)
When encountering parameter names, they are put into a suspended list until scope is opened.


ClearSuspendedVarName

public static void ClearSuspendedVarName()
Removes all parameter names.


PutSuspendedVarName

public static void PutSuspendedVarName()
Transfers parameter names into proper scope.


GetFullyScopedClassName

public static java.lang.String GetFullyScopedClassName()