C++ Mathematical Expression Toolkit (ExprTk) release
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | List of all members
exprtk::expression_helper< T > Class Template Reference

#include <exprtk.hpp>

Public Types

enum  node_types {
  e_literal , e_variable , e_string , e_unary ,
  e_binary , e_function , e_vararg , e_null ,
  e_assert , e_sf3ext , e_sf4ext
}
 

Static Public Member Functions

static bool is_literal (const expression< T > &expr)
 
static bool is_variable (const expression< T > &expr)
 
static bool is_string (const expression< T > &expr)
 
static bool is_unary (const expression< T > &expr)
 
static bool is_binary (const expression< T > &expr)
 
static bool is_function (const expression< T > &expr)
 
static bool is_vararg (const expression< T > &expr)
 
static bool is_null (const expression< T > &expr)
 
static bool is_assert (const expression< T > &expr)
 
static bool is_sf3ext (const expression< T > &expr)
 
static bool is_sf4ext (const expression< T > &expr)
 
static bool is_type (const expression< T > &expr, const node_types node_type)
 
static bool match_type_sequence (const expression< T > &expr, const std::vector< node_types > &type_seq)
 

Detailed Description

template<typename T>
class exprtk::expression_helper< T >

Definition at line 21889 of file exprtk.hpp.

Member Enumeration Documentation

◆ node_types

template<typename T >
enum exprtk::expression_helper::node_types
Enumerator
e_literal 
e_variable 
e_string 
e_unary 
e_binary 
e_function 
e_vararg 
e_null 
e_assert 
e_sf3ext 
e_sf4ext 

Definition at line 21893 of file exprtk.hpp.

Member Function Documentation

◆ is_assert()

template<typename T >
static bool exprtk::expression_helper< T >::is_assert ( const expression< T > &  expr)
inlinestatic

Definition at line 21948 of file exprtk.hpp.

21949 {
21950 return expr.control_block_ && details::is_assert_node(expr.control_block_->expr);
21951 }
bool is_assert_node(const expression_node< T > *node)
Definition exprtk.hpp:5846

References exprtk::expression< T >::control_block_, exprtk::expression< T >::control_block::expr, and exprtk::details::is_assert_node().

Referenced by exprtk::expression_helper< T >::is_type().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_binary()

template<typename T >
static bool exprtk::expression_helper< T >::is_binary ( const expression< T > &  expr)
inlinestatic

Definition at line 21928 of file exprtk.hpp.

21929 {
21930 return expr.control_block_ && details::is_binary_node(expr.control_block_->expr);
21931 }
bool is_binary_node(const expression_node< T > *node)
Definition exprtk.hpp:5673

References exprtk::expression< T >::control_block_, exprtk::expression< T >::control_block::expr, and exprtk::details::is_binary_node().

Referenced by exprtk::expression_helper< T >::is_type().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_function()

template<typename T >
static bool exprtk::expression_helper< T >::is_function ( const expression< T > &  expr)
inlinestatic

Definition at line 21933 of file exprtk.hpp.

21934 {
21935 return expr.control_block_ && details::is_function(expr.control_block_->expr);
21936 }
bool is_function(const expression_node< T > *node)
Definition exprtk.hpp:5815

References exprtk::expression< T >::control_block_, exprtk::expression< T >::control_block::expr, and exprtk::details::is_function().

Referenced by exprtk::expression_helper< T >::is_type().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_literal()

template<typename T >
static bool exprtk::expression_helper< T >::is_literal ( const expression< T > &  expr)
inlinestatic

Definition at line 21908 of file exprtk.hpp.

21909 {
21910 return expr.control_block_ && details::is_literal_node(expr.control_block_->expr);
21911 }
bool is_literal_node(const expression_node< T > *node)
Definition exprtk.hpp:5655

References exprtk::expression< T >::control_block_, exprtk::expression< T >::control_block::expr, and exprtk::details::is_literal_node().

Here is the call graph for this function:

◆ is_null()

template<typename T >
static bool exprtk::expression_helper< T >::is_null ( const expression< T > &  expr)
inlinestatic

Definition at line 21943 of file exprtk.hpp.

21944 {
21945 return expr.control_block_ && details::is_null_node(expr.control_block_->expr);
21946 }
bool is_null_node(const expression_node< T > *node)
Definition exprtk.hpp:5791

References exprtk::expression< T >::control_block_, exprtk::expression< T >::control_block::expr, and exprtk::details::is_null_node().

Referenced by exprtk::expression_helper< T >::is_type(), and exprtk::is_valid().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_sf3ext()

template<typename T >
static bool exprtk::expression_helper< T >::is_sf3ext ( const expression< T > &  expr)
inlinestatic

Definition at line 21953 of file exprtk.hpp.

