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);
 }
예제 #2
0
        internal override CodeBase Add(FiberItem subsequentElement)
        {
            var newResult = TryToCombine(subsequentElement);
            if(newResult == null)
                return new Fiber(this, subsequentElement);

            return newResult;
        }
예제 #3
0
 void IVisitor.Fiber(FiberHead fiberHead, FiberItem[] fiberItems) => NotImplementedMethod(fiberHead, fiberItems);
예제 #4
0
 void IVisitor.Fiber(FiberHead fiberHead, FiberItem[] fiberItems)
 {
     fiberHead.Visit(this);
     foreach(var fiberItem in fiberItems)
         fiberItem.Visit(this);
 }
예제 #5
0
 protected virtual CodeBase TryToCombine(FiberItem subsequentElement) => null;
예제 #6
0
 void IVisitor.Fiber(FiberHead fiberHead, FiberItem[] fiberItems)
 {
     SubVisit(fiberHead);
     foreach(var codeBase in fiberItems)
         SubVisit(codeBase);
 }
예제 #7
0
 internal override CodeBase Add(FiberItem subsequentElement)
 {
     NotImplementedMethod(subsequentElement);
     return null;
 }