示例#1
0
 public override void Next(BoolSet flags, char c)
 {
     if (this.c == c)
     {
         flags[this.next.Index] = true;
     }
 }
示例#2
0
 private void EpsilonMove(BoolSet nexts, BoolSet epsil, BoolSet enext)
 {
     epsil.Reset();
     foreach (var i in nexts)
     {
         foreach (var n in this.instances[i].Epsilons)
         {
             epsil[n] = true;
         }
     }
     foreach (var i in epsil)
     {
         nexts[i] = true;
     }
     do
     {
         enext.Reset();
         foreach (var i in epsil)
         {
             foreach (var n in this.instances[i].Epsilons.Where(d => !nexts[d]))
             {
                 nexts[n] = true;
                 enext[n] = true;
             }
         }
         epsil.Swap(enext);
     } while (epsil);
 }
示例#3
0
        public void Swap(BoolSet set)
        {
            var impl = this.set;

            this.set = set.set;
            set.set  = impl;
        }
示例#4
0
 public override void Next(BoolSet flags, char c)
 {
     if (!flags[this.next.Index] && this.func(c))
     {
         flags[this.next.Index] = true;
     }
 }
示例#5
0
 private void InitialSet(out BoolSet flags, out BoolSet nexts, out BoolSet epsil, out BoolSet enext)
 {
     flags = new BoolSet();
     nexts = new BoolSet();
     epsil = new BoolSet();
     enext = new BoolSet();
     flags[this.startIndex] = true;
     EpsilonMove(flags, epsil, enext);
 }
示例#6
0
 private void OneStep(BoolSet flags, BoolSet nexts, BoolSet epsil, BoolSet enext, char c)
 {
     nexts.Reset();
     foreach (var i in flags)
     {
         this.instances[i].Next(nexts, c);
     }
     EpsilonMove(nexts, epsil, enext);
     flags.Swap(nexts);
 }
示例#7
0
        private bool Check(BoolSet flags)
        {
            bool inner(int i)
            {
                return(this.instances[i].Goal);
            }

            bool notinner(int i)
            {
                return(!this.instances[i].Goal);
            }

            return(this.NotFlag ? flags.All(notinner) : flags.Any(inner));
        }
示例#8
0
 public virtual void Next(BoolSet flags, char c)
 {
 }