예제 #1
0
 public SLRClosure(String title, Grammar grammar, SLRClosure closure)
     : base(title, grammar)
 {
     SLRProductions = (default(SLRClosure) != closure)
                          ? closure.SLRProductions
                          : default(List<SLRProduction>);
 }
예제 #2
0
        public override Closure GoToEntity(Entity X)
        {
            var closure = new SLRClosure("gotoX", Grammar);
            for (var index = 0; index < Count; ++index)
            {
                var product = this[index];
                var dot = product.DotPosition;
                if (dot == product.Count) continue;

                //Entity Y = product.Product[dot];
                if (X == product.Product[dot]) closure.Add(new SLRProduction(product.Producer, product.Product, dot + 1));
            }
            return closure;
        }
예제 #3
0
 public SLRClosure(String title, Grammar grammar, SLRClosure closure)
     : base(title, grammar)
 {
     SLRProductions = (closure == default(SLRClosure)) ? default(List<SLRProduction>) : closure.SLRProductions;
 }