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

Classes

struct  switch_nodes
 
struct  synthesize_binary_ext_expression
 
struct  synthesize_boc_expression
 
struct  synthesize_bov_expression
 
struct  synthesize_cob_expression
 
struct  synthesize_coboc_expression
 
struct  synthesize_cocob_expression
 
struct  synthesize_cocov_expression0
 
struct  synthesize_cocov_expression1
 
struct  synthesize_cov_expression
 
struct  synthesize_covoc_expression0
 
struct  synthesize_covoc_expression1
 
struct  synthesize_covocov_expression0
 
struct  synthesize_covocov_expression1
 
struct  synthesize_covocov_expression2
 
struct  synthesize_covocov_expression3
 
struct  synthesize_covocov_expression4
 
struct  synthesize_covov_expression0
 
struct  synthesize_covov_expression1
 
struct  synthesize_covovoc_expression0
 
struct  synthesize_covovoc_expression1
 
struct  synthesize_covovoc_expression2
 
struct  synthesize_covovoc_expression3
 
struct  synthesize_covovoc_expression4
 
struct  synthesize_covovov_expression0
 
struct  synthesize_covovov_expression1
 
struct  synthesize_covovov_expression2
 
struct  synthesize_covovov_expression3
 
struct  synthesize_covovov_expression4
 
struct  synthesize_sf3ext_expression
 
struct  synthesize_sf4ext_expression
 
struct  synthesize_vob_expression
 
struct  synthesize_voc_expression
 
struct  synthesize_vococ_expression0
 
struct  synthesize_vococ_expression1
 
struct  synthesize_vococov_expression0
 
struct  synthesize_vococov_expression1
 
struct  synthesize_vococov_expression2
 
struct  synthesize_vococov_expression3
 
struct  synthesize_vococov_expression4
 
struct  synthesize_vocov_expression0
 
struct  synthesize_vocov_expression1
 
struct  synthesize_vocovoc_expression0
 
struct  synthesize_vocovoc_expression1
 
struct  synthesize_vocovoc_expression2
 
struct  synthesize_vocovoc_expression3
 
struct  synthesize_vocovoc_expression4
 
struct  synthesize_vocovov_expression0
 
struct  synthesize_vocovov_expression1
 
struct  synthesize_vocovov_expression2
 
struct  synthesize_vocovov_expression3
 
struct  synthesize_vocovov_expression4
 
struct  synthesize_vov_expression
 
struct  synthesize_vovoc_expression0
 
struct  synthesize_vovoc_expression1
 
struct  synthesize_vovocov_expression0
 
struct  synthesize_vovocov_expression1
 
struct  synthesize_vovocov_expression2
 
struct  synthesize_vovocov_expression3
 
struct  synthesize_vovocov_expression4
 
struct  synthesize_vovov_expression0
 
struct  synthesize_vovov_expression1
 
struct  synthesize_vovovoc_expression0
 
struct  synthesize_vovovoc_expression1
 
struct  synthesize_vovovoc_expression2
 
struct  synthesize_vovovoc_expression3
 
struct  synthesize_vovovoc_expression4
 
struct  synthesize_vovovov_expression0
 
struct  synthesize_vovovov_expression1
 
struct  synthesize_vovovov_expression2
 
struct  synthesize_vovovov_expression3
 
struct  synthesize_vovovov_expression4
 

Public Types

typedef details::expression_node< Type > * expression_node_ptr
 
typedef expression_node_ptr(* synthesize_functor_t) (expression_generator< T > &, const details::operator_type &operation, expression_node_ptr(&branch)[2])
 
typedef std::map< std::string, synthesize_functor_tsynthesize_map_t
 
typedef exprtk::parser< Type > parser_t
 
typedef const Type & vtype
 
typedef const Type ctype
 

Public Member Functions

void init_synthesize_map ()
 
void set_parser (parser_t &p)
 
void set_uom (unary_op_map_t &unary_op_map)
 
void set_bom (binary_op_map_t &binary_op_map)
 
void set_ibom (inv_binary_op_map_t &inv_binary_op_map)
 
void set_sf3m (sf3_map_t &sf3_map)
 
void set_sf4m (sf4_map_t &sf4_map)
 
void set_allocator (details::node_allocator &na)
 
void set_strength_reduction_state (const bool enabled)
 
bool strength_reduction_enabled () const
 
bool valid_operator (const details::operator_type &operation, binary_functor_t &bop)
 
bool valid_operator (const details::operator_type &operation, unary_functor_t &uop)
 
details::operator_type get_operator (const binary_functor_t &bop) const
 
expression_node_ptr operator() (const Type &v) const
 
expression_node_ptr operator() (const std::string &s) const
 
expression_node_ptr operator() (std::string &s, range_t &rp) const
 
expression_node_ptr operator() (const std::string &s, range_t &rp) const
 
expression_node_ptr operator() (expression_node_ptr branch, range_t &rp) const
 
bool unary_optimisable (const details::operator_type &operation) const
 
bool sf3_optimisable (const std::string &sf3id, trinary_functor_t &tfunc) const
 
bool sf4_optimisable (const std::string &sf4id, quaternary_functor_t &qfunc) const
 
bool sf3_optimisable (const std::string &sf3id, details::operator_type &operation) const
 
bool sf4_optimisable (const std::string &sf4id, details::operator_type &operation) const
 
expression_node_ptr operator() (const details::operator_type &operation, expression_node_ptr(&branch)[1])
 
bool is_assignment_operation (const details::operator_type &operation) const
 
bool valid_string_operation (const details::operator_type &operation) const
 
std::string to_str (const details::operator_type &operation) const
 
bool operation_optimisable (const details::operator_type &operation) const
 
std::string branch_to_id (expression_node_ptr branch) const
 
std::string branch_to_id (expression_node_ptr(&branch)[2]) const
 
