using System;
using System.Collections;
using System.Text;
using SymbolTable;

namespace SymbolTable
{
    public class CSymbolTable
    {
        public Hashtable mSymbolTable;
        private int mVarCount;

        public CSymbolTable()
        {
            mVarCount = 0;
            mSymbolTable = new Hashtable();
        }

        public int SymbolCount { get { return mVarCount; } }

        public void Add(ISymbolStructure _symbol)
        {
            mVarCount++;
            mSymbolTable.Add(_symbol.Ident, _symbol);
        }

        public ISymbolStructure Get(string _ident)
        {
            return (ISymbolStructure)mSymbolTable[_ident];
        }

        public void Remove(string _ident)
        {
            mSymbolTable.Remove(_ident);
            mVarCount--;
        }
    }
}
