Beispiel #1
0
		private Token GetCurrentToken()
		{
			if (currentToken == null)
			{
				if (scanner.InternalMoveNext())
				{
					currentToken = scanner.Current;
				}
			}
			return currentToken;
		}
Beispiel #2
0
		/// <summary>
		/// Consumes the current token and increments the parsed token count
		/// </summary>
		internal void ConsumeCurrent()
		{
			++tokensParsed;
			tokenAvailable = false;
			current = null;
		}
Beispiel #3
0
		internal bool InternalMoveNext()
		{
			if (!tokenAvailable && !streamEndProduced)
			{
				FetchMoreTokens();
			}
			if (tokens.Count > 0)
			{
				current = tokens.Dequeue();
				tokenAvailable = false;
				return true;
			}
			else
			{
				current = null;
				return false;
			}
		}
Beispiel #4
0
		private void Skip()
		{
			if (currentToken != null)
			{
				currentToken = null;
				scanner.ConsumeCurrent();
			}
		}