Example #1
0
 public override int Eval(IMyDictionary <String, int> sym)
 {
     if (sym.ContainsKey(id))
     {
         int v;
         sym.TryGetValue(id, out v);
         return(v);
     }
     else
     {
         throw new Exception("The element does not exist in the symbol table");
     }
 }
Example #2
0
        public PrgState Execute(PrgState p)
        {
            IMyDictionary <string, int> symbolt = p.SymTable;
            int id;

            symbolt.TryGetValue(expFileId, out id);
            FileData fd;

            p.FileTable.TryGetValue(id, out fd);
            StreamReader sr = fd.FileDescriptor;

            sr.Close();
            p.FileTable.Remove(id);
            return(p);
        }