Beispiel #1
0
 public bool Interpret(Context context)
 {
     if (context.MoveNext() && _seperator.Equals(context.Current()))
         return true;
     context.Failed();
     return false;
 }
Beispiel #2
0
        public bool Interpret(Context context)
        {
            var tryInterpret = _digit == ExpressionBuilder.ALPHANUM;

            if ((tryInterpret  || context.MoveNext()) && char.IsDigit(context.Current()))
            {
                context.Feed();
                return true;
            }
            if (tryInterpret) return false;
            context.Failed();
            return false;
        }
Beispiel #3
0
        public bool Interpret(Context context)
        {
            var tryInterpret = _mask == ExpressionBuilder.ALPHANUM;

            var notFinished = (tryInterpret || context.MoveNext());

            if (notFinished && char.IsLetter(context.Current()))
            {
                context.Feed();
                return true;
            }
            if (tryInterpret) return false;
            context.Failed();
            return false;
        }