Reactions  0.0.0
Handling reaction trees and decays
Classes | Typedefs | Functions
reactions::tokens Namespace Reference

Syntax tokens. More...

Classes

struct  token
 Template to define new tokens. More...
 

Typedefs

using space = token<' '>
 Defines the separation of two elements. More...
 
using arrow = token<'-', '>'>
 Defines a reaction. More...
 
using left_bra = token<'{'>
 Defines the begining of a reaction. More...
 
using right_bra = token<'}'>
 Defines the end of a reaction. More...
 

Functions

template<char... C, std::size_t... I>
bool match_token_impl (token< C... >, std::index_sequence< I... >, std::string::const_iterator const &it)
 Check if the iterator at the current position matches the token. More...
 
template<class Token >
bool match_token (std::string::const_iterator const &it)
 Check if the iterator at the current position matches the token. More...
 
template<char... C>
constexpr bool match_any (char c)
 Check if the given character matches any of the template arguments. More...
 
template<char C0, char C1>
constexpr bool match_range (char c)
 

Detailed Description

Syntax tokens.

Typedef Documentation

◆ arrow

using reactions::tokens::arrow = typedef token<'-', '>'>

Defines a reaction.

◆ left_bra

using reactions::tokens::left_bra = typedef token<'{'>

Defines the begining of a reaction.

◆ right_bra

using reactions::tokens::right_bra = typedef token<'}'>

Defines the end of a reaction.

◆ space

using reactions::tokens::space = typedef token<' '>

Defines the separation of two elements.

Function Documentation

◆ match_any()

template<char... C>
constexpr bool reactions::tokens::match_any ( char  c)

Check if the given character matches any of the template arguments.

◆ match_range()

template<char C0, char C1>
constexpr bool reactions::tokens::match_range ( char  c)

Check if the given character is within the range defined by the template arguments

◆ match_token()

template<class Token >
bool reactions::tokens::match_token ( std::string::const_iterator const &  it)

Check if the iterator at the current position matches the token.

◆ match_token_impl()

template<char... C, std::size_t... I>
bool reactions::tokens::match_token_impl ( token< C... >  ,
std::index_sequence< I... >  ,
std::string::const_iterator const &  it 
)

Check if the iterator at the current position matches the token.