예제 #1
0
        public bool IsFinal()
        {
            var token = encoding.GetString(data, 0, dataIndex);

            matcher.Reset();
            for (int i = 0; i < token.Length; ++i)
            {
                if (!matcher.Next(token[i]))
                {
                    return(false);
                }
            }
            return(matcher.IsFinal());
        }
 public void Reset()
 {
     tail   = 0;
     index  = 0;
     symbol = 0;
     matcher.Reset();
 }
예제 #3
0
        public void Reset()
        {
            decoder      = encoding.GetDecoder();
            decoderSteps = 0;

            matcher.Reset();
            matcherSteps.Clear();
        }
예제 #4
0
 public static bool IsMatch <T>(this IDfaMatcher <T> matcher, IEnumerable <T> word)
 {
     matcher.Reset();
     foreach (var c in word)
     {
         if (!matcher.Next(c))
         {
             return(false);
         }
     }
     return(matcher.IsFinal());
 }