P4  1
name analysis
Public Member Functions | Package Functions
SymTable Class Reference

List of all members.

Public Member Functions

 SymTable ()
void addDecl (String name, SemSym sym) throws DuplicateSymException, EmptySymTableException, NullPointerException
void addScope ()
SemSym lookupLocal (String name)
SemSym lookupGlobal (String name)

Package Functions

void removeScope () throws EmptySymTableException
void print ()

Detailed Description

The SymTable class allocates a List of HashMaps each of which pertain to a scope and hold symbols pertaining to the declarations of that scope

Author:
Matt Rennebohm

Constructor & Destructor Documentation

Constructs new, empty SymTable initialized with one empty HashMap


Member Function Documentation

void SymTable.addDecl ( String  name,
SemSym  sym 
) throws DuplicateSymException, EmptySymTableException, NullPointerException

Add a new declaration to the current (top of list) scope

Parameters:
declarationname
declarationsymbol
Exceptions:
DuplicateSymException
EmptySymTableException
NullPointerException

Add new scope to the scope list

SemSym SymTable.lookupGlobal ( String  name)

Return symbol from Global scope given its declaration name

Returns:
symbol (null if not found)
SemSym SymTable.lookupLocal ( String  name)

Return symbol from local scope given its declaration name

Returns:
symbol (null if not found)
void SymTable.print ( ) [package]

Debugging method to dump symbol table

void SymTable.removeScope ( ) throws EmptySymTableException [package]

Remove top scope from the scope list

Exceptions:
EmptySymTableException

The documentation for this class was generated from the following file:
 All Classes Functions Variables