btool
A parser/converter/transpiler for .bib files
ValueParserState Class Reference

Key Parser State. More...

#include <ValueParserState.hpp>

+ Inheritance diagram for ValueParserState:
+ Collaboration diagram for ValueParserState:

Public Member Functions

 ValueParserState (ParserContext &context, std::vector< BibElement > &result) noexcept
 
auto handleCharacter (char c) -> ParserState *override
 
- Public Member Functions inherited from AbstractParserState
 AbstractParserState (ParserContext &context, std::vector< BibElement > &result) noexcept
 
- Public Member Functions inherited from ParserState
virtual ~ParserState ()=default
 

Static Public Member Functions

static auto replaceSpecialCharacter (std::string &s) -> void
 

Private Attributes

std::string value
 a accumulator for value-characters while parsing it More...
 
std::stack< std::pair< std::size_t, std::size_t > > braces
 a stack for counting delimiting braces More...
 

Additional Inherited Members

- Protected Member Functions inherited from AbstractParserState
auto fail (const std::string &message) -> void
 
- Protected Attributes inherited from AbstractParserState
ParserContextcontext
 Context of the State. More...
 
std::vector< BibElement > & result
 Container for accumulating Parsing-Results. More...
 

Detailed Description

Key Parser State.

Value State of the Parser, parsing the value of the last Bib-Elements properties key

Examples
/github/workspace/test/ParserStateFixtureTest.cpp.

Definition at line 16 of file ValueParserState.hpp.

Constructor & Destructor Documentation

◆ ValueParserState()

ValueParserState::ValueParserState ( ParserContext context,
std::vector< BibElement > &  result 
)
noexcept

Constructor.

Parameters
contextof the parser
resultaccumulator of parsing-results

Definition at line 17 of file ValueParserState.cpp.

Member Function Documentation

◆ handleCharacter()

auto ValueParserState::handleCharacter ( char  c) -> ParserState *
overridevirtual

Handles the next character in value-state

Parameters
cthe next character to parse
Returns
a new parser-state
Exceptions
ParserExceptionon parsing-error (invalid input)

Reimplemented from AbstractParserState.

Definition at line 26 of file ValueParserState.cpp.

◆ replaceSpecialCharacter()

auto ValueParserState::replaceSpecialCharacter ( std::string &  s) -> void
static

Definition at line 58 of file ValueParserState.cpp.

Member Data Documentation

◆ braces

std::stack<std::pair<std::size_t, std::size_t> > ValueParserState::braces
private

a stack for counting delimiting braces

Definition at line 18 of file ValueParserState.hpp.

◆ value

std::string ValueParserState::value
private

a accumulator for value-characters while parsing it

Definition at line 17 of file ValueParserState.hpp.


The documentation for this class was generated from the following files: