Example #1
0
        protected override IParseResult TryGetTokenWithoutNullCheck(IStringStream inputStream, out IToken token)
        {
            inputStream.Pop();

            if (inputStream.CurrentPosition > inputStream.Count || !inputStream.LookAhead(0).Equals(SpecialCharacters.NegateCharacterClass))
            {
                token = new OpenCharacterClassToken(_initialStreamPosition);
                return(new SuccessParseResult());
            }

            inputStream.Pop();
            token = new OpenNegatedCharacterClassToken(_initialStreamPosition);
            return(new SuccessParseResult());
        }
Example #2
0
 private static void CallPop(IStringStream stream, int popCalls)
 {
     for (var i = 0; i < popCalls; i++)
     {
         stream.Pop();
     }
 }
Example #3
0
        protected override IParseResult TryGetTokenWithoutNullCheck(IStringStream inputStream, out IToken token)
        {
            inputStream.Pop();
            var interval = new IntegerInterval();

            interval.TrySetValue(0, 1);
            token = new IntegerIntervalToken(interval, _initialStreamPosition, 1);
            return(new SuccessParseResult());
        }
Example #4
0
 protected override IParseResult TryGetTokenWithoutNullCheck(IStringStream inputStream, out IToken token)
 {
     inputStream.Pop();
     token = new IntersectionToken(_initialStreamPosition);
     return(new SuccessParseResult());
 }