Example #1
0
		private Token GetCurrentToken()
		{
			if (currentToken == null)
			{
				if (scanner.InternalMoveNext())
				{
					currentToken = scanner.Current;
				}
			}
			return currentToken;
		}
Example #2
0
		/// <summary>
		/// Consumes the current token and increments the parsed token count
		/// </summary>
		internal void ConsumeCurrent()
		{
			++tokensParsed;
			tokenAvailable = false;
			current = null;
		}
Example #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;
			}
		}
Example #4
0
		private void Skip()
		{
			if (currentToken != null)
			{
				currentToken = null;
				scanner.ConsumeCurrent();
			}
		}