code: private void advance() {
          try {
              // loop until we find a word in the reader, or there are no more
              // words
              while (true) {
                  // if we haven't looked at any lines yet, or if the index into
                  // the current line is already at the end 
                  if (curLine == null || !matcher.find()) {
  
                      String line = br.readLine();
                      
                      // if there aren't any more lines in the reader, then mark
                      // next as null to indicate that there are no more words
                      if (line == null) {
                          next = null;
                          br.close();
                          return;
                      }
                      
                      // create a new matcher to find all the tokens in this line
                      matcher = notWhiteSpace.matcher(line);
                      curLine = line;
                      
                      // skip lines with no matches
                      if (!matcher.find())
                          continue;                    
                  }
  
                  next = curLine.substring(matcher.start(), matcher.end());
                  break;
              }
          } catch (IOException ioe) {
              throw new IOError(ioe);
          }
      }
docs: Advances to the next word in the buffer.