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 22154 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 22158 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 22213 of file exprtk.hpp.

22214 {
22215 return expr.control_block_ && details::is_assert_node(expr.control_block_->expr);
22216 }
bool is_assert_node(const expression_node< T > *node)
Definition exprtk.hpp:5991

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

22194 {
22195 return expr.control_block_ && details::is_binary_node(expr.control_block_->expr);
22196 }
bool is_binary_node(const expression_node< T > *node)
Definition exprtk.hpp:5800

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

22199 {
22200 return expr.control_block_ && details::is_function(expr.control_block_->expr);
22201 }
bool is_function(const expression_node< T > *node)
Definition exprtk.hpp:5960

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

22174 {
22175 return expr.control_block_ && details::is_literal_node(expr.control_block_->expr);
22176 }
bool is_literal_node(const expression_node< T > *node)
Definition exprtk.hpp:5782

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

22209 {
22210 return expr.control_block_ && details::is_null_node(expr.control_block_->expr);
22211 }
bool is_null_node(const expression_node< T > *node)
Definition exprtk.hpp:5936

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

22219 {
22220 return expr.control_block_ && details::is_sf3ext_node(expr.control_block_->expr);
22221 }
bool is_sf3ext_node(const expression_node< T > *n)
Definition exprtk.hpp:17855

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

22224 {
22225 return expr.control_block_ && details::is_sf4ext_node(expr.control_block_->expr);
22226 }
bool is_sf4ext_node(const expression_node< T > *n)
Definition exprtk.hpp:18033

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

22184 {
22185 return expr.control_block_ && details::is_generally_string_node(expr.control_block_->expr);
22186 }
bool is_generally_string_node(const expression_node< T > *node)
Definition exprtk.hpp:19184

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

22229 {
22230 if (0 == expr.control_block_)
22231 {
22232 return false;
22233 }
22234
22235 switch (node_type)
22236 {
22237 case e_literal : return is_literal_node(expr);
22238 case e_variable : return is_variable (expr);
22239 case e_string : return is_string (expr);
22240 case e_unary : return is_unary (expr);
22241 case e_binary : return is_binary (expr);
22242 case e_function : return is_function (expr);
22243 case e_null : return is_null (expr);
22244 case e_assert : return is_assert (expr);
22245 case e_sf3ext : return is_sf3ext (expr);
22246 case e_sf4ext : return is_sf4ext (expr);
22247 };
22248
22249 return false;
22250 }
static bool is_assert(const expression< T > &expr)
Definition exprtk.hpp:22213
static bool is_sf4ext(const expression< T > &expr)
Definition exprtk.hpp:22223
static bool is_variable(const expression< T > &expr)
Definition exprtk.hpp:22178
static bool is_binary(const expression< T > &expr)
Definition exprtk.hpp:22193
static bool is_function(const expression< T > &expr)
Definition exprtk.hpp:22198
static bool is_sf3ext(const expression< T > &expr)
Definition exprtk.hpp:22218
static bool is_string(const expression< T > &expr)
Definition exprtk.hpp:22183
static bool is_unary(const expression< T > &expr)
Definition exprtk.hpp:22188
static bool is_null(const expression< T > &expr)
Definition exprtk.hpp:22208

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

22189 {
22190 return expr.control_block_ && details::is_unary_node(expr.control_block_->expr);
22191 }
bool is_unary_node(const expression_node< T > *node)
Definition exprtk.hpp:5788

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

22204 {
22205 return expr.control_block_ && details::is_vararg_node(expr.control_block_->expr);
22206 }
bool is_vararg_node(const expression_node< T > *node)
Definition exprtk.hpp:5966

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

22179 {
22180 return expr.control_block_ && details::is_variable_node(expr.control_block_->expr);
22181 }
bool is_variable_node(const expression_node< T > *node)
Definition exprtk.hpp:5806

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

22253 {
22254 if ((0 == expr.control_block_) || !is_vararg(expr))
22255 {
22256 return false;
22257 }
22258
22260
22261 mo_vararg_t* vnode = dynamic_cast<mo_vararg_t*>(expr.control_block_->expr);
22262
22263 if (
22264 (0 == vnode) ||
22265 type_seq.empty() ||
22266 (vnode->size() < type_seq.size())
22267 )
22268 {
22269 return false;
22270 }
22271
22272 for (std::size_t i = 0; i < type_seq.size(); ++i)
22273 {
22274 assert((*vnode)[i]);
22275
22276 switch (type_seq[i])
22277 {
22278 case e_literal : { if (details::is_literal_node ((*vnode)[i])) continue; } break;
22279 case e_variable : { if (details::is_variable_node ((*vnode)[i])) continue; } break;
22280 case e_string : { if (details::is_generally_string_node((*vnode)[i])) continue; } break;
22281 case e_unary : { if (details::is_unary_node ((*vnode)[i])) continue; } break;
22282 case e_binary : { if (details::is_binary_node ((*vnode)[i])) continue; } break;
22283 case e_function : { if (details::is_function ((*vnode)[i])) continue; } break;
22284 case e_null : { if (details::is_null_node ((*vnode)[i])) continue; } break;
22285 case e_assert : { if (details::is_assert_node ((*vnode)[i])) continue; } break;
22286 case e_sf3ext : { if (details::is_sf3ext_node ((*vnode)[i])) continue; } break;
22287 case e_sf4ext : { if (details::is_sf4ext_node ((*vnode)[i])) continue; } break;
22288 case e_vararg : break;
22289 }
22290
22291 return false;
22292 }
22293
22294 return true;
22295 }
static bool is_vararg(const expression< T > &expr)
Definition exprtk.hpp:22203
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:605

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: