internal override CodeBase Fiber(Fiber visitedObject) { var data = visitedObject.FiberItems; var newItems = new FiberItem[data.Length]; var index = data.Length - 1; newItems[index] = data[index].Visit(this); return Fiber(visitedObject, null, newItems); }
internal override CodeBase Add(FiberItem subsequentElement) { var newResult = TryToCombine(subsequentElement); if(newResult == null) return new Fiber(this, subsequentElement); return newResult; }
void IVisitor.Fiber(FiberHead fiberHead, FiberItem[] fiberItems) => NotImplementedMethod(fiberHead, fiberItems);
void IVisitor.Fiber(FiberHead fiberHead, FiberItem[] fiberItems) { fiberHead.Visit(this); foreach(var fiberItem in fiberItems) fiberItem.Visit(this); }
protected virtual CodeBase TryToCombine(FiberItem subsequentElement) => null;
void IVisitor.Fiber(FiberHead fiberHead, FiberItem[] fiberItems) { SubVisit(fiberHead); foreach(var codeBase in fiberItems) SubVisit(codeBase); }
internal override CodeBase Add(FiberItem subsequentElement) { NotImplementedMethod(subsequentElement); return null; }