C++ Mathematical Expression Toolkit (ExprTk) release
Loading...
Searching...
No Matches
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 22238 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 22242 of file exprtk.hpp.

Member Function Documentation

◆ is_assert()

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

Definition at line 22297 of file exprtk.hpp.

22298 {
22299 return expr.control_block_ && details::is_assert_node(expr.control_block_->expr);
22300 }
bool is_assert_node(const expression_node< T > *node)
Definition exprtk.hpp:6012

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

Referenced by is_type().

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

◆ is_binary()

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

Definition at line 22277 of file exprtk.hpp.

22278 {
22279 return expr.control_block_ && details::is_binary_node(expr.control_block_->expr);
22280 }
bool is_binary_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_binary_node().

Referenced by is_type().

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

◆ is_function()

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

Definition at line 22282 of file exprtk.hpp.

22283 {
22284 return expr.control_block_ && details::is_function(expr.control_block_->expr);
22285 }
bool is_function(const expression_node< T > *node)
Definition exprtk.hpp:5981

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

Referenced by is_type().

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

◆ is_literal()

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

Definition at line 22257 of file exprtk.hpp.

22258 {
22259 return expr.control_block_ && details::is_literal_node(expr.control_block_->expr);
22260 }
bool is_literal_node(const expression_node< T > *node)
Definition exprtk.hpp:5803

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

Referenced by run_test18(), run_test22(), and test_expression().

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

◆ is_null()

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

Definition at line 22292 of file exprtk.hpp.

22293 {
22294 return expr.control_block_ && details::is_null_node(expr.control_block_->expr);
22295 }
bool is_null_node(const expression_node< T > *node)
Definition exprtk.hpp:5957

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

Referenced by is_type(), exprtk::is_valid(), and run_test22().

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

◆ is_sf3ext()

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

Definition at line 22302 of file exprtk.hpp.

22303 {
22304 return expr.control_block_ && details::is_sf3ext_node(expr.control_block_->expr);
22305 }
bool is_sf3ext_node(const expression_node< T > *n)
Definition exprtk.hpp:17935

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

Referenced by is_type().

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

◆ is_sf4ext()

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

Definition at line 22307 of file exprtk.hpp.

22308 {
22309 return expr.control_block_ && details::is_sf4ext_node(expr.control_block_->expr);
22310 }
bool is_sf4ext_node(const expression_node< T > *n)
Definition exprtk.hpp:18113

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

Referenced by is_type().

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

◆ is_string()

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

Definition at line 22267 of file exprtk.hpp.

22268 {
22269 return expr.control_block_ && details::is_generally_string_node(expr.control_block_->expr);
22270 }
bool is_generally_string_node(const expression_node< T > *node)
Definition exprtk.hpp:19264

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

Referenced by is_type().

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

◆ is_type()

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

Definition at line 22312 of file exprtk.hpp.

22313 {
22314 if (0 == expr.control_block_)
22315 {
22316 return false;
22317 }
22318
22319 switch (node_type)
22320 {
22321 case e_literal : return is_literal_node(expr);
22322 case e_variable : return is_variable (expr);
22323 case e_string : return is_string (expr);
22324 case e_unary : return is_unary (expr);
22325 case e_binary : return is_binary (expr);
22326 case e_function : return is_function (expr);
22327 case e_null : return is_null (expr);
22328 case e_assert : return is_assert (expr);
22329 case e_sf3ext : return is_sf3ext (expr);
22330 case e_sf4ext : return is_sf4ext (expr);
22331 };
22332
22333 return false;
22334 }
static bool is_assert(const expression< T > &expr)
Definition exprtk.hpp:22297
static bool is_sf4ext(const expression< T > &expr)
Definition exprtk.hpp:22307
static bool is_variable(const expression< T > &expr)
Definition exprtk.hpp:22262
static bool is_binary(const expression< T > &expr)
Definition exprtk.hpp:22277
static bool is_function(const expression< T > &expr)
Definition exprtk.hpp:22282
static bool is_sf3ext(const expression< T > &expr)
Definition exprtk.hpp:22302
static bool is_string(const expression< T > &expr)
Definition exprtk.hpp:22267
static bool is_unary(const expression< T > &expr)
Definition exprtk.hpp:22272
static bool is_null(const expression< T > &expr)
Definition exprtk.hpp:22292

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

Here is the call graph for this function:

◆ is_unary()

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

Definition at line 22272 of file exprtk.hpp.

22273 {
22274 return expr.control_block_ && details::is_unary_node(expr.control_block_->expr);
22275 }
bool is_unary_node(const expression_node< T > *node)
Definition exprtk.hpp:5809

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

Referenced by is_type().

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

◆ is_vararg()

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

Definition at line 22287 of file exprtk.hpp.

22288 {
22289 return expr.control_block_ && details::is_vararg_node(expr.control_block_->expr);
22290 }
bool is_vararg_node(const expression_node< T > *node)
Definition exprtk.hpp:5987

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

Referenced by match_type_sequence().

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

◆ is_variable()

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

Definition at line 22262 of file exprtk.hpp.

22263 {
22264 return expr.control_block_ && details::is_variable_node(expr.control_block_->expr);
22265 }
bool is_variable_node(const expression_node< T > *node)
Definition exprtk.hpp:5827

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

Referenced by is_type().

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

◆ match_type_sequence()

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

Definition at line 22336 of file exprtk.hpp.

22337 {
22338 if ((0 == expr.control_block_) || !is_vararg(expr))
22339 {
22340 return false;
22341 }
22342
22344
22345 mo_vararg_t* vnode = dynamic_cast<mo_vararg_t*>(expr.control_block_->expr);
22346
22347 if (
22348 (0 == vnode) ||
22349 type_seq.empty() ||
22350 (vnode->size() < type_seq.size())
22351 )
22352 {
22353 return false;
22354 }
22355
22356 for (std::size_t i = 0; i < type_seq.size(); ++i)
22357 {
22358 assert((*vnode)[i]);
22359
22360 switch (type_seq[i])
22361 {
22362 case e_literal : { if (details::is_literal_node ((*vnode)[i])) continue; } break;
22363 case e_variable : { if (details::is_variable_node ((*vnode)[i])) continue; } break;
22364 case e_string : { if (details::is_generally_string_node((*vnode)[i])) continue; } break;
22365 case e_unary : { if (details::is_unary_node ((*vnode)[i])) continue; } break;
22366 case e_binary : { if (details::is_binary_node ((*vnode)[i])) continue; } break;
22367 case e_function : { if (details::is_function ((*vnode)[i])) continue; } break;
22368 case e_null : { if (details::is_null_node ((*vnode)[i])) continue; } break;
22369 case e_assert : { if (details::is_assert_node ((*vnode)[i])) continue; } break;
22370 case e_sf3ext : { if (details::is_sf3ext_node ((*vnode)[i])) continue; } break;
22371 case e_sf4ext : { if (details::is_sf4ext_node ((*vnode)[i])) continue; } break;
22372 case e_vararg : break;
22373 }
22374
22375 return false;
22376 }
22377
22378 return true;
22379 }
static bool is_vararg(const expression< T > &expr)
Definition exprtk.hpp:22287

References exprtk::expression< T >::control_block_, e_assert, e_binary, e_function, e_literal, e_null, e_sf3ext, e_sf4ext, e_string, e_unary, e_vararg, 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(), is_vararg(), and exprtk::details::is_variable_node().

Referenced by run_test22().

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

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