Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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;
            }
        }