Ejemplo n.º 1
0
 void Restriction(out ActionRestrictions ar)
 {
     ar = null; ChannelRestrictions res = new ChannelRestrictions();
     Expect(24);
     if (la.kind == 3)
     {
         Get();
         res.Add(t.val); SetPos(res, t); res.ParenCount = 0; ar = res;
     }
     else if (la.kind == 25)
     {
         Get();
         res.ParenCount = 1;
         Expect(3);
         res.Add(t.val); SetPos(res, t);
         while (la.kind == 11)
         {
             Get();
             Expect(3);
             res.Add(t.val);
         }
         Expect(26);
         ar = res;
     }
     else if (la.kind == 6)
     {
         Get();
         ar = new CustomRestrictions(t.val.Replace(":", "")); SetPos(ar, t);
     }
     else
     {
         SynErr(45);
     }
 }
        //ActionHandling

        public override void Visit(ChannelRestrictions restrictions)
        {
            PopChildren();
            if (restrictions.ChannelNames.Count == 0)
            {
                Return("");
            }
            else
            {
                Return(" \\ {" + Join(", ", restrictions.ChannelNames) + "}");
            }
        }
 public virtual void Visit(ChannelRestrictions restrictions)
 {
 }