bool cov_optimisable (const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
 
bool voc_optimisable (const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
 
bool vov_optimisable (const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
 
bool cob_optimisable (const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
 
bool boc_optimisable (const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
 
bool cocob_optimisable (const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
 
bool coboc_optimisable (const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
 
bool uvouv_optimisable (const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
 
bool vob_optimisable (const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
 
bool bov_optimisable (const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
 
bool binext_optimisable (const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
 
bool is_invalid_assignment_op (const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
 
bool is_constpow_operation (const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
 
bool is_invalid_break_continue_op (expression_node_ptr(&branch)[2]) const
 
bool is_invalid_string_op (const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
 
bool is_invalid_string_op (const details::operator_type &operation, expression_node_ptr(&branch)[3]) const
 
bool is_string_operation (const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
 
bool is_string_operation (const details::operator_type &operation, expression_node_ptr(&branch)[3]) const
 
bool is_shortcircuit_expression (const details::operator_type &operation) const
 
bool is_null_present (expression_node_ptr(&branch)[2]) const
 
bool is_vector_eqineq_logic_operation (const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
 
bool is_vector_arithmetic_operation (const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
 
expression_node_ptr operator() (const details::operator_type &operation, expression_node_ptr(&branch)[2])
 
expression_node_ptr operator() (const details::operator_type &operation, expression_node_ptr(&branch)[3])
 
expression_node_ptr operator() (const details::operator_type &operation, expression_node_ptr(&branch)[4])
 
expression_node_ptr operator() (const details::operator_type &operation, expression_node_ptr b0)
 
expression_node_ptr operator() (const details::operator_type &operation, expression_node_ptr &b0, expression_node_ptr &b1)
 
expression_node_ptr conditional (expression_node_ptr condition, expression_node_ptr consequent, expression_node_ptr alternative) const
 
expression_node_ptr conditional_string (expression_node_ptr condition, expression_node_ptr consequent, expression_node_ptr alternative) const
 
expression_node_ptr conditional_vector (expression_node_ptr condition, expression_node_ptr consequent, expression_node_ptr alternative) const
 
loop_runtime_check_ptr get_loop_runtime_check (const loop_runtime_check::loop_types loop_type) const
 
vector_access_runtime_check_ptr get_vector_access_runtime_check () const
 
expression_node_ptr while_loop (expression_node_ptr &condition, expression_node_ptr &branch, const bool break_continue_present=false) const
 
expression_node_ptr repeat_until_loop (expression_node_ptr &condition, expression_node_ptr &branch, const bool break_continue_present=false) const
 
expression_node_ptr for_loop (expression_node_ptr &initialiser, expression_node_ptr &condition, expression_node_ptr &incrementor, expression_node_ptr &loop_body, bool break_continue_present=false) const
 
template<typename Allocator , template< typename, typename > class Sequence>
expression_node_ptr const_optimise_switch (Sequence< expression_node_ptr, Allocator > &arg_list)
 
template<typename Allocator , template< typename, typename > class Sequence>
expression_node_ptr const_optimise_mswitch (Sequence< expression_node_ptr, Allocator > &arg_list)
 
template<typename Allocator , template< typename, typename > class Sequence>
expression_node_ptr switch_statement (Sequence< expression_node_ptr, Allocator > &arg_list, const bool default_statement_present)
 
template<typename Allocator , template< typename, typename > class Sequence>
expression_node_ptr multi_switch_statement (Sequence< expression_node_ptr, Allocator > &arg_list)
 
expression_node_ptr assert_call (expression_node_ptr &assert_condition, expression_node_ptr &assert_message, const assert_check::assert_context &context)
 
expression_node_ptr synthesize_uv_expression (const details::operator_type &operation, expression_node_ptr(&branch)[1])
 
expression_node_ptr synthesize_uvec_expression (const details::operator_type &operation, expression_node_ptr(&branch)[1])
 
expression_node_ptr synthesize_unary_expression (const details::operator_type &operation, expression_node_ptr(&branch)[1])
 
expression_node_ptr const_optimise_sf3 (const details::operator_type &operation, expression_node_ptr(&branch)[3])
 
expression_node_ptr varnode_optimise_sf3 (const details::operator_type &operation, expression_node_ptr(&branch)[3])
 
expression_node_ptr special_function (const details::operator_type &operation, expression_node_ptr(&branch)[3])
 
expression_node_ptr const_optimise_sf4 (const details::operator_type &operation, expression_node_ptr(&branch)[4])
 
expression_node_ptr varnode_optimise_sf4 (const details::operator_type &operation, expression_node_ptr(&branch)[4])
 
expression_node_ptr special_function (const details::operator_type &operation, expression_node_ptr(&branch)[4])
 
template<typename Allocator , template< typename, typename > class Sequence>
expression_node_ptr const_optimise_varargfunc (const details::operator_type &operation, Sequence< expression_node_ptr, Allocator > &arg_list)
 
bool special_one_parameter_vararg (const details::operator_type &operation) const
 
template<typename Allocator , template< typename, typename > class Sequence>
expression_node_ptr varnode_optimise_varargfunc (const details::operator_type &operation, Sequence< expression_node_ptr, Allocator > &arg_list)
 
template<typename Allocator , template< typename, typename > class Sequence>
expression_node_ptr vectorize_func (const details::operator_type &operation, Sequence< expression_node_ptr, Allocator > &arg_list)
 
template<typename Allocator , template< typename, typename > class Sequence>
expression_node_ptr vararg_function (const details::operator_type &operation, Sequence< expression_node_ptr, Allocator > &arg_list)
 
template<std::size_t N>
expression_node_ptr function (ifunction_t *f, expression_node_ptr(&b)[N])
 
expression_node_ptr function (ifunction_t *f)
 
expression_node_ptr vararg_function_call (ivararg_function_t *vaf, std::vector< expression_node_ptr > &arg_list)
 
expression_node_ptr generic_function_call (igeneric_function_t *gf, std::vector< expression_node_ptr > &arg_list, const std::size_t &param_seq_index=std::numeric_limits< std::size_t >::max())
 
expression_node_ptr string_function_call (igeneric_function_t *gf, std::vector< expression_node_ptr > &arg_list, const std::size_t &param_seq_index=std::numeric_limits< std::size_t >::max())
 
expression_node_ptr return_call (std::vector< expression_node_ptr > &arg_list)
 
expression_node_ptr return_envelope (expression_node_ptr body, results_context_t *rc, bool *&return_invoked)
 
expression_node_ptr vector_element (const std::string &symbol, vector_holder_ptr vector_base, expression_node_ptr vec_node, expression_node_ptr index)
 

Private Member Functions

template<std::size_t N, typename NodePtr >
bool is_constant_foldable (NodePtr(&b)[N]) const
 
template<typename NodePtr , typename Allocator , template< typename, typename > class Sequence>
bool is_constant_foldable (const Sequence< NodePtr, Allocator > &b) const
 
void lodge_assignment (symbol_type cst, expression_node_ptr node)
 
const void * base_ptr (expression_node_ptr node)
 
bool assign_immutable_symbol (expression_node_ptr node)
 
expression_node_ptr synthesize_assignment_expression (const details::operator_type &operation, expression_node_ptr(&branch)[2])
 
expression_node_ptr synthesize_assignment_operation_expression (const details::operator_type &operation, expression_node_ptr(&branch)[2])
 
expression_node_ptr synthesize_veceqineqlogic_operation_expression (const details::operator_type &operation, expression_node_ptr(&branch)[2])
 
expression_node_ptr synthesize_vecarithmetic_operation_expression (const details::operator_type &operation, expression_node_ptr(&branch)[2])
 
expression_node_ptr synthesize_swap_expression (expression_node_ptr(&branch)[2])
 
expression_node_ptr synthesize_shortcircuit_expression (const details::operator_type &operation, expression_node_ptr(&branch)[2])
 
template<typename TType , template< typename, typename > class IPowNode>
expression_node_ptr cardinal_pow_optimisation_impl (const TType &v, const unsigned int &p)
 
expression_node_ptr cardinal_pow_optimisation (const T &v, const T &c)
 
bool cardinal_pow_optimisable (const details::operator_type &operation, const T &c) const
 
expression_node_ptr cardinal_pow_optimisation (expression_node_ptr(&branch)[2])
 
bool synthesize_expression (const details::operator_type &operation, expression_node_ptr(&branch)[2], expression_node_ptr &result)
 
expression_node_ptr synthesize_uvouv_expression (const details::operator_type &operation, expression_node_ptr(&branch)[2])
 
template<typename T0 , typename T1 >
expression_node_ptr synthesize_str_xrox_expression_impl (const details::operator_type &opr, T0 s0, T1 s1, range_t rp0)
 
template<typename T0 , typename T1 >
expression_node_ptr synthesize_str_xoxr_expression_impl (const details::operator_type &opr, T0 s0, T1 s1, range_t rp1)
 
template<typename T0 , typename T1 >
expression_node_ptr synthesize_str_xroxr_expression_impl (const details::operator_type &opr, T0 s0, T1 s1, range_t rp0, range_t rp1)
 
template<typename T0 , typename T1 >
expression_node_ptr synthesize_sos_expression_impl (const details::operator_type &opr, T0 s0, T1 s1)
 
expression_node_ptr synthesize_sos_expression (const details::operator_type &opr, expression_node_ptr(&branch)[2])
 
expression_node_ptr synthesize_sros_expression (const details::operator_type &opr, expression_node_ptr(&branch)[2])
 
expression_node_ptr synthesize_sosr_expression (const details::operator_type &opr, expression_node_ptr(&branch)[2])
 
expression_node_ptr synthesize_socsr_expression (const details::operator_type &opr, expression_node_ptr(&branch)[2])
 
expression_node_ptr synthesize_srosr_expression (const details::operator_type &opr, expression_node_ptr(&branch)[2])
 
expression_node_ptr synthesize_socs_expression (const details::operator_type &opr, expression_node_ptr(&branch)[2])
 
expression_node_ptr synthesize_csos_expression (const details::operator_type &opr, expression_node_ptr(&branch)[2])
 
expression_node_ptr synthesize_csosr_expression (const details::operator_type &opr, expression_node_ptr(&branch)[2])
 
expression_node_ptr synthesize_srocs_expression (const details::operator_type &opr, expression_node_ptr(&branch)[2])
 
expression_node_ptr synthesize_srocsr_expression (const details::operator_type &opr, expression_node_ptr(&branch)[2])
 
expression_node_ptr synthesize_csocs_expression (const details::operator_type &opr, expression_node_ptr(&branch)[2])
 
expression_node_ptr synthesize_csocsr_expression (const details::operator_type &opr, expression_node_ptr(&branch)[2])
 
expression_node_ptr synthesize_csros_expression (const details::operator_type &opr, expression_node_ptr(&branch)[2])
 
expression_node_ptr synthesize_csrosr_expression (const details::operator_type &opr, expression_node_ptr(&branch)[2])
 
expression_node_ptr synthesize_csrocs_expression (const details::operator_type &opr, expression_node_ptr(&branch)[2])
 
expression_node_ptr synthesize_csrocsr_expression (const details::operator_type &opr, expression_node_ptr(&branch)[2])
 
expression_node_ptr synthesize_strogen_expression (const details::operator_type &opr, expression_node_ptr(&branch)[2])
 
expression_node_ptr synthesize_string_expression (const details::operator_type &opr, expression_node_ptr(&branch)[2])
 
expression_node_ptr synthesize_string_expression (const details::operator_type &opr, expression_node_ptr(&branch)[3])
 
expression_node_ptr synthesize_null_expression (const details::operator_type &operation, expression_node_ptr(&branch)[2])
 
template<typename NodeType , std::size_t N>
expression_node_ptr synthesize_expression (const details::operator_type &operation, expression_node_ptr(&branch)[N])
 
template<typename NodeType , std::size_t N>
expression_node_ptr synthesize_expression (F *f, expression_node_ptr(&branch)[N])
 

Private Attributes

bool strength_reduction_enabled_
 
details::node_allocatornode_allocator_
 
synthesize_map_t synthesize_map_
 
unary_op_map_tunary_op_map_
 
binary_op_map_tbinary_op_map_
 
inv_binary_op_map_tinv_binary_op_map_
 
sf3_map_tsf3_map_
 
sf4_map_tsf4_map_
 
parser_tparser_
 

Detailed Description

template<typename T>
template<typename Type>
class exprtk::parser< T >::expression_generator< Type >

Definition at line 31298 of file exprtk.hpp.

Member Typedef Documentation

◆ ctype

template<typename T >
template<typename Type >
typedef const Type exprtk::parser< T >::expression_generator< Type >::ctype

Definition at line 31307 of file exprtk.hpp.

◆ expression_node_ptr

template<typename T >
template<typename Type >
typedef details::expression_node<Type>* exprtk::parser< T >::expression_generator< Type >::expression_node_ptr

Definition at line 31302 of file exprtk.hpp.

◆ parser_t

template<typename T >
template<typename Type >
typedef exprtk::parser<Type> exprtk::parser< T >::expression_generator< Type >::parser_t

Definition at line 31305 of file exprtk.hpp.

◆ synthesize_functor_t

template<typename T >
template<typename Type >
typedef expression_node_ptr(* exprtk::parser< T >::expression_generator< Type >::synthesize_functor_t) (expression_generator< T > &, const details::operator_type &operation, expression_node_ptr(&branch)[2])

Definition at line 31303 of file exprtk.hpp.

◆ synthesize_map_t

template<typename T >
template<typename Type >
typedef std::map<std::string,synthesize_functor_t> exprtk::parser< T >::expression_generator< Type >::synthesize_map_t

Definition at line 31304 of file exprtk.hpp.

◆ vtype

template<typename T >
template<typename Type >
typedef const Type& exprtk::parser< T >::expression_generator< Type >::vtype

Definition at line 31306 of file exprtk.hpp.

Member Function Documentation

◆ assert_call()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::assert_call ( expression_node_ptr assert_condition,
expression_node_ptr assert_message,
const assert_check::assert_context context 
)
inline

Definition at line 32885 of file exprtk.hpp.

32888 {
32889 typedef details::assert_node<Type> alloc_type;
32890
32892 (assert_condition, assert_message, parser_->assert_check_, context);
32893
32894 if (result && result->valid())
32895 {
32896 parser_->state_.activate_side_effect("assert_call()");
32897 return result;
32898 }
32899
32901 details::free_node(*node_allocator_, assert_condition);
32902 details::free_node(*node_allocator_, assert_message );
32903
32904 return error_node();
32905 }
expression_node< typename node_type::value_type > * allocate_rrrr(T1 &t1, T2 &t2, T3 &t3, T4 &t4) const
Definition exprtk.hpp:19185
details::expression_node< Type > * expression_node_ptr
Definition exprtk.hpp:31302
details::node_allocator * node_allocator_
Definition exprtk.hpp:41320
assert_check_ptr assert_check_
Definition exprtk.hpp:41653
parser_state state_
Definition exprtk.hpp:41621
static expression_node_ptr error_node()
Definition exprtk.hpp:25405
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
void free_node(NodeAllocator &, expression_node< T > *&node)
Definition exprtk.hpp:6007
void activate_side_effect(const std::string &)
Definition exprtk.hpp:23400

References exprtk::parser< T >::parser_state::activate_side_effect(), exprtk::details::node_allocator::allocate_rrrr(), exprtk::parser< T >::assert_check_, exprtk::parser< T >::error_node(), exprtk::details::free_node(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::parser< T >::state_, and exprtk::details::expression_node< T >::valid().

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

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

◆ assign_immutable_symbol()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::assign_immutable_symbol ( expression_node_ptr  node)
inlineprivate

Definition at line 33994 of file exprtk.hpp.

33995 {
33996 interval_t interval;
33997 const void* baseptr_addr = base_ptr(node);
33998
33999 exprtk_debug(("assign_immutable_symbol - base ptr addr: %p\n", baseptr_addr));
34000
34001 if (parser_->immutable_memory_map_.in_interval(baseptr_addr,interval))
34002 {
34003 typename immutable_symtok_map_t::iterator itr = parser_->immutable_symtok_map_.find(interval);
34004
34005 if (parser_->immutable_symtok_map_.end() != itr)
34006 {
34007 token_t& token = itr->second;
34010 token,
34011 "ERR265 - Symbol '" + token.value + "' cannot be assigned-to as it is immutable.",
34013 }
34014 else
34015 parser_->set_synthesis_error("Unable to assign symbol is immutable.");
34016
34017 return true;
34018 }
34019
34020 return false;
34021 }
const void * base_ptr(expression_node_ptr node)
Definition exprtk.hpp:33944
bool in_interval(const interval_point_t point, interval_t &interval) const
Definition exprtk.hpp:22726
interval_container_t< constvoid * >::interval_t interval_t
Definition exprtk.hpp:30615
void set_synthesis_error(const std::string &synthesis_error_message)
Definition exprtk.hpp:41343
immutable_symtok_map_t immutable_symtok_map_
Definition exprtk.hpp:41637
void set_error(const parser_error::type &error_type)
Definition exprtk.hpp:41330
lexer::token token_t
Definition exprtk.hpp:22252
immutable_memory_map_t immutable_memory_map_
Definition exprtk.hpp:41636
#define exprtk_debug(params)
Definition exprtk.hpp:64
#define exprtk_error_location
Definition exprtk.hpp:67
type make_error(const error_mode mode, const std::string &diagnostic="", const std::string &src_location="")
Definition exprtk.hpp:22071

References exprtk::parser< T >::expression_generator< Type >::base_ptr(), exprtk::parser_error::e_parser, exprtk_debug, exprtk_error_location, exprtk::parser< T >::immutable_memory_map_, exprtk::parser< T >::immutable_symtok_map_, exprtk::parser< T >::interval_container_t< IntervalPointType, RangePolicy >::in_interval(), exprtk::parser_error::make_error(), exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::parser< T >::set_error(), exprtk::parser< T >::set_synthesis_error(), and exprtk::lexer::token::value.

Referenced by exprtk::parser< T >::expression_generator< Type >::synthesize_assignment_expression(), and exprtk::parser< T >::expression_generator< Type >::synthesize_assignment_operation_expression().

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

◆ base_ptr()

template<typename T >
template<typename Type >
const void * exprtk::parser< T >::expression_generator< Type >::base_ptr ( expression_node_ptr  node)
inlineprivate

Definition at line 33944 of file exprtk.hpp.

33945 {
33946 if (node)
33947 {
33948 switch(node->type())
33949 {
33951 return reinterpret_cast<const void*>(&static_cast<variable_node_t*>(node)->ref());
33952
33954 return reinterpret_cast<const void*>(&static_cast<vector_elem_node_t*>(node)->ref());
33955
33957 return reinterpret_cast<const void*>(&static_cast<vector_celem_node_t*>(node)->ref());
33958
33960 return reinterpret_cast<const void*>(&static_cast<vector_elem_rtc_node_t*>(node)->ref());
33961
33963 return reinterpret_cast<const void*>(&static_cast<vector_celem_rtc_node_t*>(node)->ref());
33964
33966 return reinterpret_cast<const void*>(&static_cast<rebasevector_elem_node_t*>(node)->ref());
33967
33969 return reinterpret_cast<const void*>(&static_cast<rebasevector_elem_rtc_node_t*>(node)->ref());
33970
33972 return reinterpret_cast<const void*>(&static_cast<rebasevector_celem_node_t*>(node)->ref());
33973
33975 return reinterpret_cast<const void*>(&static_cast<rebasevector_celem_rtc_node_t*>(node)->ref());
33976
33978 return reinterpret_cast<const void*>(static_cast<vector_node_t*>(node)->vec_holder().data());
33979
33980 #ifndef exprtk_disable_string_capabilities
33982 return reinterpret_cast<const void*>((static_cast<stringvar_node_t*>(node)->base()));
33983
33985 return reinterpret_cast<const void*>((static_cast<string_range_node_t*>(node)->base()));
33986 #endif
33987 default : return reinterpret_cast<const void*>(0);
33988 }
33989 }
33990
33991 return reinterpret_cast<const void*>(0);
33992 }
details::vector_node< T > vector_node_t
Definition exprtk.hpp:22226
details::rebasevector_celem_node< T > rebasevector_celem_node_t
Definition exprtk.hpp:22223
details::stringvar_node< T > stringvar_node_t
Definition exprtk.hpp:22230
details::vector_elem_node< T > vector_elem_node_t
Definition exprtk.hpp:22218
details::vector_celem_rtc_node< T > vector_celem_rtc_node_t
Definition exprtk.hpp:22221
details::variable_node< T > variable_node_t
Definition exprtk.hpp:22217
details::vector_elem_rtc_node< T > vector_elem_rtc_node_t
Definition exprtk.hpp:22220
details::rebasevector_elem_rtc_node< T > rebasevector_elem_rtc_node_t
Definition exprtk.hpp:22224
details::rebasevector_celem_rtc_node< T > rebasevector_celem_rtc_node_t
Definition exprtk.hpp:22225
details::string_range_node< T > string_range_node_t
Definition exprtk.hpp:22232
details::vector_celem_node< T > vector_celem_node_t
Definition exprtk.hpp:22219
details::rebasevector_elem_node< T > rebasevector_elem_node_t
Definition exprtk.hpp:22222

References exprtk::details::expression_node< T >::type().

Referenced by exprtk::parser< T >::expression_generator< Type >::assign_immutable_symbol().

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

◆ binext_optimisable()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::binext_optimisable ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
) const
inline

Definition at line 31828 of file exprtk.hpp.

31829 {
31830 if (!operation_optimisable(operation))
31831 return false;
31832 else
31833 return !details::is_constant_node(branch[0]) ||
31834 !details::is_constant_node(branch[1]) ;
31835 }
bool operation_optimisable(const details::operator_type &operation) const
Definition exprtk.hpp:31656
bool is_constant_node(const expression_node< T > *node)
Definition exprtk.hpp:5781

References exprtk::details::is_constant_node(), and exprtk::parser< T >::expression_generator< Type >::operation_optimisable().

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ boc_optimisable()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::boc_optimisable ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
) const
inline

Definition at line 31760 of file exprtk.hpp.

31761 {
31762 if (!operation_optimisable(operation))
31763 return false;
31764 else
31765 return !details::is_constant_node(branch[0]) &&
31766 details::is_constant_node(branch[1]) ;
31767 }

References exprtk::details::is_constant_node(), and exprtk::parser< T >::expression_generator< Type >::operation_optimisable().

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ bov_optimisable()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::bov_optimisable ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
) const
inline

Definition at line 31819 of file exprtk.hpp.

31820 {
31821 if (!operation_optimisable(operation))
31822 return false;
31823 else
31824 return !details::is_variable_node(branch[0]) &&
31825 details::is_variable_node(branch[1]) ;
31826 }
bool is_variable_node(const expression_node< T > *node)
Definition exprtk.hpp:5679

References exprtk::details::is_variable_node(), and exprtk::parser< T >::expression_generator< Type >::operation_optimisable().

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ branch_to_id() [1/2]

template<typename T >
template<typename Type >
std::string exprtk::parser< T >::expression_generator< Type >::branch_to_id ( expression_node_ptr  branch) const
inline

Definition at line 31678 of file exprtk.hpp.

31679 {
31680 static const std::string null_str ("(null)" );
31681 static const std::string const_str ("(c)" );
31682 static const std::string var_str ("(v)" );
31683 static const std::string vov_str ("(vov)" );
31684 static const std::string cov_str ("(cov)" );
31685 static const std::string voc_str ("(voc)" );
31686 static const std::string str_str ("(s)" );
31687 static const std::string strrng_str ("(rngs)" );
31688 static const std::string cs_str ("(cs)" );
31689 static const std::string cstrrng_str("(crngs)");
31690
31691 if (details::is_null_node(branch))
31692 return null_str;
31693 else if (details::is_constant_node(branch))
31694 return const_str;
31695 else if (details::is_variable_node(branch))
31696 return var_str;
31697 else if (details::is_vov_node(branch))
31698 return vov_str;
31699 else if (details::is_cov_node(branch))
31700 return cov_str;
31701 else if (details::is_voc_node(branch))
31702 return voc_str;
31703 else if (details::is_string_node(branch))
31704 return str_str;
31705 else if (details::is_const_string_node(branch))
31706 return cs_str;
31707 else if (details::is_string_range_node(branch))
31708 return strrng_str;
31709 else if (details::is_const_string_range_node(branch))
31710 return cstrrng_str;
31711 else if (details::is_t0ot1ot2_node(branch))
31712 return "(" + dynamic_cast<details::T0oT1oT2_base_node<T>*>(branch)->type_id() + ")";
31713 else if (details::is_t0ot1ot2ot3_node(branch))
31714 return "(" + dynamic_cast<details::T0oT1oT2oT3_base_node<T>*>(branch)->type_id() + ")";
31715 else
31716 return "ERROR";
31717 }
bool is_voc_node(const expression_node< T > *node)
Definition exprtk.hpp:18883
bool is_t0ot1ot2ot3_node(const expression_node< T > *node)
Definition exprtk.hpp:18907
bool is_vov_node(const expression_node< T > *node)
Definition exprtk.hpp:18871
bool is_string_node(const expression_node< T > *node)
Definition exprtk.hpp:18919
bool is_const_string_range_node(const expression_node< T > *node)
Definition exprtk.hpp:18937
bool is_cov_node(const expression_node< T > *node)
Definition exprtk.hpp:18877
bool is_const_string_node(const expression_node< T > *node)
Definition exprtk.hpp:18931
bool is_null_node(const expression_node< T > *node)
Definition exprtk.hpp:5791
bool is_string_range_node(const expression_node< T > *node)
Definition exprtk.hpp:18925
bool is_t0ot1ot2_node(const expression_node< T > *node)
Definition exprtk.hpp:18901

References exprtk::details::is_const_string_node(), exprtk::details::is_const_string_range_node(), exprtk::details::is_constant_node(), exprtk::details::is_cov_node(), exprtk::details::is_null_node(), exprtk::details::is_string_node(), exprtk::details::is_string_range_node(), exprtk::details::is_t0ot1ot2_node(), exprtk::details::is_t0ot1ot2ot3_node(), exprtk::details::is_variable_node(), exprtk::details::is_voc_node(), exprtk::details::is_vov_node(), and exprtk::details::T0oT1oT2oT3_base_node< T >::type_id().

Referenced by exprtk::parser< T >::expression_generator< Type >::branch_to_id(), and exprtk::parser< T >::expression_generator< Type >::synthesize_expression().

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

◆ branch_to_id() [2/2]

template<typename T >
template<typename Type >
std::string exprtk::parser< T >::expression_generator< Type >::branch_to_id ( expression_node_ptr(&)  branch[2]) const
inline

Definition at line 31719 of file exprtk.hpp.

31720 {
31721 return branch_to_id(branch[0]) + std::string("o") + branch_to_id(branch[1]);
31722 }
std::string branch_to_id(expression_node_ptr branch) const
Definition exprtk.hpp:31678

References exprtk::parser< T >::expression_generator< Type >::branch_to_id().

Here is the call graph for this function:

◆ cardinal_pow_optimisable()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::cardinal_pow_optimisable ( const details::operator_type operation,
const T &  c 
) const
inlineprivate

Definition at line 34764 of file exprtk.hpp.

34765 {
34766 return (details::e_pow == operation) && (details::numeric::abs(c) <= T(60)) && details::numeric::is_integer(c);
34767 }
bool is_integer(const T v)
Definition exprtk.hpp:1625

References exprtk::details::numeric::abs(), exprtk::details::e_pow, and exprtk::details::numeric::is_integer().

Referenced by exprtk::parser< T >::expression_generator< Type >::is_constpow_operation(), and exprtk::parser< T >::expression_generator< Type >::synthesize_voc_expression::process().

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

◆ cardinal_pow_optimisation() [1/2]

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::cardinal_pow_optimisation ( const T &  v,
const T &  c 
)
inlineprivate

Definition at line 34743 of file exprtk.hpp.

34744 {
34745 const bool not_recipricol = (c >= T(0));
34746 const unsigned int p = static_cast<unsigned int>(details::numeric::to_int32(details::numeric::abs(c)));
34747
34748 if (0 == p)
34750 else if (std::equal_to<T>()(T(2),c))
34751 {
34752 return node_allocator_->
34753 template allocate_rr<typename details::vov_node<Type,details::mul_op<Type> > >(v,v);
34754 }
34755 else
34756 {
34757 if (not_recipricol)
34758 return cardinal_pow_optimisation_impl<T,details::ipow_node>(v,p);
34759 else
34760 return cardinal_pow_optimisation_impl<T,details::ipowinv_node>(v,p);
34761 }
34762 }
expression_node< typename node_type::value_type > * allocate_c(const T1 &t1) const
Definition exprtk.hpp:19095
details::literal_node< T > literal_node_t
Definition exprtk.hpp:22195
int to_int32(const T v)
Definition exprtk.hpp:1464

References exprtk::details::numeric::abs(), exprtk::details::node_allocator::allocate_c(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, and exprtk::details::numeric::to_int32().

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()(), and exprtk::parser< T >::expression_generator< Type >::synthesize_voc_expression::process().

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

◆ cardinal_pow_optimisation() [2/2]

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::cardinal_pow_optimisation ( expression_node_ptr(&)  branch[2])
inlineprivate

Definition at line 34769 of file exprtk.hpp.

34770 {
34771 const Type c = static_cast<details::literal_node<Type>*>(branch[1])->value();
34772 const bool not_recipricol = (c >= T(0));
34773 const unsigned int p = static_cast<unsigned int>(details::numeric::to_int32(details::numeric::abs(c)));
34774
34775 node_allocator_->free(branch[1]);
34776
34777 if (0 == p)
34778 {
34780
34782 }
34783 else if (not_recipricol)
34784 return cardinal_pow_optimisation_impl<expression_node_ptr,details::bipow_node>(branch[0],p);
34785 else
34786 return cardinal_pow_optimisation_impl<expression_node_ptr,details::bipowinv_node>(branch[0],p);
34787 }
void free(expression_node< T > *&e) const
Definition exprtk.hpp:19384
T value(details::expression_node< T > *n)
Definition exprtk.hpp:15749
void free_all_nodes(NodeAllocator &node_allocator, expression_node< T > *(&b)[N])
Definition exprtk.hpp:5984

References exprtk::details::numeric::abs(), exprtk::details::node_allocator::allocate_c(), exprtk::details::node_allocator::free(), exprtk::details::free_all_nodes(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, and exprtk::details::numeric::to_int32().

Here is the call graph for this function:

◆ cardinal_pow_optimisation_impl()

template<typename T >
template<typename Type >
template<typename TType , template< typename, typename > class IPowNode>
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::cardinal_pow_optimisation_impl ( const TType &  v,
const unsigned int &  p 
)
inlineprivate

Definition at line 34715 of file exprtk.hpp.

34716 {
34717 switch (p)
34718 {
34719 #define case_stmt(cp) \
34720 case cp : return node_allocator_-> \
34721 allocate<IPowNode<T,details::numeric::fast_exp<T,cp> > >(v); \
34722
34723 case_stmt( 1) case_stmt( 2) case_stmt( 3) case_stmt( 4)
34724 case_stmt( 5) case_stmt( 6) case_stmt( 7) case_stmt( 8)
34725 case_stmt( 9) case_stmt(10) case_stmt(11) case_stmt(12)
34726 case_stmt(13) case_stmt(14) case_stmt(15) case_stmt(16)
34727 case_stmt(17) case_stmt(18) case_stmt(19) case_stmt(20)
34728 case_stmt(21) case_stmt(22) case_stmt(23) case_stmt(24)
34729 case_stmt(25) case_stmt(26) case_stmt(27) case_stmt(28)
34730 case_stmt(29) case_stmt(30) case_stmt(31) case_stmt(32)
34731 case_stmt(33) case_stmt(34) case_stmt(35) case_stmt(36)
34732 case_stmt(37) case_stmt(38) case_stmt(39) case_stmt(40)
34733 case_stmt(41) case_stmt(42) case_stmt(43) case_stmt(44)
34734 case_stmt(45) case_stmt(46) case_stmt(47) case_stmt(48)
34735 case_stmt(49) case_stmt(50) case_stmt(51) case_stmt(52)
34736 case_stmt(53) case_stmt(54) case_stmt(55) case_stmt(56)
34737 case_stmt(57) case_stmt(58) case_stmt(59) case_stmt(60)
34738 #undef case_stmt
34739 default : return error_node();
34740 }
34741 }
#define case_stmt(N)
Definition exprtk.hpp:32731

References case_stmt, and exprtk::parser< T >::error_node().

Here is the call graph for this function:

◆ cob_optimisable()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::cob_optimisable ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
) const
inline

Definition at line 31751 of file exprtk.hpp.

31752 {
31753 if (!operation_optimisable(operation))
31754 return false;
31755 else
31756 return details::is_constant_node(branch[0]) &&
31757 !details::is_constant_node(branch[1]) ;
31758 }

References exprtk::details::is_constant_node(), and exprtk::parser< T >::expression_generator< Type >::operation_optimisable().

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ coboc_optimisable()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::coboc_optimisable ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
) const
inline

Definition at line 31785 of file exprtk.hpp.

31786 {
31787 if (
31788 (details::e_add == operation) ||
31789 (details::e_sub == operation) ||
31790 (details::e_mul == operation) ||
31791 (details::e_div == operation)
31792 )
31793 {
31794 return (details::is_constant_node(branch[0]) && details::is_boc_node(branch[1])) ||
31795 (details::is_constant_node(branch[1]) && details::is_boc_node(branch[0])) ;
31796 }
31797 else
31798 return false;
31799 }
bool is_boc_node(const expression_node< T > *node)
Definition exprtk.hpp:18895

References exprtk::details::e_add, exprtk::details::e_div, exprtk::details::e_mul, exprtk::details::e_sub, exprtk::details::is_boc_node(), and exprtk::details::is_constant_node().

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ cocob_optimisable()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::cocob_optimisable ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
) const
inline

Definition at line 31769 of file exprtk.hpp.

31770 {
31771 if (
31772 (details::e_add == operation) ||
31773 (details::e_sub == operation) ||
31774 (details::e_mul == operation) ||
31775 (details::e_div == operation)
31776 )
31777 {
31778 return (details::is_constant_node(branch[0]) && details::is_cob_node(branch[1])) ||
31779 (details::is_constant_node(branch[1]) && details::is_cob_node(branch[0])) ;
31780 }
31781 else
31782 return false;
31783 }
bool is_cob_node(const expression_node< T > *node)
Definition exprtk.hpp:18889

References exprtk::details::e_add, exprtk::details::e_div, exprtk::details::e_mul, exprtk::details::e_sub, exprtk::details::is_cob_node(), and exprtk::details::is_constant_node().

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ conditional()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::conditional ( expression_node_ptr  condition,
expression_node_ptr  consequent,
expression_node_ptr  alternative 
) const
inline

Definition at line 32219 of file exprtk.hpp.

32222 {
32223 if ((0 == condition) || (0 == consequent))
32224 {
32225 details::free_node(*node_allocator_, condition );
32226 details::free_node(*node_allocator_, consequent );
32227 details::free_node(*node_allocator_, alternative);
32228
32229 const std::string invalid_branches =
32230 ((0 == condition ) ? std::string("condition ") : "") +
32231 ((0 == consequent) ? std::string("consequent") : "") ;
32232
32236 "ERR247 - Invalid " + invalid_branches + " for conditional statement",
32238
32239 return error_node();
32240 }
32241 // Can the condition be immediately evaluated? if so optimise.
32242 else if (details::is_constant_node(condition))
32243 {
32244 // True branch
32245 if (details::is_true(condition))
32246 {
32247 details::free_node(*node_allocator_, condition );
32248 details::free_node(*node_allocator_, alternative);
32249
32250 return consequent;
32251 }
32252 // False branch
32253 else
32254 {
32255 details::free_node(*node_allocator_, condition );
32256 details::free_node(*node_allocator_, consequent);
32257
32258 if (alternative)
32259 return alternative;
32260 else
32262 }
32263 }
32264
32266 std::string node_name = "Unknown!";
32267
32268 if ((0 != consequent) && (0 != alternative))
32269 {
32270 result = node_allocator_->allocate<conditional_node_t>(condition, consequent, alternative);
32271 node_name = "conditional_node_t";
32272 }
32273 else
32274 {
32275 result = node_allocator_->allocate<cons_conditional_node_t>(condition, consequent);
32276 node_name = "cons_conditional_node_t";
32277 }
32278
32279 if (result && result->valid())
32280 {
32281 return result;
32282 }
32283
32286 token_t(),
32287 "ERR248 - Failed to synthesize node: " + node_name,
32289
32291 return error_node();
32292 }
expression_node< typename ResultNode::value_type > * allocate(OpType &operation, ExprNode(&branch)[1])
Definition exprtk.hpp:19014
details::conditional_node< T > conditional_node_t
Definition exprtk.hpp:22200
details::cons_conditional_node< T > cons_conditional_node_t
Definition exprtk.hpp:22201
state_t current_state() const
Definition exprtk.hpp:25037
bool is_true(const double v)
Definition exprtk.hpp:5615

References exprtk::details::node_allocator::allocate(), exprtk::parser< T >::current_state(), exprtk::parser_error::e_parser, exprtk::parser< T >::error_node(), exprtk_error_location, exprtk::details::free_node(), exprtk::details::is_constant_node(), exprtk::details::is_true(), exprtk::parser_error::make_error(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::parser< T >::set_error(), exprtk::parser< T >::state_t::token, and exprtk::details::expression_node< T >::valid().

Referenced by exprtk::parser< T >::parse_conditional_statement_01(), exprtk::parser< T >::parse_conditional_statement_02(), and exprtk::parser< T >::parse_ternary_conditional_statement().

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

◆ conditional_string()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::conditional_string ( expression_node_ptr  condition,
expression_node_ptr  consequent,
expression_node_ptr  alternative 
) const
inline

Definition at line 32295 of file exprtk.hpp.

32298 {
32299 if ((0 == condition) || (0 == consequent))
32300 {
32301 details::free_node(*node_allocator_, condition );
32302 details::free_node(*node_allocator_, consequent );
32303 details::free_node(*node_allocator_, alternative);
32304
32305 const std::string invalid_branches =
32306 ((0 == condition ) ? std::string("condition ") : "") +
32307 ((0 == consequent) ? std::string("consequent") : "") ;
32308
32312 "ERR249 - Invalid " + invalid_branches + " for string conditional statement",
32314
32315 return error_node();
32316 }
32317 // Can the condition be immediately evaluated? if so optimise.
32318 else if (details::is_constant_node(condition))
32319 {
32320 // True branch
32321 if (details::is_true(condition))
32322 {
32323 details::free_node(*node_allocator_, condition );
32324 details::free_node(*node_allocator_, alternative);
32325
32326 return consequent;
32327 }
32328 // False branch
32329 else
32330 {
32331 details::free_node(*node_allocator_, condition );
32332 details::free_node(*node_allocator_, consequent);
32333
32334 if (alternative)
32335 return alternative;
32336 else
32337 return node_allocator_->
32338 allocate_c<details::string_literal_node<Type> >("");
32339 }
32340 }
32341 else if ((0 != consequent) && (0 != alternative))
32342 {
32343 expression_node_ptr result =
32344 node_allocator_->allocate<conditional_string_node_t>(condition, consequent, alternative);
32345
32346 if (result && result->valid())
32347 {
32348 return result;
32349 }
32350
32353 token_t(),
32354 "ERR250 - Failed to synthesize node: conditional_string_node_t",
32356
32358 }
32359
32360 return error_node();
32361 }
details::conditional_string_node< T > conditional_string_node_t
Definition exprtk.hpp:22238

References exprtk::details::node_allocator::allocate(), exprtk::parser< T >::current_state(), exprtk::parser_error::e_parser, exprtk::parser< T >::error_node(), exprtk_error_location, exprtk::details::free_node(), exprtk::details::is_constant_node(), exprtk::details::is_true(), exprtk::parser_error::make_error(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::parser< T >::set_error(), exprtk::parser< T >::state_t::token, and exprtk::details::expression_node< T >::valid().

Referenced by exprtk::parser< T >::parse_conditional_statement_01(), exprtk::parser< T >::parse_conditional_statement_02(), and exprtk::parser< T >::parse_ternary_conditional_statement().

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

◆ conditional_vector()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::conditional_vector ( expression_node_ptr  condition,
expression_node_ptr  consequent,
expression_node_ptr  alternative 
) const
inline

Definition at line 32371 of file exprtk.hpp.

32374 {
32375 if ((0 == condition) || (0 == consequent))
32376 {
32377 details::free_node(*node_allocator_, condition );
32378 details::free_node(*node_allocator_, consequent );
32379 details::free_node(*node_allocator_, alternative);
32380
32381 const std::string invalid_branches =
32382 ((0 == condition ) ? std::string("condition ") : "") +
32383 ((0 == consequent) ? std::string("consequent") : "") ;
32384
32388 "ERR251 - Invalid " + invalid_branches + " for vector conditional statement",
32390
32391 return error_node();
32392 }
32393 // Can the condition be immediately evaluated? if so optimise.
32394 else if (details::is_constant_node(condition))
32395 {
32396 // True branch
32397 if (details::is_true(condition))
32398 {
32399 details::free_node(*node_allocator_, condition );
32400 details::free_node(*node_allocator_, alternative);
32401
32402 return consequent;
32403 }
32404 // False branch
32405 else
32406 {
32407 details::free_node(*node_allocator_, condition );
32408 details::free_node(*node_allocator_, consequent);
32409
32410 if (alternative)
32411 return alternative;
32412 else
32414
32415 }
32416 }
32417 else if ((0 != consequent) && (0 != alternative))
32418 {
32419 return node_allocator_->
32420 allocate<conditional_vector_node_t>(condition, consequent, alternative);
32421 }
32422 else
32423 return error_node();
32424 }

References exprtk::details::node_allocator::allocate(), exprtk::parser< T >::current_state(), exprtk::parser_error::e_parser, exprtk::parser< T >::error_node(), exprtk_error_location, exprtk::details::free_node(), exprtk::details::is_constant_node(), exprtk::details::is_true(), exprtk::parser_error::make_error(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::parser< T >::set_error(), and exprtk::parser< T >::state_t::token.

Referenced by exprtk::parser< T >::parse_conditional_statement_01(), exprtk::parser< T >::parse_conditional_statement_02(), and exprtk::parser< T >::parse_ternary_conditional_statement().

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

◆ const_optimise_mswitch()

template<typename T >
template<typename Type >
template<typename Allocator , template< typename, typename > class Sequence>
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::const_optimise_mswitch ( Sequence< expression_node_ptr, Allocator > &  arg_list)
inline

Definition at line 32693 of file exprtk.hpp.

32694 {
32696
32697 for (std::size_t i = 0; i < (arg_list.size() / 2); ++i)
32698 {
32699 expression_node_ptr condition = arg_list[(2 * i) ];
32700 expression_node_ptr consequent = arg_list[(2 * i) + 1];
32701
32702 if (details::is_true(condition))
32703 {
32704 result = consequent;
32705 }
32706 }
32707
32708 if (0 == result)
32709 {
32710 const T zero = T(0);
32711 result = node_allocator_->allocate<literal_node_t>(zero);
32712 }
32713
32714 for (std::size_t i = 0; i < arg_list.size(); ++i)
32715 {
32716 expression_node_ptr& current_expr = arg_list[i];
32717
32718 if (current_expr && (current_expr != result))
32719 {
32720 details::free_node(*node_allocator_,current_expr);
32721 }
32722 }
32723
32724 return result;
32725 }

References exprtk::details::node_allocator::allocate(), exprtk::parser< T >::error_node(), exprtk::details::free_node(), exprtk::details::is_true(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Referenced by exprtk::parser< T >::expression_generator< Type >::multi_switch_statement().

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

◆ const_optimise_sf3()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::const_optimise_sf3 ( const details::operator_type operation,
expression_node_ptr(&)  branch[3] 
)
inline

Definition at line 32997 of file exprtk.hpp.

32999 {
33000 expression_node_ptr temp_node = error_node();
33001
33002 switch (operation)
33003 {
33004 #define case_stmt(op) \
33005 case details::e_sf##op : temp_node = node_allocator_-> \
33006 allocate<details::sf3_node<Type,details::sf##op##_op<Type> > > \
33007 (operation, branch); \
33008 break; \
33009
33010 case_stmt(00) case_stmt(01) case_stmt(02) case_stmt(03)
33011 case_stmt(04) case_stmt(05) case_stmt(06) case_stmt(07)
33012 case_stmt(08) case_stmt(09) case_stmt(10) case_stmt(11)
33013 case_stmt(12) case_stmt(13) case_stmt(14) case_stmt(15)
33014 case_stmt(16) case_stmt(17) case_stmt(18) case_stmt(19)
33015 case_stmt(20) case_stmt(21) case_stmt(22) case_stmt(23)
33016 case_stmt(24) case_stmt(25) case_stmt(26) case_stmt(27)
33017 case_stmt(28) case_stmt(29) case_stmt(30) case_stmt(31)
33018 case_stmt(32) case_stmt(33) case_stmt(34) case_stmt(35)
33019 case_stmt(36) case_stmt(37) case_stmt(38) case_stmt(39)
33020 case_stmt(40) case_stmt(41) case_stmt(42) case_stmt(43)
33021 case_stmt(44) case_stmt(45) case_stmt(46) case_stmt(47)
33022 #undef case_stmt
33023 default : return error_node();
33024 }
33025
33026 assert(temp_node);
33027
33028 const T v = temp_node->value();
33029
33031
33033 }

References exprtk::details::node_allocator::allocate(), case_stmt, exprtk::parser< T >::error_node(), exprtk::details::free_node(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, and exprtk::details::expression_node< T >::value().

Referenced by exprtk::parser< T >::expression_generator< Type >::special_function().

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

◆ const_optimise_sf4()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::const_optimise_sf4 ( const details::operator_type operation,
expression_node_ptr(&)  branch[4] 
)
inline

Definition at line 33102 of file exprtk.hpp.

33103 {
33104 expression_node_ptr temp_node = error_node();
33105
33106 switch (operation)
33107 {
33108 #define case_stmt(op) \
33109 case details::e_sf##op : temp_node = node_allocator_-> \
33110 allocate<details::sf4_node<Type,details::sf##op##_op<Type> > > \
33111 (operation, branch); \
33112 break; \
33113
33114 case_stmt(48) case_stmt(49) case_stmt(50) case_stmt(51)
33115 case_stmt(52) case_stmt(53) case_stmt(54) case_stmt(55)
33116 case_stmt(56) case_stmt(57) case_stmt(58) case_stmt(59)
33117 case_stmt(60) case_stmt(61) case_stmt(62) case_stmt(63)
33118 case_stmt(64) case_stmt(65) case_stmt(66) case_stmt(67)
33119 case_stmt(68) case_stmt(69) case_stmt(70) case_stmt(71)
33120 case_stmt(72) case_stmt(73) case_stmt(74) case_stmt(75)
33121 case_stmt(76) case_stmt(77) case_stmt(78) case_stmt(79)
33122 case_stmt(80) case_stmt(81) case_stmt(82) case_stmt(83)
33123 case_stmt(84) case_stmt(85) case_stmt(86) case_stmt(87)
33124 case_stmt(88) case_stmt(89) case_stmt(90) case_stmt(91)
33125 case_stmt(92) case_stmt(93) case_stmt(94) case_stmt(95)
33126 case_stmt(96) case_stmt(97) case_stmt(98) case_stmt(99)
33127 #undef case_stmt
33128 default : return error_node();
33129 }
33130
33131 assert(temp_node);
33132
33133 const T v = temp_node->value();
33134
33136
33138 }

References exprtk::details::node_allocator::allocate(), case_stmt, exprtk::parser< T >::error_node(), exprtk::details::free_node(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, and exprtk::details::expression_node< T >::value().

Referenced by exprtk::parser< T >::expression_generator< Type >::special_function().

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

◆ const_optimise_switch()

template<typename T >
template<typename Type >
template<typename Allocator , template< typename, typename > class Sequence>
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::const_optimise_switch ( Sequence< expression_node_ptr, Allocator > &  arg_list)
inline

Definition at line 32657 of file exprtk.hpp.

32658 {
32660
32661 for (std::size_t i = 0; i < (arg_list.size() / 2); ++i)
32662 {
32663 expression_node_ptr condition = arg_list[(2 * i) ];
32664 expression_node_ptr consequent = arg_list[(2 * i) + 1];
32665
32666 if ((0 == result) && details::is_true(condition))
32667 {
32668 result = consequent;
32669 break;
32670 }
32671 }
32672
32673 if (0 == result)
32674 {
32675 result = arg_list.back();
32676 }
32677
32678 for (std::size_t i = 0; i < arg_list.size(); ++i)
32679 {
32680 expression_node_ptr current_expr = arg_list[i];
32681
32682 if (current_expr && (current_expr != result))
32683 {
32684 free_node(*node_allocator_,current_expr);
32685 }
32686 }
32687
32688 return result;
32689 }

References exprtk::parser< T >::error_node(), exprtk::details::is_true(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Referenced by exprtk::parser< T >::expression_generator< Type >::switch_statement().

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

◆ const_optimise_varargfunc()

template<typename T >
template<typename Type >
template<typename Allocator , template< typename, typename > class Sequence>
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::const_optimise_varargfunc ( const details::operator_type operation,
Sequence< expression_node_ptr, Allocator > &  arg_list 
)
inline

Definition at line 33209 of file exprtk.hpp.

33210 {
33211 expression_node_ptr temp_node = error_node();
33212
33213 switch (operation)
33214 {
33215 #define case_stmt(op0, op1) \
33216 case op0 : temp_node = node_allocator_-> \
33217 allocate<details::vararg_node<Type,op1<Type> > > \
33218 (arg_list); \
33219 break; \
33220
33221 case_stmt(details::e_sum , details::vararg_add_op )
33222 case_stmt(details::e_prod , details::vararg_mul_op )
33223 case_stmt(details::e_avg , details::vararg_avg_op )
33224 case_stmt(details::e_min , details::vararg_min_op )
33225 case_stmt(details::e_max , details::vararg_max_op )
33226 case_stmt(details::e_mand , details::vararg_mand_op )
33227 case_stmt(details::e_mor , details::vararg_mor_op )
33228 case_stmt(details::e_multi , details::vararg_multi_op)
33229 #undef case_stmt
33230 default : return error_node();
33231 }
33232
33233 const T v = temp_node->value();
33234
33236
33238 }

References exprtk::details::node_allocator::allocate(), case_stmt, exprtk::details::e_avg, exprtk::details::e_mand, exprtk::details::e_max, exprtk::details::e_min, exprtk::details::e_mor, exprtk::details::e_multi, exprtk::details::e_prod, exprtk::details::e_sum, exprtk::parser< T >::error_node(), exprtk::details::free_node(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, and exprtk::details::expression_node< T >::value().

Referenced by exprtk::parser< T >::expression_generator< Type >::vararg_function().

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

◆ cov_optimisable()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::cov_optimisable ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
) const
inline

Definition at line 31724 of file exprtk.hpp.

31725 {
31726 if (!operation_optimisable(operation))
31727 return false;
31728 else
31729 return details::is_constant_node(branch[0]) &&
31730 details::is_variable_node(branch[1]) ;
31731 }

References exprtk::details::is_constant_node(), exprtk::details::is_variable_node(), and exprtk::parser< T >::expression_generator< Type >::operation_optimisable().

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ for_loop()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::for_loop ( expression_node_ptr initialiser,
expression_node_ptr condition,
expression_node_ptr incrementor,
expression_node_ptr loop_body,
bool  break_continue_present = false 
) const
inline

Definition at line 32562 of file exprtk.hpp.

32567 {
32568 if (
32569 !break_continue_present &&
32571 details::is_constant_node(condition)
32572 )
32573 {
32575
32576 if (details::is_true(condition))
32577 {
32578 // Infinite loops are not allowed.
32579
32583 "ERR253 - Infinite loop condition without 'break' or 'return' not allowed in for-loop",
32585
32586 result = error_node();
32587 }
32588 else
32590
32591 details::free_node(*node_allocator_, initialiser);
32592 details::free_node(*node_allocator_, condition );
32593 details::free_node(*node_allocator_, incrementor);
32594 details::free_node(*node_allocator_, loop_body );
32595
32596 return result;
32597 }
32598 else if (details::is_null_node(condition) || (0 == condition))
32599 {
32600 details::free_node(*node_allocator_, initialiser);
32601 details::free_node(*node_allocator_, condition );
32602 details::free_node(*node_allocator_, incrementor);
32603
32604 return loop_body;
32605 }
32606
32608
32609 if (!break_continue_present)
32610 {
32611 if (rtc)
32613 (
32614 initialiser,
32615 condition,
32616 incrementor,
32617 loop_body,
32618 rtc
32619 );
32620 else
32622 (
32623 initialiser,
32624 condition,
32625 incrementor,
32626 loop_body
32627 );
32628 }
32629 #ifndef exprtk_disable_break_continue
32630 else
32631 {
32632 if (rtc)
32634 (
32635 initialiser,
32636 condition,
32637 incrementor,
32638 loop_body,
32639 rtc
32640 );
32641 else
32643 (
32644 initialiser,
32645 condition,
32646 incrementor,
32647 loop_body
32648 );
32649 }
32650 #else
32651 return error_node();
32652 #endif
32653 }
loop_runtime_check_ptr get_loop_runtime_check(const loop_runtime_check::loop_types loop_type) const
Definition exprtk.hpp:32426
details::for_loop_rtc_node< T > for_loop_rtc_node_t
Definition exprtk.hpp:22207
details::for_loop_bc_node< T > for_loop_bc_node_t
Definition exprtk.hpp:22211
details::for_loop_node< T > for_loop_node_t
Definition exprtk.hpp:22204
details::for_loop_bc_rtc_node< T > for_loop_bc_rtc_node_t
Definition exprtk.hpp:22214
loop_runtime_check * loop_runtime_check_ptr
Definition exprtk.hpp:2168

References exprtk::details::node_allocator::allocate(), exprtk::parser< T >::current_state(), exprtk::loop_runtime_check::e_for_loop, exprtk::parser_error::e_parser, exprtk::parser< T >::error_node(), exprtk_error_location, exprtk::details::free_node(), exprtk::parser< T >::expression_generator< Type >::get_loop_runtime_check(), exprtk::details::is_constant_node(), exprtk::details::is_null_node(), exprtk::details::is_true(), exprtk::parser_error::make_error(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::parser< T >::parser_state::return_stmt_present, exprtk::parser< T >::set_error(), exprtk::parser< T >::state_, and exprtk::parser< T >::state_t::token.

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

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

◆ function() [1/2]

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::function ( ifunction_t f)
inline

Definition at line 33434 of file exprtk.hpp.

33435 {
33436 typedef typename details::function_N_node<Type,ifunction_t,0> function_N_node_t;
33437 return node_allocator_->allocate<function_N_node_t>(f);
33438 }

References exprtk::details::node_allocator::allocate(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Here is the call graph for this function:

◆ function() [2/2]

template<typename T >
template<typename Type >
template<std::size_t N>
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::function ( ifunction_t f,
expression_node_ptr(&)  b[N] 
)
inline

Definition at line 33381 of file exprtk.hpp.

33382 {
33383 typedef typename details::function_N_node<T,ifunction_t,N> function_N_node_t;
33384 expression_node_ptr result = synthesize_expression<function_N_node_t,N>(f,b);
33385
33386 if (0 == result)
33387 return error_node();
33388 else
33389 {
33390 // Can the function call be completely optimised?
33391 if (details::is_constant_node(result))
33392 return result;
33393 else if (!all_nodes_valid(b))
33394 {
33396 std::fill_n(b, N, reinterpret_cast<expression_node_ptr>(0));
33397
33398 return error_node();
33399 }
33400 else if (N != f->param_count)
33401 {
33403 std::fill_n(b, N, reinterpret_cast<expression_node_ptr>(0));
33404
33405 return error_node();
33406 }
33407
33408 function_N_node_t* func_node_ptr = reinterpret_cast<function_N_node_t*>(result);
33409
33410 if (!func_node_ptr->init_branches(b))
33411 {
33413 std::fill_n(b, N, reinterpret_cast<expression_node_ptr>(0));
33414
33415 return error_node();
33416 }
33417
33418 if (result && result->valid())
33419 {
33420 return result;
33421 }
33422
33425 token_t(),
33426 "ERR256 - Failed to synthesize node: function_N_node_t",
33428
33430 return error_node();
33431 }
33432 }
bool all_nodes_valid(expression_node< T > *const (&b)[N])
Definition exprtk.hpp:5860

References exprtk::parser_error::e_synthesis, exprtk::parser< T >::error_node(), exprtk_error_location, exprtk::details::free_node(), exprtk::details::is_constant_node(), exprtk::parser_error::make_error(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, exprtk::ifunction< T >::param_count, exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::parser< T >::set_error(), and exprtk::details::expression_node< T >::valid().

Referenced by exprtk::parser< T >::parse_function_call(), and exprtk::parser< T >::parse_function_call_0().

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

◆ generic_function_call()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::generic_function_call ( igeneric_function_t gf,
std::vector< expression_node_ptr > &  arg_list,
const std::size_t &  param_seq_index = std::numeric_limits<std::size_t>::max() 
)
inline

Definition at line 33482 of file exprtk.hpp.

33485 {
33486 if (!all_nodes_valid(arg_list))
33487 {
33489 return error_node();
33490 }
33491
33494
33495 const std::size_t no_psi = std::numeric_limits<std::size_t>::max();
33496
33498 std::string node_name = "Unknown";
33499
33500 if (no_psi == param_seq_index)
33501 {
33502 result = node_allocator_->allocate<alloc_type1>(arg_list,gf);
33503 node_name = "generic_function_node<igeneric_function_t>";
33504 }
33505 else
33506 {
33507 result = node_allocator_->allocate<alloc_type2>(gf, param_seq_index, arg_list);
33508 node_name = "multimode_genfunction_node<igeneric_function_t>";
33509 }
33510
33511 alloc_type1* genfunc_node_ptr = static_cast<alloc_type1*>(result);
33512
33513 assert(genfunc_node_ptr);
33514
33515 if (
33516 !arg_list.empty() &&
33517 !gf->has_side_effects() &&
33519 is_constant_foldable(arg_list)
33520 )
33521 {
33522 genfunc_node_ptr->init_branches();
33523
33524 const Type v = result->value();
33525
33527
33529 }
33530 else if (genfunc_node_ptr->init_branches())
33531 {
33532 if (result && result->valid())
33533 {
33534 parser_->state_.activate_side_effect("generic_function_call()");
33535 return result;
33536 }
33537
33540 token_t(),
33541 "ERR258 - Failed to synthesize node: " + node_name,
33543
33545 return error_node();
33546 }
33547 else
33548 {
33551
33552 return error_node();
33553 }
33554 }
bool is_constant_foldable(NodePtr(&b)[N]) const
Definition exprtk.hpp:33865

References exprtk::parser< T >::parser_state::activate_side_effect(), exprtk::details::node_allocator::allocate(), exprtk::parser_error::e_synthesis, exprtk::parser< T >::error_node(), exprtk_error_location, exprtk::details::free_all_nodes(), exprtk::details::free_node(), exprtk::function_traits::has_side_effects(), exprtk::parser< T >::expression_generator< Type >::is_constant_foldable(), exprtk::parser_error::make_error(), exprtk::details::match_impl(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::parser< T >::set_error(), exprtk::parser< T >::state_, exprtk::parser< T >::parser_state::type_check_enabled, exprtk::details::expression_node< T >::valid(), and exprtk::details::expression_node< T >::value().

Referenced by exprtk::parser< T >::parse_generic_function_call(), and exprtk::parser< T >::parse_overload_function_call().

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

◆ get_loop_runtime_check()

template<typename T >
template<typename Type >
loop_runtime_check_ptr exprtk::parser< T >::expression_generator< Type >::get_loop_runtime_check ( const loop_runtime_check::loop_types  loop_type) const
inline

Definition at line 32426 of file exprtk.hpp.

32427 {
32428 if (
32430 (loop_type == (parser_->loop_runtime_check_->loop_set & loop_type))
32431 )
32432 {
32434 }
32435
32436 return loop_runtime_check_ptr(0);
32437 }
loop_runtime_check_ptr loop_runtime_check_
Definition exprtk.hpp:41650

References exprtk::parser< T >::loop_runtime_check_, exprtk::loop_runtime_check::loop_set, and exprtk::parser< T >::expression_generator< Type >::parser_.

Referenced by exprtk::parser< T >::expression_generator< Type >::for_loop(), exprtk::parser< T >::expression_generator< Type >::repeat_until_loop(), and exprtk::parser< T >::expression_generator< Type >::while_loop().

Here is the caller graph for this function:

◆ get_operator()

template<typename T >
template<typename Type >
details::operator_type exprtk::parser< T >::expression_generator< Type >::get_operator ( const binary_functor_t bop) const
inline

Definition at line 31453 of file exprtk.hpp.

31454 {
31455 return (*inv_binary_op_map_).find(bop)->second;
31456 }

Referenced by exprtk::parser< T >::expression_generator< Type >::synthesize_vovovov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovoc_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovocov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covocov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovoc_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovoc_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vococov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovov_expression2::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovoc_expression2::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovocov_expression2::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovov_expression2::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovov_expression2::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covocov_expression2::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovoc_expression2::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovoc_expression2::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovov_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovoc_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovocov_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovov_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovov_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covocov_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovoc_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovoc_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vococov_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovov_expression4::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovoc_expression4::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovocov_expression4::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovov_expression4::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovov_expression4::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covocov_expression4::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovoc_expression4::process(), and exprtk::parser< T >::expression_generator< Type >::synthesize_covovoc_expression4::process().

Here is the caller graph for this function:

◆ get_vector_access_runtime_check()

template<typename T >
template<typename Type >
vector_access_runtime_check_ptr exprtk::parser< T >::expression_generator< Type >::get_vector_access_runtime_check ( ) const
inline

Definition at line 32439 of file exprtk.hpp.

32440 {
32442 }
vector_access_runtime_check_ptr vector_access_runtime_check_
Definition exprtk.hpp:41651

References exprtk::parser< T >::expression_generator< Type >::parser_, and exprtk::parser< T >::vector_access_runtime_check_.

Referenced by exprtk::parser< T >::expression_generator< Type >::vector_element().

Here is the caller graph for this function:

◆ init_synthesize_map()

template<typename T >
template<typename Type >
void exprtk::parser< T >::expression_generator< Type >::init_synthesize_map ( )
inline

Definition at line 31309 of file exprtk.hpp.

31310 {
31311 #ifndef exprtk_disable_enhanced_features
31315
31316 #define register_synthezier(S) \
31317 synthesize_map_[S ::node_type::id()] = S ::process; \
31318
31319 register_synthezier(synthesize_vovov_expression0)
31320 register_synthezier(synthesize_vovov_expression1)
31321 register_synthezier(synthesize_vovoc_expression0)
31322 register_synthezier(synthesize_vovoc_expression1)
31323 register_synthezier(synthesize_vocov_expression0)
31324 register_synthezier(synthesize_vocov_expression1)
31325 register_synthezier(synthesize_covov_expression0)
31326 register_synthezier(synthesize_covov_expression1)
31327 register_synthezier(synthesize_covoc_expression0)
31328 register_synthezier(synthesize_covoc_expression1)
31329 register_synthezier(synthesize_cocov_expression1)
31330 register_synthezier(synthesize_vococ_expression0)
31331
31332 register_synthezier(synthesize_vovovov_expression0)
31333 register_synthezier(synthesize_vovovoc_expression0)
31334 register_synthezier(synthesize_vovocov_expression0)
31335 register_synthezier(synthesize_vocovov_expression0)
31336 register_synthezier(synthesize_covovov_expression0)
31337 register_synthezier(synthesize_covocov_expression0)
31338 register_synthezier(synthesize_vocovoc_expression0)
31339 register_synthezier(synthesize_covovoc_expression0)
31340 register_synthezier(synthesize_vococov_expression0)
31341
31342 register_synthezier(synthesize_vovovov_expression1)
31343 register_synthezier(synthesize_vovovoc_expression1)
31344 register_synthezier(synthesize_vovocov_expression1)
31345 register_synthezier(synthesize_vocovov_expression1)
31346 register_synthezier(synthesize_covovov_expression1)
31347 register_synthezier(synthesize_covocov_expression1)
31348 register_synthezier(synthesize_vocovoc_expression1)
31349 register_synthezier(synthesize_covovoc_expression1)
31350 register_synthezier(synthesize_vococov_expression1)
31351
31352 register_synthezier(synthesize_vovovov_expression2)
31353 register_synthezier(synthesize_vovovoc_expression2)
31354 register_synthezier(synthesize_vovocov_expression2)
31355 register_synthezier(synthesize_vocovov_expression2)
31356 register_synthezier(synthesize_covovov_expression2)
31357 register_synthezier(synthesize_covocov_expression2)
31358 register_synthezier(synthesize_vocovoc_expression2)
31359 register_synthezier(synthesize_covovoc_expression2)
31360
31361 register_synthezier(synthesize_vovovov_expression3)
31362 register_synthezier(synthesize_vovovoc_expression3)
31363 register_synthezier(synthesize_vovocov_expression3)
31364 register_synthezier(synthesize_vocovov_expression3)
31365 register_synthezier(synthesize_covovov_expression3)
31366 register_synthezier(synthesize_covocov_expression3)
31367 register_synthezier(synthesize_vocovoc_expression3)
31368 register_synthezier(synthesize_covovoc_expression3)
31369 register_synthezier(synthesize_vococov_expression3)
31370
31371 register_synthezier(synthesize_vovovov_expression4)
31372 register_synthezier(synthesize_vovovoc_expression4)
31373 register_synthezier(synthesize_vovocov_expression4)
31374 register_synthezier(synthesize_vocovov_expression4)
31375 register_synthezier(synthesize_covovov_expression4)
31376 register_synthezier(synthesize_covocov_expression4)
31377 register_synthezier(synthesize_vocovoc_expression4)
31378 register_synthezier(synthesize_covovoc_expression4)
31379
31380 #undef register_synthezier
31381 #endif
31382 }
#define register_synthezier(S)
static expression_node_ptr process(expression_generator< Type > &expr_gen, const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:35784
static expression_node_ptr process(expression_generator< Type > &expr_gen, const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:35819
static expression_node_ptr process(expression_generator< Type > &expr_gen, const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:35760

References exprtk::parser< T >::expression_generator< Type >::synthesize_vov_expression::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_cov_expression::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_voc_expression::process(), register_synthezier, and exprtk::parser< T >::expression_generator< Type >::synthesize_map_.

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

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

◆ is_assignment_operation()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::is_assignment_operation ( const details::operator_type operation) const
inline

Definition at line 31594 of file exprtk.hpp.

31595 {
31596 return (
31597 (details::e_addass == operation) ||
31598 (details::e_subass == operation) ||
31599 (details::e_mulass == operation) ||
31600 (details::e_divass == operation) ||
31601 (details::e_modass == operation)
31602 ) &&
31604 }
bool assignment_enabled(const details::operator_type &assignment) const
Definition exprtk.hpp:23935
settings_store settings_
Definition exprtk.hpp:41614

References exprtk::parser< T >::settings_store::assignment_enabled(), exprtk::details::e_addass, exprtk::details::e_divass, exprtk::details::e_modass, exprtk::details::e_mulass, exprtk::details::e_subass, exprtk::parser< T >::expression_generator< Type >::parser_, and exprtk::parser< T >::settings_.

Referenced by exprtk::parser< T >::expression_generator< Type >::is_invalid_assignment_op(), and exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ is_constant_foldable() [1/2]

template<typename T >
template<typename Type >
template<typename NodePtr , typename Allocator , template< typename, typename > class Sequence>
bool exprtk::parser< T >::expression_generator< Type >::is_constant_foldable ( const Sequence< NodePtr, Allocator > &  b) const
inlineprivate

Definition at line 33881 of file exprtk.hpp.

33882 {
33883 for (std::size_t i = 0; i < b.size(); ++i)
33884 {
33885 if (0 == b[i])
33886 return false;
33887 else if (!details::is_constant_node(b[i]))
33888 return false;
33889 }
33890
33891 return true;
33892 }

References exprtk::details::is_constant_node().

Here is the call graph for this function:

◆ is_constant_foldable() [2/2]

template<typename T >
template<typename Type >
template<std::size_t N, typename NodePtr >
bool exprtk::parser< T >::expression_generator< Type >::is_constant_foldable ( NodePtr(&)  b[N]) const
inlineprivate

Definition at line 33865 of file exprtk.hpp.

33866 {
33867 for (std::size_t i = 0; i < N; ++i)
33868 {
33869 if (0 == b[i])
33870 return false;
33871 else if (!details::is_constant_node(b[i]))
33872 return false;
33873 }
33874
33875 return true;
33876 }

References exprtk::details::is_constant_node().

Referenced by exprtk::parser< T >::expression_generator< Type >::generic_function_call(), exprtk::parser< T >::expression_generator< Type >::multi_switch_statement(), exprtk::parser< T >::expression_generator< Type >::special_function(), exprtk::parser< T >::expression_generator< Type >::special_function(), exprtk::parser< T >::expression_generator< Type >::string_function_call(), exprtk::parser< T >::expression_generator< Type >::switch_statement(), exprtk::parser< T >::expression_generator< Type >::vararg_function(), and exprtk::parser< T >::expression_generator< Type >::vararg_function_call().

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

◆ is_constpow_operation()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::is_constpow_operation ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
) const
inline

Definition at line 31866 of file exprtk.hpp.

31867 {
31868 if (
31869 !details::is_constant_node(branch[1]) ||
31870 details::is_constant_node(branch[0]) ||
31871 details::is_variable_node(branch[0]) ||
31872 details::is_vector_node (branch[0]) ||
31874 )
31875 return false;
31876
31877 const Type c = static_cast<details::literal_node<Type>*>(branch[1])->value();
31878
31879 return cardinal_pow_optimisable(operation, c);
31880 }
bool cardinal_pow_optimisable(const details::operator_type &operation, const T &c) const
Definition exprtk.hpp:34764
bool is_vector_node(const expression_node< T > *node)
Definition exprtk.hpp:5750
bool is_generally_string_node(const expression_node< T > *node)
Definition exprtk.hpp:18985

References exprtk::parser< T >::expression_generator< Type >::cardinal_pow_optimisable(), exprtk::details::is_constant_node(), exprtk::details::is_generally_string_node(), exprtk::details::is_variable_node(), and exprtk::details::is_vector_node().

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ is_invalid_assignment_op()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::is_invalid_assignment_op ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
) const
inline

Definition at line 31837 of file exprtk.hpp.

31838 {
31839 if (is_assignment_operation(operation))
31840 {
31841 const bool b1_is_genstring = details::is_generally_string_node(branch[1]);
31842
31843 if (details::is_string_node(branch[0]))
31844 return !b1_is_genstring;
31845 else if (details::is_literal_node(branch[0]))
31846 return true;
31847 else
31848 return (
31849 !details::is_variable_node (branch[0]) &&
31850 !details::is_vector_elem_node (branch[0]) &&
31851 !details::is_vector_celem_node (branch[0]) &&
31852 !details::is_vector_elem_rtc_node (branch[0]) &&
31853 !details::is_vector_celem_rtc_node (branch[0]) &&
31858 !details::is_vector_node (branch[0])
31859 )
31860 || b1_is_genstring;
31861 }
31862 else
31863 return false;
31864 }
bool is_assignment_operation(const details::operator_type &operation) const
Definition exprtk.hpp:31594
bool is_vector_elem_rtc_node(const expression_node< T > *node)
Definition exprtk.hpp:5714
bool is_rebasevector_elem_node(const expression_node< T > *node)
Definition exprtk.hpp:5726
bool is_vector_celem_node(const expression_node< T > *node)
Definition exprtk.hpp:5708
bool is_literal_node(const expression_node< T > *node)
Definition exprtk.hpp:5655
bool is_rebasevector_celem_rtc_node(const expression_node< T > *node)
Definition exprtk.hpp:5738
bool is_vector_celem_rtc_node(const expression_node< T > *node)
Definition exprtk.hpp:5720
bool is_vector_elem_node(const expression_node< T > *node)
Definition exprtk.hpp:5702
bool is_rebasevector_celem_node(const expression_node< T > *node)
Definition exprtk.hpp:5744
bool is_rebasevector_elem_rtc_node(const expression_node< T > *node)
Definition exprtk.hpp:5732

References exprtk::parser< T >::expression_generator< Type >::is_assignment_operation(), exprtk::details::is_generally_string_node(), exprtk::details::is_literal_node(), exprtk::details::is_rebasevector_celem_node(), exprtk::details::is_rebasevector_celem_rtc_node(), exprtk::details::is_rebasevector_elem_node(), exprtk::details::is_rebasevector_elem_rtc_node(), exprtk::details::is_string_node(), exprtk::details::is_variable_node(), exprtk::details::is_vector_celem_node(), exprtk::details::is_vector_celem_rtc_node(), exprtk::details::is_vector_elem_node(), exprtk::details::is_vector_elem_rtc_node(), and exprtk::details::is_vector_node().

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ is_invalid_break_continue_op()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::is_invalid_break_continue_op ( expression_node_ptr(&)  branch[2]) const
inline

Definition at line 31882 of file exprtk.hpp.

31883 {
31884 return (
31885 details::is_break_node (branch[0]) ||
31886 details::is_break_node (branch[1]) ||
31887 details::is_continue_node(branch[0]) ||
31888 details::is_continue_node(branch[1])
31889 );
31890 }
bool is_continue_node(const expression_node< T > *node)
Definition exprtk.hpp:5803
bool is_break_node(const expression_node< T > *node)
Definition exprtk.hpp:5797

References exprtk::details::is_break_node(), and exprtk::details::is_continue_node().

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ is_invalid_string_op() [1/2]

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::is_invalid_string_op ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
) const
inline

Definition at line 31892 of file exprtk.hpp.

31893 {
31894 const bool b0_string = is_generally_string_node(branch[0]);
31895 const bool b1_string = is_generally_string_node(branch[1]);
31896
31897 bool result = false;
31898
31899 if (b0_string != b1_string)
31900 result = true;
31901 else if (!valid_string_operation(operation) && b0_string && b1_string)
31902 result = true;
31903
31904 if (result)
31905 {
31906 parser_->set_synthesis_error("Invalid string operation");
31907 }
31908
31909 return result;
31910 }
bool valid_string_operation(const details::operator_type &operation) const
Definition exprtk.hpp:31607

References exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::parser< T >::set_synthesis_error(), and exprtk::parser< T >::expression_generator< Type >::valid_string_operation().

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()(), and exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ is_invalid_string_op() [2/2]

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::is_invalid_string_op ( const details::operator_type operation,
expression_node_ptr(&)  branch[3] 
) const
inline

Definition at line 31912 of file exprtk.hpp.

31913 {
31914 const bool b0_string = is_generally_string_node(branch[0]);
31915 const bool b1_string = is_generally_string_node(branch[1]);
31916 const bool b2_string = is_generally_string_node(branch[2]);
31917
31918 bool result = false;
31919
31920 if ((b0_string != b1_string) || (b1_string != b2_string))
31921 result = true;
31922 else if ((details::e_inrange != operation) && b0_string && b1_string && b2_string)
31923 result = true;
31924
31925 if (result)
31926 {
31927 parser_->set_synthesis_error("Invalid string operation");
31928 }
31929
31930 return result;
31931 }

References exprtk::details::e_inrange, exprtk::parser< T >::expression_generator< Type >::parser_, and exprtk::parser< T >::set_synthesis_error().

Here is the call graph for this function:

◆ is_null_present()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::is_null_present ( expression_node_ptr(&)  branch[2]) const
inline

Definition at line 31965 of file exprtk.hpp.

31966 {
31967 return (
31968 details::is_null_node(branch[0]) ||
31969 details::is_null_node(branch[1])
31970 );
31971 }

References exprtk::details::is_null_node().

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ is_shortcircuit_expression()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::is_shortcircuit_expression ( const details::operator_type operation) const
inline

Definition at line 31951 of file exprtk.hpp.

31952 {
31953 return (
31954 (details::e_scand == operation) ||
31955 (details::e_scor == operation)
31956 );
31957 }

References exprtk::details::e_scand, and exprtk::details::e_scor.

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

Here is the caller graph for this function:

◆ is_string_operation() [1/2]

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::is_string_operation ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
) const
inline

Definition at line 31933 of file exprtk.hpp.

31934 {
31935 const bool b0_string = is_generally_string_node(branch[0]);
31936 const bool b1_string = is_generally_string_node(branch[1]);
31937
31938 return (b0_string && b1_string && valid_string_operation(operation));
31939 }

References exprtk::parser< T >::expression_generator< Type >::valid_string_operation().

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()(), and exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ is_string_operation() [2/2]

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::is_string_operation ( const details::operator_type operation,
expression_node_ptr(&)  branch[3] 
) const
inline

Definition at line 31941 of file exprtk.hpp.

31942 {
31943 const bool b0_string = is_generally_string_node(branch[0]);
31944 const bool b1_string = is_generally_string_node(branch[1]);
31945 const bool b2_string = is_generally_string_node(branch[2]);
31946
31947 return (b0_string && b1_string && b2_string && (details::e_inrange == operation));
31948 }

References exprtk::details::e_inrange.

◆ is_vector_arithmetic_operation()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::is_vector_arithmetic_operation ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
) const
inline

Definition at line 31995 of file exprtk.hpp.

31996 {
31997 if (!is_ivector_node(branch[0]) && !is_ivector_node(branch[1]))
31998 return false;
31999 else
32000 return (
32001 (details::e_add == operation) ||
32002 (details::e_sub == operation) ||
32003 (details::e_mul == operation) ||
32004 (details::e_div == operation) ||
32005 (details::e_pow == operation)
32006 );
32007 }
bool is_ivector_node(const expression_node< T > *node)
Definition exprtk.hpp:5756

References exprtk::details::e_add, exprtk::details::e_div, exprtk::details::e_mul, exprtk::details::e_pow, and exprtk::details::e_sub.

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

Here is the caller graph for this function:

◆ is_vector_eqineq_logic_operation()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::is_vector_eqineq_logic_operation ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
) const
inline

Definition at line 31973 of file exprtk.hpp.

31974 {
31975 if (!is_ivector_node(branch[0]) && !is_ivector_node(branch[1]))
31976 return false;
31977 else
31978 return (
31979 (details::e_lt == operation) ||
31980 (details::e_lte == operation) ||
31981 (details::e_gt == operation) ||
31982 (details::e_gte == operation) ||
31983 (details::e_eq == operation) ||
31984 (details::e_ne == operation) ||
31985 (details::e_equal == operation) ||
31986 (details::e_and == operation) ||
31987 (details::e_nand == operation) ||
31988 (details::e_or == operation) ||
31989 (details::e_nor == operation) ||
31990 (details::e_xor == operation) ||
31991 (details::e_xnor == operation)
31992 );
31993 }

References exprtk::details::e_and, exprtk::details::e_eq, exprtk::details::e_equal, exprtk::details::e_gt, exprtk::details::e_gte, exprtk::details::e_lt, exprtk::details::e_lte, exprtk::details::e_nand, exprtk::details::e_ne, exprtk::details::e_nor, exprtk::details::e_or, exprtk::details::e_xnor, and exprtk::details::e_xor.

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

Here is the caller graph for this function:

◆ lodge_assignment()

template<typename T >
template<typename Type >
void exprtk::parser< T >::expression_generator< Type >::lodge_assignment ( symbol_type  cst,
expression_node_ptr  node 
)
inlineprivate

Definition at line 33894 of file exprtk.hpp.

33895 {
33896 parser_->state_.activate_side_effect("lodge_assignment()");
33897
33899 return;
33900
33901 std::string symbol_name;
33902
33903 switch (cst)
33904 {
33905 case e_st_variable : symbol_name = parser_->symtab_store_
33906 .get_variable_name(node);
33907 break;
33908
33909 #ifndef exprtk_disable_string_capabilities
33910 case e_st_string : symbol_name = parser_->symtab_store_
33911 .get_stringvar_name(node);
33912 break;
33913 #endif
33914
33915 case e_st_vector : {
33917
33918 vector_holder_t& vh = static_cast<vector_node_t*>(node)->vec_holder();
33919
33920 symbol_name = parser_->symtab_store_.get_vector_name(&vh);
33921 }
33922 break;
33923
33924 case e_st_vecelem : {
33926
33927 vector_holder_t& vh = static_cast<vector_elem_node_t*>(node)->vec_holder();
33928
33929 symbol_name = parser_->symtab_store_.get_vector_name(&vh);
33930
33931 cst = e_st_vector;
33932 }
33933 break;
33934
33935 default : return;
33936 }
33937
33938 if (!symbol_name.empty())
33939 {
33940 parser_->dec_.add_assignment(symbol_name,cst);
33941 }
33942 }
void add_assignment(const std::string &symbol, const symbol_type st)
Definition exprtk.hpp:23629
dependent_entity_collector dec_
Definition exprtk.hpp:41618
symtab_store symtab_store_
Definition exprtk.hpp:41617
details::vector_holder< T > vector_holder_t
Definition exprtk.hpp:22257
std::string get_vector_name(const vector_holder_ptr &ptr) const
Definition exprtk.hpp:23346
std::string get_stringvar_name(const expression_node_ptr &ptr) const
Definition exprtk.hpp:23352
std::string get_variable_name(const expression_node_ptr &ptr) const
Definition exprtk.hpp:23341

References exprtk::parser< T >::parser_state::activate_side_effect(), exprtk::parser< T >::dependent_entity_collector::add_assignment(), exprtk::parser< T >::dependent_entity_collector::collect_assignments(), exprtk::parser< T >::dec_, exprtk::parser< T >::e_st_string, exprtk::parser< T >::e_st_variable, exprtk::parser< T >::e_st_vecelem, exprtk::parser< T >::e_st_vector, exprtk::parser< T >::symtab_store::get_stringvar_name(), exprtk::parser< T >::symtab_store::get_variable_name(), exprtk::parser< T >::symtab_store::get_vector_name(), exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::parser< T >::state_, and exprtk::parser< T >::symtab_store_.

Referenced by exprtk::parser< T >::expression_generator< Type >::synthesize_assignment_expression(), and exprtk::parser< T >::expression_generator< Type >::synthesize_assignment_operation_expression().

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

◆ multi_switch_statement()

template<typename T >
template<typename Type >
template<typename Allocator , template< typename, typename > class Sequence>
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::multi_switch_statement ( Sequence< expression_node_ptr, Allocator > &  arg_list)
inline

Definition at line 32871 of file exprtk.hpp.

32872 {
32873 if (!all_nodes_valid(arg_list))
32874 {
32876
32877 return error_node();
32878 }
32879 else if (is_constant_foldable(arg_list))
32880 return const_optimise_mswitch(arg_list);
32881 else
32883 }
expression_node_ptr const_optimise_mswitch(Sequence< expression_node_ptr, Allocator > &arg_list)
Definition exprtk.hpp:32693

References exprtk::details::node_allocator::allocate(), exprtk::parser< T >::expression_generator< Type >::const_optimise_mswitch(), exprtk::parser< T >::error_node(), exprtk::details::free_all_nodes(), exprtk::parser< T >::expression_generator< Type >::is_constant_foldable(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

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

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

◆ operation_optimisable()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::operation_optimisable ( const details::operator_type operation) const
inline

Definition at line 31656 of file exprtk.hpp.

31657 {
31658 return (details::e_add == operation) ||
31659 (details::e_sub == operation) ||
31660 (details::e_mul == operation) ||
31661 (details::e_div == operation) ||
31662 (details::e_mod == operation) ||
31663 (details::e_pow == operation) ||
31664 (details::e_lt == operation) ||
31665 (details::e_lte == operation) ||
31666 (details::e_gt == operation) ||
31667 (details::e_gte == operation) ||
31668 (details::e_eq == operation) ||
31669 (details::e_ne == operation) ||
31670 (details::e_and == operation) ||
31671 (details::e_nand == operation) ||
31672 (details::e_or == operation) ||
31673 (details::e_nor == operation) ||
31674 (details::e_xor == operation) ||
31675 (details::e_xnor == operation) ;
31676 }

References exprtk::details::e_add, exprtk::details::e_and, exprtk::details::e_div, exprtk::details::e_eq, exprtk::details::e_gt, exprtk::details::e_gte, exprtk::details::e_lt, exprtk::details::e_lte, exprtk::details::e_mod, exprtk::details::e_mul, exprtk::details::e_nand, exprtk::details::e_ne, exprtk::details::e_nor, exprtk::details::e_or, exprtk::details::e_pow, exprtk::details::e_sub, exprtk::details::e_xnor, and exprtk::details::e_xor.

Referenced by exprtk::parser< T >::expression_generator< Type >::binext_optimisable(), exprtk::parser< T >::expression_generator< Type >::boc_optimisable(), exprtk::parser< T >::expression_generator< Type >::bov_optimisable(), exprtk::parser< T >::expression_generator< Type >::cob_optimisable(), exprtk::parser< T >::expression_generator< Type >::cov_optimisable(), exprtk::parser< T >::expression_generator< Type >::synthesize_expression(), exprtk::parser< T >::expression_generator< Type >::uvouv_optimisable(), exprtk::parser< T >::expression_generator< Type >::vob_optimisable(), exprtk::parser< T >::expression_generator< Type >::voc_optimisable(), and exprtk::parser< T >::expression_generator< Type >::vov_optimisable().

Here is the caller graph for this function:

◆ operator()() [1/11]

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::operator() ( const details::operator_type operation,
expression_node_ptr b0,
expression_node_ptr b1 
)
inline

Definition at line 32204 of file exprtk.hpp.

32205 {
32207
32208 if ((0 != b0) && (0 != b1))
32209 {
32210 expression_node_ptr branch[2] = { b0, b1 };
32211 result = expression_generator<Type>::operator()(operation, branch);
32212 b0 = branch[0];
32213 b1 = branch[1];
32214 }
32215
32216 return result;
32217 }
expression_node_ptr operator()(const Type &v) const
Definition exprtk.hpp:31458

References exprtk::parser< T >::error_node(), and exprtk::parser< T >::expression_generator< Type >::operator()().

Here is the call graph for this function:

◆ operator()() [2/11]

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::operator() ( const details::operator_type operation,
expression_node_ptr  b0 
)
inline

Definition at line 32198 of file exprtk.hpp.

32199 {
32200 expression_node_ptr branch[1] = { b0 };
32201 return (*this)(operation,branch);
32202 }

◆ operator()() [3/11]

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::operator() ( const details::operator_type operation,
expression_node_ptr(&)  branch[1] 
)
inline

Definition at line 31560 of file exprtk.hpp.

31561 {
31562 if (0 == branch[0])
31563 {
31564 return error_node();
31565 }
31566 else if (details::is_null_node(branch[0]))
31567 {
31568 return branch[0];
31569 }
31570 else if (details::is_break_node(branch[0]))
31571 {
31572 return error_node();
31573 }
31574 else if (details::is_continue_node(branch[0]))
31575 {
31576 return error_node();
31577 }
31578 else if (details::is_constant_node(branch[0]))
31579 {
31580 return synthesize_expression<unary_node_t,1>(operation,branch);
31581 }
31582 else if (unary_optimisable(operation) && details::is_variable_node(branch[0]))
31583 {
31584 return synthesize_uv_expression(operation,branch);
31585 }
31586 else if (unary_optimisable(operation) && details::is_ivector_node(branch[0]))
31587 {
31588 return synthesize_uvec_expression(operation,branch);
31589 }
31590 else
31591 return synthesize_unary_expression(operation,branch);
31592 }
expression_node_ptr synthesize_uvec_expression(const details::operator_type &operation, expression_node_ptr(&branch)[1])
Definition exprtk.hpp:32966
expression_node_ptr synthesize_uv_expression(const details::operator_type &operation, expression_node_ptr(&branch)[1])
Definition exprtk.hpp:32949
expression_node_ptr synthesize_unary_expression(const details::operator_type &operation, expression_node_ptr(&branch)[1])
Definition exprtk.hpp:32982
bool unary_optimisable(const details::operator_type &operation) const
Definition exprtk.hpp:31488

References exprtk::parser< T >::error_node(), exprtk::details::is_break_node(), exprtk::details::is_constant_node(), exprtk::details::is_continue_node(), exprtk::details::is_ivector_node(), exprtk::details::is_null_node(), exprtk::details::is_variable_node(), exprtk::parser< T >::expression_generator< Type >::synthesize_unary_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_uv_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_uvec_expression(), and exprtk::parser< T >::expression_generator< Type >::unary_optimisable().

Here is the call graph for this function:

◆ operator()() [4/11]

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::operator() ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
)
inline

Definition at line 32009 of file exprtk.hpp.

32010 {
32011 if ((0 == branch[0]) || (0 == branch[1]))
32012 {
32016 "ERR241 - Invalid branches received for operator '" + details::to_str(operation) + "'",
32018
32019 return error_node();
32020 }
32021 else if (is_invalid_string_op(operation,branch))
32022 {
32026 "ERR242 - Invalid branch pair for string operator '" + details::to_str(operation) + "'",
32028
32029 return error_node();
32030 }
32031 else if (is_invalid_assignment_op(operation,branch))
32032 {
32036 "ERR243 - Invalid branch pair for assignment operator '" + details::to_str(operation) + "'",
32038
32039 return error_node();
32040 }
32041 else if (is_invalid_break_continue_op(branch))
32042 {
32046 "ERR244 - Invalid branch pair for break/continue operator '" + details::to_str(operation) + "'",
32048
32049 return error_node();
32050 }
32051 else if (details::e_assign == operation)
32052 {
32053 return synthesize_assignment_expression(operation, branch);
32054 }
32055 else if (details::e_swap == operation)
32056 {
32057 return synthesize_swap_expression(branch);
32058 }
32059 else if (is_assignment_operation(operation))
32060 {
32061 return synthesize_assignment_operation_expression(operation, branch);
32062 }
32063 else if (is_vector_eqineq_logic_operation(operation, branch))
32064 {
32065 return synthesize_veceqineqlogic_operation_expression(operation, branch);
32066 }
32067 else if (is_vector_arithmetic_operation(operation, branch))
32068 {
32069 return synthesize_vecarithmetic_operation_expression(operation, branch);
32070 }
32071 else if (is_shortcircuit_expression(operation))
32072 {
32073 return synthesize_shortcircuit_expression(operation, branch);
32074 }
32075 else if (is_string_operation(operation, branch))
32076 {
32077 return synthesize_string_expression(operation, branch);
32078 }
32079 else if (is_null_present(branch))
32080 {
32081 return synthesize_null_expression(operation, branch);
32082 }
32083 #ifndef exprtk_disable_cardinal_pow_optimisation
32084 else if (is_constpow_operation(operation, branch))
32085 {
32086 return cardinal_pow_optimisation(branch);
32087 }
32088 #endif
32089
32091
32092 #ifndef exprtk_disable_enhanced_features
32093 if (synthesize_expression(operation, branch, result))
32094 {
32095 return result;
32096 }
32097 else
32098 #endif
32099
32100 {
32101 /*
32102 Possible reductions:
32103 1. c o cob -> cob
32104 2. cob o c -> cob
32105 3. c o boc -> boc
32106 4. boc o c -> boc
32107 */
32108 result = error_node();
32109
32110 if (cocob_optimisable(operation, branch))
32111 {
32112 result = synthesize_cocob_expression::process((*this), operation, branch);
32113 }
32114 else if (coboc_optimisable(operation, branch) && (0 == result))
32115 {
32116 result = synthesize_coboc_expression::process((*this), operation, branch);
32117 }
32118
32119 if (result)
32120 return result;
32121 }
32122
32123 if (uvouv_optimisable(operation, branch))
32124 {
32125 return synthesize_uvouv_expression(operation, branch);
32126 }
32127 else if (vob_optimisable(operation, branch))
32128 {
32129 return synthesize_vob_expression::process((*this), operation, branch);
32130 }
32131 else if (bov_optimisable(operation, branch))
32132 {
32133 return synthesize_bov_expression::process((*this), operation, branch);
32134 }
32135 else if (cob_optimisable(operation, branch))
32136 {
32137 return synthesize_cob_expression::process((*this), operation, branch);
32138 }
32139 else if (boc_optimisable(operation, branch))
32140 {
32141 return synthesize_boc_expression::process((*this), operation, branch);
32142 }
32143 #ifndef exprtk_disable_enhanced_features
32144 else if (cov_optimisable(operation, branch))
32145 {
32146 return synthesize_cov_expression::process((*this), operation, branch);
32147 }
32148 #endif
32149 else if (binext_optimisable(operation, branch))
32150 {
32151 return synthesize_binary_ext_expression::process((*this), operation, branch);
32152 }
32153 else
32154 return synthesize_expression<binary_node_t,2>(operation, branch);
32155 }
bool coboc_optimisable(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:31785
bool boc_optimisable(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:31760
bool cov_optimisable(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:31724
expression_node_ptr synthesize_veceqineqlogic_operation_expression(const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:34374
bool is_invalid_string_op(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:31892
bool is_invalid_assignment_op(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:31837
expression_node_ptr synthesize_swap_expression(expression_node_ptr(&branch)[2])
Definition exprtk.hpp:34552
bool is_null_present(expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:31965
bool synthesize_expression(const details::operator_type &operation, expression_node_ptr(&branch)[2], expression_node_ptr &result)
Definition exprtk.hpp:35735
bool is_vector_eqineq_logic_operation(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:31973
bool binext_optimisable(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:31828
expression_node_ptr synthesize_shortcircuit_expression(const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:34634
expression_node_ptr synthesize_uvouv_expression(const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:40528
bool is_string_operation(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:31933
bool is_constpow_operation(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:31866
bool is_vector_arithmetic_operation(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:31995
bool is_invalid_break_continue_op(expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:31882
expression_node_ptr synthesize_string_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:40932
expression_node_ptr synthesize_assignment_expression(const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:34023
bool vob_optimisable(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:31810
expression_node_ptr synthesize_null_expression(const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:41135
expression_node_ptr synthesize_assignment_operation_expression(const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:34102
expression_node_ptr synthesize_vecarithmetic_operation_expression(const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:34466
bool cob_optimisable(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:31751
expression_node_ptr cardinal_pow_optimisation(const T &v, const T &c)
Definition exprtk.hpp:34743
bool bov_optimisable(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:31819
bool is_shortcircuit_expression(const details::operator_type &operation) const
Definition exprtk.hpp:31951
bool uvouv_optimisable(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:31801
bool cocob_optimisable(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:31769
std::string to_str(int i)
Definition exprtk.hpp:277
static expression_node_ptr process(expression_generator< Type > &expr_gen, const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:34807
static expression_node_ptr process(expression_generator< Type > &expr_gen, const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:35256
static expression_node_ptr process(expression_generator< Type > &expr_gen, const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:35032
static expression_node_ptr process(expression_generator< Type > &expr_gen, const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:35118
static expression_node_ptr process(expression_generator< Type > &expr_gen, const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:35580
static expression_node_ptr process(expression_generator< Type > &expr_gen, const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:35375
static expression_node_ptr process(expression_generator< Type > &expr_gen, const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:34957

References exprtk::parser< T >::expression_generator< Type >::binext_optimisable(), exprtk::parser< T >::expression_generator< Type >::boc_optimisable(), exprtk::parser< T >::expression_generator< Type >::bov_optimisable(), exprtk::parser< T >::expression_generator< Type >::cardinal_pow_optimisation(), exprtk::parser< T >::expression_generator< Type >::cob_optimisable(), exprtk::parser< T >::expression_generator< Type >::coboc_optimisable(), exprtk::parser< T >::expression_generator< Type >::cocob_optimisable(), exprtk::parser< T >::expression_generator< Type >::cov_optimisable(), exprtk::parser< T >::current_state(), exprtk::details::e_assign, exprtk::details::e_swap, exprtk::parser_error::e_syntax, exprtk::parser< T >::error_node(), exprtk_error_location, exprtk::parser< T >::expression_generator< Type >::is_assignment_operation(), exprtk::parser< T >::expression_generator< Type >::is_constpow_operation(), exprtk::parser< T >::expression_generator< Type >::is_invalid_assignment_op(), exprtk::parser< T >::expression_generator< Type >::is_invalid_break_continue_op(), exprtk::parser< T >::expression_generator< Type >::is_invalid_string_op(), exprtk::parser< T >::expression_generator< Type >::is_null_present(), exprtk::parser< T >::expression_generator< Type >::is_shortcircuit_expression(), exprtk::parser< T >::expression_generator< Type >::is_string_operation(), exprtk::parser< T >::expression_generator< Type >::is_vector_arithmetic_operation(), exprtk::parser< T >::expression_generator< Type >::is_vector_eqineq_logic_operation(), exprtk::parser_error::make_error(), exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::parser< T >::expression_generator< Type >::synthesize_binary_ext_expression::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vob_expression::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_bov_expression::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_cob_expression::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_boc_expression::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_cocob_expression::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_coboc_expression::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_cov_expression::process(), exprtk::parser< T >::set_error(), exprtk::parser< T >::expression_generator< Type >::synthesize_assignment_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_assignment_operation_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_null_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_shortcircuit_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_string_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_swap_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_uvouv_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_vecarithmetic_operation_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_veceqineqlogic_operation_expression(), exprtk::details::to_str(), exprtk::parser< T >::state_t::token, exprtk::parser< T >::expression_generator< Type >::uvouv_optimisable(), and exprtk::parser< T >::expression_generator< Type >::vob_optimisable().

Here is the call graph for this function:

◆ operator()() [5/11]

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::operator() ( const details::operator_type operation,
expression_node_ptr(&)  branch[3] 
)
inline

Definition at line 32157 of file exprtk.hpp.

32158 {
32159 if (
32160 (0 == branch[0]) ||
32161 (0 == branch[1]) ||
32162 (0 == branch[2])
32163 )
32164 {
32166
32170 "ERR245 - Invalid branches operator '" + details::to_str(operation) + "'",
32172
32173 return error_node();
32174 }
32175 else if (is_invalid_string_op(operation, branch))
32176 {
32180 "ERR246 - Invalid branches for string operator '" + details::to_str(operation) + "'",
32182
32183 return error_node();
32184 }
32185 else if (is_string_operation(operation, branch))
32186 {
32187 return synthesize_string_expression(operation, branch);
32188 }
32189 else
32190 return synthesize_expression<trinary_node_t,3>(operation, branch);
32191 }

References exprtk::parser< T >::current_state(), exprtk::parser_error::e_syntax, exprtk::parser< T >::error_node(), exprtk_error_location, exprtk::details::free_all_nodes(), exprtk::parser< T >::expression_generator< Type >::is_invalid_string_op(), exprtk::parser< T >::expression_generator< Type >::is_string_operation(), exprtk::parser_error::make_error(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::parser< T >::set_error(), exprtk::parser< T >::expression_generator< Type >::synthesize_string_expression(), exprtk::details::to_str(), and exprtk::parser< T >::state_t::token.

Here is the call graph for this function:

◆ operator()() [6/11]

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::operator() ( const details::operator_type operation,
expression_node_ptr(&)  branch[4] 
)
inline

Definition at line 32193 of file exprtk.hpp.

32194 {
32195 return synthesize_expression<quaternary_node_t,4>(operation,branch);
32196 }

◆ operator()() [7/11]

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::operator() ( const std::string &  s) const
inline

Definition at line 31464 of file exprtk.hpp.

31465 {
31467 }
details::string_literal_node< T > string_literal_node_t
Definition exprtk.hpp:22231

References exprtk::details::node_allocator::allocate(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Here is the call graph for this function:

◆ operator()() [8/11]

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::operator() ( const std::string &  s,
range_t rp 
) const
inline

Definition at line 31474 of file exprtk.hpp.

31475 {
31477 }
expression_node< typename node_type::value_type > * allocate_tt(T1 t1, T2 t2) const
Definition exprtk.hpp:19145
details::const_string_range_node< T > const_string_range_node_t
Definition exprtk.hpp:22233

References exprtk::details::node_allocator::allocate_tt(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Here is the call graph for this function:

◆ operator()() [9/11]

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::operator() ( const Type &  v) const
inline

Definition at line 31458 of file exprtk.hpp.

31459 {
31461 }

References exprtk::details::node_allocator::allocate(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ operator()() [10/11]

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::operator() ( expression_node_ptr  branch,
range_t rp 
) const
inline

Definition at line 31479 of file exprtk.hpp.

31480 {
31481 if (is_generally_string_node(branch))
31483 else
31484 return error_node();
31485 }
details::generic_string_range_node< T > generic_string_range_node_t
Definition exprtk.hpp:22234

References exprtk::details::node_allocator::allocate_tt(), exprtk::parser< T >::error_node(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Here is the call graph for this function:

◆ operator()() [11/11]

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::operator() ( std::string &  s,
range_t rp 
) const
inline

Definition at line 31469 of file exprtk.hpp.

31470 {
31472 }
expression_node< typename node_type::value_type > * allocate_rr(T1 &t1, T2 &t2) const
Definition exprtk.hpp:19135

References exprtk::details::node_allocator::allocate_rr(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Here is the call graph for this function:

◆ repeat_until_loop()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::repeat_until_loop ( expression_node_ptr condition,
expression_node_ptr branch,
const bool  break_continue_present = false 
) const
inline

Definition at line 32508 of file exprtk.hpp.

32511 {
32512 if (!break_continue_present && details::is_constant_node(condition))
32513 {
32514 if (
32515 details::is_true(condition) &&
32517 )
32518 {
32519 free_node(*node_allocator_,condition);
32520
32521 return branch;
32522 }
32523
32526
32527 return error_node();
32528 }
32529 else if (details::is_null_node(condition))
32530 {
32532
32533 return branch;
32534 }
32535
32537
32538 if (!break_continue_present)
32539 {
32540 if (rtc)
32542 (condition, branch, rtc);
32543 else
32545 (condition, branch);
32546 }
32547 #ifndef exprtk_disable_break_continue
32548 else
32549 {
32550 if (rtc)
32552 (condition, branch, rtc);
32553 else
32555 (condition, branch);
32556 }
32557 #else
32558 return error_node();
32559 #endif
32560 }
details::repeat_until_loop_node< T > repeat_until_loop_node_t
Definition exprtk.hpp:22203
details::repeat_until_loop_bc_node< T > repeat_until_loop_bc_node_t
Definition exprtk.hpp:22210
details::repeat_until_loop_bc_rtc_node< T > repeat_until_loop_bc_rtc_node_t
Definition exprtk.hpp:22213
details::repeat_until_loop_rtc_node< T > repeat_until_loop_rtc_node_t
Definition exprtk.hpp:22206

References exprtk::details::node_allocator::allocate(), exprtk::loop_runtime_check::e_repeat_until_loop, exprtk::parser< T >::error_node(), exprtk::details::free_node(), exprtk::parser< T >::expression_generator< Type >::get_loop_runtime_check(), exprtk::details::is_constant_node(), exprtk::details::is_null_node(), exprtk::details::is_true(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

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

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

◆ return_call()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::return_call ( std::vector< expression_node_ptr > &  arg_list)
inline

Definition at line 33632 of file exprtk.hpp.

33633 {
33634 if (!all_nodes_valid(arg_list))
33635 {
33637 return error_node();
33638 }
33639
33640 typedef details::return_node<Type> alloc_type;
33641
33643 allocate_rr<alloc_type>(arg_list,parser_->results_ctx());
33644
33645 alloc_type* return_node_ptr = static_cast<alloc_type*>(result);
33646
33647 assert(return_node_ptr);
33648
33649 if (return_node_ptr->init_branches())
33650 {
33651 if (result && result->valid())
33652 {
33653 parser_->state_.activate_side_effect("return_call()");
33654 return result;
33655 }
33656
33659 token_t(),
33660 "ERR260 - Failed to synthesize node: return_node",
33662
33664 return error_node();
33665 }
33666 else
33667 {
33670
33671 return error_node();
33672 }
33673 }
results_context_t & results_ctx()
Definition exprtk.hpp:41586

References exprtk::parser< T >::parser_state::activate_side_effect(), exprtk::parser_error::e_synthesis, exprtk::parser< T >::error_node(), exprtk_error_location, exprtk::details::free_all_nodes(), exprtk::details::free_node(), exprtk::parser_error::make_error(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::parser< T >::results_ctx(), exprtk::parser< T >::set_error(), exprtk::parser< T >::state_, and exprtk::details::expression_node< T >::valid().

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

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

◆ return_envelope()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::return_envelope ( expression_node_ptr  body,
results_context_t rc,
bool *&  return_invoked 
)
inline

Definition at line 33675 of file exprtk.hpp.

33678 {
33679 typedef details::return_envelope_node<Type> alloc_type;
33680
33682 allocate_cr<alloc_type>(body,(*rc));
33683
33684 return_invoked = static_cast<alloc_type*>(result)->retinvk_ptr();
33685
33686 return result;
33687 }

References exprtk::parser< T >::expression_generator< Type >::node_allocator_.

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

Here is the caller graph for this function:

◆ set_allocator()

template<typename T >
template<typename Type >
void exprtk::parser< T >::expression_generator< Type >::set_allocator ( details::node_allocator na)
inline

Definition at line 31414 of file exprtk.hpp.

31415 {
31416 node_allocator_ = &na;
31417 }

References exprtk::parser< T >::expression_generator< Type >::node_allocator_.

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

Here is the caller graph for this function:

◆ set_bom()

template<typename T >
template<typename Type >
void exprtk::parser< T >::expression_generator< Type >::set_bom ( binary_op_map_t binary_op_map)
inline

Definition at line 31394 of file exprtk.hpp.

31395 {
31396 binary_op_map_ = &binary_op_map;
31397 }

References exprtk::parser< T >::expression_generator< Type >::binary_op_map_.

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

Here is the caller graph for this function:

◆ set_ibom()

template<typename T >
template<typename Type >
void exprtk::parser< T >::expression_generator< Type >::set_ibom ( inv_binary_op_map_t inv_binary_op_map)
inline

Definition at line 31399 of file exprtk.hpp.

31400 {
31401 inv_binary_op_map_ = &inv_binary_op_map;
31402 }
inv_binary_op_map_t * inv_binary_op_map_
Definition exprtk.hpp:41324

References exprtk::parser< T >::expression_generator< Type >::inv_binary_op_map_.

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

Here is the caller graph for this function:

◆ set_parser()

template<typename T >
template<typename Type >
void exprtk::parser< T >::expression_generator< Type >::set_parser ( parser_t p)
inline

Definition at line 31384 of file exprtk.hpp.

31385 {
31386 parser_ = &p;
31387 }

References exprtk::parser< T >::expression_generator< Type >::parser_.

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

Here is the caller graph for this function:

◆ set_sf3m()

template<typename T >
template<typename Type >
void exprtk::parser< T >::expression_generator< Type >::set_sf3m ( sf3_map_t sf3_map)
inline

Definition at line 31404 of file exprtk.hpp.

31405 {
31406 sf3_map_ = &sf3_map;
31407 }

References exprtk::parser< T >::expression_generator< Type >::sf3_map_.

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

Here is the caller graph for this function:

◆ set_sf4m()

template<typename T >
template<typename Type >
void exprtk::parser< T >::expression_generator< Type >::set_sf4m ( sf4_map_t sf4_map)
inline

Definition at line 31409 of file exprtk.hpp.

31410 {
31411 sf4_map_ = &sf4_map;
31412 }

References exprtk::parser< T >::expression_generator< Type >::sf4_map_.

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

Here is the caller graph for this function:

◆ set_strength_reduction_state()

template<typename T >
template<typename Type >
void exprtk::parser< T >::expression_generator< Type >::set_strength_reduction_state ( const bool  enabled)
inline

Definition at line 31419 of file exprtk.hpp.

31420 {
31422 }

References exprtk::parser< T >::expression_generator< Type >::strength_reduction_enabled_.

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

Here is the caller graph for this function:

◆ set_uom()

template<typename T >
template<typename Type >
void exprtk::parser< T >::expression_generator< Type >::set_uom ( unary_op_map_t unary_op_map)
inline

Definition at line 31389 of file exprtk.hpp.

31390 {
31391 unary_op_map_ = &unary_op_map;
31392 }

References exprtk::parser< T >::expression_generator< Type >::unary_op_map_.

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

Here is the caller graph for this function:

◆ sf3_optimisable() [1/2]

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::sf3_optimisable ( const std::string &  sf3id,
details::operator_type operation 
) const
inline

Definition at line 31536 of file exprtk.hpp.

31537 {
31538 typename sf3_map_t::const_iterator itr = sf3_map_->find(sf3id);
31539
31540 if (sf3_map_->end() == itr)
31541 return false;
31542 else
31543 operation = itr->second.second;
31544
31545 return true;
31546 }

References exprtk::parser< T >::expression_generator< Type >::sf3_map_.

◆ sf3_optimisable() [2/2]

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::sf3_optimisable ( const std::string &  sf3id,
trinary_functor_t tfunc 
) const
inline

Definition at line 31512 of file exprtk.hpp.

31513 {
31514 typename sf3_map_t::const_iterator itr = sf3_map_->find(sf3id);
31515
31516 if (sf3_map_->end() == itr)
31517 return false;
31518 else
31519 tfunc = itr->second.first;
31520
31521 return true;
31522 }

References exprtk::parser< T >::expression_generator< Type >::sf3_map_.

Referenced by exprtk::parser< T >::expression_generator< Type >::synthesize_sf3ext_expression::compile().

Here is the caller graph for this function:

◆ sf4_optimisable() [1/2]

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::sf4_optimisable ( const std::string &  sf4id,
details::operator_type operation 
) const
inline

Definition at line 31548 of file exprtk.hpp.

31549 {
31550 typename sf4_map_t::const_iterator itr = sf4_map_->find(sf4id);
31551
31552 if (sf4_map_->end() == itr)
31553 return false;
31554 else
31555 operation = itr->second.second;
31556
31557 return true;
31558 }

References exprtk::parser< T >::expression_generator< Type >::sf4_map_.

◆ sf4_optimisable() [2/2]

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::sf4_optimisable ( const std::string &  sf4id,
quaternary_functor_t qfunc 
) const
inline

Definition at line 31524 of file exprtk.hpp.

31525 {
31526 typename sf4_map_t::const_iterator itr = sf4_map_->find(sf4id);
31527
31528 if (sf4_map_->end() == itr)
31529 return false;
31530 else
31531 qfunc = itr->second.first;
31532
31533 return true;
31534 }

References exprtk::parser< T >::expression_generator< Type >::sf4_map_.

Referenced by exprtk::parser< T >::expression_generator< Type >::synthesize_sf4ext_expression::compile().

Here is the caller graph for this function:

◆ special_function() [1/2]

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::special_function ( const details::operator_type operation,
expression_node_ptr(&)  branch[3] 
)
inline

Definition at line 33067 of file exprtk.hpp.

33068 {
33069 if (!all_nodes_valid(branch))
33070 return error_node();
33071 else if (is_constant_foldable(branch))
33072 return const_optimise_sf3(operation,branch);
33073 else if (all_nodes_variables(branch))
33074 return varnode_optimise_sf3(operation,branch);
33075 else
33076 {
33077 switch (operation)
33078 {
33079 #define case_stmt(op) \
33080 case details::e_sf##op : return node_allocator_-> \
33081 allocate<details::sf3_node<Type,details::sf##op##_op<Type> > > \
33082 (operation, branch); \
33083
33084 case_stmt(00) case_stmt(01) case_stmt(02) case_stmt(03)
33085 case_stmt(04) case_stmt(05) case_stmt(06) case_stmt(07)
33086 case_stmt(08) case_stmt(09) case_stmt(10) case_stmt(11)
33087 case_stmt(12) case_stmt(13) case_stmt(14) case_stmt(15)
33088 case_stmt(16) case_stmt(17) case_stmt(18) case_stmt(19)
33089 case_stmt(20) case_stmt(21) case_stmt(22) case_stmt(23)
33090 case_stmt(24) case_stmt(25) case_stmt(26) case_stmt(27)
33091 case_stmt(28) case_stmt(29) case_stmt(30) case_stmt(31)
33092 case_stmt(32) case_stmt(33) case_stmt(34) case_stmt(35)
33093 case_stmt(36) case_stmt(37) case_stmt(38) case_stmt(39)
33094 case_stmt(40) case_stmt(41) case_stmt(42) case_stmt(43)
33095 case_stmt(44) case_stmt(45) case_stmt(46) case_stmt(47)
33096 #undef case_stmt
33097 default : return error_node();
33098 }
33099 }
33100 }
expression_node_ptr varnode_optimise_sf3(const details::operator_type &operation, expression_node_ptr(&branch)[3])
Definition exprtk.hpp:33035
expression_node_ptr const_optimise_sf3(const details::operator_type &operation, expression_node_ptr(&branch)[3])
Definition exprtk.hpp:32997
bool all_nodes_variables(expression_node< T > *const (&b)[N])
Definition exprtk.hpp:5884

References case_stmt, exprtk::parser< T >::expression_generator< Type >::const_optimise_sf3(), exprtk::parser< T >::error_node(), exprtk::parser< T >::expression_generator< Type >::is_constant_foldable(), and exprtk::parser< T >::expression_generator< Type >::varnode_optimise_sf3().

Referenced by exprtk::parser< T >::parse_special_function_impl< Type, NumberOfParameters >::process().

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

◆ special_function() [2/2]

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::special_function ( const details::operator_type operation,
expression_node_ptr(&)  branch[4] 
)
inline

Definition at line 33174 of file exprtk.hpp.

33175 {
33176 if (!all_nodes_valid(branch))
33177 return error_node();
33178 else if (is_constant_foldable(branch))
33179 return const_optimise_sf4(operation,branch);
33180 else if (all_nodes_variables(branch))
33181 return varnode_optimise_sf4(operation,branch);
33182 switch (operation)
33183 {
33184 #define case_stmt(op) \
33185 case details::e_sf##op : return node_allocator_-> \
33186 allocate<details::sf4_node<Type,details::sf##op##_op<Type> > > \
33187 (operation, branch); \
33188
33189 case_stmt(48) case_stmt(49) case_stmt(50) case_stmt(51)
33190 case_stmt(52) case_stmt(53) case_stmt(54) case_stmt(55)
33191 case_stmt(56) case_stmt(57) case_stmt(58) case_stmt(59)
33192 case_stmt(60) case_stmt(61) case_stmt(62) case_stmt(63)
33193 case_stmt(64) case_stmt(65) case_stmt(66) case_stmt(67)
33194 case_stmt(68) case_stmt(69) case_stmt(70) case_stmt(71)
33195 case_stmt(72) case_stmt(73) case_stmt(74) case_stmt(75)
33196 case_stmt(76) case_stmt(77) case_stmt(78) case_stmt(79)
33197 case_stmt(80) case_stmt(81) case_stmt(82) case_stmt(83)
33198 case_stmt(84) case_stmt(85) case_stmt(86) case_stmt(87)
33199 case_stmt(88) case_stmt(89) case_stmt(90) case_stmt(91)
33200 case_stmt(92) case_stmt(93) case_stmt(94) case_stmt(95)
33201 case_stmt(96) case_stmt(97) case_stmt(98) case_stmt(99)
33202 #undef case_stmt
33203 default : return error_node();
33204 }
33205 }
expression_node_ptr varnode_optimise_sf4(const details::operator_type &operation, expression_node_ptr(&branch)[4])
Definition exprtk.hpp:33140
expression_node_ptr const_optimise_sf4(const details::operator_type &operation, expression_node_ptr(&branch)[4])
Definition exprtk.hpp:33102

References case_stmt, exprtk::parser< T >::expression_generator< Type >::const_optimise_sf4(), exprtk::parser< T >::error_node(), exprtk::parser< T >::expression_generator< Type >::is_constant_foldable(), and exprtk::parser< T >::expression_generator< Type >::varnode_optimise_sf4().

Here is the call graph for this function:

◆ special_one_parameter_vararg()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::special_one_parameter_vararg ( const details::operator_type operation) const
inline

Definition at line 33240 of file exprtk.hpp.

33241 {
33242 return (
33243 (details::e_sum == operation) ||
33244 (details::e_prod == operation) ||
33245 (details::e_avg == operation) ||
33246 (details::e_min == operation) ||
33247 (details::e_max == operation)
33248 );
33249 }

References exprtk::details::e_avg, exprtk::details::e_max, exprtk::details::e_min, exprtk::details::e_prod, and exprtk::details::e_sum.

Referenced by exprtk::parser< T >::expression_generator< Type >::vararg_function().

Here is the caller graph for this function:

◆ strength_reduction_enabled()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::strength_reduction_enabled ( ) const
inline

◆ string_function_call()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::string_function_call ( igeneric_function_t gf,
std::vector< expression_node_ptr > &  arg_list,
const std::size_t &  param_seq_index = std::numeric_limits<std::size_t>::max() 
)
inline

Definition at line 33557 of file exprtk.hpp.

33560 {
33561 if (!all_nodes_valid(arg_list))
33562 {
33564 return error_node();
33565 }
33566
33569
33570 const std::size_t no_psi = std::numeric_limits<std::size_t>::max();
33571
33573 std::string node_name = "Unknown";
33574
33575 if (no_psi == param_seq_index)
33576 {
33577 result = node_allocator_->allocate<alloc_type1>(gf,arg_list);
33578 node_name = "string_function_node<igeneric_function_t>";
33579 }
33580 else
33581 {
33582 result = node_allocator_->allocate<alloc_type2>(gf, param_seq_index, arg_list);
33583 node_name = "multimode_strfunction_node<igeneric_function_t>";
33584 }
33585
33586 alloc_type1* strfunc_node_ptr = static_cast<alloc_type1*>(result);
33587
33588 assert(strfunc_node_ptr);
33589
33590 if (
33591 !arg_list.empty() &&
33592 !gf->has_side_effects() &&
33593 is_constant_foldable(arg_list)
33594 )
33595 {
33596 strfunc_node_ptr->init_branches();
33597
33598 const Type v = result->value();
33599
33601
33603 }
33604 else if (strfunc_node_ptr->init_branches())
33605 {
33606 if (result && result->valid())
33607 {
33608 parser_->state_.activate_side_effect("string_function_call()");
33609 return result;
33610 }
33611
33614 token_t(),
33615 "ERR259 - Failed to synthesize node: " + node_name,
33617
33619 return error_node();
33620 }
33621 else
33622 {
33625
33626 return error_node();
33627 }
33628 }

References exprtk::parser< T >::parser_state::activate_side_effect(), exprtk::details::node_allocator::allocate(), exprtk::parser_error::e_synthesis, exprtk::parser< T >::error_node(), exprtk_error_location, exprtk::details::free_all_nodes(), exprtk::details::free_node(), exprtk::function_traits::has_side_effects(), exprtk::parser< T >::expression_generator< Type >::is_constant_foldable(), exprtk::parser_error::make_error(), exprtk::details::match_impl(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::parser< T >::set_error(), exprtk::parser< T >::state_, exprtk::details::expression_node< T >::valid(), and exprtk::details::expression_node< T >::value().

Referenced by exprtk::parser< T >::parse_overload_function_call(), and exprtk::parser< T >::parse_string_function_call().

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

◆ switch_statement()

template<typename T >
template<typename Type >
template<typename Allocator , template< typename, typename > class Sequence>
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::switch_statement ( Sequence< expression_node_ptr, Allocator > &  arg_list,
const bool  default_statement_present 
)
inline

Definition at line 32832 of file exprtk.hpp.

32833 {
32834 if (arg_list.empty())
32835 return error_node();
32836 else if (
32837 !all_nodes_valid(arg_list) ||
32838 (!default_statement_present && (arg_list.size() < 2))
32839 )
32840 {
32842
32843 return error_node();
32844 }
32845 else if (is_constant_foldable(arg_list))
32846 return const_optimise_switch(arg_list);
32847
32848 switch ((arg_list.size() - 1) / 2)
32849 {
32850 #define case_stmt(N) \
32851 case N : \
32852 return node_allocator_-> \
32853 allocate<details::switch_n_node \
32854 <Type,typename switch_nodes::switch_impl_##N > >(arg_list); \
32855
32856 case_stmt(1)
32857 case_stmt(2)
32858 case_stmt(3)
32859 case_stmt(4)
32860 case_stmt(5)
32861 case_stmt(6)
32862 case_stmt(7)
32863 #undef case_stmt
32864
32865 default : return node_allocator_->allocate<details::switch_node<Type> >(arg_list);
32866 }
32867 }
expression_node_ptr const_optimise_switch(Sequence< expression_node_ptr, Allocator > &arg_list)
Definition exprtk.hpp:32657

References exprtk::details::node_allocator::allocate(), case_stmt, exprtk::parser< T >::expression_generator< Type >::const_optimise_switch(), exprtk::parser< T >::error_node(), exprtk::details::free_all_nodes(), exprtk::parser< T >::expression_generator< Type >::is_constant_foldable(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

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

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

◆ synthesize_assignment_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_assignment_expression ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 34023 of file exprtk.hpp.

34024 {
34025 if (assign_immutable_symbol(branch[0]))
34026 {
34027 return error_node();
34028 }
34029 else if (details::is_variable_node(branch[0]))
34030 {
34032 return synthesize_expression<assignment_node_t,2>(operation,branch);
34033 }
34034 else if (details::is_vector_elem_node(branch[0]) || details::is_vector_celem_node(branch[0]))
34035 {
34036 lodge_assignment(e_st_vecelem,branch[0]);
34037 return synthesize_expression<assignment_vec_elem_node_t, 2>(operation, branch);
34038 }
34040 {
34041 lodge_assignment(e_st_vecelem,branch[0]);
34042 return synthesize_expression<assignment_vec_elem_rtc_node_t, 2>(operation, branch);
34043 }
34044 else if (details::is_rebasevector_elem_node(branch[0]))
34045 {
34046 lodge_assignment(e_st_vecelem,branch[0]);
34047 return synthesize_expression<assignment_rebasevec_elem_node_t, 2>(operation, branch);
34048 }
34049 else if (details::is_rebasevector_elem_rtc_node(branch[0]))
34050 {
34051 lodge_assignment(e_st_vecelem,branch[0]);
34052 return synthesize_expression<assignment_rebasevec_elem_rtc_node_t, 2>(operation, branch);
34053 }
34054 else if (details::is_rebasevector_celem_node(branch[0]))
34055 {
34056 lodge_assignment(e_st_vecelem,branch[0]);
34057 return synthesize_expression<assignment_rebasevec_celem_node_t, 2>(operation, branch);
34058 }
34059 #ifndef exprtk_disable_string_capabilities
34060 else if (details::is_string_node(branch[0]))
34061 {
34062 lodge_assignment(e_st_string,branch[0]);
34063 return synthesize_expression<assignment_string_node_t,2>(operation, branch);
34064 }
34065 else if (details::is_string_range_node(branch[0]))
34066 {
34067 lodge_assignment(e_st_string,branch[0]);
34068 return synthesize_expression<assignment_string_range_node_t,2>(operation, branch);
34069 }
34070 #endif
34071 else if (details::is_vector_node(branch[0]))
34072 {
34073 lodge_assignment(e_st_vector,branch[0]);
34074
34075 if (details::is_ivector_node(branch[1]))
34076 return synthesize_expression<assignment_vecvec_node_t,2>(operation, branch);
34077 else
34078 return synthesize_expression<assignment_vec_node_t,2>(operation, branch);
34079 }
34080 else if (details::is_literal_node(branch[0]))
34081 {
34085 "ERR266 - Cannot assign value to const variable",
34087
34088 return error_node();
34089 }
34090 else
34091 {
34095 "ERR267 - Invalid branches for assignment operator '" + details::to_str(operation) + "'",
34097
34098 return error_node();
34099 }
34100 }
void lodge_assignment(symbol_type cst, expression_node_ptr node)
Definition exprtk.hpp:33894
bool assign_immutable_symbol(expression_node_ptr node)
Definition exprtk.hpp:33994

References exprtk::parser< T >::expression_generator< Type >::assign_immutable_symbol(), exprtk::parser< T >::current_state(), exprtk::parser< T >::e_st_string, exprtk::parser< T >::e_st_variable, exprtk::parser< T >::e_st_vecelem, exprtk::parser< T >::e_st_vector, exprtk::parser_error::e_syntax, exprtk::parser< T >::error_node(), exprtk_error_location, exprtk::details::is_ivector_node(), exprtk::details::is_literal_node(), exprtk::details::is_rebasevector_celem_node(), exprtk::details::is_rebasevector_elem_node(), exprtk::details::is_rebasevector_elem_rtc_node(), exprtk::details::is_string_node(), exprtk::details::is_string_range_node(), exprtk::details::is_variable_node(), exprtk::details::is_vector_celem_node(), exprtk::details::is_vector_celem_rtc_node(), exprtk::details::is_vector_elem_node(), exprtk::details::is_vector_elem_rtc_node(), exprtk::details::is_vector_node(), exprtk::parser< T >::expression_generator< Type >::lodge_assignment(), exprtk::parser_error::make_error(), exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::parser< T >::set_error(), exprtk::details::to_str(), and exprtk::parser< T >::state_t::token.

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ synthesize_assignment_operation_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_assignment_operation_expression ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 34102 of file exprtk.hpp.

34104 {
34105 if (assign_immutable_symbol(branch[0]))
34106 {
34107 return error_node();
34108 }
34109
34111 std::string node_name = "Unknown";
34112
34113 if (details::is_variable_node(branch[0]))
34114 {
34116
34117 switch (operation)
34118 {
34119 #define case_stmt(op0, op1) \
34120 case op0 : result = node_allocator_-> \
34121 template allocate_rrr<typename details::assignment_op_node<Type,op1<Type> > > \
34122 (operation, branch[0], branch[1]); \
34123 node_name = "assignment_op_node"; \
34124 break; \
34125
34126 case_stmt(details::e_addass , details::add_op)
34127 case_stmt(details::e_subass , details::sub_op)
34128 case_stmt(details::e_mulass , details::mul_op)
34129 case_stmt(details::e_divass , details::div_op)
34130 case_stmt(details::e_modass , details::mod_op)
34131 #undef case_stmt
34132 default : return error_node();
34133 }
34134 }
34135 else if (details::is_vector_elem_node(branch[0]))
34136 {
34137 lodge_assignment(e_st_vecelem,branch[0]);
34138
34139 switch (operation)
34140 {
34141 #define case_stmt(op0, op1) \
34142 case op0 : result = node_allocator_-> \
34143 template allocate_rrr<typename details::assignment_vec_elem_op_node<Type,op1<Type> > > \
34144 (operation, branch[0], branch[1]); \
34145 node_name = "assignment_vec_elem_op_node"; \
34146 break; \
34147
34148 case_stmt(details::e_addass , details::add_op)
34149 case_stmt(details::e_subass , details::sub_op)
34150 case_stmt(details::e_mulass , details::mul_op)
34151 case_stmt(details::e_divass , details::div_op)
34152 case_stmt(details::e_modass , details::mod_op)
34153 #undef case_stmt
34154 default : return error_node();
34155 }
34156 }
34157 else if (details::is_vector_elem_rtc_node(branch[0]))
34158 {
34159 lodge_assignment(e_st_vecelem,branch[0]);
34160
34161 switch (operation)
34162 {
34163 #define case_stmt(op0, op1) \
34164 case op0 : result = node_allocator_-> \
34165 template allocate_rrr<typename details::assignment_vec_elem_op_rtc_node<Type,op1<Type> > > \
34166 (operation, branch[0], branch[1]); \
34167 node_name = "assignment_vec_elem_op_rtc_node"; \
34168 break; \
34169
34170 case_stmt(details::e_addass , details::add_op)
34171 case_stmt(details::e_subass , details::sub_op)
34172 case_stmt(details::e_mulass , details::mul_op)
34173 case_stmt(details::e_divass , details::div_op)
34174 case_stmt(details::e_modass , details::mod_op)
34175 #undef case_stmt
34176 default : return error_node();
34177 }
34178 }
34179 else if (details::is_vector_celem_rtc_node(branch[0]))
34180 {
34181 lodge_assignment(e_st_vecelem,branch[0]);
34182
34183 switch (operation)
34184 {
34185 #define case_stmt(op0, op1) \
34186 case op0 : result = node_allocator_-> \
34187 template allocate_rrr<typename details::assignment_vec_celem_op_rtc_node<Type,op1<Type> > > \
34188 (operation, branch[0], branch[1]); \
34189 node_name = "assignment_vec_celem_op_rtc_node"; \
34190 break; \
34191
34192 case_stmt(details::e_addass , details::add_op)
34193 case_stmt(details::e_subass , details::sub_op)
34194 case_stmt(details::e_mulass , details::mul_op)
34195 case_stmt(details::e_divass , details::div_op)
34196 case_stmt(details::e_modass , details::mod_op)
34197 #undef case_stmt
34198 default : return error_node();
34199 }
34200 }
34201 else if (details::is_rebasevector_elem_node(branch[0]))
34202 {
34203 lodge_assignment(e_st_vecelem,branch[0]);
34204
34205 switch (operation)
34206 {
34207 #define case_stmt(op0, op1) \
34208 case op0 : result = node_allocator_-> \
34209 template allocate_rrr<typename details::assignment_rebasevec_elem_op_node<Type,op1<Type> > > \
34210 (operation, branch[0], branch[1]); \
34211 node_name = "assignment_rebasevec_elem_op_node"; \
34212 break; \
34213
34214 case_stmt(details::e_addass , details::add_op)
34215 case_stmt(details::e_subass , details::sub_op)
34216 case_stmt(details::e_mulass , details::mul_op)
34217 case_stmt(details::e_divass , details::div_op)
34218 case_stmt(details::e_modass , details::mod_op)
34219 #undef case_stmt
34220 default : return error_node();
34221 }
34222 }
34223 else if (details::is_rebasevector_celem_node(branch[0]))
34224 {
34225 lodge_assignment(e_st_vecelem,branch[0]);
34226
34227 switch (operation)
34228 {
34229 #define case_stmt(op0, op1) \
34230 case op0 : result = node_allocator_-> \
34231 template allocate_rrr<typename details::assignment_rebasevec_celem_op_node<Type,op1<Type> > > \
34232 (operation, branch[0], branch[1]); \
34233 node_name = "assignment_rebasevec_celem_op_node"; \
34234 break; \
34235
34236 case_stmt(details::e_addass , details::add_op)
34237 case_stmt(details::e_subass , details::sub_op)
34238 case_stmt(details::e_mulass , details::mul_op)
34239 case_stmt(details::e_divass , details::div_op)
34240 case_stmt(details::e_modass , details::mod_op)
34241 #undef case_stmt
34242 default : return error_node();
34243 }
34244 }
34245 else if (details::is_rebasevector_elem_rtc_node(branch[0]))
34246 {
34247 lodge_assignment(e_st_vecelem,branch[0]);
34248
34249 switch (operation)
34250 {
34251 #define case_stmt(op0, op1) \
34252 case op0 : result = node_allocator_-> \
34253 template allocate_rrr<typename details::assignment_rebasevec_elem_op_rtc_node<Type,op1<Type> > > \
34254 (operation, branch[0], branch[1]); \
34255 node_name = "assignment_rebasevec_elem_op_rtc_node"; \
34256 break; \
34257
34258 case_stmt(details::e_addass , details::add_op)
34259 case_stmt(details::e_subass , details::sub_op)
34260 case_stmt(details::e_mulass , details::mul_op)
34261 case_stmt(details::e_divass , details::div_op)
34262 case_stmt(details::e_modass , details::mod_op)
34263 #undef case_stmt
34264 default : return error_node();
34265 }
34266 }
34267 else if (details::is_rebasevector_celem_rtc_node(branch[0]))
34268 {
34269 lodge_assignment(e_st_vecelem,branch[0]);
34270
34271 switch (operation)
34272 {
34273 #define case_stmt(op0, op1) \
34274 case op0 : result = node_allocator_-> \
34275 template allocate_rrr<typename details::assignment_rebasevec_celem_op_rtc_node<Type,op1<Type> > > \
34276 (operation, branch[0], branch[1]); \
34277 node_name = "assignment_rebasevec_celem_op_rtc_node"; \
34278 break; \
34279
34280 case_stmt(details::e_addass , details::add_op)
34281 case_stmt(details::e_subass , details::sub_op)
34282 case_stmt(details::e_mulass , details::mul_op)
34283 case_stmt(details::e_divass , details::div_op)
34284 case_stmt(details::e_modass , details::mod_op)
34285 #undef case_stmt
34286 default : return error_node();
34287 }
34288 }
34289 else if (details::is_vector_node(branch[0]))
34290 {
34291 lodge_assignment(e_st_vector,branch[0]);
34292
34293 if (details::is_ivector_node(branch[1]))
34294 {
34295 switch (operation)
34296 {
34297 #define case_stmt(op0, op1) \
34298 case op0 : result = node_allocator_-> \
34299 template allocate_rrr<typename details::assignment_vecvec_op_node<Type,op1<Type> > > \
34300 (operation, branch[0], branch[1]); \
34301 node_name = "assignment_rebasevec_celem_op_node"; \
34302 break; \
34303
34304 case_stmt(details::e_addass , details::add_op)
34305 case_stmt(details::e_subass , details::sub_op)
34306 case_stmt(details::e_mulass , details::mul_op)
34307 case_stmt(details::e_divass , details::div_op)
34308 case_stmt(details::e_modass , details::mod_op)
34309 #undef case_stmt
34310 default : return error_node();
34311 }
34312 }
34313 else
34314 {
34315 switch (operation)
34316 {
34317 #define case_stmt(op0, op1) \
34318 case op0 : result = node_allocator_-> \
34319 template allocate_rrr<typename details::assignment_vec_op_node<Type,op1<Type> > > \
34320 (operation, branch[0], branch[1]); \
34321 node_name = "assignment_vec_op_node"; \
34322 break; \
34323
34324 case_stmt(details::e_addass , details::add_op)
34325 case_stmt(details::e_subass , details::sub_op)
34326 case_stmt(details::e_mulass , details::mul_op)
34327 case_stmt(details::e_divass , details::div_op)
34328 case_stmt(details::e_modass , details::mod_op)
34329 #undef case_stmt
34330 default : return error_node();
34331 }
34332 }
34333 }
34334 #ifndef exprtk_disable_string_capabilities
34335 else if (
34336 (details::e_addass == operation) &&
34337 details::is_string_node(branch[0])
34338 )
34339 {
34341
34342 lodge_assignment(e_st_string,branch[0]);
34343
34344 result = synthesize_expression<addass_t,2>(operation,branch);
34345 node_name = "assignment_string_node<T,details::asn_addassignment>";
34346 }
34347 #endif
34348 else
34349 {
34353 "ERR268 - Invalid branches for assignment operator '" + details::to_str(operation) + "'",
34355
34356 return error_node();
34357 }
34358
34359 if (result && result->valid())
34360 {
34361 return result;
34362 }
34363
34366 token_t(),
34367 "ERR269 - Failed to synthesize node: " + node_name,
34369
34371 return error_node();
34372 }

References exprtk::parser< T >::expression_generator< Type >::assign_immutable_symbol(), case_stmt, exprtk::parser< T >::current_state(), exprtk::details::e_addass, exprtk::details::e_divass, exprtk::details::e_modass, exprtk::details::e_mulass, exprtk::parser< T >::e_st_string, exprtk::parser< T >::e_st_variable, exprtk::parser< T >::e_st_vecelem, exprtk::parser< T >::e_st_vector, exprtk::details::e_subass, exprtk::parser_error::e_syntax, exprtk::parser_error::e_synthesis, exprtk::parser< T >::error_node(), exprtk_error_location, exprtk::details::free_node(), exprtk::details::is_ivector_node(), exprtk::details::is_rebasevector_celem_node(), exprtk::details::is_rebasevector_celem_rtc_node(), exprtk::details::is_rebasevector_elem_node(), exprtk::details::is_rebasevector_elem_rtc_node(), exprtk::details::is_string_node(), exprtk::details::is_variable_node(), exprtk::details::is_vector_celem_rtc_node(), exprtk::details::is_vector_elem_node(), exprtk::details::is_vector_elem_rtc_node(), exprtk::details::is_vector_node(), exprtk::parser< T >::expression_generator< Type >::lodge_assignment(), exprtk::parser_error::make_error(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::parser< T >::set_error(), exprtk::details::to_str(), exprtk::parser< T >::state_t::token, and exprtk::details::expression_node< T >::valid().

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ synthesize_csocs_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_csocs_expression ( const details::operator_type opr,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 40811 of file exprtk.hpp.

40812 {
40813 const std::string s0 = static_cast<details::string_literal_node<Type>*>(branch[0])->str();
40814 const std::string s1 = static_cast<details::string_literal_node<Type>*>(branch[1])->str();
40815
40817
40818 if (details::e_add == opr)
40820 else if (details::e_in == opr)
40822 else if (details::e_like == opr)
40824 else if (details::e_ilike == opr)
40826 else
40827 {
40828 expression_node_ptr temp = synthesize_sos_expression_impl<const std::string, const std::string>(opr, s0, s1);
40829
40830 const Type v = temp->value();
40831
40833
40835 }
40836
40838
40839 return result;
40840 }
static T process(const T &, const T &)
Definition exprtk.hpp:15728
static T process(const T &, const T &)
Definition exprtk.hpp:15706
static T process(const T &, const T &)
Definition exprtk.hpp:15717

References exprtk::details::node_allocator::allocate(), exprtk::details::node_allocator::allocate_c(), exprtk::details::e_add, exprtk::details::e_ilike, exprtk::details::e_in, exprtk::details::e_like, exprtk::parser< T >::error_node(), exprtk::details::free_all_nodes(), exprtk::details::free_node(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, exprtk::details::in_op< T >::process(), exprtk::details::like_op< T >::process(), exprtk::details::ilike_op< T >::process(), and exprtk::details::expression_node< T >::value().

Referenced by exprtk::parser< T >::expression_generator< Type >::synthesize_string_expression().

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

◆ synthesize_csocsr_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_csocsr_expression ( const details::operator_type opr,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 40842 of file exprtk.hpp.

40843 {
40844 const std::string s0 = static_cast<details::string_literal_node<Type>* >(branch[0])->str ();
40845 std::string s1 = static_cast<details::const_string_range_node<Type>*>(branch[1])->str ();
40846 range_t rp1 = static_cast<details::const_string_range_node<Type>*>(branch[1])->range();
40847
40848 static_cast<details::const_string_range_node<Type>*>(branch[1])->range_ref().clear();
40849
40852
40853 return synthesize_str_xoxr_expression_impl<const std::string, const std::string>(opr, s0, s1, rp1);
40854 }
details::range_pack< T > range_t
Definition exprtk.hpp:22228

References exprtk::details::free_node(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Referenced by exprtk::parser< T >::expression_generator< Type >::synthesize_string_expression().

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

◆ synthesize_csos_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_csos_expression ( const details::operator_type opr,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 40757 of file exprtk.hpp.

40758 {
40759 std::string s0 = static_cast<details::string_literal_node<Type>*>(branch[0])->str();
40760 std::string& s1 = static_cast<details::stringvar_node<Type>* >(branch[1])->ref();
40761
40763
40764 return synthesize_sos_expression_impl<const std::string,std::string&>(opr, s0, s1);
40765 }

References exprtk::details::free_node(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Referenced by exprtk::parser< T >::expression_generator< Type >::synthesize_string_expression().

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

◆ synthesize_csosr_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_csosr_expression ( const details::operator_type opr,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 40767 of file exprtk.hpp.

40768 {
40769 std::string s0 = static_cast<details::string_literal_node<Type>*>(branch[0])->str ();
40770 std::string& s1 = static_cast<details::string_range_node<Type>* >(branch[1])->ref ();
40771 range_t rp1 = static_cast<details::string_range_node<Type>* >(branch[1])->range();
40772
40773 static_cast<details::string_range_node<Type>*>(branch[1])->range_ref().clear();
40774
40777
40778 return synthesize_str_xoxr_expression_impl<const std::string,std::string&>(opr, s0, s1, rp1);
40779 }

References exprtk::details::free_node(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Referenced by exprtk::parser< T >::expression_generator< Type >::synthesize_string_expression().

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

◆ synthesize_csrocs_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_csrocs_expression ( const details::operator_type opr,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 40885 of file exprtk.hpp.

40886 {
40887 const std::string s0 = static_cast<details::const_string_range_node<Type>*>(branch[0])->str ();
40888 const std::string s1 = static_cast<details::string_literal_node<Type>* >(branch[1])->str ();
40889 const range_t rp0 = static_cast<details::const_string_range_node<Type>*>(branch[0])->range();
40890
40891 static_cast<details::const_string_range_node<Type>*>(branch[0])->range_ref().clear();
40892
40894
40895 return synthesize_str_xrox_expression_impl<const std::string,std::string>(opr, s0, s1, rp0);
40896 }

References exprtk::details::free_all_nodes(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Referenced by exprtk::parser< T >::expression_generator< Type >::synthesize_string_expression().

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

◆ synthesize_csrocsr_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_csrocsr_expression ( const details::operator_type opr,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 40898 of file exprtk.hpp.

40899 {
40900 const std::string s0 = static_cast<details::const_string_range_node<Type>*>(branch[0])->str ();
40901 const std::string s1 = static_cast<details::const_string_range_node<Type>*>(branch[1])->str ();
40902 const range_t rp0 = static_cast<details::const_string_range_node<Type>*>(branch[0])->range();
40903 const range_t rp1 = static_cast<details::const_string_range_node<Type>*>(branch[1])->range();
40904
40905 static_cast<details::const_string_range_node<Type>*>(branch[0])->range_ref().clear();
40906 static_cast<details::const_string_range_node<Type>*>(branch[1])->range_ref().clear();
40907
40909
40910 return synthesize_str_xroxr_expression_impl<const std::string, const std::string>(opr, s0, s1, rp0, rp1);
40911 }

References exprtk::details::free_all_nodes(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Referenced by exprtk::parser< T >::expression_generator< Type >::synthesize_string_expression().

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

◆ synthesize_csros_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_csros_expression ( const details::operator_type opr,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 40856 of file exprtk.hpp.

40857 {
40858 std::string s0 = static_cast<details::const_string_range_node<Type>*>(branch[0])->str ();
40859 std::string& s1 = static_cast<details::stringvar_node<Type>* >(branch[1])->ref ();
40860 range_t rp0 = static_cast<details::const_string_range_node<Type>*>(branch[0])->range();
40861
40862 static_cast<details::const_string_range_node<Type>*>(branch[0])->range_ref().clear();
40863
40865
40866 return synthesize_str_xrox_expression_impl<const std::string,std::string&>(opr, s0, s1, rp0);
40867 }

References exprtk::details::free_node(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Referenced by exprtk::parser< T >::expression_generator< Type >::synthesize_string_expression().

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

◆ synthesize_csrosr_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_csrosr_expression ( const details::operator_type opr,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 40869 of file exprtk.hpp.

40870 {
40871 const std::string s0 = static_cast<details::const_string_range_node<Type>*>(branch[0])->str ();
40872 std::string& s1 = static_cast<details::string_range_node<Type>* >(branch[1])->ref ();
40873 const range_t rp0 = static_cast<details::const_string_range_node<Type>*>(branch[0])->range();
40874 const range_t rp1 = static_cast<details::string_range_node<Type>* >(branch[1])->range();
40875
40876 static_cast<details::const_string_range_node<Type>*>(branch[0])->range_ref().clear();
40877 static_cast<details::string_range_node<Type>*> (branch[1])->range_ref().clear();
40878
40881
40882 return synthesize_str_xroxr_expression_impl<const std::string,std::string&>(opr, s0, s1, rp0, rp1);
40883 }

References exprtk::details::free_node(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Referenced by exprtk::parser< T >::expression_generator< Type >::synthesize_string_expression().

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

◆ synthesize_expression() [1/3]

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::synthesize_expression ( const details::operator_type operation,
expression_node_ptr(&)  branch[2],
expression_node_ptr result 
)
inlineprivate

Definition at line 35735 of file exprtk.hpp.

35738 {
35739 result = error_node();
35740
35741 if (!operation_optimisable(operation))
35742 return false;
35743
35744 const std::string node_id = branch_to_id(branch);
35745
35746 const typename synthesize_map_t::iterator itr = synthesize_map_.find(node_id);
35747
35748 if (synthesize_map_.end() != itr)
35749 {
35750 result = itr->second((*this), operation, branch);
35751
35752 return true;
35753 }
35754 else
35755 return false;
35756 }

References exprtk::parser< T >::expression_generator< Type >::branch_to_id(), exprtk::parser< T >::error_node(), exprtk::parser< T >::expression_generator< Type >::operation_optimisable(), and exprtk::parser< T >::expression_generator< Type >::synthesize_map_.

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ synthesize_expression() [2/3]

template<typename T >
template<typename Type >
template<typename NodeType , std::size_t N>
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_expression ( const details::operator_type operation,
expression_node_ptr(&)  branch[N] 
)
inlineprivate

Definition at line 41232 of file exprtk.hpp.

41233 {
41234 if (
41235 (details::e_in == operation) ||
41236 (details::e_like == operation) ||
41237 (details::e_ilike == operation)
41238 )
41239 {
41241
41242 return error_node();
41243 }
41244 else if (!details::all_nodes_valid<N>(branch))
41245 {
41247
41248 return error_node();
41249 }
41250 else if ((details::e_default != operation))
41251 {
41252 // Attempt simple constant folding optimisation.
41253 expression_node_ptr expression_point = node_allocator_->allocate<NodeType>(operation,branch);
41254
41255 if (is_constant_foldable<N>(branch))
41256 {
41257 const Type v = expression_point->value();
41258 details::free_node(*node_allocator_,expression_point);
41259
41261 }
41262
41263 if (expression_point && expression_point->valid())
41264 {
41265 return expression_point;
41266 }
41267
41270 token_t(),
41271 "ERR273 - Failed to synthesize node: NodeType",
41273
41274 details::free_node(*node_allocator_, expression_point);
41275 }
41276
41277 return error_node();
41278 }

References exprtk::details::node_allocator::allocate(), exprtk::details::e_default, exprtk::details::e_ilike, exprtk::details::e_in, exprtk::details::e_like, exprtk::parser_error::e_parser, exprtk::parser< T >::error_node(), exprtk_error_location, exprtk::details::free_node(), exprtk::parser_error::make_error(), exprtk::details::match_impl(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::parser< T >::set_error(), exprtk::details::expression_node< T >::valid(), and exprtk::details::expression_node< T >::value().

Here is the call graph for this function:

◆ synthesize_expression() [3/3]

template<typename T >
template<typename Type >
template<typename NodeType , std::size_t N>
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_expression ( F f,
expression_node_ptr(&)  branch[N] 
)
inlineprivate

Definition at line 41281 of file exprtk.hpp.

41282 {
41283 if (!details::all_nodes_valid<N>(branch))
41284 {
41286
41287 return error_node();
41288 }
41289
41290 typedef typename details::function_N_node<T,ifunction_t,N> function_N_node_t;
41291
41292 // Attempt simple constant folding optimisation.
41293
41294 expression_node_ptr expression_point = node_allocator_->allocate<NodeType>(f);
41295 function_N_node_t* func_node_ptr = dynamic_cast<function_N_node_t*>(expression_point);
41296
41297 if (0 == func_node_ptr)
41298 {
41300
41301 return error_node();
41302 }
41303 else
41304 func_node_ptr->init_branches(branch);
41305
41306 if (is_constant_foldable<N>(branch) && !f->has_side_effects())
41307 {
41308 Type v = expression_point->value();
41309 details::free_node(*node_allocator_,expression_point);
41310
41312 }
41313
41314 parser_->state_.activate_side_effect("synthesize_expression(function<NT,N>)");
41315
41316 return expression_point;
41317 }

References exprtk::parser< T >::parser_state::activate_side_effect(), exprtk::details::node_allocator::allocate(), exprtk::parser< T >::error_node(), exprtk::details::free_node(), exprtk::function_traits::has_side_effects(), exprtk::details::match_impl(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::parser< T >::state_, and exprtk::details::expression_node< T >::value().

Here is the call graph for this function:

◆ synthesize_null_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_null_expression ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 41135 of file exprtk.hpp.

41136 {
41137 /*
41138 Note: The following are the type promotion rules
41139 that relate to operations that include 'null':
41140 0. null ==/!= null --> true false
41141 1. null operation null --> null
41142 2. x ==/!= null --> true/false
41143 3. null ==/!= x --> true/false
41144 4. x operation null --> x
41145 5. null operation x --> x
41146 */
41147
41148 typedef typename details::null_eq_node<T> nulleq_node_t;
41149
41150 const bool b0_null = details::is_null_node(branch[0]);
41151 const bool b1_null = details::is_null_node(branch[1]);
41152
41153 if (b0_null && b1_null)
41154 {
41156
41157 if (details::e_eq == operation)
41158 result = node_allocator_->allocate_c<literal_node_t>(T(1));
41159 else if (details::e_ne == operation)
41160 result = node_allocator_->allocate_c<literal_node_t>(T(0));
41161
41162 if (result)
41163 {
41166
41167 return result;
41168 }
41169
41171
41172 return branch[0];
41173 }
41174 else if (details::e_eq == operation)
41175 {
41177 allocate_rc<nulleq_node_t>(branch[b0_null ? 0 : 1],true);
41178
41179 details::free_node(*node_allocator_,branch[b0_null ? 1 : 0]);
41180
41181 return result;
41182 }
41183 else if (details::e_ne == operation)
41184 {
41186 allocate_rc<nulleq_node_t>(branch[b0_null ? 0 : 1],false);
41187
41188 details::free_node(*node_allocator_,branch[b0_null ? 1 : 0]);
41189
41190 return result;
41191 }
41192 else if (b0_null)
41193 {
41195 branch[0] = branch[1];
41196 branch[1] = error_node();
41197 }
41198 else if (b1_null)
41199 {
41201 branch[1] = error_node();
41202 }
41203
41204 if (
41205 (details::e_add == operation) || (details::e_sub == operation) ||
41206 (details::e_mul == operation) || (details::e_div == operation) ||
41207 (details::e_mod == operation) || (details::e_pow == operation)
41208 )
41209 {
41210 return branch[0];
41211 }
41212
41214
41215 if (
41216 (details::e_lt == operation) || (details::e_lte == operation) ||
41217 (details::e_gt == operation) || (details::e_gte == operation) ||
41218 (details::e_and == operation) || (details::e_nand == operation) ||
41219 (details::e_or == operation) || (details::e_nor == operation) ||
41220 (details::e_xor == operation) || (details::e_xnor == operation) ||
41221 (details::e_in == operation) || (details::e_like == operation) ||
41222 (details::e_ilike == operation)
41223 )
41224 {
41226 }
41227
41229 }

References exprtk::details::node_allocator::allocate(), exprtk::details::node_allocator::allocate_c(), exprtk::details::e_add, exprtk::details::e_and, exprtk::details::e_div, exprtk::details::e_eq, exprtk::details::e_gt, exprtk::details::e_gte, exprtk::details::e_ilike, exprtk::details::e_in, exprtk::details::e_like, exprtk::details::e_lt, exprtk::details::e_lte, exprtk::details::e_mod, exprtk::details::e_mul, exprtk::details::e_nand, exprtk::details::e_ne, exprtk::details::e_nor, exprtk::details::e_or, exprtk::details::e_pow, exprtk::details::e_sub, exprtk::details::e_xnor, exprtk::details::e_xor, exprtk::parser< T >::error_node(), exprtk::details::free_node(), exprtk::details::is_null_node(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ synthesize_shortcircuit_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_shortcircuit_expression ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 34634 of file exprtk.hpp.

34635 {
34637
34638 if (details::is_constant_node(branch[0]))
34639 {
34640 if (
34641 (details::e_scand == operation) &&
34642 std::equal_to<T>()(T(0),branch[0]->value())
34643 )
34644 result = node_allocator_->allocate_c<literal_node_t>(T(0));
34645 else if (
34646 (details::e_scor == operation) &&
34647 std::not_equal_to<T>()(T(0),branch[0]->value())
34648 )
34649 result = node_allocator_->allocate_c<literal_node_t>(T(1));
34650 }
34651
34652 if (details::is_constant_node(branch[1]) && (0 == result))
34653 {
34654 if (
34655 (details::e_scand == operation) &&
34656 std::equal_to<T>()(T(0),branch[1]->value())
34657 )
34658 result = node_allocator_->allocate_c<literal_node_t>(T(0));
34659 else if (
34660 (details::e_scor == operation) &&
34661 std::not_equal_to<T>()(T(0),branch[1]->value())
34662 )
34663 result = node_allocator_->allocate_c<literal_node_t>(T(1));
34664 }
34665
34666 if (result)
34667 {
34670
34671 return result;
34672 }
34673 else if (details::e_scand == operation)
34674 {
34675 return synthesize_expression<scand_node_t,2>(operation, branch);
34676 }
34677 else if (details::e_scor == operation)
34678 {
34679 return synthesize_expression<scor_node_t,2>(operation, branch);
34680 }
34681 else
34682 return error_node();
34683 }

References exprtk::details::node_allocator::allocate_c(), exprtk::details::e_scand, exprtk::details::e_scor, exprtk::parser< T >::error_node(), exprtk::details::free_node(), exprtk::details::is_constant_node(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ synthesize_socs_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_socs_expression ( const details::operator_type opr,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 40747 of file exprtk.hpp.

40748 {
40749 std::string& s0 = static_cast< details::stringvar_node<Type>*>(branch[0])->ref();
40750 std::string s1 = static_cast<details::string_literal_node<Type>*>(branch[1])->str();
40751
40753
40754 return synthesize_sos_expression_impl<std::string&, const std::string>(opr, s0, s1);
40755 }

References exprtk::details::free_node(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Referenced by exprtk::parser< T >::expression_generator< Type >::synthesize_string_expression().

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

◆ synthesize_socsr_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_socsr_expression ( const details::operator_type opr,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 40718 of file exprtk.hpp.

40719 {
40720 std::string& s0 = static_cast<details::stringvar_node<Type>*> (branch[0])->ref ();
40721 std::string s1 = static_cast<details::const_string_range_node<Type>*>(branch[1])->str ();
40722 range_t rp1 = static_cast<details::const_string_range_node<Type>*>(branch[1])->range();
40723
40724 static_cast<details::const_string_range_node<Type>*>(branch[1])->range_ref().clear();
40725
40727
40728 return synthesize_str_xoxr_expression_impl<std::string&, const std::string>(opr, s0, s1, rp1);
40729 }

References exprtk::details::free_node(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Referenced by exprtk::parser< T >::expression_generator< Type >::synthesize_string_expression().

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

◆ synthesize_sos_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_sos_expression ( const details::operator_type opr,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 40684 of file exprtk.hpp.

40685 {
40686 std::string& s0 = static_cast<details::stringvar_node<Type>*>(branch[0])->ref();
40687 std::string& s1 = static_cast<details::stringvar_node<Type>*>(branch[1])->ref();
40688
40689 return synthesize_sos_expression_impl<std::string&,std::string&>(opr, s0, s1);
40690 }

Referenced by exprtk::parser< T >::expression_generator< Type >::synthesize_string_expression().

Here is the caller graph for this function:

◆ synthesize_sos_expression_impl()

template<typename T >
template<typename Type >
template<typename T0 , typename T1 >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_sos_expression_impl ( const details::operator_type opr,
T0  s0,
T1  s1 
)
inlineprivate

Definition at line 40670 of file exprtk.hpp.

40671 {
40672 switch (opr)
40673 {
40674 #define case_stmt(op0, op1) \
40675 case op0 : return node_allocator_-> \
40676 allocate_tt<typename details::sos_node<Type,T0,T1,op1<Type> >,T0,T1>(s0, s1); \
40677
40679 #undef case_stmt
40680 default : return error_node();
40681 }
40682 }
#define string_opr_switch_statements
Definition exprtk.hpp:40604

References exprtk::parser< T >::error_node(), and string_opr_switch_statements.

Here is the call graph for this function:

◆ synthesize_sosr_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_sosr_expression ( const details::operator_type opr,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 40705 of file exprtk.hpp.

40706 {
40707 std::string& s0 = static_cast<details::stringvar_node<Type>*> (branch[0])->ref ();
40708 std::string& s1 = static_cast<details::string_range_node<Type>*>(branch[1])->ref ();
40709 range_t rp1 = static_cast<details::string_range_node<Type>*>(branch[1])->range();
40710
40711 static_cast<details::string_range_node<Type>*>(branch[1])->range_ref().clear();
40712
40714
40715 return synthesize_str_xoxr_expression_impl<std::string&,std::string&>(opr, s0, s1, rp1);
40716 }

References exprtk::details::free_node(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Referenced by exprtk::parser< T >::expression_generator< Type >::synthesize_string_expression().

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

◆ synthesize_srocs_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_srocs_expression ( const details::operator_type opr,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 40781 of file exprtk.hpp.

40782 {
40783 std::string& s0 = static_cast<details::string_range_node<Type>* >(branch[0])->ref ();
40784 std::string s1 = static_cast<details::string_literal_node<Type>*>(branch[1])->str ();
40785 range_t rp0 = static_cast<details::string_range_node<Type>* >(branch[0])->range();
40786
40787 static_cast<details::string_range_node<Type>*>(branch[0])->range_ref().clear();
40788
40791
40792 return synthesize_str_xrox_expression_impl<std::string&, const std::string>(opr, s0, s1, rp0);
40793 }

References exprtk::details::free_node(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Referenced by exprtk::parser< T >::expression_generator< Type >::synthesize_string_expression().

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

◆ synthesize_srocsr_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_srocsr_expression ( const details::operator_type opr,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 40795 of file exprtk.hpp.

40796 {
40797 std::string& s0 = static_cast<details::string_range_node<Type>* >(branch[0])->ref ();
40798 std::string s1 = static_cast<details::const_string_range_node<Type>*>(branch[1])->str ();
40799 range_t rp0 = static_cast<details::string_range_node<Type>* >(branch[0])->range();
40800 range_t rp1 = static_cast<details::const_string_range_node<Type>*>(branch[1])->range();
40801
40802 static_cast<details::string_range_node<Type>*> (branch[0])->range_ref().clear();
40803 static_cast<details::const_string_range_node<Type>*>(branch[1])->range_ref().clear();
40804
40807
40808 return synthesize_str_xroxr_expression_impl<std::string&, const std::string>(opr, s0, s1, rp0, rp1);
40809 }

References exprtk::details::free_node(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Referenced by exprtk::parser< T >::expression_generator< Type >::synthesize_string_expression().

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

◆ synthesize_sros_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_sros_expression ( const details::operator_type opr,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 40692 of file exprtk.hpp.

40693 {
40694 std::string& s0 = static_cast<details::string_range_node<Type>*>(branch[0])->ref ();
40695 std::string& s1 = static_cast<details::stringvar_node<Type>*> (branch[1])->ref ();
40696 range_t rp0 = static_cast<details::string_range_node<Type>*>(branch[0])->range();
40697
40698 static_cast<details::string_range_node<Type>*>(branch[0])->range_ref().clear();
40699
40701
40702 return synthesize_str_xrox_expression_impl<std::string&,std::string&>(opr, s0, s1, rp0);
40703 }

References exprtk::details::free_node(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Referenced by exprtk::parser< T >::expression_generator< Type >::synthesize_string_expression().

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

◆ synthesize_srosr_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_srosr_expression ( const details::operator_type opr,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 40731 of file exprtk.hpp.

40732 {
40733 std::string& s0 = static_cast<details::string_range_node<Type>*>(branch[0])->ref ();
40734 std::string& s1 = static_cast<details::string_range_node<Type>*>(branch[1])->ref ();
40735 range_t rp0 = static_cast<details::string_range_node<Type>*>(branch[0])->range();
40736 range_t rp1 = static_cast<details::string_range_node<Type>*>(branch[1])->range();
40737
40738 static_cast<details::string_range_node<Type>*>(branch[0])->range_ref().clear();
40739 static_cast<details::string_range_node<Type>*>(branch[1])->range_ref().clear();
40740
40743
40744 return synthesize_str_xroxr_expression_impl<std::string&,std::string&>(opr, s0, s1, rp0, rp1);
40745 }

References exprtk::details::free_node(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Referenced by exprtk::parser< T >::expression_generator< Type >::synthesize_string_expression().

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

◆ synthesize_str_xoxr_expression_impl()

template<typename T >
template<typename Type >
template<typename T0 , typename T1 >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_str_xoxr_expression_impl ( const details::operator_type opr,
T0  s0,
T1  s1,
range_t  rp1 
)
inlineprivate

Definition at line 40634 of file exprtk.hpp.

40637 {
40638 switch (opr)
40639 {
40640 #define case_stmt(op0, op1) \
40641 case op0 : return node_allocator_-> \
40642 allocate_ttt<typename details::str_xoxr_node<Type,T0,T1,range_t,op1<Type> >,T0,T1> \
40643 (s0, s1, rp1); \
40644
40646 #undef case_stmt
40647 default : return error_node();
40648 }
40649 }

References exprtk::parser< T >::error_node(), and string_opr_switch_statements.

Here is the call graph for this function:

◆ synthesize_str_xrox_expression_impl()

template<typename T >
template<typename Type >
template<typename T0 , typename T1 >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_str_xrox_expression_impl ( const details::operator_type opr,
T0  s0,
T1  s1,
range_t  rp0 
)
inlineprivate

Definition at line 40616 of file exprtk.hpp.

40619 {
40620 switch (opr)
40621 {
40622 #define case_stmt(op0, op1) \
40623 case op0 : return node_allocator_-> \
40624 allocate_ttt<typename details::str_xrox_node<Type,T0,T1,range_t,op1<Type> >,T0,T1> \
40625 (s0, s1, rp0); \
40626
40628 #undef case_stmt
40629 default : return error_node();
40630 }
40631 }

References exprtk::parser< T >::error_node(), and string_opr_switch_statements.

Here is the call graph for this function:

◆ synthesize_str_xroxr_expression_impl()

template<typename T >
template<typename Type >
template<typename T0 , typename T1 >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_str_xroxr_expression_impl ( const details::operator_type opr,
T0  s0,
T1  s1,
range_t  rp0,
range_t  rp1 
)
inlineprivate

Definition at line 40652 of file exprtk.hpp.

40655 {
40656 switch (opr)
40657 {
40658 #define case_stmt(op0, op1) \
40659 case op0 : return node_allocator_-> \
40660 allocate_tttt<typename details::str_xroxr_node<Type,T0,T1,range_t,op1<Type> >,T0,T1> \
40661 (s0, s1, rp0, rp1); \
40662
40664 #undef case_stmt
40665 default : return error_node();
40666 }
40667 }

References exprtk::parser< T >::error_node(), and string_opr_switch_statements.

Here is the call graph for this function:

◆ synthesize_string_expression() [1/2]

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_string_expression ( const details::operator_type opr,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 40932 of file exprtk.hpp.

40933 {
40934 if ((0 == branch[0]) || (0 == branch[1]))
40935 {
40937
40938 return error_node();
40939 }
40940
40941 const bool b0_is_s = details::is_string_node (branch[0]);
40942 const bool b0_is_cs = details::is_const_string_node (branch[0]);
40943 const bool b0_is_sr = details::is_string_range_node (branch[0]);
40944 const bool b0_is_csr = details::is_const_string_range_node(branch[0]);
40945
40946 const bool b1_is_s = details::is_string_node (branch[1]);
40947 const bool b1_is_cs = details::is_const_string_node (branch[1]);
40948 const bool b1_is_sr = details::is_string_range_node (branch[1]);
40949 const bool b1_is_csr = details::is_const_string_range_node(branch[1]);
40950
40951 const bool b0_is_gen = details::is_string_assignment_node (branch[0]) ||
40953 details::is_string_concat_node (branch[0]) ||
40957 details::is_string_vararg_node (branch[0]) ;
40958
40959 const bool b1_is_gen = details::is_string_assignment_node (branch[1]) ||
40961 details::is_string_concat_node (branch[1]) ||
40965 details::is_string_vararg_node (branch[1]) ;
40966
40967 if (details::e_add == opr)
40968 {
40969 if (!b0_is_cs || !b1_is_cs)
40970 {
40971 return synthesize_expression<string_concat_node_t,2>(opr,branch);
40972 }
40973 }
40974
40975 if (b0_is_gen || b1_is_gen)
40976 {
40977 return synthesize_strogen_expression(opr,branch);
40978 }
40979 else if (b0_is_s)
40980 {
40981 if (b1_is_s ) return synthesize_sos_expression (opr,branch);
40982 else if (b1_is_cs ) return synthesize_socs_expression (opr,branch);
40983 else if (b1_is_sr ) return synthesize_sosr_expression (opr,branch);
40984 else if (b1_is_csr) return synthesize_socsr_expression (opr,branch);
40985 }
40986 else if (b0_is_cs)
40987 {
40988 if (b1_is_s ) return synthesize_csos_expression (opr,branch);
40989 else if (b1_is_cs ) return synthesize_csocs_expression (opr,branch);
40990 else if (b1_is_sr ) return synthesize_csosr_expression (opr,branch);
40991 else if (b1_is_csr) return synthesize_csocsr_expression(opr,branch);
40992 }
40993 else if (b0_is_sr)
40994 {
40995 if (b1_is_s ) return synthesize_sros_expression (opr,branch);
40996 else if (b1_is_sr ) return synthesize_srosr_expression (opr,branch);
40997 else if (b1_is_cs ) return synthesize_srocs_expression (opr,branch);
40998 else if (b1_is_csr) return synthesize_srocsr_expression(opr,branch);
40999 }
41000 else if (b0_is_csr)
41001 {
41002 if (b1_is_s ) return synthesize_csros_expression (opr,branch);
41003 else if (b1_is_sr ) return synthesize_csrosr_expression (opr,branch);
41004 else if (b1_is_cs ) return synthesize_csrocs_expression (opr,branch);
41005 else if (b1_is_csr) return synthesize_csrocsr_expression(opr,branch);
41006 }
41007
41008 return error_node();
41009 }
expression_node_ptr synthesize_sosr_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:40705
expression_node_ptr synthesize_srosr_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:40731
expression_node_ptr synthesize_csros_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:40856
expression_node_ptr synthesize_csosr_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:40767
expression_node_ptr synthesize_csocs_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:40811
expression_node_ptr synthesize_srocs_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:40781
expression_node_ptr synthesize_csos_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:40757
expression_node_ptr synthesize_srocsr_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:40795
expression_node_ptr synthesize_sros_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:40692
expression_node_ptr synthesize_csocsr_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:40842
expression_node_ptr synthesize_csrocs_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:40885
expression_node_ptr synthesize_socsr_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:40718
expression_node_ptr synthesize_csrocsr_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:40898
expression_node_ptr synthesize_strogen_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:40913
expression_node_ptr synthesize_csrosr_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:40869
expression_node_ptr synthesize_socs_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:40747
expression_node_ptr synthesize_sos_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:40684
bool is_string_ccondition_node(const expression_node< T > *node)
Definition exprtk.hpp:18967
bool is_string_assignment_node(const expression_node< T > *node)
Definition exprtk.hpp:18943
bool is_string_vararg_node(const expression_node< T > *node)
Definition exprtk.hpp:18973
bool is_string_condition_node(const expression_node< T > *node)
Definition exprtk.hpp:18961
bool is_string_function_node(const expression_node< T > *node)
Definition exprtk.hpp:18955
bool is_genricstring_range_node(const expression_node< T > *node)
Definition exprtk.hpp:18979
bool is_string_concat_node(const expression_node< T > *node)
Definition exprtk.hpp:18949

References exprtk::details::e_add, exprtk::parser< T >::error_node(), exprtk::details::free_all_nodes(), exprtk::details::is_const_string_node(), exprtk::details::is_const_string_range_node(), exprtk::details::is_genricstring_range_node(), exprtk::details::is_string_assignment_node(), exprtk::details::is_string_ccondition_node(), exprtk::details::is_string_concat_node(), exprtk::details::is_string_condition_node(), exprtk::details::is_string_function_node(), exprtk::details::is_string_node(), exprtk::details::is_string_range_node(), exprtk::details::is_string_vararg_node(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, exprtk::parser< T >::expression_generator< Type >::synthesize_csocs_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_csocsr_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_csos_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_csosr_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_csrocs_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_csrocsr_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_csros_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_csrosr_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_socs_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_socsr_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_sos_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_sosr_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_srocs_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_srocsr_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_sros_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_srosr_expression(), and exprtk::parser< T >::expression_generator< Type >::synthesize_strogen_expression().

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()(), and exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ synthesize_string_expression() [2/2]

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_string_expression ( const details::operator_type opr,
expression_node_ptr(&)  branch[3] 
)
inlineprivate

Definition at line 41019 of file exprtk.hpp.

41020 {
41021 if (details::e_inrange != opr)
41022 return error_node();
41023 else if ((0 == branch[0]) || (0 == branch[1]) || (0 == branch[2]))
41024 {
41026
41027 return error_node();
41028 }
41029 else if (
41030 details::is_const_string_node(branch[0]) &&
41031 details::is_const_string_node(branch[1]) &&
41033 )
41034 {
41035 const std::string s0 = static_cast<details::string_literal_node<Type>*>(branch[0])->str();
41036 const std::string s1 = static_cast<details::string_literal_node<Type>*>(branch[1])->str();
41037 const std::string s2 = static_cast<details::string_literal_node<Type>*>(branch[2])->str();
41038
41039 const Type v = (((s0 <= s1) && (s1 <= s2)) ? Type(1) : Type(0));
41040
41042
41044 }
41045 else if (
41046 details::is_string_node(branch[0]) &&
41047 details::is_string_node(branch[1]) &&
41048 details::is_string_node(branch[2])
41049 )
41050 {
41051 std::string& s0 = static_cast<details::stringvar_node<Type>*>(branch[0])->ref();
41052 std::string& s1 = static_cast<details::stringvar_node<Type>*>(branch[1])->ref();
41053 std::string& s2 = static_cast<details::stringvar_node<Type>*>(branch[2])->ref();
41054
41056
41057 return node_allocator_->allocate_type<inrange_t, std::string&, std::string&, std::string&>(s0, s1, s2);
41058 }
41059 else if (
41060 details::is_const_string_node(branch[0]) &&
41061 details::is_string_node(branch[1]) &&
41063 )
41064 {
41065 std::string s0 = static_cast<details::string_literal_node<Type>*>(branch[0])->str();
41066 std::string& s1 = static_cast<details::stringvar_node<Type>* >(branch[1])->ref();
41067 std::string s2 = static_cast<details::string_literal_node<Type>*>(branch[2])->str();
41068
41070
41073
41074 return node_allocator_->allocate_type<inrange_t, std::string, std::string&, std::string>(s0, s1, s2);
41075 }
41076 else if (
41077 details::is_string_node(branch[0]) &&
41078 details::is_const_string_node(branch[1]) &&
41079 details::is_string_node(branch[2])
41080 )
41081 {
41082 std::string& s0 = static_cast<details::stringvar_node<Type>* >(branch[0])->ref();
41083 std::string s1 = static_cast<details::string_literal_node<Type>*>(branch[1])->str();
41084 std::string& s2 = static_cast<details::stringvar_node<Type>* >(branch[2])->ref();
41085
41087
41089
41090 return node_allocator_->allocate_type<inrange_t, std::string&, std::string, std::string&>(s0, s1, s2);
41091 }
41092 else if (
41093 details::is_string_node(branch[0]) &&
41094 details::is_string_node(branch[1]) &&
41096 )
41097 {
41098 std::string& s0 = static_cast<details::stringvar_node<Type>* >(branch[0])->ref();
41099 std::string& s1 = static_cast<details::stringvar_node<Type>* >(branch[1])->ref();
41100 std::string s2 = static_cast<details::string_literal_node<Type>*>(branch[2])->str();
41101
41103
41105
41106 return node_allocator_->allocate_type<inrange_t, std::string&, std::string&, std::string>(s0, s1, s2);
41107 }
41108 else if (
41109 details::is_const_string_node(branch[0]) &&
41110 details:: is_string_node(branch[1]) &&
41111 details:: is_string_node(branch[2])
41112 )
41113 {
41114 std::string s0 = static_cast<details::string_literal_node<Type>*>(branch[0])->str();
41115 std::string& s1 = static_cast<details::stringvar_node<Type>* >(branch[1])->ref();
41116 std::string& s2 = static_cast<details::stringvar_node<Type>* >(branch[2])->ref();
41117
41119
41121
41122 return node_allocator_->allocate_type<inrange_t, std::string, std::string&, std::string&>(s0, s1, s2);
41123 }
41124 else
41125 return error_node();
41126 }
expression_node< typename node_type::value_type > * allocate_type(T1 t1, T2 t2, T3 t3) const
Definition exprtk.hpp:19320

References exprtk::details::node_allocator::allocate_c(), exprtk::details::node_allocator::allocate_type(), exprtk::details::e_inrange, exprtk::parser< T >::error_node(), exprtk::details::free_all_nodes(), exprtk::details::free_node(), exprtk::details::is_const_string_node(), exprtk::details::is_string_node(), and exprtk::parser< T >::expression_generator< Type >::node_allocator_.

Here is the call graph for this function:

◆ synthesize_strogen_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_strogen_expression ( const details::operator_type opr,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 40913 of file exprtk.hpp.

40914 {
40915 switch (opr)
40916 {
40917 #define case_stmt(op0, op1) \
40918 case op0 : return node_allocator_-> \
40919 allocate_ttt<typename details::str_sogens_node<Type,op1<Type> > > \
40920 (opr, branch[0], branch[1]); \
40921
40923 #undef case_stmt
40924 default : return error_node();
40925 }
40926 }

References exprtk::parser< T >::error_node(), and string_opr_switch_statements.

Referenced by exprtk::parser< T >::expression_generator< Type >::synthesize_string_expression().

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

◆ synthesize_swap_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_swap_expression ( expression_node_ptr(&)  branch[2])
inlineprivate

Definition at line 34552 of file exprtk.hpp.

34553 {
34554 const bool v0_is_ivar = details::is_ivariable_node(branch[0]);
34555 const bool v1_is_ivar = details::is_ivariable_node(branch[1]);
34556
34557 const bool v0_is_ivec = details::is_ivector_node (branch[0]);
34558 const bool v1_is_ivec = details::is_ivector_node (branch[1]);
34559
34560 #ifndef exprtk_disable_string_capabilities
34561 const bool v0_is_str = details::is_generally_string_node(branch[0]);
34562 const bool v1_is_str = details::is_generally_string_node(branch[1]);
34563 #endif
34564
34566 std::string node_name = "Unknown";
34567
34568 if (v0_is_ivar && v1_is_ivar)
34569 {
34570 typedef details::variable_node<T>* variable_node_ptr;
34571
34572 variable_node_ptr v0 = variable_node_ptr(0);
34573 variable_node_ptr v1 = variable_node_ptr(0);
34574
34575 if (
34576 (0 != (v0 = dynamic_cast<variable_node_ptr>(branch[0]))) &&
34577 (0 != (v1 = dynamic_cast<variable_node_ptr>(branch[1])))
34578 )
34579 {
34581 node_name = "swap_node";
34582 }
34583 else
34584 {
34585 result = node_allocator_->allocate<details::swap_generic_node<T> >(branch[0],branch[1]);
34586 node_name = "swap_generic_node";
34587 }
34588 }
34589 else if (v0_is_ivec && v1_is_ivec)
34590 {
34591 result = node_allocator_->allocate<details::swap_vecvec_node<T> >(branch[0],branch[1]);
34592 node_name = "swap_vecvec_node";
34593 }
34594 #ifndef exprtk_disable_string_capabilities
34595 else if (v0_is_str && v1_is_str)
34596 {
34597 if (is_string_node(branch[0]) && is_string_node(branch[1]))
34598 {
34600 (branch[0], branch[1]);
34601 node_name = "swap_string_node";
34602 }
34603 else
34604 {
34606 (branch[0], branch[1]);
34607 node_name = "swap_genstrings_node";
34608 }
34609 }
34610 #endif
34611 else
34612 {
34613 parser_->set_synthesis_error("Only variables, strings, vectors or vector elements can be swapped");
34614 return error_node();
34615 }
34616
34617 if (result && result->valid())
34618 {
34619 parser_->state_.activate_side_effect("synthesize_swap_expression()");
34620 return result;
34621 }
34622
34625 token_t(),
34626 "ERR272 - Failed to synthesize node: " + node_name,
34628
34630 return error_node();
34631 }
bool is_ivariable_node(const expression_node< T > *node)
Definition exprtk.hpp:5685

References exprtk::parser< T >::parser_state::activate_side_effect(), exprtk::details::node_allocator::allocate(), exprtk::parser_error::e_synthesis, exprtk::parser< T >::error_node(), exprtk_error_location, exprtk::details::free_node(), exprtk::details::is_generally_string_node(), exprtk::details::is_ivariable_node(), exprtk::details::is_ivector_node(), exprtk::parser_error::make_error(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::parser< T >::set_error(), exprtk::parser< T >::set_synthesis_error(), exprtk::parser< T >::state_, and exprtk::details::expression_node< T >::valid().

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ synthesize_unary_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_unary_expression ( const details::operator_type operation,
expression_node_ptr(&)  branch[1] 
)
inline

Definition at line 32982 of file exprtk.hpp.

32984 {
32985 switch (operation)
32986 {
32987 #define case_stmt(op0, op1) \
32988 case op0 : return node_allocator_-> \
32989 allocate<typename details::unary_branch_node<Type,op1<Type> > >(branch[0]); \
32990
32992 #undef case_stmt
32993 default : return error_node();
32994 }
32995 }
#define unary_opr_switch_statements
Definition exprtk.hpp:32907

References exprtk::parser< T >::error_node(), and unary_opr_switch_statements.

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ synthesize_uv_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_uv_expression ( const details::operator_type operation,
expression_node_ptr(&)  branch[1] 
)
inline

Definition at line 32949 of file exprtk.hpp.

32951 {
32952 T& v = static_cast<details::variable_node<T>*>(branch[0])->ref();
32953
32954 switch (operation)
32955 {
32956 #define case_stmt(op0, op1) \
32957 case op0 : return node_allocator_-> \
32958 allocate<typename details::unary_variable_node<Type,op1<Type> > >(v); \
32959
32961 #undef case_stmt
32962 default : return error_node();
32963 }
32964 }

References exprtk::parser< T >::error_node(), and unary_opr_switch_statements.

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ synthesize_uvec_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_uvec_expression ( const details::operator_type operation,
expression_node_ptr(&)  branch[1] 
)
inline

Definition at line 32966 of file exprtk.hpp.

32968 {
32969 switch (operation)
32970 {
32971 #define case_stmt(op0, op1) \
32972 case op0 : return node_allocator_-> \
32973 allocate<typename details::unary_vector_node<Type,op1<Type> > > \
32974 (operation, branch[0]); \
32975
32977 #undef case_stmt
32978 default : return error_node();
32979 }
32980 }

References exprtk::parser< T >::error_node(), and unary_opr_switch_statements.

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ synthesize_uvouv_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_uvouv_expression ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 40528 of file exprtk.hpp.

40529 {
40530 // Definition: uv o uv
40531 details::operator_type o0 = static_cast<details::uv_base_node<Type>*>(branch[0])->operation();
40532 details::operator_type o1 = static_cast<details::uv_base_node<Type>*>(branch[1])->operation();
40533 const Type& v0 = static_cast<details::uv_base_node<Type>*>(branch[0])->v();
40534 const Type& v1 = static_cast<details::uv_base_node<Type>*>(branch[1])->v();
40535 unary_functor_t u0 = reinterpret_cast<unary_functor_t> (0);
40536 unary_functor_t u1 = reinterpret_cast<unary_functor_t> (0);
40537 binary_functor_t f = reinterpret_cast<binary_functor_t>(0);
40538
40539 if (!valid_operator(o0,u0))
40540 return error_node();
40541 else if (!valid_operator(o1,u1))
40542 return error_node();
40543 else if (!valid_operator(operation,f))
40544 return error_node();
40545
40547
40548 if (
40549 (details::e_neg == o0) &&
40550 (details::e_neg == o1)
40551 )
40552 {
40553 switch (operation)
40554 {
40555 // (-v0 + -v1) --> -(v0 + v1)
40556 case details::e_add : result = (*this)(details::e_neg,
40558 allocate_rr<typename details::
40560 exprtk_debug(("(-v0 + -v1) --> -(v0 + v1)\n"));
40561 break;
40562
40563 // (-v0 - -v1) --> (v1 - v0)
40564 case details::e_sub : result = node_allocator_->
40565 allocate_rr<typename details::
40567 exprtk_debug(("(-v0 - -v1) --> (v1 - v0)\n"));
40568 break;
40569
40570 // (-v0 * -v1) --> (v0 * v1)
40571 case details::e_mul : result = node_allocator_->
40572 allocate_rr<typename details::
40574 exprtk_debug(("(-v0 * -v1) --> (v0 * v1)\n"));
40575 break;
40576
40577 // (-v0 / -v1) --> (v0 / v1)
40578 case details::e_div : result = node_allocator_->
40579 allocate_rr<typename details::
40581 exprtk_debug(("(-v0 / -v1) --> (v0 / v1)\n"));
40582 break;
40583
40584 default : break;
40585 }
40586 }
40587
40588 if (0 == result)
40589 {
40590 result = node_allocator_->
40591 allocate_rrrrr<typename details::uvouv_node<Type> >(v0, v1, u0, u1, f);
40592 }
40593
40595 return result;
40596 }
bool valid_operator(const details::operator_type &operation, binary_functor_t &bop)
Definition exprtk.hpp:31429
functor_t::bfunc_t binary_functor_t
Definition exprtk.hpp:22263
functor_t::ufunc_t unary_functor_t
Definition exprtk.hpp:22264

References exprtk::details::e_add, exprtk::details::e_div, exprtk::details::e_mul, exprtk::details::e_neg, exprtk::details::e_sub, exprtk::parser< T >::error_node(), exprtk_debug, exprtk::details::free_all_nodes(), exprtk::details::match_impl(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, and exprtk::parser< T >::expression_generator< Type >::valid_operator().

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ synthesize_vecarithmetic_operation_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_vecarithmetic_operation_expression ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 34466 of file exprtk.hpp.

34468 {
34469 const bool is_b0_ivec = details::is_ivector_node(branch[0]);
34470 const bool is_b1_ivec = details::is_ivector_node(branch[1]);
34471
34472 #define vector_ops \
34473 case_stmt(details::e_add , details::add_op) \
34474 case_stmt(details::e_sub , details::sub_op) \
34475 case_stmt(details::e_mul , details::mul_op) \
34476 case_stmt(details::e_div , details::div_op) \
34477 case_stmt(details::e_mod , details::mod_op) \
34478
34480 std::string node_name = "Unknown";
34481
34482 if (is_b0_ivec && is_b1_ivec)
34483 {
34484 switch (operation)
34485 {
34486 #define case_stmt(op0, op1) \
34487 case op0 : result = node_allocator_-> \
34488 template allocate_rrr<typename details::vec_binop_vecvec_node<Type,op1<Type> > > \
34489 (operation, branch[0], branch[1]); \
34490 node_name = "vec_binop_vecvec_node"; \
34491 break; \
34492
34494 case_stmt(details::e_pow,details:: pow_op)
34495 #undef case_stmt
34496 default : return error_node();
34497 }
34498 }
34499 else if (is_b0_ivec && !is_b1_ivec)
34500 {
34501 switch (operation)
34502 {
34503 #define case_stmt(op0, op1) \
34504 case op0 : result = node_allocator_-> \
34505 template allocate_rrr<typename details::vec_binop_vecval_node<Type,op1<Type> > > \
34506 (operation, branch[0], branch[1]); \
34507 node_name = "vec_binop_vecval_node(b0ivec,!b1ivec)"; \
34508 break; \
34509
34511 case_stmt(details::e_pow,details:: pow_op)
34512 #undef case_stmt
34513 default : return error_node();
34514 }
34515 }
34516 else if (!is_b0_ivec && is_b1_ivec)
34517 {
34518 switch (operation)
34519 {
34520 #define case_stmt(op0, op1) \
34521 case op0 : result = node_allocator_-> \
34522 template allocate_rrr<typename details::vec_binop_valvec_node<Type,op1<Type> > > \
34523 (operation, branch[0], branch[1]); \
34524 node_name = "vec_binop_vecval_node(!b0ivec,b1ivec)"; \
34525 break; \
34526
34528 #undef case_stmt
34529 default : return error_node();
34530 }
34531 }
34532 else
34533 return error_node();
34534
34535 if (result && result->valid())
34536 {
34537 return result;
34538 }
34539
34542 token_t(),
34543 "ERR271 - Failed to synthesize node: " + node_name,
34545
34547 return error_node();
34548
34549 #undef vector_ops
34550 }
#define vector_ops

References case_stmt, exprtk::details::e_pow, exprtk::parser_error::e_synthesis, exprtk::parser< T >::error_node(), exprtk_error_location, exprtk::details::free_node(), exprtk::details::is_ivector_node(), exprtk::parser_error::make_error(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::parser< T >::set_error(), exprtk::details::expression_node< T >::valid(), and vector_ops.

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ synthesize_veceqineqlogic_operation_expression()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::synthesize_veceqineqlogic_operation_expression ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
)
inlineprivate

Definition at line 34374 of file exprtk.hpp.

34376 {
34377 const bool is_b0_ivec = details::is_ivector_node(branch[0]);
34378 const bool is_b1_ivec = details::is_ivector_node(branch[1]);
34379
34380 #define batch_eqineq_logic_case \
34381 case_stmt(details::e_lt , details::lt_op ) \
34382 case_stmt(details::e_lte , details::lte_op ) \
34383 case_stmt(details::e_gt , details::gt_op ) \
34384 case_stmt(details::e_gte , details::gte_op ) \
34385 case_stmt(details::e_eq , details::eq_op ) \
34386 case_stmt(details::e_ne , details::ne_op ) \
34387 case_stmt(details::e_equal , details::equal_op) \
34388 case_stmt(details::e_and , details::and_op ) \
34389 case_stmt(details::e_nand , details::nand_op ) \
34390 case_stmt(details::e_or , details::or_op ) \
34391 case_stmt(details::e_nor , details::nor_op ) \
34392 case_stmt(details::e_xor , details::xor_op ) \
34393 case_stmt(details::e_xnor , details::xnor_op ) \
34394
34396 std::string node_name = "Unknown";
34397
34398 if (is_b0_ivec && is_b1_ivec)
34399 {
34400 switch (operation)
34401 {
34402 #define case_stmt(op0, op1) \
34403 case op0 : result = node_allocator_-> \
34404 template allocate_rrr<typename details::vec_binop_vecvec_node<Type,op1<Type> > > \
34405 (operation, branch[0], branch[1]); \
34406 node_name = "vec_binop_vecvec_node"; \
34407 break; \
34408
34410 #undef case_stmt
34411 default : return error_node();
34412 }
34413 }
34414 else if (is_b0_ivec && !is_b1_ivec)
34415 {
34416 switch (operation)
34417 {
34418 #define case_stmt(op0, op1) \
34419 case op0 : result = node_allocator_-> \
34420 template allocate_rrr<typename details::vec_binop_vecval_node<Type,op1<Type> > > \
34421 (operation, branch[0], branch[1]); \
34422 node_name = "vec_binop_vecval_node"; \
34423 break; \
34424
34426 #undef case_stmt
34427 default : return error_node();
34428 }
34429 }
34430 else if (!is_b0_ivec && is_b1_ivec)
34431 {
34432 switch (operation)
34433 {
34434 #define case_stmt(op0, op1) \
34435 case op0 : result = node_allocator_-> \
34436 template allocate_rrr<typename details::vec_binop_valvec_node<Type,op1<Type> > > \
34437 (operation, branch[0], branch[1]); \
34438 node_name = "vec_binop_valvec_node"; \
34439 break; \
34440
34442 #undef case_stmt
34443 default : return error_node();
34444 }
34445 }
34446 else
34447 return error_node();
34448
34449 if (result && result->valid())
34450 {
34451 return result;
34452 }
34453
34456 token_t(),
34457 "ERR270 - Failed to synthesize node: " + node_name,
34459
34461 return error_node();
34462
34463 #undef batch_eqineq_logic_case
34464 }
#define batch_eqineq_logic_case

References batch_eqineq_logic_case, exprtk::parser_error::e_synthesis, exprtk::parser< T >::error_node(), exprtk_error_location, exprtk::details::free_node(), exprtk::details::is_ivector_node(), exprtk::parser_error::make_error(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::parser< T >::set_error(), and exprtk::details::expression_node< T >::valid().

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ to_str()

template<typename T >
template<typename Type >
std::string exprtk::parser< T >::expression_generator< Type >::to_str ( const details::operator_type operation) const
inline

Definition at line 31630 of file exprtk.hpp.

31631 {
31632 switch (operation)
31633 {
31634 case details::e_add : return "+" ;
31635 case details::e_sub : return "-" ;
31636 case details::e_mul : return "*" ;
31637 case details::e_div : return "/" ;
31638 case details::e_mod : return "%" ;
31639 case details::e_pow : return "^" ;
31640 case details::e_lt : return "<" ;
31641 case details::e_lte : return "<=" ;
31642 case details::e_gt : return ">" ;
31643 case details::e_gte : return ">=" ;
31644 case details::e_eq : return "==" ;
31645 case details::e_ne : return "!=" ;
31646 case details::e_and : return "and" ;
31647 case details::e_nand : return "nand" ;
31648 case details::e_or : return "or" ;
31649 case details::e_nor : return "nor" ;
31650 case details::e_xor : return "xor" ;
31651 case details::e_xnor : return "xnor" ;
31652 default : return "UNKNOWN";
31653 }
31654 }

References exprtk::details::e_add, exprtk::details::e_and, exprtk::details::e_div, exprtk::details::e_eq, exprtk::details::e_gt, exprtk::details::e_gte, exprtk::details::e_lt, exprtk::details::e_lte, exprtk::details::e_mod, exprtk::details::e_mul, exprtk::details::e_nand, exprtk::details::e_ne, exprtk::details::e_nor, exprtk::details::e_or, exprtk::details::e_pow, exprtk::details::e_sub, exprtk::details::e_xnor, and exprtk::details::e_xor.

Referenced by exprtk::parser< T >::expression_generator< Type >::synthesize_sf4ext_expression::compile_left(), exprtk::parser< T >::expression_generator< Type >::synthesize_sf4ext_expression::compile_right(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovov_expression0::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovov_expression1::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovoc_expression0::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovoc_expression1::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocov_expression0::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocov_expression1::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_covov_expression0::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_covov_expression1::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_covoc_expression0::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_covoc_expression1::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_cocov_expression1::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vococ_expression0::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovov_expression0::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovoc_expression0::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovocov_expression0::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovov_expression0::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovov_expression0::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_covocov_expression0::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovoc_expression0::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovoc_expression0::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vococov_expression0::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovov_expression1::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovoc_expression1::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovocov_expression1::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovov_expression1::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovov_expression1::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_covocov_expression1::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovoc_expression1::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovoc_expression1::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vococov_expression1::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovov_expression2::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovoc_expression2::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovocov_expression2::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovov_expression2::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovov_expression2::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_covocov_expression2::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovoc_expression2::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovoc_expression2::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovov_expression3::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovoc_expression3::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovocov_expression3::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovov_expression3::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovov_expression3::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_covocov_expression3::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovoc_expression3::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovoc_expression3::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vococov_expression3::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovov_expression4::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovoc_expression4::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovocov_expression4::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovov_expression4::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovov_expression4::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_covocov_expression4::id(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovoc_expression4::id(), and exprtk::parser< T >::expression_generator< Type >::synthesize_covovoc_expression4::id().

Here is the caller graph for this function:

◆ unary_optimisable()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::unary_optimisable ( const details::operator_type operation) const
inline

Definition at line 31488 of file exprtk.hpp.

31489 {
31490 return (details::e_abs == operation) || (details::e_acos == operation) ||
31491 (details::e_acosh == operation) || (details::e_asin == operation) ||
31492 (details::e_asinh == operation) || (details::e_atan == operation) ||
31493 (details::e_atanh == operation) || (details::e_ceil == operation) ||
31494 (details::e_cos == operation) || (details::e_cosh == operation) ||
31495 (details::e_exp == operation) || (details::e_expm1 == operation) ||
31496 (details::e_floor == operation) || (details::e_log == operation) ||
31497 (details::e_log10 == operation) || (details::e_log2 == operation) ||
31498 (details::e_log1p == operation) || (details::e_neg == operation) ||
31499 (details::e_pos == operation) || (details::e_round == operation) ||
31500 (details::e_sin == operation) || (details::e_sinc == operation) ||
31501 (details::e_sinh == operation) || (details::e_sqrt == operation) ||
31502 (details::e_tan == operation) || (details::e_tanh == operation) ||
31503 (details::e_cot == operation) || (details::e_sec == operation) ||
31504 (details::e_csc == operation) || (details::e_r2d == operation) ||
31505 (details::e_d2r == operation) || (details::e_d2g == operation) ||
31506 (details::e_g2d == operation) || (details::e_notl == operation) ||
31507 (details::e_sgn == operation) || (details::e_erf == operation) ||
31508 (details::e_erfc == operation) || (details::e_ncdf == operation) ||
31509 (details::e_frac == operation) || (details::e_trunc == operation) ;
31510 }

References exprtk::details::e_abs, exprtk::details::e_acos, exprtk::details::e_acosh, exprtk::details::e_asin, exprtk::details::e_asinh, exprtk::details::e_atan, exprtk::details::e_atanh, exprtk::details::e_ceil, exprtk::details::e_cos, exprtk::details::e_cosh, exprtk::details::e_cot, exprtk::details::e_csc, exprtk::details::e_d2g, exprtk::details::e_d2r, exprtk::details::e_erf, exprtk::details::e_erfc, exprtk::details::e_exp, exprtk::details::e_expm1, exprtk::details::e_floor, exprtk::details::e_frac, exprtk::details::e_g2d, exprtk::details::e_log, exprtk::details::e_log10, exprtk::details::e_log1p, exprtk::details::e_log2, exprtk::details::e_ncdf, exprtk::details::e_neg, exprtk::details::e_notl, exprtk::details::e_pos, exprtk::details::e_r2d, exprtk::details::e_round, exprtk::details::e_sec, exprtk::details::e_sgn, exprtk::details::e_sin, exprtk::details::e_sinc, exprtk::details::e_sinh, exprtk::details::e_sqrt, exprtk::details::e_tan, exprtk::details::e_tanh, and exprtk::details::e_trunc.

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

Here is the caller graph for this function:

◆ uvouv_optimisable()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::uvouv_optimisable ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
) const
inline

Definition at line 31801 of file exprtk.hpp.

31802 {
31803 if (!operation_optimisable(operation))
31804 return false;
31805 else
31806 return details::is_uv_node(branch[0]) &&
31807 details::is_uv_node(branch[1]) ;
31808 }
bool is_uv_node(const expression_node< T > *node)
Definition exprtk.hpp:18913

References exprtk::details::is_uv_node(), and exprtk::parser< T >::expression_generator< Type >::operation_optimisable().

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ valid_operator() [1/2]

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::valid_operator ( const details::operator_type operation,
binary_functor_t bop 
)
inline

Definition at line 31429 of file exprtk.hpp.

31430 {
31431 typename binary_op_map_t::iterator bop_itr = binary_op_map_->find(operation);
31432
31433 if (binary_op_map_->end() == bop_itr)
31434 return false;
31435
31436 bop = bop_itr->second;
31437
31438 return true;
31439 }

References exprtk::parser< T >::expression_generator< Type >::binary_op_map_.

Referenced by exprtk::parser< T >::expression_generator< Type >::synthesize_vovov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovoc_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovoc_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covoc_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covoc_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_cocov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vococ_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovoc_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovocov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covocov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovoc_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovoc_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vococov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovoc_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovocov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covocov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovoc_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovoc_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vococov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovov_expression2::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovoc_expression2::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovocov_expression2::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovov_expression2::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovov_expression2::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covocov_expression2::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovoc_expression2::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovoc_expression2::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovov_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovoc_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovocov_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovov_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovov_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covocov_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovoc_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovoc_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vococov_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovov_expression4::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovoc_expression4::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovocov_expression4::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovov_expression4::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovov_expression4::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covocov_expression4::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovoc_expression4::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovoc_expression4::process(), and exprtk::parser< T >::expression_generator< Type >::synthesize_uvouv_expression().

Here is the caller graph for this function:

◆ valid_operator() [2/2]

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::valid_operator ( const details::operator_type operation,
unary_functor_t uop 
)
inline

Definition at line 31441 of file exprtk.hpp.

31442 {
31443 typename unary_op_map_t::iterator uop_itr = unary_op_map_->find(operation);
31444
31445 if ((*unary_op_map_).end() == uop_itr)
31446 return false;
31447
31448 uop = uop_itr->second;
31449
31450 return true;
31451 }

References exprtk::parser< T >::expression_generator< Type >::unary_op_map_.

◆ valid_string_operation()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::valid_string_operation ( const details::operator_type operation) const
inline

Definition at line 31607 of file exprtk.hpp.

31608 {
31609 return (details::e_add == operation) ||
31610 (details::e_lt == operation) ||
31611 (details::e_lte == operation) ||
31612 (details::e_gt == operation) ||
31613 (details::e_gte == operation) ||
31614 (details::e_eq == operation) ||
31615 (details::e_ne == operation) ||
31616 (details::e_in == operation) ||
31617 (details::e_like == operation) ||
31618 (details::e_ilike == operation) ||
31619 (details::e_assign == operation) ||
31620 (details::e_addass == operation) ||
31621 (details::e_swap == operation) ;
31622 }

References exprtk::details::e_add, exprtk::details::e_addass, exprtk::details::e_assign, exprtk::details::e_eq, exprtk::details::e_gt, exprtk::details::e_gte, exprtk::details::e_ilike, exprtk::details::e_in, exprtk::details::e_like, exprtk::details::e_lt, exprtk::details::e_lte, exprtk::details::e_ne, and exprtk::details::e_swap.

Referenced by exprtk::parser< T >::expression_generator< Type >::is_invalid_string_op(), and exprtk::parser< T >::expression_generator< Type >::is_string_operation().

Here is the caller graph for this function:

◆ vararg_function()

template<typename T >
template<typename Type >
template<typename Allocator , template< typename, typename > class Sequence>
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::vararg_function ( const details::operator_type operation,
Sequence< expression_node_ptr, Allocator > &  arg_list 
)
inline

Definition at line 33303 of file exprtk.hpp.

33305 {
33306 if (!all_nodes_valid(arg_list))
33307 {
33309
33310 return error_node();
33311 }
33312 else if (is_constant_foldable(arg_list))
33313 return const_optimise_varargfunc(operation,arg_list);
33314 else if ((1 == arg_list.size()) && details::is_ivector_node(arg_list[0]))
33315 return vectorize_func(operation,arg_list);
33316 else if ((1 == arg_list.size()) && special_one_parameter_vararg(operation))
33317 return arg_list[0];
33318 else if (all_nodes_variables(arg_list))
33319 return varnode_optimise_varargfunc(operation,arg_list);
33320
33321 #ifndef exprtk_disable_string_capabilities
33322 if (details::e_smulti == operation)
33323 {
33325 allocate<details::str_vararg_node<Type,details::vararg_multi_op<Type> > >(arg_list);
33326 if (result && result->valid())
33327 {
33328 return result;
33329 }
33330
33333 token_t(),
33334 "ERR254 - Failed to synthesize node: str_vararg_node<vararg_multi_op>",
33336
33338 }
33339 else
33340 #endif
33341 {
33343
33344 switch (operation)
33345 {
33346 #define case_stmt(op0, op1) \
33347 case op0 : result = node_allocator_-> \
33348 allocate<details::vararg_node<Type,op1<Type> > >(arg_list); \
33349 break; \
33350
33351 case_stmt(details::e_sum , details::vararg_add_op )
33352 case_stmt(details::e_prod , details::vararg_mul_op )
33353 case_stmt(details::e_avg , details::vararg_avg_op )
33354 case_stmt(details::e_min , details::vararg_min_op )
33355 case_stmt(details::e_max , details::vararg_max_op )
33356 case_stmt(details::e_mand , details::vararg_mand_op )
33357 case_stmt(details::e_mor , details::vararg_mor_op )
33358 case_stmt(details::e_multi , details::vararg_multi_op)
33359 #undef case_stmt
33360 default : return error_node();
33361 }
33362
33363 if (result && result->valid())
33364 {
33365 return result;
33366 }
33367
33370 token_t(),
33371 "ERR255 - Failed to synthesize node: vararg_node",
33373
33375 }
33376
33377 return error_node();
33378 }
bool special_one_parameter_vararg(const details::operator_type &operation) const
Definition exprtk.hpp:33240
expression_node_ptr const_optimise_varargfunc(const details::operator_type &operation, Sequence< expression_node_ptr, Allocator > &arg_list)
Definition exprtk.hpp:33209
expression_node_ptr varnode_optimise_varargfunc(const details::operator_type &operation, Sequence< expression_node_ptr, Allocator > &arg_list)
Definition exprtk.hpp:33253
expression_node_ptr vectorize_func(const details::operator_type &operation, Sequence< expression_node_ptr, Allocator > &arg_list)
Definition exprtk.hpp:33277

References case_stmt, exprtk::parser< T >::expression_generator< Type >::const_optimise_varargfunc(), exprtk::details::e_avg, exprtk::details::e_mand, exprtk::details::e_max, exprtk::details::e_min, exprtk::details::e_mor, exprtk::details::e_multi, exprtk::details::e_prod, exprtk::details::e_smulti, exprtk::details::e_sum, exprtk::parser_error::e_synthesis, exprtk::parser< T >::error_node(), exprtk_error_location, exprtk::details::free_all_nodes(), exprtk::details::free_node(), exprtk::parser< T >::expression_generator< Type >::is_constant_foldable(), exprtk::details::is_ivector_node(), exprtk::parser_error::make_error(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::parser< T >::set_error(), exprtk::parser< T >::expression_generator< Type >::special_one_parameter_vararg(), exprtk::details::expression_node< T >::valid(), exprtk::parser< T >::expression_generator< Type >::varnode_optimise_varargfunc(), and exprtk::parser< T >::expression_generator< Type >::vectorize_func().

Referenced by exprtk::parser< T >::parse_vararg_function(), and exprtk::parser< T >::simplify().

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

◆ vararg_function_call()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::vararg_function_call ( ivararg_function_t vaf,
std::vector< expression_node_ptr > &  arg_list 
)
inline

Definition at line 33440 of file exprtk.hpp.

33442 {
33443 if (!all_nodes_valid(arg_list))
33444 {
33446
33447 return error_node();
33448 }
33449
33451
33452 expression_node_ptr result = node_allocator_->allocate<alloc_type>(vaf,arg_list);
33453
33454 if (
33455 !arg_list.empty() &&
33456 !vaf->has_side_effects() &&
33457 is_constant_foldable(arg_list)
33458 )
33459 {
33460 const Type v = result->value();
33463 }
33464
33465 parser_->state_.activate_side_effect("vararg_function_call()");
33466
33467 if (result && result->valid())
33468 {
33469 return result;
33470 }
33471
33474 token_t(),
33475 "ERR257 - Failed to synthesize node: vararg_function_node<ivararg_function_t>",
33477
33479 return error_node();
33480 }

References exprtk::parser< T >::parser_state::activate_side_effect(), exprtk::details::node_allocator::allocate(), exprtk::parser_error::e_synthesis, exprtk::parser< T >::error_node(), exprtk_error_location, exprtk::details::free_all_nodes(), exprtk::details::free_node(), exprtk::function_traits::has_side_effects(), exprtk::parser< T >::expression_generator< Type >::is_constant_foldable(), exprtk::parser_error::make_error(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::parser< T >::set_error(), exprtk::parser< T >::state_, exprtk::details::expression_node< T >::valid(), and exprtk::details::expression_node< T >::value().

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

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

◆ varnode_optimise_sf3()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::varnode_optimise_sf3 ( const details::operator_type operation,
expression_node_ptr(&)  branch[3] 
)
inline

Definition at line 33035 of file exprtk.hpp.

33036 {
33037 typedef details::variable_node<Type>* variable_ptr;
33038
33039 const Type& v0 = static_cast<variable_ptr>(branch[0])->ref();
33040 const Type& v1 = static_cast<variable_ptr>(branch[1])->ref();
33041 const Type& v2 = static_cast<variable_ptr>(branch[2])->ref();
33042
33043 switch (operation)
33044 {
33045 #define case_stmt(op) \
33046 case details::e_sf##op : return node_allocator_-> \
33047 allocate_rrr<details::sf3_var_node<Type,details::sf##op##_op<Type> > > \
33048 (v0, v1, v2); \
33049
33050 case_stmt(00) case_stmt(01) case_stmt(02) case_stmt(03)
33051 case_stmt(04) case_stmt(05) case_stmt(06) case_stmt(07)
33052 case_stmt(08) case_stmt(09) case_stmt(10) case_stmt(11)
33053 case_stmt(12) case_stmt(13) case_stmt(14) case_stmt(15)
33054 case_stmt(16) case_stmt(17) case_stmt(18) case_stmt(19)
33055 case_stmt(20) case_stmt(21) case_stmt(22) case_stmt(23)
33056 case_stmt(24) case_stmt(25) case_stmt(26) case_stmt(27)
33057 case_stmt(28) case_stmt(29) case_stmt(30) case_stmt(31)
33058 case_stmt(32) case_stmt(33) case_stmt(34) case_stmt(35)
33059 case_stmt(36) case_stmt(37) case_stmt(38) case_stmt(39)
33060 case_stmt(40) case_stmt(41) case_stmt(42) case_stmt(43)
33061 case_stmt(44) case_stmt(45) case_stmt(46) case_stmt(47)
33062 #undef case_stmt
33063 default : return error_node();
33064 }
33065 }

References case_stmt, and exprtk::parser< T >::error_node().

Referenced by exprtk::parser< T >::expression_generator< Type >::special_function().

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

◆ varnode_optimise_sf4()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::varnode_optimise_sf4 ( const details::operator_type operation,
expression_node_ptr(&)  branch[4] 
)
inline

Definition at line 33140 of file exprtk.hpp.

33141 {
33142 typedef details::variable_node<Type>* variable_ptr;
33143
33144 const Type& v0 = static_cast<variable_ptr>(branch[0])->ref();
33145 const Type& v1 = static_cast<variable_ptr>(branch[1])->ref();
33146 const Type& v2 = static_cast<variable_ptr>(branch[2])->ref();
33147 const Type& v3 = static_cast<variable_ptr>(branch[3])->ref();
33148
33149 switch (operation)
33150 {
33151 #define case_stmt(op) \
33152 case details::e_sf##op : return node_allocator_-> \
33153 allocate_rrrr<details::sf4_var_node<Type,details::sf##op##_op<Type> > > \
33154 (v0, v1, v2, v3); \
33155
33156 case_stmt(48) case_stmt(49) case_stmt(50) case_stmt(51)
33157 case_stmt(52) case_stmt(53) case_stmt(54) case_stmt(55)
33158 case_stmt(56) case_stmt(57) case_stmt(58) case_stmt(59)
33159 case_stmt(60) case_stmt(61) case_stmt(62) case_stmt(63)
33160 case_stmt(64) case_stmt(65) case_stmt(66) case_stmt(67)
33161 case_stmt(68) case_stmt(69) case_stmt(70) case_stmt(71)
33162 case_stmt(72) case_stmt(73) case_stmt(74) case_stmt(75)
33163 case_stmt(76) case_stmt(77) case_stmt(78) case_stmt(79)
33164 case_stmt(80) case_stmt(81) case_stmt(82) case_stmt(83)
33165 case_stmt(84) case_stmt(85) case_stmt(86) case_stmt(87)
33166 case_stmt(88) case_stmt(89) case_stmt(90) case_stmt(91)
33167 case_stmt(92) case_stmt(93) case_stmt(94) case_stmt(95)
33168 case_stmt(96) case_stmt(97) case_stmt(98) case_stmt(99)
33169 #undef case_stmt
33170 default : return error_node();
33171 }
33172 }

References case_stmt, and exprtk::parser< T >::error_node().

Referenced by exprtk::parser< T >::expression_generator< Type >::special_function().

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

◆ varnode_optimise_varargfunc()

template<typename T >
template<typename Type >
template<typename Allocator , template< typename, typename > class Sequence>
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::varnode_optimise_varargfunc ( const details::operator_type operation,
Sequence< expression_node_ptr, Allocator > &  arg_list 
)
inline

Definition at line 33253 of file exprtk.hpp.

33255 {
33256 switch (operation)
33257 {
33258 #define case_stmt(op0, op1) \
33259 case op0 : return node_allocator_-> \
33260 allocate<details::vararg_varnode<Type,op1<Type> > >(arg_list); \
33261
33262 case_stmt(details::e_sum , details::vararg_add_op )
33263 case_stmt(details::e_prod , details::vararg_mul_op )
33264 case_stmt(details::e_avg , details::vararg_avg_op )
33265 case_stmt(details::e_min , details::vararg_min_op )
33266 case_stmt(details::e_max , details::vararg_max_op )
33267 case_stmt(details::e_mand , details::vararg_mand_op )
33268 case_stmt(details::e_mor , details::vararg_mor_op )
33269 case_stmt(details::e_multi , details::vararg_multi_op)
33270 #undef case_stmt
33271 default : return error_node();
33272 }
33273 }

References case_stmt, exprtk::details::e_avg, exprtk::details::e_mand, exprtk::details::e_max, exprtk::details::e_min, exprtk::details::e_mor, exprtk::details::e_multi, exprtk::details::e_prod, exprtk::details::e_sum, and exprtk::parser< T >::error_node().

Referenced by exprtk::parser< T >::expression_generator< Type >::vararg_function().

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

◆ vector_element()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::vector_element ( const std::string &  symbol,
vector_holder_ptr  vector_base,
expression_node_ptr  vec_node,
expression_node_ptr  index 
)
inline

Definition at line 33702 of file exprtk.hpp.

33706 {
33708 std::string node_name = "Unknown";
33709
33710 if (details::is_constant_node(index))
33711 {
33712 const std::size_t vec_index = static_cast<std::size_t>(details::numeric::to_int64(index->value()));
33713
33715
33716 if (vec_index >= vector_base->size())
33717 {
33720 token_t(),
33721 "ERR261 - Index of " + details::to_str(vec_index) + " out of range for "
33722 "vector '" + symbol + "' of size " + details::to_str(vector_base->size()),
33724
33726
33727 return error_node();
33728 }
33729
33730 if (vector_base->rebaseable())
33731 {
33733
33734 result = (rtc) ?
33735 node_allocator_->allocate<rebasevector_celem_rtc_node_t>(vec_node, vec_index, vector_base, rtc) :
33736 node_allocator_->allocate<rebasevector_celem_node_t >(vec_node, vec_index, vector_base ) ;
33737
33738 node_name = (rtc) ?
33739 "rebasevector_elem_rtc_node_t" :
33740 "rebasevector_elem_node_t" ;
33741
33742 if (result && result->valid())
33743 {
33744 return result;
33745 }
33746
33749 token_t(),
33750 "ERR262 - Failed to synthesize node: " + node_name + " for vector: " + symbol,
33752
33754 return error_node();
33755 }
33756 else if (details::is_ivector_node(vec_node) && !details::is_vector_node(vec_node))
33757 {
33759
33760 result = (rtc) ?
33761 node_allocator_->allocate<vector_celem_rtc_node_t>(vec_node, vec_index, vector_base, rtc) :
33762 node_allocator_->allocate<vector_celem_node_t >(vec_node, vec_index, vector_base ) ;
33763
33764 node_name = (rtc) ?
33765 "vector_elem_rtc_node_t" :
33766 "vector_elem_node_t" ;
33767
33768 if (result && result->valid())
33769 {
33770 return result;
33771 }
33772
33775 token_t(),
33776 "ERR263 - Failed to synthesize node: " + node_name + " for vector: " + symbol,
33778
33780 return error_node();
33781 }
33782
33783 const scope_element& se = parser_->sem_.get_element(symbol,vec_index);
33784
33785 if (se.index == vec_index)
33786 {
33787 result = se.var_node;
33789 }
33790 else
33791 {
33792 scope_element nse;
33793 nse.name = symbol;
33794 nse.active = true;
33795 nse.ref_count = 1;
33796 nse.type = scope_element::e_vecelem;
33797 nse.index = vec_index;
33798 nse.depth = parser_->state_.scope_depth;
33799 nse.data = 0;
33800 nse.var_node = node_allocator_->allocate<variable_node_t>((*(*vector_base)[vec_index]));
33801
33802 if (!parser_->sem_.add_element(nse))
33803 {
33804 parser_->set_synthesis_error("Failed to add new local vector element to SEM [1]");
33805
33807
33808 result = error_node();
33809 }
33810
33812
33813 exprtk_debug(("vector_element() - INFO - Added new local vector element: %s\n", nse.name.c_str()));
33814
33815 parser_->state_.activate_side_effect("vector_element()");
33816
33817 result = nse.var_node;
33818 node_name = "variable_node_t";
33819 }
33820 }
33821 else
33822 {
33824
33825 if (vector_base->rebaseable())
33826 {
33827 result = (rtc) ?
33828 node_allocator_->allocate<rebasevector_elem_rtc_node_t>(vec_node, index, vector_base, rtc) :
33829 node_allocator_->allocate<rebasevector_elem_node_t >(vec_node, index, vector_base ) ;
33830
33831 node_name = (rtc) ?
33832 "rebasevector_elem_rtc_node_t" :
33833 "rebasevector_elem_node_t" ;
33834 }
33835 else
33836 {
33837 result = rtc ?
33838 node_allocator_->allocate<vector_elem_rtc_node_t>(vec_node, index, vector_base, rtc) :
33839 node_allocator_->allocate<vector_elem_node_t >(vec_node, index, vector_base ) ;
33840
33841 node_name = (rtc) ?
33842 "vector_elem_rtc_node_t" :
33843 "vector_elem_node_t" ;
33844 }
33845 }
33846
33847 if (result && result->valid())
33848 {
33849 return result;
33850 }
33851
33854 token_t(),
33855 "ERR264 - Failed to synthesize node: " + node_name,
33857
33859 return error_node();
33860 }
vector_access_runtime_check_ptr get_vector_access_runtime_check() const
Definition exprtk.hpp:32439
scope_element & get_element(const std::size_t &index)
Definition exprtk.hpp:22419
bool add_element(const scope_element &se)
Definition exprtk.hpp:22470
void free_element(scope_element &se)
Definition exprtk.hpp:22513
scope_element_manager sem_
Definition exprtk.hpp:41633
_int64_t to_int64(const T v)
Definition exprtk.hpp:1471
vector_access_runtime_check * vector_access_runtime_check_ptr
Definition exprtk.hpp:2192
expression_node_ptr var_node
Definition exprtk.hpp:22389

References exprtk::parser< T >::parser_state::activate_side_effect(), exprtk::parser< T >::scope_element::active, exprtk::parser< T >::scope_element_manager::add_element(), exprtk::details::node_allocator::allocate(), exprtk::parser< T >::scope_element::data, exprtk::parser< T >::scope_element::depth, exprtk::parser_error::e_parser, exprtk::parser_error::e_synthesis, exprtk::parser< T >::scope_element::e_vecelem, exprtk::parser< T >::error_node(), exprtk_debug, exprtk_error_location, exprtk::parser< T >::scope_element_manager::free_element(), exprtk::details::free_node(), exprtk::parser< T >::scope_element_manager::get_element(), exprtk::parser< T >::expression_generator< Type >::get_vector_access_runtime_check(), exprtk::parser< T >::scope_element::index, exprtk::details::is_constant_node(), exprtk::details::is_ivector_node(), exprtk::details::is_vector_node(), exprtk::parser_error::make_error(), exprtk::parser< T >::scope_element::name, exprtk::parser< T >::expression_generator< Type >::node_allocator_, exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::details::vector_holder< Type >::rebaseable(), exprtk::parser< T >::scope_element::ref_count, exprtk::parser< T >::parser_state::scope_depth, exprtk::parser< T >::sem_, exprtk::parser< T >::set_error(), exprtk::parser< T >::set_synthesis_error(), exprtk::details::vector_holder< Type >::size(), exprtk::parser< T >::state_, exprtk::details::numeric::to_int64(), exprtk::details::to_str(), exprtk::parser< T >::scope_element::type, exprtk::details::expression_node< T >::valid(), exprtk::details::expression_node< T >::value(), and exprtk::parser< T >::scope_element::var_node.

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

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

◆ vectorize_func()

template<typename T >
template<typename Type >
template<typename Allocator , template< typename, typename > class Sequence>
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::vectorize_func ( const details::operator_type operation,
Sequence< expression_node_ptr, Allocator > &  arg_list 
)
inline

Definition at line 33277 of file exprtk.hpp.

33279 {
33280 if (1 == arg_list.size())
33281 {
33282 switch (operation)
33283 {
33284 #define case_stmt(op0, op1) \
33285 case op0 : return node_allocator_-> \
33286 allocate<details::vectorize_node<Type,op1<Type> > >(arg_list[0]); \
33287
33288 case_stmt(details::e_sum , details::vec_add_op)
33289 case_stmt(details::e_prod , details::vec_mul_op)
33290 case_stmt(details::e_avg , details::vec_avg_op)
33291 case_stmt(details::e_min , details::vec_min_op)
33292 case_stmt(details::e_max , details::vec_max_op)
33293 #undef case_stmt
33294 default : return error_node();
33295 }
33296 }
33297 else
33298 return error_node();
33299 }

References case_stmt, exprtk::details::e_avg, exprtk::details::e_max, exprtk::details::e_min, exprtk::details::e_prod, exprtk::details::e_sum, and exprtk::parser< T >::error_node().

Referenced by exprtk::parser< T >::expression_generator< Type >::vararg_function().

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

◆ vob_optimisable()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::vob_optimisable ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
) const
inline

Definition at line 31810 of file exprtk.hpp.

31811 {
31812 if (!operation_optimisable(operation))
31813 return false;
31814 else
31815 return details::is_variable_node(branch[0]) &&
31816 !details::is_variable_node(branch[1]) ;
31817 }

References exprtk::details::is_variable_node(), and exprtk::parser< T >::expression_generator< Type >::operation_optimisable().

Referenced by exprtk::parser< T >::expression_generator< Type >::operator()().

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

◆ voc_optimisable()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::voc_optimisable ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
) const
inline

Definition at line 31733 of file exprtk.hpp.

31734 {
31735 if (!operation_optimisable(operation))
31736 return false;
31737 else
31738 return details::is_variable_node(branch[0]) &&
31739 details::is_constant_node(branch[1]) ;
31740 }

References exprtk::details::is_constant_node(), exprtk::details::is_variable_node(), and exprtk::parser< T >::expression_generator< Type >::operation_optimisable().

Here is the call graph for this function:

◆ vov_optimisable()

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::vov_optimisable ( const details::operator_type operation,
expression_node_ptr(&)  branch[2] 
) const
inline

Definition at line 31742 of file exprtk.hpp.

31743 {
31744 if (!operation_optimisable(operation))
31745 return false;
31746 else
31747 return details::is_variable_node(branch[0]) &&
31748 details::is_variable_node(branch[1]) ;
31749 }

References exprtk::details::is_variable_node(), and exprtk::parser< T >::expression_generator< Type >::operation_optimisable().

Here is the call graph for this function:

◆ while_loop()

template<typename T >
template<typename Type >
expression_node_ptr exprtk::parser< T >::expression_generator< Type >::while_loop ( expression_node_ptr condition,
expression_node_ptr branch,
const bool  break_continue_present = false 
) const
inline

Definition at line 32444 of file exprtk.hpp.

32447 {
32448 if (
32449 !break_continue_present &&
32451 details::is_constant_node(condition)
32452 )
32453 {
32455 if (details::is_true(condition))
32456 {
32457 // Infinite loops are not allowed.
32458
32462 "ERR252 - Infinite loop condition without 'break' or 'return' not allowed in while-loops",
32464
32465 result = error_node();
32466 }
32467 else
32469
32472
32473 return result;
32474 }
32475 else if (details::is_null_node(condition))
32476 {
32478
32479 return branch;
32480 }
32481
32483
32484 if (!break_continue_present)
32485 {
32486 if (rtc)
32488 (condition, branch, rtc);
32489 else
32491 (condition, branch);
32492 }
32493 #ifndef exprtk_disable_break_continue
32494 else
32495 {
32496 if (rtc)
32498 (condition, branch, rtc);
32499 else
32501 (condition, branch);
32502 }
32503 #else
32504 return error_node();
32505 #endif
32506 }
details::while_loop_bc_rtc_node< T > while_loop_bc_rtc_node_t
Definition exprtk.hpp:22212
details::while_loop_bc_node< T > while_loop_bc_node_t
Definition exprtk.hpp:22209
details::while_loop_rtc_node< T > while_loop_rtc_node_t
Definition exprtk.hpp:22205
details::while_loop_node< T > while_loop_node_t
Definition exprtk.hpp:22202

References exprtk::details::node_allocator::allocate(), exprtk::parser< T >::current_state(), exprtk::parser_error::e_parser, exprtk::loop_runtime_check::e_while_loop, exprtk::parser< T >::error_node(), exprtk_error_location, exprtk::details::free_node(), exprtk::parser< T >::expression_generator< Type >::get_loop_runtime_check(), exprtk::details::is_constant_node(), exprtk::details::is_null_node(), exprtk::details::is_true(), exprtk::parser_error::make_error(), exprtk::parser< T >::expression_generator< Type >::node_allocator_, exprtk::parser< T >::expression_generator< Type >::parser_, exprtk::parser< T >::parser_state::return_stmt_present, exprtk::parser< T >::set_error(), exprtk::parser< T >::state_, and exprtk::parser< T >::state_t::token.

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

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

Member Data Documentation

◆ binary_op_map_

template<typename T >
template<typename Type >
binary_op_map_t* exprtk::parser< T >::expression_generator< Type >::binary_op_map_
private

◆ inv_binary_op_map_

template<typename T >
template<typename Type >
inv_binary_op_map_t* exprtk::parser< T >::expression_generator< Type >::inv_binary_op_map_
private

◆ node_allocator_

template<typename T >
template<typename Type >
details::node_allocator* exprtk::parser< T >::expression_generator< Type >::node_allocator_
private

Definition at line 41320 of file exprtk.hpp.

Referenced by exprtk::parser< T >::expression_generator< Type >::assert_call(), exprtk::parser< T >::expression_generator< Type >::cardinal_pow_optimisation(), exprtk::parser< T >::expression_generator< Type >::cardinal_pow_optimisation(), exprtk::parser< T >::expression_generator< Type >::conditional(), exprtk::parser< T >::expression_generator< Type >::conditional_string(), exprtk::parser< T >::expression_generator< Type >::conditional_vector(), exprtk::parser< T >::expression_generator< Type >::const_optimise_mswitch(), exprtk::parser< T >::expression_generator< Type >::const_optimise_sf3(), exprtk::parser< T >::expression_generator< Type >::const_optimise_sf4(), exprtk::parser< T >::expression_generator< Type >::const_optimise_switch(), exprtk::parser< T >::expression_generator< Type >::const_optimise_varargfunc(), exprtk::parser< T >::expression_generator< Type >::for_loop(), exprtk::parser< T >::expression_generator< Type >::function(), exprtk::parser< T >::expression_generator< Type >::function(), exprtk::parser< T >::expression_generator< Type >::generic_function_call(), exprtk::parser< T >::expression_generator< Type >::multi_switch_statement(), exprtk::parser< T >::expression_generator< Type >::operator()(), exprtk::parser< T >::expression_generator< Type >::operator()(), exprtk::parser< T >::expression_generator< Type >::operator()(), exprtk::parser< T >::expression_generator< Type >::operator()(), exprtk::parser< T >::expression_generator< Type >::operator()(), exprtk::parser< T >::expression_generator< Type >::operator()(), exprtk::parser< T >::expression_generator< Type >::synthesize_binary_ext_expression::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vob_expression::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_bov_expression::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_cob_expression::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_boc_expression::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_cocob_expression::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_coboc_expression::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_cov_expression::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_voc_expression::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovoc_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovoc_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covoc_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covoc_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_cocov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vococ_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovoc_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovocov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covocov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovoc_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovoc_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vococov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovoc_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovocov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covocov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovoc_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovoc_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vococov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovov_expression2::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovoc_expression2::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovocov_expression2::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovov_expression2::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovov_expression2::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covocov_expression2::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovoc_expression2::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovoc_expression2::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovov_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovoc_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovocov_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovov_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovov_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covocov_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovoc_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovoc_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vococov_expression3::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovov_expression4::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovoc_expression4::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovocov_expression4::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovov_expression4::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovov_expression4::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covocov_expression4::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovoc_expression4::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovoc_expression4::process(), exprtk::parser< T >::expression_generator< Type >::repeat_until_loop(), exprtk::parser< T >::expression_generator< Type >::return_call(), exprtk::parser< T >::expression_generator< Type >::return_envelope(), exprtk::parser< T >::expression_generator< Type >::set_allocator(), exprtk::parser< T >::expression_generator< Type >::string_function_call(), exprtk::parser< T >::expression_generator< Type >::switch_statement(), exprtk::parser< T >::expression_generator< Type >::synthesize_assignment_operation_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_csocs_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_csocsr_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_csos_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_csosr_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_csrocs_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_csrocsr_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_csros_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_csrosr_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_null_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_shortcircuit_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_socs_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_socsr_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_sosr_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_srocs_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_srocsr_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_sros_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_srosr_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_string_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_string_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_swap_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_uvouv_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_vecarithmetic_operation_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_veceqineqlogic_operation_expression(), exprtk::parser< T >::expression_generator< Type >::vararg_function(), exprtk::parser< T >::expression_generator< Type >::vararg_function_call(), exprtk::parser< T >::expression_generator< Type >::vector_element(), and exprtk::parser< T >::expression_generator< Type >::while_loop().

◆ parser_

template<typename T >
template<typename Type >
parser_t* exprtk::parser< T >::expression_generator< Type >::parser_
private

Definition at line 41327 of file exprtk.hpp.

Referenced by exprtk::parser< T >::expression_generator< Type >::assert_call(), exprtk::parser< T >::expression_generator< Type >::assign_immutable_symbol(), exprtk::parser< T >::expression_generator< Type >::conditional(), exprtk::parser< T >::expression_generator< Type >::conditional_string(), exprtk::parser< T >::expression_generator< Type >::conditional_vector(), exprtk::parser< T >::expression_generator< Type >::for_loop(), exprtk::parser< T >::expression_generator< Type >::function(), exprtk::parser< T >::expression_generator< Type >::generic_function_call(), exprtk::parser< T >::expression_generator< Type >::get_loop_runtime_check(), exprtk::parser< T >::expression_generator< Type >::get_vector_access_runtime_check(), exprtk::parser< T >::expression_generator< Type >::is_assignment_operation(), exprtk::parser< T >::expression_generator< Type >::is_invalid_string_op(), exprtk::parser< T >::expression_generator< Type >::is_invalid_string_op(), exprtk::parser< T >::expression_generator< Type >::lodge_assignment(), exprtk::parser< T >::expression_generator< Type >::operator()(), exprtk::parser< T >::expression_generator< Type >::operator()(), exprtk::parser< T >::expression_generator< Type >::synthesize_binary_ext_expression::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovoc_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovoc_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covoc_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covoc_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_cocov_expression1::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vococ_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovovoc_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vovocov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covocov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vocovoc_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_covovoc_expression0::process(), exprtk::parser< T >::expression_generator< Type >::synthesize_vococov_expression0::process(), exprtk::parser< T >::expression_generator< Type >::return_call(), exprtk::parser< T >::expression_generator< Type >::set_parser(), exprtk::parser< T >::expression_generator< Type >::string_function_call(), exprtk::parser< T >::expression_generator< Type >::synthesize_assignment_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_assignment_operation_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_swap_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_vecarithmetic_operation_expression(), exprtk::parser< T >::expression_generator< Type >::synthesize_veceqineqlogic_operation_expression(), exprtk::parser< T >::expression_generator< Type >::vararg_function(), exprtk::parser< T >::expression_generator< Type >::vararg_function_call(), exprtk::parser< T >::expression_generator< Type >::vector_element(), and exprtk::parser< T >::expression_generator< Type >::while_loop().

◆ sf3_map_

template<typename T >
template<typename Type >
sf3_map_t* exprtk::parser< T >::expression_generator< Type >::sf3_map_
private

◆ sf4_map_

template<typename T >
template<typename Type >
sf4_map_t* exprtk::parser< T >::expression_generator< Type >::sf4_map_
private

◆ strength_reduction_enabled_

template<typename T >
template<typename Type >
bool exprtk::parser< T >::expression_generator< Type >::strength_reduction_enabled_
private

◆ synthesize_map_

template<typename T >
template<typename Type >
synthesize_map_t exprtk::parser< T >::expression_generator< Type >::synthesize_map_
private

◆ unary_op_map_

template<typename T >
template<typename Type >
unary_op_map_t* exprtk::parser< T >::expression_generator< Type >::unary_op_map_
private

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