neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
neolib::lexer_atom< Token, Scope, CharT > Class Template Reference

#include <lexer.hpp>

Classes

struct  not_scope
 
struct  not_token
 

Public Types

typedef Token token_type
 
typedef Scope scope_type
 
typedef CharT char_type
 
typedef std::pair< char_type, char_typerange_type
 
typedef std::basic_string< char_typestring_type
 
typedef std::vector< lexer_atom_functionfunction_list
 
typedef std::pair< token_type, function_listfunction_type
 
typedef std::pair< scope_type, boolscope_change_type
 
typedef std::variant< std::monostate, char_type, range_type, string_type, lexer_atom_match_any, token_type, function_type, scope_type, scope_change_typevalue_type
 
typedef string_type token_value_type
 

Public Member Functions

 lexer_atom ()
 
template<typename T >
 lexer_atom (const T &aValue, const token_value_type &aTokenValue=token_value_type{})
 
template<typename T >
 lexer_atom (lexer_atom_function aFunction, const T &aValue, const token_value_type &aTokenValue=token_value_type{})
 
bool operator== (const lexer_atom &aOther) const
 
bool operator!= (const lexer_atom &aOther) const
 
template<typename T >
bool is () const
 
const value_typevalue () const
 
bool is_token () const
 
token_type token () const
 
void set_token (token_type aToken)
 
bool is_scope () const
 
scope_type scope () const
 
void set_scope (scope_type aScope)
 
bool has_functions () const
 
const function_listfunctions () const
 
function_listfunctions ()
 
const token_value_typetoken_value () const
 
token_value_typetoken_value ()
 

Detailed Description

template<typename Token, typename Scope = no_scopes, typename CharT = char>
class neolib::lexer_atom< Token, Scope, CharT >

Definition at line 101 of file lexer.hpp.

Member Typedef Documentation

◆ char_type

template<typename Token , typename Scope = no_scopes, typename CharT = char>
typedef CharT neolib::lexer_atom< Token, Scope, CharT >::char_type

Definition at line 106 of file lexer.hpp.

◆ function_list

template<typename Token , typename Scope = no_scopes, typename CharT = char>
typedef std::vector<lexer_atom_function> neolib::lexer_atom< Token, Scope, CharT >::function_list

Definition at line 109 of file lexer.hpp.

◆ function_type

template<typename Token , typename Scope = no_scopes, typename CharT = char>
typedef std::pair<token_type, function_list> neolib::lexer_atom< Token, Scope, CharT >::function_type

Definition at line 110 of file lexer.hpp.

◆ range_type

template<typename Token , typename Scope = no_scopes, typename CharT = char>
typedef std::pair<char_type, char_type> neolib::lexer_atom< Token, Scope, CharT >::range_type

Definition at line 107 of file lexer.hpp.

◆ scope_change_type

template<typename Token , typename Scope = no_scopes, typename CharT = char>
typedef std::pair<scope_type, bool> neolib::lexer_atom< Token, Scope, CharT >::scope_change_type

Definition at line 111 of file lexer.hpp.

◆ scope_type

template<typename Token , typename Scope = no_scopes, typename CharT = char>
typedef Scope neolib::lexer_atom< Token, Scope, CharT >::scope_type

Definition at line 105 of file lexer.hpp.

◆ string_type

template<typename Token , typename Scope = no_scopes, typename CharT = char>
typedef std::basic_string<char_type> neolib::lexer_atom< Token, Scope, CharT >::string_type

Definition at line 108 of file lexer.hpp.

◆ token_type

template<typename Token , typename Scope = no_scopes, typename CharT = char>
typedef Token neolib::lexer_atom< Token, Scope, CharT >::token_type

Definition at line 104 of file lexer.hpp.

◆ token_value_type

template<typename Token , typename Scope = no_scopes, typename CharT = char>
typedef string_type neolib::lexer_atom< Token, Scope, CharT >::token_value_type

Definition at line 113 of file lexer.hpp.

◆ value_type

template<typename Token , typename Scope = no_scopes, typename CharT = char>
typedef std::variant<std::monostate, char_type, range_type, string_type, lexer_atom_match_any, token_type, function_type, scope_type, scope_change_type> neolib::lexer_atom< Token, Scope, CharT >::value_type

Definition at line 112 of file lexer.hpp.

Constructor & Destructor Documentation

◆ lexer_atom() [1/3]

template<typename Token , typename Scope = no_scopes, typename CharT = char>
neolib::lexer_atom< Token, Scope, CharT >::lexer_atom ( )
inline

