예제 #1
0
 //-----
 public override void Execute()
 {
     kids = data.getData();
     for (int a = 0; a < args.Count; a++)
     {
         ParseVar v = (ParseVar)args[a];
         process(v);
     }
 }
예제 #2
0
        //------
        private void processM(MultVar v, int i)
        {
            ArrayList vlist = v.getVector();

            for (int k = 0; k < vlist.Count; k++)
            {
                ParseVar pv = (ParseVar)vlist[k];
                process(pv, i);
            }
        }
예제 #3
0
        //-----
        private void process(MultVar v)
        {
            ArrayList mvec = v.getVector();

            for (int k = mvec.Count - 1; k >= 0; k--)
            {
                ParseVar pv      = (ParseVar)mvec[k];
                int      sortKey = pv.getValue();
                sortByKey(sortKey);
            }
        }
예제 #4
0
        //-----
        protected ParseVar getVar(string s)
        {
            ParseVar v = new ParseVar(s);

            if (v.isLegal())
            {
                return(v);
            }
            else
            {
                return(null);
            }
        }
예제 #5
0
 public override bool interpret()
 {
     if (topStack(ParseVar.VAR, ParseVar.VAR))
     {
         //reduces VAR VAR to MULTVAR
         ParseVar v1 = (ParseVar)stk.pop();
         ParseVar v2 = (ParseVar)stk.pop();
         MultVar  mv = new MultVar(v2, v1);
         stk.push(mv);
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #6
0
 public override bool interpret()
 {
     if (topStack(ParseVar.VAR, ParseVar.MULTVAR))
     {
         //reduce Var MultVar to MultVar
         ParseVar v  = (ParseVar)stk.pop();
         MultVar  mv = (MultVar)stk.pop();
         mv.add(v);
         stk.push(mv);
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #7
0
 //-----
 public override void Execute()
 {
     kids = data.getData();
     ptable.Items.Clear();
     for (int i = 0; i < kids.Length; i++)
     {
         pline = "";
         for (int j = 0; j < args.Count; j++)
         {
             ParseVar v = (ParseVar)args[j];
             if (v.getType() == ParseObject.MULTVAR)
             {
                 processM((MultVar)v, i);
             }
             else
             {
                 process(v, i);
             }
             ptable.Items.Add(pline);
         }
     }
 }
 public override bool interpret()
 {
     //reduce Var to Multvar
     if (topStack(ParseObject.MULTVAR, ParseObject.VAR))
     {
         MultVar  mv  = new MultVar();
         MultVar  mvo = (MultVar)stk.pop();
         ParseVar v   = (ParseVar)stk.pop();
         mv.add(v);
         ArrayList mvec = mvo.getVector();
         for (int i = 0; i < mvec.Count; i++)
         {
             mv.add((ParseVar)mvec[i]);
         }
         stk.push(mv);
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #9
0
 private void process(ParseVar v, int i)
 {
     pline = pline + kids[i].getData(v.getValue()).ToString() + " ";
 }
예제 #10
0
 public string getTableName(int key)
 {
     return(ParseVar.getTableName(key));
 }
예제 #11
0
 public int getTableKey(string tbName)
 {
     return(ParseVar.computeValue(tbName.ToLower()));
 }
예제 #12
0
 //----------
 public ParseVar(string s) : base(-1, VAR)
 {
     value = ParseVar.computeValue(s.ToLower());
 }
예제 #13
0
        //-----
        private void process(ParseVar v)
        {
            int sortKey = v.getValue();

            sortByKey(sortKey);
        }