bibtex-0.0.5: Parse, format and processing BibTeX files





file :: Parser [T]Source

Beware that this and all other parsers do not accept leading spaces, cf. skippingSpace. That is when encountering leading white spaces the parser will just return an empty list. If you want to parse a file that contains entirely of BibTeX data you better call skippingLeadingSpace file instead. However, the file parser is more combinable and can be used for files that contain both BibTeX and other data or it can be used for automated filetype checking.

comment :: Parser StringSource

Parse a line that starts with a hash like

 # this is a comment


entry :: Parser TSource

Parse a BibTeX entry like

   author = {Firstname Surname},
   title = {Title},
   year = {2010},


assignment :: Parser (String, String)Source

Parse an assignment like

 author = {Firstname Surname}


value :: Parser StringSource

Parse an assignment like



 {Firstname Surname}


 "Firstname Surname"


texSequence :: Char -> Parser StringSource

Parse a sequence of texBlocks until the occurrence of a closing character. The closing character is not part of the result.

texBlock :: Char -> Parser StringSource

Parse a single character like a, a LaTeX macro call like \alpha or a block enclosed in curly braces like {\"{a}bc}.

identifier :: Parser StringSource

Parse a type of a BibTeX entry like article.

bibIdentifier :: Parser StringSource

Parse a name of a BibTeX entry like author2010title.

skippingSpace :: Parser a -> Parser aSource

Extends a parser, such that all trailing spaces are skipped. It might be more comfortable to skip all leading zeros, but parser written that way are hard to combine. This is so, since if you run two parsers in parallel and both of them expect leading spaces, then the parser combinator does not know which one of the parallel parsers to choose.

Convert contents of BibTeX fields into lists

splitCommaSepList :: String -> [String]Source

Split a string at the commas and remove leading spaces.

splitAuthorList :: String -> [String]Source

Split a string containing a list of authors in BibTeX notation.