Beispiel #1
0
        void OutAction(out Action action, string locality)
        {
            Expression exp = null; action = new OutAction(); action.Locality = locality;

            Expect(17);
            Expect(14);
            OutParam(out exp);
            action.AddExpression(exp);
            while (la.kind == 8)
            {
                Get();
                OutParam(out exp);
                action.AddExpression(exp);
            }
            Expect(15);
            Expect(18);
            if (la.kind == 1)
            {
                Get();
                action.At = new PLRString(t.val);
            }
            else if (la.kind == 2)
            {
                Get();
                action.At = new Variable(t.val);
            }
            else
            {
                SynErr(29);
            }
        }
Beispiel #2
0
        void ActionPrefix(out Process proc, string locality)
        {
            Process nextproc = new NilProcess(); proc = null; Action action = null;

            if (la.kind == 17 || la.kind == 19 || la.kind == 20)
            {
                Action(out action, locality);
                if (la.kind == 13)
                {
                    Get();
                    ActionPrefix(out nextproc, locality);
                }
                proc = new ActionPrefix(action, nextproc); CopyPos(proc, action, t);
            }
            else if (la.kind == 14)
            {
                Get();
                Process(out proc, locality);
                Expect(15);
            }
            else if (la.kind == 16)
            {
                Get();
                proc = new NilProcess(); SetPos(proc, t);
            }
            else
            {
                SynErr(27);
            }
        }
Beispiel #3
0
 void Action(out Action action, string locality)
 {
     action = null; Token start = la;
     if (la.kind == 17)
     {
         OutAction(out action, locality);
     }
     else if (la.kind == 19 || la.kind == 20)
     {
         InOrReadAction(out action, locality);
     }
     else
     {
         SynErr(28);
     }
     action.Nr = _actionNr++;
     Token end = t; SetPos(action, start, end);
 }
Beispiel #4
0
        void InOrReadAction(out Action action, string locality)
        {
            Expression exp = null;   action = null;

            if (la.kind == 19)
            {
                Get();
                action = new InAction(); action.Locality = locality;
            }
            else if (la.kind == 20)
            {
                Get();
                action = new ReadAction();  action.Locality = locality;
            }
            else
            {
                SynErr(30);
            }
            Expect(14);
            InOrReadParam(out exp);
            action.AddExpression(exp);
            while (la.kind == 8)
            {
                Get();
                InOrReadParam(out exp);
                action.AddExpression(exp);
            }
            Expect(15);
            Expect(18);
            if (la.kind == 1)
            {
                Get();
                action.At = new PLRString(t.val); SetPos(action.At, t);
            }
            else if (la.kind == 2)
            {
                Get();
                action.At = new Variable(t.val); SetPos(action.At, t);
            }
            else
            {
                SynErr(31);
            }
        }
 void Action(out Action action, string locality)
 {
     action = null; Token start = la;
     if (la.kind == 17) {
     OutAction(out action, locality);
     } else if (la.kind == 19 || la.kind == 20) {
     InOrReadAction(out action, locality);
     } else SynErr(28);
     action.Nr = _actionNr++;
     Token end = t; SetPos(action, start, end);
 }
 void OutAction(out Action action, string locality)
 {
     Expression exp = null; action = new OutAction(); action.Locality = locality;
     Expect(17);
     Expect(14);
     OutParam(out exp);
     action.AddExpression(exp);
     while (la.kind == 8) {
     Get();
     OutParam(out exp);
     action.AddExpression(exp);
     }
     Expect(15);
     Expect(18);
     if (la.kind == 1) {
     Get();
     action.At = new PLRString(t.val);
     } else if (la.kind == 2) {
     Get();
     action.At = new Variable(t.val);
     } else SynErr(29);
 }
 void InOrReadAction(out Action action, string locality)
 {
     Expression exp = null;   action = null;
     if (la.kind == 19) {
     Get();
     action = new InAction(); action.Locality = locality;
     } else if (la.kind == 20) {
     Get();
     action = new ReadAction();  action.Locality = locality;
     } else SynErr(30);
     Expect(14);
     InOrReadParam(out exp);
     action.AddExpression(exp);
     while (la.kind == 8) {
     Get();
     InOrReadParam(out exp);
     action.AddExpression(exp);
     }
     Expect(15);
     Expect(18);
     if (la.kind == 1) {
     Get();
     action.At = new PLRString(t.val); SetPos(action.At, t);
     } else if (la.kind == 2) {
     Get();
     action.At = new Variable(t.val); SetPos(action.At, t);
     } else SynErr(31);
 }