21954 {
21955 return expr.control_block_ && details::is_sf3ext_node(expr.control_block_->expr);
21956 }
bool is_sf3ext_node(const expression_node< T > *n)
Definition exprtk.hpp:17656

References exprtk::expression< T >::control_block_, exprtk::expression< T >::control_block::expr, and exprtk::details::is_sf3ext_node().

Referenced by exprtk::expression_helper< T >::is_type().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_sf4ext()

template<typename T >
static bool exprtk::expression_helper< T >::is_sf4ext ( const expression< T > &  expr)
inlinestatic

Definition at line 21958 of file exprtk.hpp.

21959 {
21960 return expr.control_block_ && details::is_sf4ext_node(expr.control_block_->expr);
21961 }
bool is_sf4ext_node(const expression_node< T > *n)
Definition exprtk.hpp:17834

References exprtk::expression< T >::control_block_, exprtk::expression< T >::control_block::expr, and exprtk::details::is_sf4ext_node().

Referenced by exprtk::expression_helper< T >::is_type().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_string()

template<typename T >
static bool exprtk::expression_helper< T >::is_string ( const expression< T > &  expr)
inlinestatic

Definition at line 21918 of file exprtk.hpp.

21919 {
21920 return expr.control_block_ && details::is_generally_string_node(expr.control_block_->expr);
21921 }
bool is_generally_string_node(const expression_node< T > *node)
Definition exprtk.hpp:18985

References exprtk::expression< T >::control_block_, exprtk::expression< T >::control_block::expr, and exprtk::details::is_generally_string_node().

Referenced by exprtk::expression_helper< T >::is_type().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_type()

template<typename T >
static bool exprtk::expression_helper< T >::is_type ( const expression< T > &  expr,
const node_types  node_type 
)
inlinestatic

Definition at line 21963 of file exprtk.hpp.

21964 {
21965 if (0 == expr.control_block_)
21966 {
21967 return false;
21968 }
21969
21970 switch (node_type)
21971 {
21972 case e_literal : return is_literal_node(expr);
21973 case e_variable : return is_variable (expr);
21974 case e_string : return is_string (expr);
21975 case e_unary : return is_unary (expr);
21976 case e_binary : return is_binary (expr);
21977 case e_function : return is_function (expr);
21978 case e_null : return is_null (expr);
21979 case e_assert : return is_assert (expr);
21980 case e_sf3ext : return is_sf3ext (expr);
21981 case e_sf4ext : return is_sf4ext (expr);
21982 };
21983
21984 return false;
21985 }
static bool is_assert(const expression< T > &expr)
Definition exprtk.hpp:21948
static bool is_sf4ext(const expression< T > &expr)
Definition exprtk.hpp:21958
static bool is_variable(const expression< T > &expr)
Definition exprtk.hpp:21913
static bool is_binary(const expression< T > &expr)
Definition exprtk.hpp:21928
static bool is_function(const expression< T > &expr)
Definition exprtk.hpp:21933
static bool is_sf3ext(const expression< T > &expr)
Definition exprtk.hpp:21953
static bool is_string(const expression< T > &expr)
Definition exprtk.hpp:21918
static bool is_unary(const expression< T > &expr)
Definition exprtk.hpp:21923
static bool is_null(const expression< T > &expr)
Definition exprtk.hpp:21943

References exprtk::expression< T >::control_block_, exprtk::expression_helper< T >::e_assert, exprtk::expression_helper< T >::e_binary, exprtk::expression_helper< T >::e_function, exprtk::expression_helper< T >::e_literal, exprtk::expression_helper< T >::e_null, exprtk::expression_helper< T >::e_sf3ext, exprtk::expression_helper< T >::e_sf4ext, exprtk::expression_helper< T >::e_string, exprtk::expression_helper< T >::e_unary, exprtk::expression_helper< T >::e_variable, exprtk::expression_helper< T >::is_assert(), exprtk::expression_helper< T >::is_binary(), exprtk::expression_helper< T >::is_function(), exprtk::expression_helper< T >::is_null(), exprtk::expression_helper< T >::is_sf3ext(), exprtk::expression_helper< T >::is_sf4ext(), exprtk::expression_helper< T >::is_string(), exprtk::expression_helper< T >::is_unary(), and exprtk::expression_helper< T >::is_variable().

Here is the call graph for this function:

◆ is_unary()

template<typename T >
static bool exprtk::expression_helper< T >::is_unary ( const expression< T > &  expr)
inlinestatic

Definition at line 21923 of file exprtk.hpp.

21924 {
21925 return expr.control_block_ && details::is_unary_node(expr.control_block_->expr);
21926 }
bool is_unary_node(const expression_node< T > *node)
Definition exprtk.hpp:5661

References exprtk::expression< T >::control_block_, exprtk::expression< T >::control_block::expr, and exprtk::details::is_unary_node().

