public void Wrap(ICodeSet codeSet, ICollection <Symbol> buffer, IEnumerable <Action> emits) { var symbol = codeSet.GetSymbolForCode(SpecialCodes.Func4); foreach (var item in emits) { buffer.Add(symbol); item(); } }
public static int FlushCodeSet(ICodeSet set, byte[] input, ICollection <Symbol> buffer, int startIndex, int count) { while (count > 0) { buffer.Add(set.GetSymbolForCode(input[startIndex])); ++startIndex; --count; } return(startIndex); }
public static IEnumerable <Action> CreateFlushEmits(ICodeSet set, byte[] input, ICollection <Symbol> buffer, int startIndex, int count) { while (count > 0) { var readIndex = startIndex; yield return(() => buffer.Add(set.GetSymbolForCode(input[readIndex]))); ++startIndex; --count; } }