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

#include <AbstractParserState.hpp>

+ Inheritance diagram for AbstractParserState:
+ Collaboration diagram for AbstractParserState:

Public Member Functions

 AbstractParserState (ParserContext &context, std::vector< BibElement > &result) noexcept
 
- Public Member Functions inherited from ParserState
virtual ~ParserState ()=default
 

Protected Member Functions

auto fail (const std::string &message) -> void
 
auto handleCharacter (char c) -> ParserState *override
 

Protected Attributes

ParserContextcontext
 Context of the State. More...
 
std::vector< BibElement > & result
 Container for accumulating Parsing-Results. More...
 

Detailed Description

Abstract Class with default-implementation of a ParserState

Definition at line 13 of file AbstractParserState.hpp.

Constructor & Destructor Documentation

◆ AbstractParserState()

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

Constructor.

Parameters
contextthe context of the State
resultan accumulator for results

Definition at line 9 of file AbstractParserState.cpp.

Member Function Documentation

◆ fail()

auto AbstractParserState::fail ( const std::string &  message) -> void
protected

Error handling on parsing-error

Parameters
messageError-Message to display
Exceptions
ParserException(always)

Definition at line 17 of file AbstractParserState.cpp.

◆ handleCharacter()

auto AbstractParserState::handleCharacter ( char  c) -> ParserState *
overrideprotectedvirtual

Behaviour of a State to parse next Character

Parameters
cthe next character
Returns
a new Parser-State

Implements ParserState.

Reimplemented in ValueParserState, StyleParserState, KeyParserState, IdentifierParserState, and GlobalParserState.

Definition at line 26 of file AbstractParserState.cpp.

Member Data Documentation

◆ context

ParserContext& AbstractParserState::context
protected

Context of the State.

Definition at line 15 of file AbstractParserState.hpp.

Referenced by GlobalParserState::handleCharacter().

◆ result

std::vector<BibElement>& AbstractParserState::result
protected

Container for accumulating Parsing-Results.

Definition at line 16 of file AbstractParserState.hpp.

Referenced by GlobalParserState::handleCharacter().


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