Overview

Author: Wade Gasior
Symbol Table Structure
CPSC 351 Spring 2010

This code implements a symbol table structure that could be adapted for use
with a C- compiler. 

Description of Data Structure:
The data structure exists as a doubly-linked list of hash tables. Each level of this list represents a level of scope.

Examples of Methods of Interest
A compiler would make use of the following methods:
	hashes = create_HashTable(); /* Scope level is at 0 */
This creates a new linked list of hash tables of length 1.

	insertEntry(hashes, createHashEntry("Level0ItemA", 1, 3));
Insert a new entry into the hash table. As the first argument, provide the root element of the linked list of hash tables.
The function will take care of inserting the element in the proper scope level.

	addScopeLevel(hashes); /* Scope level is at 1 */
Add a level of scope.

	removeScopeLevel(hashes);
Remove a level of scope.

	 lu = lookup(hashes, "Level0ItemB");
Lookup an item in the table - checks all scope levels. Returns a pointer to the element in the highest scope level. 
Returns NULL if not found.

	printHashTable(hashes);
Print the current hash table - all scope levels.

	getScopeLevel(hashes)
Get the current level of scope (returns a number between 0 and n)


Work Log (bzr log output)
------------------------------------------------------------
revno: 13
committer: Wade Gasior <wadegasior@gmail.com>
branch nick: gasior_symbol_table
timestamp: Fri 2010-04-09 16:37:39 -0400
message:
  Completed README.
------------------------------------------------------------
revno: 12
committer: Wade Gasior <wadegasior@gmail.com>
branch nick: gasior_symbol_table
timestamp: Fri 2010-04-09 16:24:43 -0400
message:
  Implemented functionality to deal with hash collisions. Tested this by setting hash size to 1.
------------------------------------------------------------
revno: 11
committer: Wade Gasior <wadegasior@gmail.com>
branch nick: gasior_symbol_table
timestamp: Fri 2010-04-09 15:26:03 -0400
message:
  Removed for loops from lookup methods.
  Modified tester.c to reflect real world use.
------------------------------------------------------------
revno: 10
committer: Wade Gasior <wadegasior@gmail.com>
branch nick: gasior_symbol_table
timestamp: Fri 2010-04-09 12:45:22 -0400
message:
  Added a new function to check if an entry exists in a specific scope level.
  Added insert function - does not take into account collisions!
------------------------------------------------------------
revno: 9
committer: Wade Gasior <wadegasior@gmail.com>
branch nick: gasior_symbol_table
timestamp: Fri 2010-04-09 12:24:29 -0400
message:
  Added basic lookup method.
  HashEntry constructor now takes name, type (int), and line number
  Added function to add linenumber to existing entry.
------------------------------------------------------------
revno: 8
committer: Wade Gasior <wadegasior@gmail.com>
branch nick: gasior_symbol_table
timestamp: Thu 2010-04-08 20:18:10 -0400
message:
  Corrected error in printHashTable method where it was not printing the last hash in the set.
  Made the printHashTable method print more formatted output (with indentations for each level).
------------------------------------------------------------
revno: 7
committer: Wade Gasior <wadegasior@gmail.com>
branch nick: gasior_symbol_table
timestamp: Thu 2010-04-08 19:17:30 -0400
message:
  Added function to compare two hash entries.
------------------------------------------------------------
revno: 6
committer: Wade Gasior <wadegasior@gmail.com>
branch nick: gasior_symbol_table
timestamp: Thu 2010-04-08 19:08:06 -0400
message:
  Added getScopeLevel function.
  Added functions to add and remove a level of scope.
------------------------------------------------------------
revno: 5
committer: Wade Gasior <wadegasior@gmail.com>
branch nick: gasior_symbol_table
timestamp: Thu 2010-04-08 18:21:23 -0400
message:
  Added functions to create hash tables and entries.
  Added function to print a hash table.
  Added testing for this to tester.c
------------------------------------------------------------
revno: 4
committer: Wade Gasior <wadegasior@gmail.com>
branch nick: gasior_symbol_table
timestamp: Thu 2010-04-08 17:39:02 -0400
message:
  Renamed hash function to getHashCode.
  Added a function create_LineListRec to create a new entry in a list of lines.
  Added basic structs for hash table.
------------------------------------------------------------
revno: 3
committer: Wade Gasior <wadegasior@gmail.com>
branch nick: gasior_symbol_table
timestamp: Thu 2010-04-08 17:14:18 -0400
message:
  Added and tested LineListRec struct and printLines method.
------------------------------------------------------------
revno: 2
committer: Wade Gasior <wadegasior@gmail.com>
branch nick: gasior_symbol_table
timestamp: Thu 2010-04-08 16:54:01 -0400
message:
  Added and tested hash function.
------------------------------------------------------------
revno: 1
committer: Wade Gasior <wadegasior@gmail.com>
branch nick: gasior_symbol_table
timestamp: Thu 2010-04-08 16:21:49 -0400
message:
  Initial import.