/**
 * SymbolTable.java
 * Class used to map variable names to their offset from the frame pointer
 */
import java.util.Hashtable;
						

public class SymbolTable extends Hashtable{
	
	/**
	 * Inserts a symbol and its offset into the table
	 */
	public void put(String symbol, int offset){
		super.put(symbol, new Integer(offset));
	}
	
	/**
	 * Returns the offset of a passed symbol
	 */
	public int get(String symbol){
		Integer n = (Integer)super.get(symbol);
		if (n != null)
			return n.intValue();
		else
			return Integer.MAX_VALUE; // error code		
	}	
}
		
		