1
0
Fork
You've already forked cl-btparse
0
Common Lisp bindings to btparse(1)
  • Common Lisp 99.1%
  • TeX 0.9%
2026年06月01日 05:02:06 +02:00
test allow using pathname type 2026年06月01日 05:02:06 +02:00
.gitignore add gitignore 2026年04月12日 17:05:00 +02:00
biblatex-xname.lisp improve testing infrastructue 2026年05月31日 21:46:13 +02:00
bt-input.lisp allow using pathname type 2026年06月01日 05:02:06 +02:00
bt-macro.lisp add license info 2026年04月15日 20:06:21 +02:00
bt-parse.lisp ECL: Workaround for CFFI issue 2026年05月30日 15:44:18 +02:00
bt-split-names.lisp fix: formatting 2026年05月03日 23:03:27 +02:00
bt-traverse.lisp allow using pathname type 2026年06月01日 05:02:06 +02:00
cl-btparse.asd improve testing infrastructue 2026年05月31日 21:46:13 +02:00
license add license info 2026年04月15日 20:06:21 +02:00
package.lisp improve testing infrastructue 2026年05月31日 21:46:13 +02:00
process-file.lisp allow using pathname type 2026年06月01日 05:02:06 +02:00
readme.md fix extended name format 2026年05月31日 04:51:43 +02:00
strings.lisp add license info 2026年04月15日 20:06:21 +02:00
types.lisp add license info 2026年04月15日 20:06:21 +02:00
util.lisp error handling for process-file 2026年06月01日 00:25:16 +02:00

Common Lisp bindings for btparse (1)

btparse is the underlying C library used by both bibtex and biber to parse .bib files, thus using it directly is the easiest way to get a compatible bib(la)tex parser. The aim of this library is to provide a convenient interface to take advantage of btparse from Common Lisp.

Compatibility

Tested against current versions of:

  • SBCL
  • ECL*
  • CCL
  • CLISP

*: ECL support is currently depending on a workaround for an issue with cffi (see here and here). All tests pass but there might be some unexpected behaviour hidden somewhere.

Dependencies

  • System:
    • btparse (usually distributed as part of perl::text::bibtex).
  • Lisp:

API

Main entry point is process-file. The internal API follows what is documented in btparse (1). Currently exposed functionality roughly corresponds to bt_traverse (1) and bt_split_names (1).

Exported symbols

  • cl-btparse
    • custom API
      • process-file: call a function on all entries in a file.
      • parse-entry: parse entry into alist.
      • traverse-entry-fields: return alist of entry fields
    • bt_input (1)
      • with-ast-from-string: wrapper around bt_parse_entry_string.
      • with-ast-from-file: wrapper around bt_parse_file.
    • bt_traverse (1)
      • entry-type
      • entry-key
    • bt_split_names (1)
      • bt-name (struct type)
      • split-name-list
      • split-name
    • bt_misc (1)
      • purify-string
      • change-case
  • cl-btparse/biber: BibLaTex extension, aiming for biber compatibility
    • xname-p: check if a string is in biblatex extended name format
    • parse-xname: parse biblatex extended name
    • bt-xname (struct type)

For documentation consult the man pages and docstrings.

TODO

  • Handle parser/string options
  • implement bt_postprocessing API
  • implement bt_format_names API
  • implement bt_macro API
    • the functions are implemented but don't jive with the way I integrated bt_initialize and bt_cleanup into the API.
  • error handling

License

GPLv3

Also if you don't support queer & trans folk or use LLMs please fuck off.