public void Enqueue(GssLink <T> rightLink, Production rule, int size) { Debug.Assert(rightLink != null); int tail = size == 0 ? 0 : 1; GssReducePath <T> .GetAll( rightLink.LeftNode, size - tail, tail, rule, rightLink, InternalEnqueue); }
public void Enqueue(GssNode <T> rightNode, Production rule, int size) { if (size == 0) { GssReducePath <T> .GetAll(rightNode, 0, 0, rule, null, InternalEnqueue); } else { var link = rightNode.FirstLink; while (link != null) { Enqueue(link, rule, size); link = link.NextLink; } } }
public GssReducePath <T> Dequeue() { if (pendingPaths.Count == 0) { var r = reductions.Dequeue(); var size = r.Size; int tail = (r.Size != 0 && r.RightLink != null) ? 1 : 0; GssReducePath <T> .GetAll( r.RightNode, size - tail, tail, r.Rule, r.RightLink, pendingPaths.Enqueue); } return(pendingPaths.Dequeue()); }