C++ Mathematical Expression Toolkit (ExprTk) release
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
exprtk::lexer::helper::numeric_checker< T > Class Template Reference
Inheritance diagram for exprtk::lexer::helper::numeric_checker< T >:
[legend]
Collaboration diagram for exprtk::lexer::helper::numeric_checker< T >:
[legend]

Public Member Functions

 numeric_checker ()
 
bool result ()
 
void reset ()
 
bool operator() (const lexer::token &t)
 
std::size_t error_count () const
 
std::size_t error_index (const std::size_t &i) const
 
void clear_errors ()
 
- Public Member Functions inherited from exprtk::lexer::token_scanner
virtual ~token_scanner ()
 
 token_scanner (const std::size_t &stride)
 
std::size_t process (generator &g)
 
virtual bool operator() (const token &, const token &)
 
virtual bool operator() (const token &, const token &, const token &)
 
virtual bool operator() (const token &, const token &, const token &, const token &)
 
- Public Member Functions inherited from exprtk::lexer::helper_interface
virtual void init ()
 
virtual ~helper_interface ()
 

Private Attributes

std::size_t current_index_
 
std::vector< std::size_t > error_list_
 

Detailed Description

template<typename T>
class exprtk::lexer::helper::numeric_checker< T >

Definition at line 3857 of file exprtk.hpp.

Constructor & Destructor Documentation

◆ numeric_checker()

template<typename T >
exprtk::lexer::helper::numeric_checker< T >::numeric_checker ( )
inline

Definition at line 3863 of file exprtk.hpp.

3864 : token_scanner (1)
3865 , current_index_(0)
3866 {}
token_scanner(const std::size_t &stride)
Definition exprtk.hpp:3173

Member Function Documentation

◆ clear_errors()

template<typename T >
void exprtk::lexer::helper::numeric_checker< T >::clear_errors ( )
inline

Definition at line 3909 of file exprtk.hpp.

3910 {
3911 error_list_.clear();
3912 }
std::vector< std::size_t > error_list_
Definition exprtk.hpp:3917

References exprtk::lexer::helper::numeric_checker< T >::error_list_.

Referenced by exprtk::parser< T >::run_assemblies().

Here is the caller graph for this function:

◆ error_count()

template<typename T >
std::size_t exprtk::lexer::helper::numeric_checker< T >::error_count ( ) const
inline

Definition at line 3896 of file exprtk.hpp.

3897 {
3898 return error_list_.size();
3899 }

References exprtk::lexer::helper::numeric_checker< T >::error_list_.

Referenced by exprtk::parser< T >::run_assemblies().

Here is the caller graph for this function:

◆ error_index()

template<typename T >
std::size_t exprtk::lexer::helper::numeric_checker< T >::error_index ( const std::size_t &  i) const
inline

Definition at line 3901 of file exprtk.hpp.

3902 {
3903 if (i < error_list_.size())
3904 return error_list_[i];
3905 else
3906 return std::numeric_limits<std::size_t>::max();
3907 }

References exprtk::lexer::helper::numeric_checker< T >::error_list_.

Referenced by exprtk::parser< T >::run_assemblies().

Here is the caller graph for this function:

◆ operator()()

template<typename T >
bool exprtk::lexer::helper::numeric_checker< T >::operator() ( const lexer::token t)
inlinevirtual

Reimplemented from exprtk::lexer::token_scanner.

Definition at line 3879 of file exprtk.hpp.

3880 {
3881 if (token::e_number == t.type)
3882 {
3883 T v;
3884
3885 if (!exprtk::details::string_to_real(t.value,v))
3886 {
3887 error_list_.push_back(current_index_);
3888 }
3889 }
3890
3892
3893 return true;
3894 }
bool string_to_real(Iterator &itr_external, const Iterator end, T &t, numeric::details::real_type_tag)
Definition exprtk.hpp:1973

References exprtk::lexer::helper::numeric_checker< T >::current_index_, exprtk::lexer::token::e_number, exprtk::lexer::helper::numeric_checker< T >::error_list_, and exprtk::details::string_to_real().

Here is the call graph for this function:

◆ reset()

template<typename T >
void exprtk::lexer::helper::numeric_checker< T >::reset ( )
inlinevirtual

◆ result()

template<typename T >
bool exprtk::lexer::helper::numeric_checker< T >::result ( )
inlinevirtual

Reimplemented from exprtk::lexer::helper_interface.

Definition at line 3868 of file exprtk.hpp.

3869 {
3870 return error_list_.empty();
3871 }

References exprtk::lexer::helper::numeric_checker< T >::error_list_.

Member Data Documentation

◆ current_index_

template<typename T >
std::size_t exprtk::lexer::helper::numeric_checker< T >::current_index_
private

◆ error_list_

template<typename T >
std::vector<std::size_t> exprtk::lexer::helper::numeric_checker< T >::error_list_
private

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