Definition at line 118 of file lexer.hpp.

◆ lexer_atom() [2/3]

template<typename Token , typename Scope = no_scopes, typename CharT = char>
template<typename T >
neolib::lexer_atom< Token, Scope, CharT >::lexer_atom ( const T aValue,
const token_value_type aTokenValue = token_value_type{} 
)
inline

Definition at line 123 of file lexer.hpp.

◆ lexer_atom() [3/3]

template<typename Token , typename Scope = no_scopes, typename CharT = char>
template<typename T >
neolib::lexer_atom< Token, Scope, CharT >::lexer_atom ( lexer_atom_function  aFunction,
const T aValue,
const token_value_type aTokenValue = token_value_type{} 
)
inline

Definition at line 128 of file lexer.hpp.

Member Function Documentation

◆ functions() [1/2]

template<typename Token , typename Scope = no_scopes, typename CharT = char>
function_list & neolib::lexer_atom< Token, Scope, CharT >::functions ( )
inline

Definition at line 195 of file lexer.hpp.

◆ functions() [2/2]

template<typename Token , typename Scope = no_scopes, typename CharT = char>
const function_list & neolib::lexer_atom< Token, Scope, CharT >::functions ( ) const
inline

Definition at line 191 of file lexer.hpp.

◆ has_functions()

template<typename Token , typename Scope = no_scopes, typename CharT = char>
bool neolib::lexer_atom< Token, Scope, CharT >::has_functions ( ) const
inline

Definition at line 187 of file lexer.hpp.

◆ is()

template<typename Token , typename Scope = no_scopes, typename CharT = char>
template<typename T >
bool neolib::lexer_atom< Token, Scope, CharT >::is ( ) const
inline

Definition at line 143 of file lexer.hpp.

◆ is_scope()

template<typename Token , typename Scope = no_scopes, typename CharT = char>
bool neolib::lexer_atom< Token, Scope, CharT >::is_scope ( ) const
inline

Definition at line 172 of file lexer.hpp.

◆ is_token()

template<typename Token , typename Scope = no_scopes, typename CharT = char>
bool neolib::lexer_atom< Token, Scope, CharT >::is_token ( ) const
inline

Definition at line 151 of file lexer.hpp.

◆ operator!=()

template<typename Token , typename Scope = no_scopes, typename CharT = char>
bool neolib::lexer_atom< Token, Scope, CharT >::operator!= ( const lexer_atom< Token, Scope, CharT > &  aOther) const
inline

Definition at line 137 of file lexer.hpp.

◆ operator==()

template<typename Token , typename Scope = no_scopes, typename CharT = char>
bool neolib::lexer_atom< Token, Scope, CharT >::operator== ( const lexer_atom< Token, Scope, CharT > &  aOther) const
inline

Definition at line 133 of file lexer.hpp.

◆ scope()

template<typename Token , typename Scope = no_scopes, typename CharT = char>
scope_type neolib::lexer_atom< Token, Scope, CharT >::scope ( ) const
inline

Definition at line 176 of file lexer.hpp.

◆ set_scope()

template<typename Token , typename Scope = no_scopes, typename CharT = char>
void neolib::lexer_atom< Token, Scope, CharT >::set_scope ( scope_type  aScope)
inline

Definition at line 183 of file lexer.hpp.

◆ set_token()

template<typename Token , typename Scope = no_scopes, typename CharT = char>
void neolib::lexer_atom< Token, Scope, CharT >::set_token ( token_type  aToken)
inline

Definition at line 168 of file lexer.hpp.

◆ token()

template<typename Token , typename Scope = no_scopes, typename CharT = char>
token_type neolib::lexer_atom< Token, Scope, CharT >::token ( ) const
inline

Definition at line 155 of file lexer.hpp.

◆ token_value() [1/2]

template<typename Token , typename Scope = no_scopes, typename CharT = char>
token_value_type & neolib::lexer_atom< Token, Scope, CharT >::token_value ( )
inline

Definition at line 203 of file lexer.hpp.

◆ token_value() [2/2]

template<typename Token , typename Scope = no_scopes, typename CharT = char>
const token_value_type & neolib::lexer_atom< Token, Scope, CharT >::token_value ( ) const
inline

Definition at line 199 of file lexer.hpp.

◆ value()

template<typename Token , typename Scope = no_scopes, typename CharT = char>
const value_type & neolib::lexer_atom< Token, Scope, CharT >::value ( ) const
inline

Definition at line 147 of file lexer.hpp.


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