public Token next() throws IOException
	{
		// reset the value builder
		value.setLength( 0 );

		// if there's a token waiting, return it
		if( next != null )
		{
			current = next;
			next = null;
			return current;
		}

		while( true )
		{
			int read = source.read();
			if( read == -1 )
			{
				if( value.length() == 0 )
				{
					return current = Token.EOF;
				}
				return current = Token.VALUE;
			}

			if( read == delimiter )
			{
				return current = Token.VALUE;
			}

			if( read == '\n' )
			{
				if( value.length() > 0 )
				{
					if( value.charAt( value.length() - 1 ) == '\r' )
					{
						value.setLength( value.length() - 1 );
					}
					next = Token.NEWLINE;
					return current = Token.VALUE;
				}
				return current = Token.NEWLINE;
			}

			value.append( (char) read );
		}
	}