Xmipp  v3.23.11-Nereus
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cif::tls_selection_parser_impl Class Referenceabstract
Inheritance diagram for cif::tls_selection_parser_impl:
Inheritance graph
[legend]

Public Member Functions

 tls_selection_parser_impl (const std::string &selection)
 
virtual std::unique_ptr< tls_selection > Parse ()=0
 

Protected Member Functions

virtual int get_next_token ()=0
 
virtual void match (int token)
 
virtual std::string to_string (int token)=0
 

Protected Attributes

std::string m_selection
 
std::string::iterator m_p
 
std::string::iterator m_end
 
int m_lookahead
 
std::string m_token
 

Detailed Description

Definition at line 610 of file tls.cpp.

Constructor & Destructor Documentation

◆ tls_selection_parser_impl()

cif::tls_selection_parser_impl::tls_selection_parser_impl ( const std::string &  selection)
inline

Definition at line 613 of file tls.cpp.

614  : m_selection(selection)
615  , m_p(m_selection.begin())
616  , m_end(m_selection.end())
617  {
618  }
std::string::iterator m_end
Definition: tls.cpp:628
std::string::iterator m_p
Definition: tls.cpp:628

Member Function Documentation

◆ get_next_token()

virtual int cif::tls_selection_parser_impl::get_next_token ( )
protectedpure virtual

◆ match()

void cif::tls_selection_parser_impl::match ( int  token)
protectedvirtual

Definition at line 633 of file tls.cpp.

634 {
635  if (m_lookahead == token)
637  else
638  {
639  std::string expected;
640  if (token >= 256)
641  expected = to_string(token);
642  else
643  expected = { char(token) };
644 
645  std::string found;
646  if (m_lookahead >= 256)
647  found = to_string(m_lookahead) + " (" + m_token + ')';
648  else
649  found = { char(m_lookahead) };
650 
651  throw std::runtime_error("Expected " + expected + " but found " + found);
652  }
653 }
virtual std::string to_string(int token)=0

◆ Parse()

virtual std::unique_ptr<tls_selection> cif::tls_selection_parser_impl::Parse ( )
pure virtual

◆ to_string()

virtual std::string cif::tls_selection_parser_impl::to_string ( int  token)
protectedpure virtual

Member Data Documentation

◆ m_end

std::string::iterator cif::tls_selection_parser_impl::m_end
protected

Definition at line 628 of file tls.cpp.

◆ m_lookahead

int cif::tls_selection_parser_impl::m_lookahead
protected

Definition at line 629 of file tls.cpp.

◆ m_p

std::string::iterator cif::tls_selection_parser_impl::m_p
protected

Definition at line 628 of file tls.cpp.

◆ m_selection

std::string cif::tls_selection_parser_impl::m_selection
protected

Definition at line 627 of file tls.cpp.

◆ m_token

std::string cif::tls_selection_parser_impl::m_token
protected

Definition at line 630 of file tls.cpp.


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