code: private void getLastToken(StreamTokenizer tokenizer, boolean endOfFileOk) throws IOException, ParseException {
          if ((tokenizer.nextToken() != StreamTokenizer.TT_EOL) && ((tokenizer.ttype != StreamTokenizer.TT_EOF) || !endOfFileOk)) {
              throw new ParseException("end of line expected", tokenizer.lineno());
          }
      }
docs: Gets token and checks if it's end of line.
  
  @param endOfFileOk true if EOF is OK
  @throws IllegalStateException if it doesn't find an end of line