예제 #1
0
 public char Current()
 {
     if (Index >= TotalLength)
     {
         throw ParseErrors.InvalidText(this);
     }
     return(Text[Index]);
 }
예제 #2
0
        public LimitInfo ParseLimitInfo(string text)
        {
            if (string.IsNullOrWhiteSpace(text))
            {
                return(null);
            }
            var       context   = new ParseContext(text, this.CurrentCulture);
            LimitInfo limitInfo = context.ParseLimitInfo();

            context.SkipWhiteSpace();
            if (context.NotEnd())
            {
                throw ParseErrors.InvalidText(context);
            }
            return(limitInfo);
        }
예제 #3
0
        public ValueInfo ParseValue(string text)
        {
            if (string.IsNullOrWhiteSpace(text))
            {
                return(null);
            }
            var context = new ParseContext(text, this.CurrentCulture);

            context.SkipWhiteSpace();
            var value = context.ParseValueInfo();

            if (context.NotEnd())
            {
                throw ParseErrors.InvalidText(context);
            }
            return(value);
        }