Пример #1
0
  /**
   * Will parse the BibTex-Data found when reading from reader. Ignores any encoding supplied in the
   * file by "Encoding: myEncoding".
   *
   * <p>The reader will be consumed.
   *
   * <p>Multiple calls to parse() return the same results
   *
   * @return ParserResult
   * @throws IOException
   */
  public ParserResult parse() throws IOException {
    // If we already parsed this, just return it.
    if (parserResult != null) {
      return parserResult;
    }
    // Bibtex related contents.
    initializeParserResult();

    skipWhitespace();

    try {
      return parseFileContent();
    } catch (KeyCollisionException kce) {
      throw new IOException("Duplicate ID in bibtex file: " + kce);
    }
  }