private void fetch(boolean failOnEof) throws ParseException {
  if (null != current) {
    return;
  }
  List<Token<T>> filtered=null;
  Token<T> t=null;
  if (!eof) {
    while (tstream.hasNext()) {
      t=tstream.next();
      if (tokenFilter.accept(t)) {
        break;
      }
      if (null == filtered) {
        filtered=new ArrayList<Token<T>>();
      }
      filtered.add(t);
      t=null;
    }
  }
  if (null == t) {
    eof=true;
    if (failOnEof) {
      throw new ParseException(new Message(MessageType.END_OF_FILE,(null != inputRange ? this.inputRange : this.file)));
    }
    return;
  }
  TokenList<T> tl=new TokenList<T>();
  tl.t=t;
  tl.filteredTokens=null != filtered ? Collections.<Token<T>>unmodifiableList(filtered) : Collections.<Token<T>>emptyList();
  current=tl;
  if (null != prev) {
    prev.next=tl;
  }
}

private void fetch ( boolean failOnEof ) throws ParseException { if ( null != current ) { return ; } List < Token < T > > filtered = null ; Token < T > t = null ; if ( ! eof ) { while ( tstream . hasNext ( ) ) { t = tstream . next ( ) ; if ( tokenFilter . accept ( t ) ) { break ; } if ( null == filtered ) { filtered = new ArrayList < Token < T > > ( ) ; } filtered . add ( t ) ; t = null ; } } if ( null == t ) { eof = true ; if ( failOnEof ) { throw new ParseException ( new Message ( MessageType . END_OF_FILE , ( null != inputRange ? this . inputRange : this . file ) ) ) ; } return ; } TokenList < T > tl = new TokenList < T > ( ) ; tl . t = t ; tl . filteredTokens = null != filtered ? Collections . < Token < T > > unmodifiableList ( filtered ) : Collections . < Token < T > > emptyList ( ) ; current = tl ; if ( null != prev ) { prev . next = tl ; } }
ensures that there is a token on the queue ready for fetching .
