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