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()); }
private static void CallPop(IStringStream stream, int popCalls) { for (var i = 0; i < popCalls; i++) { stream.Pop(); } }
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()); }
protected override IParseResult TryGetTokenWithoutNullCheck(IStringStream inputStream, out IToken token) { inputStream.Pop(); token = new IntersectionToken(_initialStreamPosition); return(new SuccessParseResult()); }