Exemple #1
0
        public CharCheckEntry MatchSuccess(OptimizationContext context, Instruction instruction)
        {
            var matching = MatchingCharacters.Clone();

            AddEntry(instruction, true, instruction.Offset, matching);

            matching[instruction.Offset].RemoveAll(existing => InstructionHelper.NonJumpMatchWillFail(context, existing, instruction));

            return(new CharCheckEntry(matching, FailingCharacters));
        }
Exemple #2
0
        public NdState MatchSuccess(OptimizationContext context, Instruction instruction, int offset)
        {
            var matching = MatchingCharacters.Clone();

            AddEntry(instruction, true, offset, matching);

            matching[offset].RemoveAll(existing => InstructionHelper.NonJumpMatchWillFail(context, existing, instruction));

            return(new NdState(Variable, Vug, PositionA, PositionB, AdvancesA, AdvancesB, MinBounds, MaxBounds, VarAs, VarBs, matching, FailingCharacters));
        }
Exemple #3
0
        public CharCheckEntry Advance(int offset)
        {
            var matching = MatchingCharacters.Clone();
            var failing  = FailingCharacters.Clone();

            for (var i = 0; i < offset; i++)
            {
                if (matching.Count > 0)
                {
                    matching.PopFront();
                }

                if (failing.Count > 0)
                {
                    failing.PopFront();
                }
            }

            return(new CharCheckEntry(matching, failing));
        }