예제 #1
0
        public override Closure GoToEntity(Entity X)
        {
            var closure = new CLRClosure("gotoX", Grammar);
            for (var index = 0; index < Count; ++index)
            {
                var prodLALR = this[index] as CLRProduction;
                if (default(Production) == prodLALR) continue;

                var dot = prodLALR.DotPosition;
                if (dot == prodLALR.Count) continue;

                var Y = prodLALR.Product[dot];
                if (Y == X) closure.Add(new CLRProduction(prodLALR.Producer, prodLALR.Product, dot + 1, prodLALR.LookAheads));
            }
            return closure;
        }
예제 #2
0
 public CLRClosure(String title, Grammar grammar, CLRClosure closure)
     : base(title, grammar, closure)
 {
     //_productions = (closure == default(LALRClosure)) ? default(List<LRProduction>) : new List<LRProduction>(closure.ToArray());
 }