예제 #1
0
        public override int eval(MyIDictionary <string, int> tbl)
        {
            //if (!tbl.isDefined(id))
            //	throw new MyStmtExecException("The id is not in the table: Exception thrown from VarExp");

            int val = 0;
            ICollection <string> keys = tbl.keys();

            for (int i = 0; i < keys.Count(); i++)
            {
                if (keys.ElementAt(i) == this.id)
                {
                    val = tbl.get(i);
                    break;
                }
            }
            return(val);
        }