btool
A parser/converter/transpiler for .bib files
ValueParserState.hpp
Go to the documentation of this file.
1 #ifndef BIBPARSER_VALUEPARSERSTATE_HPP
2 #define BIBPARSER_VALUEPARSERSTATE_HPP
3 
5 #include <ParserContext.hpp>
6 #include <BibElement.hpp>
7 #include <cctype>
8 #include <vector>
9 #include <string>
10 #include <stack>
11 
17  std::string value;
18  std::stack<std::pair<std::size_t, std::size_t>> braces;
19 
20  public:
21 
24  std::vector<BibElement> &result
25  ) noexcept;
26 
27  auto handleCharacter(char c) -> ParserState * override;
28 
29  static auto replaceSpecialCharacter(std::string &s) -> void;
30 };
31 
32 #endif
ValueParserState::handleCharacter
auto handleCharacter(char c) -> ParserState *override
Definition: ValueParserState.cpp:26
ParserState
Definition: ParserState.hpp:7
ParserContext.hpp
AbstractParserState
Definition: AbstractParserState.hpp:13
ValueParserState::ValueParserState
ValueParserState(ParserContext &context, std::vector< BibElement > &result) noexcept
Definition: ValueParserState.cpp:17
ParserContext
Definition: ParserContext.hpp:10
ValueParserState::braces
std::stack< std::pair< std::size_t, std::size_t > > braces
a stack for counting delimiting braces
Definition: ValueParserState.hpp:18
AbstractParserState::context
ParserContext & context
Context of the State.
Definition: AbstractParserState.hpp:15
ValueParserState::value
std::string value
a accumulator for value-characters while parsing it
Definition: ValueParserState.hpp:17
ValueParserState
Key Parser State.
Definition: ValueParserState.hpp:16
AbstractParserState.hpp
AbstractParserState::result
std::vector< BibElement > & result
Container for accumulating Parsing-Results.
Definition: AbstractParserState.hpp:16
ValueParserState::replaceSpecialCharacter
static auto replaceSpecialCharacter(std::string &s) -> void
Definition: ValueParserState.cpp:58
BibElement.hpp