BibParser.BibTeX.Accumulator
— Typemutable struct Accumulator
A structure to accumulate part of the input stream as a simple string. It differs from Position that store line
and column
information.
BibParser.BibTeX.BibTeXError
— TypeBibTeXError
Description of a BibTeXError, including the relevant position in the input string.
Arguments:
kind::Symbol
: the type of BibTeX errorinput::String
: the BibTeX string being parsedstart::Position
: the row/col start position of the BibTeXErrorstop::Position
: the row/col end position of the BibTeXError
BibParser.BibTeX.Content
— TypeContent
Store the different BibTeX elements once succesfully parsed.
Free text, comments entries and preambles entries are currently ignored.
BibParser.BibTeX.Content
— MethodContent()
Create an (almost) empty content constructor for a new Parser
. Some usual BibTeX content is added:
- List of months abbreviations in English (added automatically by some BibTeX class)
Feel free to contribute to more default content.
BibParser.BibTeX.Field
— TypeField
A structure that can store BibTeX fields information.
Arguments:
braces::Int
: counter to the number of opened braces in a field being parsedname::String
: name of the field being parsedquotes::Bool
:true
if the field is delimited by quotesvalue::String
: the value of the field
BibParser.BibTeX.Parser
— TypeParser
A structure allowing to parse a BibTeX formatted string one character at a time.
Arguments:
acc::Accumulator
: an accumulated string from lastdump
tocontent
content::Content
: the current content of a parsererrors::Vector{BibTeXError}
: a collection of BibTeX errorsfield::Field
: temporary storage for an entry fields namesinput::Vector{Char}
: the BibTeX stringpos_start::Position
: pointer to the raw/col start positionpos_end::Position
: pointer to the raw/col end positionstorage::Storage
: temporary storage of the content of an entry being parsedtask::Symbol
: describe which part of the BibTeX gramma is being parsed
BibParser.BibTeX.Position
— TypePosition
A structure pointing to a position in the input based on rows and columns.
BibParser.BibTeX.Position
— MethodPosition()
Initial position constructor
BibParser.BibTeX.Storage
— TypeStorage
Store the content of an entry being parsed.
Arguments:
delim::Union{Char, Nothing}
: the character delimiting the entryfields::Vector{Field}
: a collection of the entry's fieldskey::String
: the key of the entrykind::String
: the kind/type of BibTeX entry
BibParser.BibTeX.Storage
— MethodStorage()
Empty storage constructor called when a new entry is being parsed.
BibParser.BibTeX.dump!
— Functiondump!(parser, char = ' ')
Dump the content of the parser Accumulator
into the parser Content
. Dispatch to the appropriate dump!
method according to the state of the parser.
BibParser.BibTeX.get_acc
— Methodget_acc(parser; from = 1, to = 0)
Retrieve the Accumulator
of the parser.
Arguments:
parser
: aParser
from
: a positive offset from the start of theAccumulator
, default to1
to
: a negative offset from the end of theAccumulator
, default to0
BibParser.BibTeX.get_entries
— Methodget_entries(parser)
Retrieve the entries succesfully parsed by parser
.
BibParser.BibTeX.inc!
— Methodinc!(parser, char, dumped)
Increment the start/end position and accumulator of the parser.
Arguments:
parser
: aBibTeX.Parser
structurechar
: the character being parseddumped
: boolean value describing if theAccumulator
content is being dumped into the parserContent
BibParser.BibTeX.inc_col!
— Methodinc_col!(parser) = begin
Increment the column
field of the pointer to the end position of the Parser.
BibParser.BibTeX.inc_row!
— Methodinc_row!(parser)
Increment the row
field of the pointer to the end position of the Parser.
BibParser.BibTeX.is_dumped
— Methodis_dumped(parser, char)
Check if an Accumulator
needs to be dump!
ed. Dispatch to the appropriate is_dumped
method according to the state of the parser.
BibParser.BibTeX.make_entry
— Methodmake_entry(storage)
Make a BibInternal.Entry
from a completed entry in a parser storage.
BibParser.BibTeX.parse!
— Methodparse!(parser, char)
Parse a single character of a BibTeX string. Modify the Parser
accordingly.
BibParser.BibTeX.parse_file
— Methodparse_file(path)
Parse a BibTeX file located at path
. Raise a detailed warning for each invalid entry.
BibParser.BibTeX.parse_string
— Methodparse_string(str)
Parse a BibTeX string of entries. Raise a detailed warning for each invalid entry.
BibParser.BibTeX.rev
— Methodrev(char)
Return the closing character )
/}
matching either (
or {
.
BibParser.BibTeX.set_delim!
— Methodset_delim!(parser, char)
Set the delimiter for this section of the entry to parenthesis or braces.
BibParser.BibTeX.set_entry_kind!
— Methodset_entry_kind!(parser, kind) = begin
Set the kind of the entry being parsed in the parser
's storage.
BibParser.BibTeX.warn
— Methodwarn(error)
Dispatch a BibTeX error as a Julia warning based on the type of error.