コード例 #1
0
        public SequenceValidationResult Check(IReadOnlyList <char> input, out ControlSequence seq)
        {
            Tuple <ControlSequenceGenerator, int> result;
            var seqFound = TryCheck(input, 0, out result);

            if (seqFound)
            {
                if (result != null)
                {
                    var length = result.Item2 + 1;
                    seq = result.Item1(input, length);
                    return(SequenceValidationResult.SequenceFound);
                }
                else
                {
                    seq = null;
                    return(SequenceValidationResult.PrefixFound);
                }
            }
            else
            {
                seq = null;
                return(SequenceValidationResult.SequenceNotFound);
            }
        }
コード例 #2
0
 public void Add(ControlSequence seq, params char[] input)
 {
     Add(input, 0, (a, b) => seq);
 }