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)
 
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 3801 of file exprtk.hpp.

Constructor & Destructor Documentation

◆ numeric_checker()

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

Definition at line 3807 of file exprtk.hpp.

3808 : token_scanner (1)
3809 , current_index_(0)
3810 {}
token_scanner(const std::size_t &stride)
Definition exprtk.hpp:3119

Member Function Documentation

◆ clear_errors()

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

Definition at line 3853 of file exprtk.hpp.

3854 {
3855 error_list_.clear();
3856 }
std::vector< std::size_t > error_list_
Definition exprtk.hpp:3861

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 3840 of file exprtk.hpp.

3841 {
3842 return error_list_.size();
3843 }

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)
inline

Definition at line 3845 of file exprtk.hpp.

3846 {
3847 if (i < error_list_.size())
3848 return error_list_[i];
3849 else
3850 return std::numeric_limits<std::size_t>::max();
3851 }

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 3823 of file exprtk.hpp.

3824 {
3825 if (token::e_number == t.type)
3826 {
3827 T v;
3828
3829 if (!exprtk::details::string_to_real(t.value,v))
3830 {
3831 error_list_.push_back(current_index_);
3832 }
3833 }
3834
3836
3837 return true;
3838 }
bool string_to_real(Iterator &itr_external, const Iterator end, T &t, numeric::details::real_type_tag)
Definition exprtk.hpp:1932

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 3812 of file exprtk.hpp.

3813 {
3814 return error_list_.empty();
3815 }

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: