Exemple #1
0
 public void PreProcess(IProcessingState state)
 {
     for (int i = 0; i < PreProcessActions.Length; i++)
     {
         PreProcessActions[i](state);
     }
 }
Exemple #2
0
        void Relabelling(out PreProcessActions preproc)
        {
            preproc = null; string relabelTo, relabelFrom; RelabelActions labels = new RelabelActions();
            Expect(21);
            Token first = t;

            if (la.kind == 6)
            {
                Get();
                preproc = new CustomPreprocess(t.val.Replace(":", "")); SetPos(preproc, first);
            }
            else if (la.kind == 3)
            {
                Get();
                relabelTo = t.val; SetPos(labels, first);
                Expect(22);
                Expect(3);
                relabelFrom = t.val; labels.Add(relabelFrom, relabelTo);
                while (la.kind == 11)
                {
                    Get();
                    Expect(3);
                    relabelTo = t.val;
                    Expect(22);
                    Expect(3);
                    relabelFrom = t.val; labels.Add(relabelFrom, relabelTo);
                }
                preproc = labels;
            }
            else
            {
                SynErr(44);
            }
            Expect(23);
        }
Exemple #3
0
 public virtual string Format(PreProcessActions labels)
 {
     if (labels.Count == 0)
     {
         return("");
     }
     else
     {
         StringList temp = new StringList();
         foreach (object id in labels)
         {
             temp.Add(id.ToString());
         }
         return("[" + Join(", ", temp) + "]");
     }
 }
Exemple #4
0
        void ActionPrefix(out Process proc)
        {
            ActionPrefix ap = null; ActionPrefix prev = null; ActionPrefix first = null; Process nextProc = null; ProcessConstant pc; proc = null; Action act = null;

            while (la.kind == 3 || la.kind == 5 || la.kind == 6)
            {
                Token startAction = la;
                Action(out act);
                ap = new ActionPrefix(act, null); SetStartPos(ap, startAction); if (first == null)
                {
                    first = ap;
                }
                if (prev != null)
                {
                    prev.Process = ap;
                }
                prev = ap;
                SetPos(act, startAction, t);
                Expect(16);
            }
            if (la.kind == 10)
            {
                Get();
                Process(out nextProc);
                Expect(12);
                nextProc.ParenCount++;
            }
            else if (la.kind == 17)
            {
                Get();
                nextProc = new NilProcess(); SetPos(nextProc, t);
            }
            else if (la.kind == 1)
            {
                ProcessConstantInvoke(out pc);
                nextProc = pc;
            }
            else if (la.kind == 18)
            {
                BranchProcess(out nextProc);
            }
            else
            {
                SynErr(42);
            }
            if (first == null)
            {
                proc = nextProc;
            }
            else
            {
                ap.Process = nextProc; proc = first;
            };
            if (la.kind == 21)
            {
                PreProcessActions ppa = null;
                Relabelling(out ppa);
                nextProc.PreProcessActions = ppa;
            }
            if (la.kind == 24)
            {
                ActionRestrictions ar = null;
                Restriction(out ar);
                nextProc.ActionRestrictions = ar;
            }
        }
 public virtual void Visit(PreProcessActions actions)
 {
 }