// Mike Maxim
// Environment class

package edu.cmu.cs.l3.translate;

import edu.cmu.cs.l3.symbol.*;
import edu.cmu.cs.l3.tree.*;

public class TranslateEnvironment {

    public TranslateEnvironment() {
	m_env = new SymbolTable();
    }

    public void addEntry(Symbol name, IRExpression var) throws SymbolTableException {
	m_env.put(name,var);
    }

    public IRExpression getEntry(Symbol name) {
	return (IRExpression)m_env.get(name);
    }

    public void removeEntry(Symbol name,boolean fromAll) {
	m_env.remove(name,fromAll);
    }

    public void beginScope() {
	m_env.beginScope();
    }

    public void endScope() {
	m_env.endScope();
    }

    public String toString() {
	String str="";
	str += m_env.toString() + "\n";
	return str;
    }

    private SymbolTable m_env;
}