Referenced by exprtk::expression_helper< T >::is_type().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_vararg()

template<typename T >
static bool exprtk::expression_helper< T >::is_vararg ( const expression< T > &  expr)
inlinestatic

Definition at line 21938 of file exprtk.hpp.

21939 {
21940 return expr.control_block_ && details::is_vararg_node(expr.control_block_->expr);
21941 }
bool is_vararg_node(const expression_node< T > *node)
Definition exprtk.hpp:5821

References exprtk::expression< T >::control_block_, exprtk::expression< T >::control_block::expr, and exprtk::details::is_vararg_node().

Referenced by exprtk::expression_helper< T >::match_type_sequence().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_variable()

template<typename T >
static bool exprtk::expression_helper< T >::is_variable ( const expression< T > &  expr)
inlinestatic

Definition at line 21913 of file exprtk.hpp.

21914 {
21915 return expr.control_block_ && details::is_variable_node(expr.control_block_->expr);
21916 }
bool is_variable_node(const expression_node< T > *node)
Definition exprtk.hpp:5679

References exprtk::expression< T >::control_block_, exprtk::expression< T >::control_block::expr, and exprtk::details::is_variable_node().

Referenced by exprtk::expression_helper< T >::is_type().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ match_type_sequence()

template<typename T >
static bool exprtk::expression_helper< T >::match_type_sequence ( const expression< T > &  expr,
const std::vector< node_types > &  type_seq 
)
inlinestatic

Definition at line 21987 of file exprtk.hpp.

21988 {
21989 if ((0 == expr.control_block_) || !is_vararg(expr))
21990 {
21991 return false;
21992 }
21993
21995
21996 mo_vararg_t* vnode = dynamic_cast<mo_vararg_t*>(expr.control_block_->expr);
21997
21998 if (
21999 (0 == vnode) ||
22000 type_seq.empty() ||
22001 (vnode->size() < type_seq.size())
22002 )
22003 {
22004 return false;
22005 }
22006
22007 for (std::size_t i = 0; i < type_seq.size(); ++i)
22008 {
22009 assert((*vnode)[i]);
22010
22011 switch(type_seq[i])
22012 {
22013 case e_literal : { if (details::is_literal_node ((*vnode)[i])) continue; } break;
22014 case e_variable : { if (details::is_variable_node ((*vnode)[i])) continue; } break;
22015 case e_string : { if (details::is_generally_string_node((*vnode)[i])) continue; } break;
22016 case e_unary : { if (details::is_unary_node ((*vnode)[i])) continue; } break;
22017 case e_binary : { if (details::is_binary_node ((*vnode)[i])) continue; } break;
22018 case e_function : { if (details::is_function ((*vnode)[i])) continue; } break;
22019 case e_null : { if (details::is_null_node ((*vnode)[i])) continue; } break;
22020 case e_assert : { if (details::is_assert_node ((*vnode)[i])) continue; } break;
22021 case e_sf3ext : { if (details::is_sf3ext_node ((*vnode)[i])) continue; } break;
22022 case e_sf4ext : { if (details::is_sf4ext_node ((*vnode)[i])) continue; } break;
22023 case e_vararg : break;
22024 }
22025
22026 return false;
22027 }
22028
22029 return true;
22030 }
static bool is_vararg(const expression< T > &expr)
Definition exprtk.hpp:21938
bool match_impl(const Iterator pattern_begin, const Iterator pattern_end, const Iterator data_begin, const Iterator data_end, const typename std::iterator_traits< Iterator >::value_type &zero_or_more, const typename std::iterator_traits< Iterator >::value_type &exactly_one)
Definition exprtk.hpp:598

References exprtk::expression< T >::control_block_, exprtk::expression_helper< T >::e_assert, exprtk::expression_helper< T >::e_binary, exprtk::expression_helper< T >::e_function, exprtk::expression_helper< T >::e_literal, exprtk::expression_helper< T >::e_null, exprtk::expression_helper< T >::e_sf3ext, exprtk::expression_helper< T >::e_sf4ext, exprtk::expression_helper< T >::e_string, exprtk::expression_helper< T >::e_unary, exprtk::expression_helper< T >::e_vararg, exprtk::expression_helper< T >::e_variable, exprtk::expression< T >::control_block::expr, exprtk::details::is_assert_node(), exprtk::details::is_binary_node(), exprtk::details::is_function(), exprtk::details::is_generally_string_node(), exprtk::details::is_literal_node(), exprtk::details::is_null_node(), exprtk::details::is_sf3ext_node(), exprtk::details::is_sf4ext_node(), exprtk::details::is_unary_node(), exprtk::expression_helper< T >::is_vararg(), and exprtk::details::is_variable_node().

Here is the call graph for this function:

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