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 31771 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 31780 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 31775 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 31778 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 31776 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 31777 of file exprtk.hpp.

◆ vtype

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

Definition at line 31779 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 33358 of file exprtk.hpp.

33361 {
33362 typedef details::assert_node<Type> alloc_type;
33363
33365 (assert_condition, assert_message, parser_->assert_check_, context);
33366
33367 if (result && result->valid())
33368 {
33369 parser_->state_.activate_side_effect("assert_call()");
33370 return result;
33371 }
33372
33374 details::free_node(*node_allocator_, assert_condition);
33375 details::free_node(*node_allocator_, assert_message );
33376
33377 return error_node();
33378 }
expression_node< typename node_type::value_type > * allocate_rrrr(T1 &t1, T2 &t2, T3 &t3, T4 &t4) const
Definition exprtk.hpp:19424
details::expression_node< Type > * expression_node_ptr
Definition exprtk.hpp:31775
details::node_allocator * node_allocator_
Definition exprtk.hpp:41795
assert_check_ptr assert_check_
Definition exprtk.hpp:42146
parser_state state_
Definition exprtk.hpp:42114
static expression_node_ptr error_node()
Definition exprtk.hpp:25761
bool match_impl(const Iterator pattern_begin, const Iterator pattern_end, const Iterator data_begin, const Iterator data_end, const typename std::iterator_traits< Iterator >::value_type &zero_or_more, const typename std::iterator_traits< Iterator >::value_type &exactly_one)
Definition exprtk.hpp:605
void free_node(NodeAllocator &, expression_node< T > *&node)
Definition exprtk.hpp:6152
void activate_side_effect(const std::string &)
Definition exprtk.hpp:23687

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

34470 {
34471 interval_t interval;
34472 const void* baseptr_addr = base_ptr(node);
34473
34474 exprtk_debug(("assign_immutable_symbol - base ptr addr: %p\n", baseptr_addr));
34475
34476 if (parser_->immutable_memory_map_.in_interval(baseptr_addr,interval))
34477 {
34478 typename immutable_symtok_map_t::iterator itr = parser_->immutable_symtok_map_.find(interval);
34479
34480 if (parser_->immutable_symtok_map_.end() != itr)
34481 {
34482 token_t& token = itr->second;
34485 token,
34486 "ERR273 - Symbol '" + token.value + "' cannot be assigned-to as it is immutable.",
34488 }
34489 else
34490 parser_->set_synthesis_error("Unable to assign symbol is immutable.");
34491
34492 return true;
34493 }
34494
34495 return false;
34496 }
const void * base_ptr(expression_node_ptr node)
Definition exprtk.hpp:34419
bool in_interval(const interval_point_t point, interval_t &interval) const
Definition exprtk.hpp:23013
interval_container_t< constvoid * >::interval_t interval_t
Definition exprtk.hpp:31061
void set_synthesis_error(const std::string &synthesis_error_message)
Definition exprtk.hpp:41818
immutable_symtok_map_t immutable_symtok_map_
Definition exprtk.hpp:42130
void set_error(const parser_error::type &error_type)
Definition exprtk.hpp:41805
lexer::token token_t
Definition exprtk.hpp:22517
immutable_memory_map_t immutable_memory_map_
Definition exprtk.hpp:42129
#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:22336

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

34420 {
34421 if (node)
34422 {
34423 switch (node->type())
34424 {
34426 return reinterpret_cast<const void*>(&static_cast<variable_node_t*>(node)->ref());
34427
34429 return reinterpret_cast<const void*>(&static_cast<vector_elem_node_t*>(node)->ref());
34430
34432 return reinterpret_cast<const void*>(&static_cast<vector_celem_node_t*>(node)->ref());
34433
34435 return reinterpret_cast<const void*>(&static_cast<vector_elem_rtc_node_t*>(node)->ref());
34436
34438 return reinterpret_cast<const void*>(&static_cast<vector_celem_rtc_node_t*>(node)->ref());
34439
34441 return reinterpret_cast<const void*>(&static_cast<rebasevector_elem_node_t*>(node)->ref());
34442
34444 return reinterpret_cast<const void*>(&static_cast<rebasevector_elem_rtc_node_t*>(node)->ref());
34445
34447 return reinterpret_cast<const void*>(&static_cast<rebasevector_celem_node_t*>(node)->ref());
34448
34450 return reinterpret_cast<const void*>(&static_cast<rebasevector_celem_rtc_node_t*>(node)->ref());
34451
34453 return reinterpret_cast<const void*>(static_cast<vector_node_t*>(node)->vec_holder().data());
34454
34455 #ifndef exprtk_disable_string_capabilities
34457 return reinterpret_cast<const void*>((static_cast<stringvar_node_t*>(node)->base()));
34458
34460 return reinterpret_cast<const void*>((static_cast<string_range_node_t*>(node)->base()));
34461 #endif
34462 default : return reinterpret_cast<const void*>(0);
34463 }
34464 }
34465
34466 return reinterpret_cast<const void*>(0);
34467 }
details::vector_node< T > vector_node_t
Definition exprtk.hpp:22491
details::rebasevector_celem_node< T > rebasevector_celem_node_t
Definition exprtk.hpp:22488
details::stringvar_node< T > stringvar_node_t
Definition exprtk.hpp:22495
details::vector_elem_node< T > vector_elem_node_t
Definition exprtk.hpp:22483
details::vector_celem_rtc_node< T > vector_celem_rtc_node_t
Definition exprtk.hpp:22486
details::variable_node< T > variable_node_t
Definition exprtk.hpp:22482
details::vector_elem_rtc_node< T > vector_elem_rtc_node_t
Definition exprtk.hpp:22485
details::rebasevector_elem_rtc_node< T > rebasevector_elem_rtc_node_t
Definition exprtk.hpp:22489
details::rebasevector_celem_rtc_node< T > rebasevector_celem_rtc_node_t
Definition exprtk.hpp:22490
details::string_range_node< T > string_range_node_t
Definition exprtk.hpp:22497
details::vector_celem_node< T > vector_celem_node_t
Definition exprtk.hpp:22484
details::rebasevector_elem_node< T > rebasevector_elem_node_t
Definition exprtk.hpp:22487

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

32302 {
32303 if (!operation_optimisable(operation))
32304 return false;
32305 else
32306 return !details::is_constant_node(branch[0]) ||
32307 !details::is_constant_node(branch[1]) ;
32308 }
bool operation_optimisable(const details::operator_type &operation) const
Definition exprtk.hpp:32129
bool is_constant_node(const expression_node< T > *node)
Definition exprtk.hpp:5926

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

32234 {
32235 if (!operation_optimisable(operation))
32236 return false;
32237 else
32238 return !details::is_constant_node(branch[0]) &&
32239 details::is_constant_node(branch[1]) ;
32240 }

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

32293 {
32294 if (!operation_optimisable(operation))
32295 return false;
32296 else
32297 return !details::is_variable_node(branch[0]) &&
32298 details::is_variable_node(branch[1]) ;
32299 }
bool is_variable_node(const expression_node< T > *node)
Definition exprtk.hpp:5806

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

32152 {
32153 static const std::string null_str ("(null)" );
32154 static const std::string const_str ("(c)" );
32155 static const std::string var_str ("(v)" );
32156 static const std::string vov_str ("(vov)" );
32157 static const std::string cov_str ("(cov)" );
32158 static const std::string voc_str ("(voc)" );
32159 static const std::string str_str ("(s)" );
32160 static const std::string strrng_str ("(rngs)" );
32161 static const std::string cs_str ("(cs)" );
32162 static const std::string cstrrng_str("(crngs)");
32163
32164 if (details::is_null_node(branch))
32165 return null_str;
32166 else if (details::is_constant_node(branch))
32167 return const_str;
32168 else if (details::is_variable_node(branch))
32169 return var_str;
32170 else if (details::is_vov_node(branch))
32171 return vov_str;
32172 else if (details::is_cov_node(branch))
32173 return cov_str;
32174 else if (details::is_voc_node(branch))
32175 return voc_str;
32176 else if (details::is_string_node(branch))
32177 return str_str;
32178 else if (details::is_const_string_node(branch))
32179 return cs_str;
32180 else if (details::is_string_range_node(branch))
32181 return strrng_str;
32182 else if (details::is_const_string_range_node(branch))
32183 return cstrrng_str;
32184 else if (details::is_t0ot1ot2_node(branch))
32185 return "(" + dynamic_cast<details::T0oT1oT2_base_node<T>*>(branch)->type_id() + ")";
32186 else if (details::is_t0ot1ot2ot3_node(branch))
32187 return "(" + dynamic_cast<details::T0oT1oT2oT3_base_node<T>*>(branch)->type_id() + ")";
32188 else
32189 return "ERROR";
32190 }
bool is_voc_node(const expression_node< T > *node)
Definition exprtk.hpp:19082
bool is_t0ot1ot2ot3_node(const expression_node< T > *node)
Definition exprtk.hpp:19106
bool is_vov_node(const expression_node< T > *node)
Definition exprtk.hpp:19070
bool is_string_node(const expression_node< T > *node)
Definition exprtk.hpp:19118
bool is_const_string_range_node(const expression_node< T > *node)
Definition exprtk.hpp:19136
bool is_cov_node(const expression_node< T > *node)
Definition exprtk.hpp:19076
bool is_const_string_node(const expression_node< T > *node)
Definition exprtk.hpp:19130
bool is_null_node(const expression_node< T > *node)
Definition exprtk.hpp:5936
bool is_string_range_node(const expression_node< T > *node)
Definition exprtk.hpp:19124
bool is_t0ot1ot2_node(const expression_node< T > *node)
Definition exprtk.hpp:19100

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

32193 {
32194 return branch_to_id(branch[0]) + std::string("o") + branch_to_id(branch[1]);
32195 }
std::string branch_to_id(expression_node_ptr branch) const
Definition exprtk.hpp:32151

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

35240 {
35241 return (details::e_pow == operation) && (details::numeric::abs(c) <= T(60)) && details::numeric::is_integer(c);
35242 }
bool is_integer(const T v)
Definition exprtk.hpp:1666

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

35219 {
35220 const bool not_recipricol = (c >= T(0));
35221 const unsigned int p = static_cast<unsigned int>(details::numeric::to_int32(details::numeric::abs(c)));
35222
35223 if (0 == p)
35225 else if (std::equal_to<T>()(T(2),c))
35226 {
35227 return node_allocator_->
35228 template allocate_rr<typename details::vov_node<Type,details::mul_op<Type> > >(v,v);
35229 }
35230 else
35231 {
35232 if (not_recipricol)
35233 return cardinal_pow_optimisation_impl<T,details::ipow_node>(v,p);
35234 else
35235 return cardinal_pow_optimisation_impl<T,details::ipowinv_node>(v,p);
35236 }
35237 }
expression_node< typename node_type::value_type > * allocate_c(const T1 &t1) const
Definition exprtk.hpp:19334
details::literal_node< T > literal_node_t
Definition exprtk.hpp:22460
int to_int32(const T v)
Definition exprtk.hpp:1505

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

35245 {
35246 const Type c = static_cast<details::literal_node<Type>*>(branch[1])->value();
35247 const bool not_recipricol = (c >= T(0));
35248 const unsigned int p = static_cast<unsigned int>(details::numeric::to_int32(details::numeric::abs(c)));
35249
35250 node_allocator_->free(branch[1]);
35251
35252 if (0 == p)
35253 {
35255
35257 }
35258 else if (not_recipricol)
35259 return cardinal_pow_optimisation_impl<expression_node_ptr,details::bipow_node>(branch[0],p);
35260 else
35261 return cardinal_pow_optimisation_impl<expression_node_ptr,details::bipowinv_node>(branch[0],p);
35262 }
void free(expression_node< T > *&e) const
Definition exprtk.hpp:19623
T value(details::expression_node< T > *n)
Definition exprtk.hpp:15948
void free_all_nodes(NodeAllocator &node_allocator, expression_node< T > *(&b)[N])
Definition exprtk.hpp:6129

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

35191 {
35192 switch (p)
35193 {
35194 #define case_stmt(cp) \
35195 case cp : return node_allocator_-> \
35196 allocate<IPowNode<T,details::numeric::fast_exp<T,cp> > >(v); \
35197
35198 case_stmt( 1) case_stmt( 2) case_stmt( 3) case_stmt( 4)
35199 case_stmt( 5) case_stmt( 6) case_stmt( 7) case_stmt( 8)
35200 case_stmt( 9) case_stmt(10) case_stmt(11) case_stmt(12)
35201 case_stmt(13) case_stmt(14) case_stmt(15) case_stmt(16)
35202 case_stmt(17) case_stmt(18) case_stmt(19) case_stmt(20)
35203 case_stmt(21) case_stmt(22) case_stmt(23) case_stmt(24)
35204 case_stmt(25) case_stmt(26) case_stmt(27) case_stmt(28)
35205 case_stmt(29) case_stmt(30) case_stmt(31) case_stmt(32)
35206 case_stmt(33) case_stmt(34) case_stmt(35) case_stmt(36)
35207 case_stmt(37) case_stmt(38) case_stmt(39) case_stmt(40)
35208 case_stmt(41) case_stmt(42) case_stmt(43) case_stmt(44)
35209 case_stmt(45) case_stmt(46) case_stmt(47) case_stmt(48)
35210 case_stmt(49) case_stmt(50) case_stmt(51) case_stmt(52)
35211 case_stmt(53) case_stmt(54) case_stmt(55) case_stmt(56)
35212 case_stmt(57) case_stmt(58) case_stmt(59) case_stmt(60)
35213 #undef case_stmt
35214 default : return error_node();
35215 }
35216 }
#define case_stmt(N)
Definition exprtk.hpp:33204

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

32225 {
32226 if (!operation_optimisable(operation))
32227 return false;
32228 else
32229 return details::is_constant_node(branch[0]) &&
32230 !details::is_constant_node(branch[1]) ;
32231 }

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

32259 {
32260 if (
32261 (details::e_add == operation) ||
32262 (details::e_sub == operation) ||
32263 (details::e_mul == operation) ||
32264 (details::e_div == operation)
32265 )
32266 {
32267 return (details::is_constant_node(branch[0]) && details::is_boc_node(branch[1])) ||
32268 (details::is_constant_node(branch[1]) && details::is_boc_node(branch[0])) ;
32269 }
32270 else
32271 return false;
32272 }
bool is_boc_node(const expression_node< T > *node)
Definition exprtk.hpp:19094

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

32243 {
32244 if (
32245 (details::e_add == operation) ||
32246 (details::e_sub == operation) ||
32247 (details::e_mul == operation) ||
32248 (details::e_div == operation)
32249 )
32250 {
32251 return (details::is_constant_node(branch[0]) && details::is_cob_node(branch[1])) ||
32252 (details::is_constant_node(branch[1]) && details::is_cob_node(branch[0])) ;
32253 }
32254 else
32255 return false;
32256 }
bool is_cob_node(const expression_node< T > *node)
Definition exprtk.hpp:19088

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

32695 {
32696 if ((0 == condition) || (0 == consequent))
32697 {
32698 details::free_node(*node_allocator_, condition );
32699 details::free_node(*node_allocator_, consequent );
32700 details::free_node(*node_allocator_, alternative);
32701
32702 const std::string invalid_branches =
32703 ((0 == condition ) ? std::string("condition ") : "") +
32704 ((0 == consequent) ? std::string("consequent") : "") ;
32705
32709 "ERR255 - Invalid " + invalid_branches + " for conditional statement",
32711
32712 return error_node();
32713 }
32714 // Can the condition be immediately evaluated? if so optimise.
32715 else if (details::is_constant_node(condition))
32716 {
32717 // True branch
32718 if (details::is_true(condition))
32719 {
32720 details::free_node(*node_allocator_, condition );
32721 details::free_node(*node_allocator_, alternative);
32722
32723 return consequent;
32724 }
32725 // False branch
32726 else
32727 {
32728 details::free_node(*node_allocator_, condition );
32729 details::free_node(*node_allocator_, consequent);
32730
32731 if (alternative)
32732 return alternative;
32733 else
32735 }
32736 }
32737
32739 std::string node_name = "Unknown!";
32740
32741 if ((0 != consequent) && (0 != alternative))
32742 {
32743 result = node_allocator_->allocate<conditional_node_t>(condition, consequent, alternative);
32744 node_name = "conditional_node_t";
32745 }
32746 else
32747 {
32748 result = node_allocator_->allocate<cons_conditional_node_t>(condition, consequent);
32749 node_name = "cons_conditional_node_t";
32750 }
32751
32752 if (result && result->valid())
32753 {
32754 return result;
32755 }
32756
32759 token_t(),
32760 "ERR256 - Failed to synthesize node: " + node_name,
32762
32764 return error_node();
32765 }
expression_node< typename ResultNode::value_type > * allocate(OpType &operation, ExprNode(&branch)[1])
Definition exprtk.hpp:19253
details::conditional_node< T > conditional_node_t
Definition exprtk.hpp:22465
details::cons_conditional_node< T > cons_conditional_node_t
Definition exprtk.hpp:22466
state_t current_state() const
Definition exprtk.hpp:25367
bool is_true(const double v)
Definition exprtk.hpp:5742

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

32771 {
32772 if ((0 == condition) || (0 == consequent))
32773 {
32774 details::free_node(*node_allocator_, condition );
32775 details::free_node(*node_allocator_, consequent );
32776 details::free_node(*node_allocator_, alternative);
32777
32778 const std::string invalid_branches =
32779 ((0 == condition ) ? std::string("condition ") : "") +
32780 ((0 == consequent) ? std::string("consequent") : "") ;
32781
32785 "ERR257 - Invalid " + invalid_branches + " for string conditional statement",
32787
32788 return error_node();
32789 }
32790 // Can the condition be immediately evaluated? if so optimise.
32791 else if (details::is_constant_node(condition))
32792 {
32793 // True branch
32794 if (details::is_true(condition))
32795 {
32796 details::free_node(*node_allocator_, condition );
32797 details::free_node(*node_allocator_, alternative);
32798
32799 return consequent;
32800 }
32801 // False branch
32802 else
32803 {
32804 details::free_node(*node_allocator_, condition );
32805 details::free_node(*node_allocator_, consequent);
32806
32807 if (alternative)
32808 return alternative;
32809 else
32810 return node_allocator_->
32811 allocate_c<details::string_literal_node<Type> >("");
32812 }
32813 }
32814 else if ((0 != consequent) && (0 != alternative))
32815 {
32816 expression_node_ptr result =
32817 node_allocator_->allocate<conditional_string_node_t>(condition, consequent, alternative);
32818
32819 if (result && result->valid())
32820 {
32821 return result;
32822 }
32823
32826 token_t(),
32827 "ERR258 - Failed to synthesize node: conditional_string_node_t",
32829
32831 }
32832
32833 return error_node();
32834 }
details::conditional_string_node< T > conditional_string_node_t
Definition exprtk.hpp:22503

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

32847 {
32848 if ((0 == condition) || (0 == consequent))
32849 {
32850 details::free_node(*node_allocator_, condition );
32851 details::free_node(*node_allocator_, consequent );
32852 details::free_node(*node_allocator_, alternative);
32853
32854 const std::string invalid_branches =
32855 ((0 == condition ) ? std::string("condition ") : "") +
32856 ((0 == consequent) ? std::string("consequent") : "") ;
32857
32861 "ERR259 - Invalid " + invalid_branches + " for vector conditional statement",
32863
32864 return error_node();
32865 }
32866 // Can the condition be immediately evaluated? if so optimise.
32867 else if (details::is_constant_node(condition))
32868 {
32869 // True branch
32870 if (details::is_true(condition))
32871 {
32872 details::free_node(*node_allocator_, condition );
32873 details::free_node(*node_allocator_, alternative);
32874
32875 return consequent;
32876 }
32877 // False branch
32878 else
32879 {
32880 details::free_node(*node_allocator_, condition );
32881 details::free_node(*node_allocator_, consequent);
32882
32883 if (alternative)
32884 return alternative;
32885 else
32887
32888 }
32889 }
32890 else if ((0 != consequent) && (0 != alternative))
32891 {
32892 return node_allocator_->
32893 allocate<conditional_vector_node_t>(condition, consequent, alternative);
32894 }
32895 else
32896 return error_node();
32897 }

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

33167 {
33169
33170 for (std::size_t i = 0; i < (arg_list.size() / 2); ++i)
33171 {
33172 expression_node_ptr condition = arg_list[(2 * i) ];
33173 expression_node_ptr consequent = arg_list[(2 * i) + 1];
33174
33175 if (details::is_true(condition))
33176 {
33177 result = consequent;
33178 }
33179 }
33180
33181 if (0 == result)
33182 {
33183 const T zero = T(0);
33184 result = node_allocator_->allocate<literal_node_t>(zero);
33185 }
33186
33187 for (std::size_t i = 0; i < arg_list.size(); ++i)
33188 {
33189 expression_node_ptr& current_expr = arg_list[i];
33190
33191 if (current_expr && (current_expr != result))
33192 {
33193 details::free_node(*node_allocator_,current_expr);
33194 }
33195 }
33196
33197 return result;
33198 }

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

33472 {
33473 expression_node_ptr temp_node = error_node();
33474
33475 switch (operation)
33476 {
33477 #define case_stmt(op) \
33478 case details::e_sf##op : temp_node = node_allocator_-> \
33479 allocate<details::sf3_node<Type,details::sf##op##_op<Type> > > \
33480 (operation, branch); \
33481 break; \
33482
33483 case_stmt(00) case_stmt(01) case_stmt(02) case_stmt(03)
33484 case_stmt(04) case_stmt(05) case_stmt(06) case_stmt(07)
33485 case_stmt(08) case_stmt(09) case_stmt(10) case_stmt(11)
33486 case_stmt(12) case_stmt(13) case_stmt(14) case_stmt(15)
33487 case_stmt(16) case_stmt(17) case_stmt(18) case_stmt(19)
33488 case_stmt(20) case_stmt(21) case_stmt(22) case_stmt(23)
33489 case_stmt(24) case_stmt(25) case_stmt(26) case_stmt(27)
33490 case_stmt(28) case_stmt(29) case_stmt(30) case_stmt(31)
33491 case_stmt(32) case_stmt(33) case_stmt(34) case_stmt(35)
33492 case_stmt(36) case_stmt(37) case_stmt(38) case_stmt(39)
33493 case_stmt(40) case_stmt(41) case_stmt(42) case_stmt(43)
33494 case_stmt(44) case_stmt(45) case_stmt(46) case_stmt(47)
33495 #undef case_stmt
33496 default : return error_node();
33497 }
33498
33499 assert(temp_node);
33500
33501 const T v = temp_node->value();
33502
33504
33506 }

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

33576 {
33577 expression_node_ptr temp_node = error_node();
33578
33579 switch (operation)
33580 {
33581 #define case_stmt(op) \
33582 case details::e_sf##op : temp_node = node_allocator_-> \
33583 allocate<details::sf4_node<Type,details::sf##op##_op<Type> > > \
33584 (operation, branch); \
33585 break; \
33586
33587 case_stmt(48) case_stmt(49) case_stmt(50) case_stmt(51)
33588 case_stmt(52) case_stmt(53) case_stmt(54) case_stmt(55)
33589 case_stmt(56) case_stmt(57) case_stmt(58) case_stmt(59)
33590 case_stmt(60) case_stmt(61) case_stmt(62) case_stmt(63)
33591 case_stmt(64) case_stmt(65) case_stmt(66) case_stmt(67)
33592 case_stmt(68) case_stmt(69) case_stmt(70) case_stmt(71)
33593 case_stmt(72) case_stmt(73) case_stmt(74) case_stmt(75)
33594 case_stmt(76) case_stmt(77) case_stmt(78) case_stmt(79)
33595 case_stmt(80) case_stmt(81) case_stmt(82) case_stmt(83)
33596 case_stmt(84) case_stmt(85) case_stmt(86) case_stmt(87)
33597 case_stmt(88) case_stmt(89) case_stmt(90) case_stmt(91)
33598 case_stmt(92) case_stmt(93) case_stmt(94) case_stmt(95)
33599 case_stmt(96) case_stmt(97) case_stmt(98) case_stmt(99)
33600 #undef case_stmt
33601 default : return error_node();
33602 }
33603
33604 assert(temp_node);
33605
33606 const T v = temp_node->value();
33607
33609
33611 }

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

33131 {
33133
33134 for (std::size_t i = 0; i < (arg_list.size() / 2); ++i)
33135 {
33136 expression_node_ptr condition = arg_list[(2 * i) ];
33137 expression_node_ptr consequent = arg_list[(2 * i) + 1];
33138
33139 if ((0 == result) && details::is_true(condition))
33140 {
33141 result = consequent;
33142 break;
33143 }
33144 }
33145
33146 if (0 == result)
33147 {
33148 result = arg_list.back();
33149 }
33150
33151 for (std::size_t i = 0; i < arg_list.size(); ++i)
33152 {
33153 expression_node_ptr current_expr = arg_list[i];
33154
33155 if (current_expr && (current_expr != result))
33156 {
33157 free_node(*node_allocator_,current_expr);
33158 }
33159 }
33160
33161 return result;
33162 }

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

33683 {
33684 expression_node_ptr temp_node = error_node();
33685
33686 switch (operation)
33687 {
33688 #define case_stmt(op0, op1) \
33689 case op0 : temp_node = node_allocator_-> \
33690 allocate<details::vararg_node<Type,op1<Type> > > \
33691 (arg_list); \
33692 break; \
33693
33694 case_stmt(details::e_sum , details::vararg_add_op )
33695 case_stmt(details::e_prod , details::vararg_mul_op )
33696 case_stmt(details::e_avg , details::vararg_avg_op )
33697 case_stmt(details::e_min , details::vararg_min_op )
33698 case_stmt(details::e_max , details::vararg_max_op )
33699 case_stmt(details::e_mand , details::vararg_mand_op )
33700 case_stmt(details::e_mor , details::vararg_mor_op )
33701 case_stmt(details::e_multi , details::vararg_multi_op)
33702 #undef case_stmt
33703 default : return error_node();
33704 }
33705
33706 const T v = temp_node->value();
33707
33709
33711 }

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

32198 {
32199 if (!operation_optimisable(operation))
32200 return false;
32201 else
32202 return details::is_constant_node(branch[0]) &&
32203 details::is_variable_node(branch[1]) ;
32204 }

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

33040 {
33041 if (
33042 !break_continue_present &&
33044 details::is_constant_node(condition)
33045 )
33046 {
33048
33049 if (details::is_true(condition))
33050 {
33051 // Infinite loops are not allowed.
33052
33056 "ERR261 - Infinite loop condition without 'break' or 'return' not allowed in for-loop",
33058
33059 result = error_node();
33060 }
33061 else
33063
33064 details::free_node(*node_allocator_, initialiser);
33065 details::free_node(*node_allocator_, condition );
33066 details::free_node(*node_allocator_, incrementor);
33067 details::free_node(*node_allocator_, loop_body );
33068
33069 return result;
33070 }
33071 else if (details::is_null_node(condition) || (0 == condition))
33072 {
33073 details::free_node(*node_allocator_, initialiser);
33074 details::free_node(*node_allocator_, condition );
33075 details::free_node(*node_allocator_, incrementor);
33076
33077 return loop_body;
33078 }
33079
33081
33082 if (!break_continue_present)
33083 {
33084 if (rtc)
33086 (
33087 initialiser,
33088 condition,
33089 incrementor,
33090 loop_body,
33091 rtc
33092 );
33093 else
33095 (
33096 initialiser,
33097 condition,
33098 incrementor,
33099 loop_body
33100 );
33101 }
33102 #ifndef exprtk_disable_break_continue
33103 else
33104 {
33105 if (rtc)
33107 (
33108 initialiser,
33109 condition,
33110 incrementor,
33111 loop_body,
33112 rtc
33113 );
33114 else
33116 (
33117 initialiser,
33118 condition,
33119 incrementor,
33120 loop_body
33121 );
33122 }
33123 #else
33124 return error_node();
33125 #endif
33126 }
loop_runtime_check_ptr get_loop_runtime_check(const loop_runtime_check::loop_types loop_type) const
Definition exprtk.hpp:32899
details::for_loop_rtc_node< T > for_loop_rtc_node_t
Definition exprtk.hpp:22472
details::for_loop_bc_node< T > for_loop_bc_node_t
Definition exprtk.hpp:22476
details::for_loop_node< T > for_loop_node_t
Definition exprtk.hpp:22469
details::for_loop_bc_rtc_node< T > for_loop_bc_rtc_node_t
Definition exprtk.hpp:22479
loop_runtime_check * loop_runtime_check_ptr
Definition exprtk.hpp:2210

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

33908 {
33909 typedef typename details::function_N_node<Type,ifunction_t,0> function_N_node_t;
33910 return node_allocator_->allocate<function_N_node_t>(f);
33911 }

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

33855 {
33856 typedef typename details::function_N_node<T,ifunction_t,N> function_N_node_t;
33857 expression_node_ptr result = synthesize_expression<function_N_node_t,N>(f,b);
33858
33859 if (0 == result)
33860 return error_node();
33861 else
33862 {
33863 // Can the function call be completely optimised?
33864 if (details::is_constant_node(result))
33865 return result;
33866 else if (!all_nodes_valid(b))
33867 {
33869 std::fill_n(b, N, reinterpret_cast<expression_node_ptr>(0));
33870
33871 return error_node();
33872 }
33873 else if (N != f->param_count)
33874 {
33876 std::fill_n(b, N, reinterpret_cast<expression_node_ptr>(0));
33877
33878 return error_node();
33879 }
33880
33881 function_N_node_t* func_node_ptr = reinterpret_cast<function_N_node_t*>(result);
33882
33883 if (!func_node_ptr->init_branches(b))
33884 {
33886 std::fill_n(b, N, reinterpret_cast<expression_node_ptr>(0));
33887
33888 return error_node();
33889 }
33890
33891 if (result && result->valid())
33892 {
33893 return result;
33894 }
33895
33898 token_t(),
33899 "ERR264 - Failed to synthesize node: function_N_node_t",
33901
33903 return error_node();
33904 }
33905 }
bool all_nodes_valid(expression_node< T > *const (&b)[N])
Definition exprtk.hpp:6005

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

33958 {
33959 if (!all_nodes_valid(arg_list))
33960 {
33962 return error_node();
33963 }
33964
33967
33968 const std::size_t no_psi = std::numeric_limits<std::size_t>::max();
33969
33971 std::string node_name = "Unknown";
33972
33973 if (no_psi == param_seq_index)
33974 {
33975 result = node_allocator_->allocate<alloc_type1>(arg_list,gf);
33976 node_name = "generic_function_node<igeneric_function_t>";
33977 }
33978 else
33979 {
33980 result = node_allocator_->allocate<alloc_type2>(gf, param_seq_index, arg_list);
33981 node_name = "multimode_genfunction_node<igeneric_function_t>";
33982 }
33983
33984 alloc_type1* genfunc_node_ptr = static_cast<alloc_type1*>(result);
33985
33986 assert(genfunc_node_ptr);
33987
33988 if (
33989 !arg_list.empty() &&
33990 !gf->has_side_effects() &&
33992 is_constant_foldable(arg_list)
33993 )
33994 {
33995 genfunc_node_ptr->init_branches();
33996
33997 const Type v = result->value();
33998
34000
34002 }
34003 else if (genfunc_node_ptr->init_branches())
34004 {
34005 if (result && result->valid())
34006 {
34007 parser_->state_.activate_side_effect("generic_function_call()");
34008 return result;
34009 }
34010
34013 token_t(),
34014 "ERR266 - Failed to synthesize node: " + node_name,
34016
34018 return error_node();
34019 }
34020 else
34021 {
34024
34025 return error_node();
34026 }
34027 }
bool is_constant_foldable(NodePtr(&b)[N]) const
Definition exprtk.hpp:34340

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

32900 {
32901 if (
32903 (loop_type == (parser_->loop_runtime_check_->loop_set & loop_type))
32904 )
32905 {
32907 }
32908
32909 return loop_runtime_check_ptr(0);
32910 }
loop_runtime_check_ptr loop_runtime_check_
Definition exprtk.hpp:42143

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

31927 {
31928 return (*inv_binary_op_map_).find(bop)->second;
31929 }

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

32913 {
32915 }
vector_access_runtime_check_ptr vector_access_runtime_check_
Definition exprtk.hpp:42144

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

31783 {
31784 #ifndef exprtk_disable_enhanced_features
31788
31789 #define register_synthezier(S) \
31790 synthesize_map_[S ::node_type::id()] = S ::process; \
31791
31792 register_synthezier(synthesize_vovov_expression0)
31793 register_synthezier(synthesize_vovov_expression1)
31794 register_synthezier(synthesize_vovoc_expression0)
31795 register_synthezier(synthesize_vovoc_expression1)
31796 register_synthezier(synthesize_vocov_expression0)
31797 register_synthezier(synthesize_vocov_expression1)
31798 register_synthezier(synthesize_covov_expression0)
31799 register_synthezier(synthesize_covov_expression1)
31800 register_synthezier(synthesize_covoc_expression0)
31801 register_synthezier(synthesize_covoc_expression1)
31802 register_synthezier(synthesize_cocov_expression1)
31803 register_synthezier(synthesize_vococ_expression0)
31804
31805 register_synthezier(synthesize_vovovov_expression0)
31806 register_synthezier(synthesize_vovovoc_expression0)
31807 register_synthezier(synthesize_vovocov_expression0)
31808 register_synthezier(synthesize_vocovov_expression0)
31809 register_synthezier(synthesize_covovov_expression0)
31810 register_synthezier(synthesize_covocov_expression0)
31811 register_synthezier(synthesize_vocovoc_expression0)
31812 register_synthezier(synthesize_covovoc_expression0)
31813 register_synthezier(synthesize_vococov_expression0)
31814
31815 register_synthezier(synthesize_vovovov_expression1)
31816 register_synthezier(synthesize_vovovoc_expression1)
31817 register_synthezier(synthesize_vovocov_expression1)
31818 register_synthezier(synthesize_vocovov_expression1)
31819 register_synthezier(synthesize_covovov_expression1)
31820 register_synthezier(synthesize_covocov_expression1)
31821 register_synthezier(synthesize_vocovoc_expression1)
31822 register_synthezier(synthesize_covovoc_expression1)
31823 register_synthezier(synthesize_vococov_expression1)
31824
31825 register_synthezier(synthesize_vovovov_expression2)
31826 register_synthezier(synthesize_vovovoc_expression2)
31827 register_synthezier(synthesize_vovocov_expression2)
31828 register_synthezier(synthesize_vocovov_expression2)
31829 register_synthezier(synthesize_covovov_expression2)
31830 register_synthezier(synthesize_covocov_expression2)
31831 register_synthezier(synthesize_vocovoc_expression2)
31832 register_synthezier(synthesize_covovoc_expression2)
31833
31834 register_synthezier(synthesize_vovovov_expression3)
31835 register_synthezier(synthesize_vovovoc_expression3)
31836 register_synthezier(synthesize_vovocov_expression3)
31837 register_synthezier(synthesize_vocovov_expression3)
31838 register_synthezier(synthesize_covovov_expression3)
31839 register_synthezier(synthesize_covocov_expression3)
31840 register_synthezier(synthesize_vocovoc_expression3)
31841 register_synthezier(synthesize_covovoc_expression3)
31842 register_synthezier(synthesize_vococov_expression3)
31843
31844 register_synthezier(synthesize_vovovov_expression4)
31845 register_synthezier(synthesize_vovovoc_expression4)
31846 register_synthezier(synthesize_vovocov_expression4)
31847 register_synthezier(synthesize_vocovov_expression4)
31848 register_synthezier(synthesize_covovov_expression4)
31849 register_synthezier(synthesize_covocov_expression4)
31850 register_synthezier(synthesize_vocovoc_expression4)
31851 register_synthezier(synthesize_covovoc_expression4)
31852
31853 #undef register_synthezier
31854 #endif
31855 }
#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:36259
static expression_node_ptr process(expression_generator< Type > &expr_gen, const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:36294
static expression_node_ptr process(expression_generator< Type > &expr_gen, const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:36235

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

32068 {
32069 return (
32070 (details::e_addass == operation) ||
32071 (details::e_subass == operation) ||
32072 (details::e_mulass == operation) ||
32073 (details::e_divass == operation) ||
32074 (details::e_modass == operation)
32075 ) &&
32077 }
bool assignment_enabled(const details::operator_type &assignment) const
Definition exprtk.hpp:24223
settings_store settings_
Definition exprtk.hpp:42107

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

34357 {
34358 for (std::size_t i = 0; i < b.size(); ++i)
34359 {
34360 if (0 == b[i])
34361 return false;
34362 else if (!details::is_constant_node(b[i]))
34363 return false;
34364 }
34365
34366 return true;
34367 }

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

34341 {
34342 for (std::size_t i = 0; i < N; ++i)
34343 {
34344 if (0 == b[i])
34345 return false;
34346 else if (!details::is_constant_node(b[i]))
34347 return false;
34348 }
34349
34350 return true;
34351 }

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

32340 {
32341 if (
32342 !details::is_constant_node(branch[1]) ||
32343 details::is_constant_node(branch[0]) ||
32344 details::is_variable_node(branch[0]) ||
32345 details::is_vector_node (branch[0]) ||
32347 )
32348 return false;
32349
32350 const Type c = static_cast<details::literal_node<Type>*>(branch[1])->value();
32351
32352 return cardinal_pow_optimisable(operation, c);
32353 }
bool cardinal_pow_optimisable(const details::operator_type &operation, const T &c) const
Definition exprtk.hpp:35239
bool is_vector_node(const expression_node< T > *node)
Definition exprtk.hpp:5877
bool is_generally_string_node(const expression_node< T > *node)
Definition exprtk.hpp:19184

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

32311 {
32312 if (is_assignment_operation(operation))
32313 {
32314 const bool b1_is_genstring = details::is_generally_string_node(branch[1]);
32315
32316 if (details::is_string_node(branch[0]))
32317 return !b1_is_genstring;
32318 else if (details::is_literal_node(branch[0]))
32319 return true;
32320 else
32321 return (
32322 !details::is_variable_node (branch[0]) &&
32323 !details::is_vector_elem_node (branch[0]) &&
32324 !details::is_vector_celem_node (branch[0]) &&
32325 !details::is_vector_elem_rtc_node (branch[0]) &&
32326 !details::is_vector_celem_rtc_node (branch[0]) &&
32331 !details::is_vector_node (branch[0])
32332 )
32333 || b1_is_genstring;
32334 }
32335 else
32336 return false;
32337 }
bool is_assignment_operation(const details::operator_type &operation) const
Definition exprtk.hpp:32067
bool is_vector_elem_rtc_node(const expression_node< T > *node)
Definition exprtk.hpp:5841
bool is_rebasevector_elem_node(const expression_node< T > *node)
Definition exprtk.hpp:5853
bool is_vector_celem_node(const expression_node< T > *node)
Definition exprtk.hpp:5835
bool is_literal_node(const expression_node< T > *node)
Definition exprtk.hpp:5782
bool is_rebasevector_celem_rtc_node(const expression_node< T > *node)
Definition exprtk.hpp:5865
bool is_vector_celem_rtc_node(const expression_node< T > *node)
Definition exprtk.hpp:5847
bool is_vector_elem_node(const expression_node< T > *node)
Definition exprtk.hpp:5829
bool is_rebasevector_celem_node(const expression_node< T > *node)
Definition exprtk.hpp:5871
bool is_rebasevector_elem_rtc_node(const expression_node< T > *node)
Definition exprtk.hpp:5859

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

32356 {
32357 return (
32358 details::is_break_node (branch[0]) ||
32359 details::is_break_node (branch[1]) ||
32360 details::is_continue_node(branch[0]) ||
32361 details::is_continue_node(branch[1])
32362 );
32363 }
bool is_continue_node(const expression_node< T > *node)
Definition exprtk.hpp:5948
bool is_break_node(const expression_node< T > *node)
Definition exprtk.hpp:5942

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

32366 {
32367 const bool b0_string = is_generally_string_node(branch[0]);
32368 const bool b1_string = is_generally_string_node(branch[1]);
32369
32370 bool result = false;
32371
32372 if (b0_string != b1_string)
32373 result = true;
32374 else if (!valid_string_operation(operation) && b0_string && b1_string)
32375 result = true;
32376
32377 if (result)
32378 {
32379 parser_->set_synthesis_error("Invalid string operation");
32380 }
32381
32382 return result;
32383 }
bool valid_string_operation(const details::operator_type &operation) const
Definition exprtk.hpp:32080

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

32386 {
32387 const bool b0_string = is_generally_string_node(branch[0]);
32388 const bool b1_string = is_generally_string_node(branch[1]);
32389 const bool b2_string = is_generally_string_node(branch[2]);
32390
32391 bool result = false;
32392
32393 if ((b0_string != b1_string) || (b1_string != b2_string))
32394 result = true;
32395 else if ((details::e_inrange != operation) && b0_string && b1_string && b2_string)
32396 result = true;
32397
32398 if (result)
32399 {
32400 parser_->set_synthesis_error("Invalid string operation");
32401 }
32402
32403 return result;
32404 }

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

32439 {
32440 return (
32441 details::is_null_node(branch[0]) ||
32442 details::is_null_node(branch[1])
32443 );
32444 }

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

32425 {
32426 return (
32427 (details::e_scand == operation) ||
32428 (details::e_scor == operation)
32429 );
32430 }

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

32407 {
32408 const bool b0_string = is_generally_string_node(branch[0]);
32409 const bool b1_string = is_generally_string_node(branch[1]);
32410
32411 return (b0_string && b1_string && valid_string_operation(operation));
32412 }

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

32415 {
32416 const bool b0_string = is_generally_string_node(branch[0]);
32417 const bool b1_string = is_generally_string_node(branch[1]);
32418 const bool b2_string = is_generally_string_node(branch[2]);
32419
32420 return (b0_string && b1_string && b2_string && (details::e_inrange == operation));
32421 }

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

32469 {
32470 if (!is_ivector_node(branch[0]) && !is_ivector_node(branch[1]))
32471 return false;
32472 else
32473 return (
32474 (details::e_add == operation) ||
32475 (details::e_sub == operation) ||
32476 (details::e_mul == operation) ||
32477 (details::e_div == operation) ||
32478 (details::e_pow == operation)
32479 );
32480 }
bool is_ivector_node(const expression_node< T > *node)
Definition exprtk.hpp:5883

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

32447 {
32448 if (!is_ivector_node(branch[0]) && !is_ivector_node(branch[1]))
32449 return false;
32450 else
32451 return (
32452 (details::e_lt == operation) ||
32453 (details::e_lte == operation) ||
32454 (details::e_gt == operation) ||
32455 (details::e_gte == operation) ||
32456 (details::e_eq == operation) ||
32457 (details::e_ne == operation) ||
32458 (details::e_equal == operation) ||
32459 (details::e_and == operation) ||
32460 (details::e_nand == operation) ||
32461 (details::e_or == operation) ||
32462 (details::e_nor == operation) ||
32463 (details::e_xor == operation) ||
32464 (details::e_xnor == operation)
32465 );
32466 }

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

34370 {
34371 parser_->state_.activate_side_effect("lodge_assignment()");
34372
34374 return;
34375
34376 std::string symbol_name;
34377
34378 switch (cst)
34379 {
34380 case e_st_variable : symbol_name = parser_->symtab_store_
34381 .get_variable_name(node);
34382 break;
34383
34384 #ifndef exprtk_disable_string_capabilities
34385 case e_st_string : symbol_name = parser_->symtab_store_
34386 .get_stringvar_name(node);
34387 break;
34388 #endif
34389
34390 case e_st_vector : {
34392
34393 vector_holder_t& vh = static_cast<vector_node_t*>(node)->vec_holder();
34394
34395 symbol_name = parser_->symtab_store_.get_vector_name(&vh);
34396 }
34397 break;
34398
34399 case e_st_vecelem : {
34401
34402 vector_holder_t& vh = static_cast<vector_elem_node_t*>(node)->vec_holder();
34403
34404 symbol_name = parser_->symtab_store_.get_vector_name(&vh);
34405
34406 cst = e_st_vector;
34407 }
34408 break;
34409
34410 default : return;
34411 }
34412
34413 if (!symbol_name.empty())
34414 {
34415 parser_->dec_.add_assignment(symbol_name,cst);
34416 }
34417 }
void add_assignment(const std::string &symbol, const symbol_type st)
Definition exprtk.hpp:23916
dependent_entity_collector dec_
Definition exprtk.hpp:42111
symtab_store symtab_store_
Definition exprtk.hpp:42110
details::vector_holder< T > vector_holder_t
Definition exprtk.hpp:22522
std::string get_vector_name(const vector_holder_ptr &ptr) const
Definition exprtk.hpp:23633
std::string get_stringvar_name(const expression_node_ptr &ptr) const
Definition exprtk.hpp:23639
std::string get_variable_name(const expression_node_ptr &ptr) const
Definition exprtk.hpp:23628

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

33345 {
33346 if (!all_nodes_valid(arg_list))
33347 {
33349
33350 return error_node();
33351 }
33352 else if (is_constant_foldable(arg_list))
33353 return const_optimise_mswitch(arg_list);
33354 else
33356 }
expression_node_ptr const_optimise_mswitch(Sequence< expression_node_ptr, Allocator > &arg_list)
Definition exprtk.hpp:33166

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

32130 {
32131 return (details::e_add == operation) ||
32132 (details::e_sub == operation) ||
32133 (details::e_mul == operation) ||
32134 (details::e_div == operation) ||
32135 (details::e_mod == operation) ||
32136 (details::e_pow == operation) ||
32137 (details::e_lt == operation) ||
32138 (details::e_lte == operation) ||
32139 (details::e_gt == operation) ||
32140 (details::e_gte == operation) ||
32141 (details::e_eq == operation) ||
32142 (details::e_ne == operation) ||
32143 (details::e_and == operation) ||
32144 (details::e_nand == operation) ||
32145 (details::e_or == operation) ||
32146 (details::e_nor == operation) ||
32147 (details::e_xor == operation) ||
32148 (details::e_xnor == operation) ;
32149 }

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

32678 {
32680
32681 if ((0 != b0) && (0 != b1))
32682 {
32683 expression_node_ptr branch[2] = { b0, b1 };
32684 result = expression_generator<Type>::operator()(operation, branch);
32685 b0 = branch[0];
32686 b1 = branch[1];
32687 }
32688
32689 return result;
32690 }
expression_node_ptr operator()(const Type &v) const
Definition exprtk.hpp:31931

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

32672 {
32673 expression_node_ptr branch[1] = { b0 };
32674 return (*this)(operation,branch);
32675 }

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

32034 {
32035 if (0 == branch[0])
32036 {
32037 return error_node();
32038 }
32039 else if (details::is_null_node(branch[0]))
32040 {
32041 return branch[0];
32042 }
32043 else if (details::is_break_node(branch[0]))
32044 {
32045 return error_node();
32046 }
32047 else if (details::is_continue_node(branch[0]))
32048 {
32049 return error_node();
32050 }
32051 else if (details::is_constant_node(branch[0]))
32052 {
32053 return synthesize_expression<unary_node_t,1>(operation,branch);
32054 }
32055 else if (unary_optimisable(operation) && details::is_variable_node(branch[0]))
32056 {
32057 return synthesize_uv_expression(operation,branch);
32058 }
32059 else if (unary_optimisable(operation) && details::is_ivector_node(branch[0]))
32060 {
32061 return synthesize_uvec_expression(operation,branch);
32062 }
32063 else
32064 return synthesize_unary_expression(operation,branch);
32065 }
expression_node_ptr synthesize_uvec_expression(const details::operator_type &operation, expression_node_ptr(&branch)[1])
Definition exprtk.hpp:33439
expression_node_ptr synthesize_uv_expression(const details::operator_type &operation, expression_node_ptr(&branch)[1])
Definition exprtk.hpp:33422
expression_node_ptr synthesize_unary_expression(const details::operator_type &operation, expression_node_ptr(&branch)[1])
Definition exprtk.hpp:33455
bool unary_optimisable(const details::operator_type &operation) const
Definition exprtk.hpp:31961

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

32483 {
32484 if ((0 == branch[0]) || (0 == branch[1]))
32485 {
32489 "ERR249 - Invalid branches received for operator '" + details::to_str(operation) + "'",
32491
32492 return error_node();
32493 }
32494 else if (is_invalid_string_op(operation,branch))
32495 {
32499 "ERR250 - Invalid branch pair for string operator '" + details::to_str(operation) + "'",
32501
32502 return error_node();
32503 }
32504 else if (is_invalid_assignment_op(operation,branch))
32505 {
32509 "ERR251 - Invalid branch pair for assignment operator '" + details::to_str(operation) + "'",
32511
32512 return error_node();
32513 }
32514 else if (is_invalid_break_continue_op(branch))
32515 {
32519 "ERR252 - Invalid branch pair for break/continue operator '" + details::to_str(operation) + "'",
32521
32522 return error_node();
32523 }
32524 else if (details::e_assign == operation)
32525 {
32526 return synthesize_assignment_expression(operation, branch);
32527 }
32528 else if (details::e_swap == operation)
32529 {
32530 return synthesize_swap_expression(branch);
32531 }
32532 else if (is_assignment_operation(operation))
32533 {
32534 return synthesize_assignment_operation_expression(operation, branch);
32535 }
32536 else if (is_vector_eqineq_logic_operation(operation, branch))
32537 {
32538 return synthesize_veceqineqlogic_operation_expression(operation, branch);
32539 }
32540 else if (is_vector_arithmetic_operation(operation, branch))
32541 {
32542 return synthesize_vecarithmetic_operation_expression(operation, branch);
32543 }
32544 else if (is_shortcircuit_expression(operation))
32545 {
32546 return synthesize_shortcircuit_expression(operation, branch);
32547 }
32548 else if (is_string_operation(operation, branch))
32549 {
32550 return synthesize_string_expression(operation, branch);
32551 }
32552 else if (is_null_present(branch))
32553 {
32554 return synthesize_null_expression(operation, branch);
32555 }
32556 #ifndef exprtk_disable_cardinal_pow_optimisation
32557 else if (is_constpow_operation(operation, branch))
32558 {
32559 return cardinal_pow_optimisation(branch);
32560 }
32561 #endif
32562
32564
32565 #ifndef exprtk_disable_enhanced_features
32566 if (synthesize_expression(operation, branch, result))
32567 {
32568 return result;
32569 }
32570 else
32571 #endif
32572
32573 {
32574 /*
32575 Possible reductions:
32576 1. c o cob -> cob
32577 2. cob o c -> cob
32578 3. c o boc -> boc
32579 4. boc o c -> boc
32580 */
32581 result = error_node();
32582
32583 if (cocob_optimisable(operation, branch))
32584 {
32585 result = synthesize_cocob_expression::process((*this), operation, branch);
32586 }
32587 else if (coboc_optimisable(operation, branch) && (0 == result))
32588 {
32589 result = synthesize_coboc_expression::process((*this), operation, branch);
32590 }
32591
32592 if (result)
32593 return result;
32594 }
32595
32596 if (uvouv_optimisable(operation, branch))
32597 {
32598 return synthesize_uvouv_expression(operation, branch);
32599 }
32600 else if (vob_optimisable(operation, branch))
32601 {
32602 return synthesize_vob_expression::process((*this), operation, branch);
32603 }
32604 else if (bov_optimisable(operation, branch))
32605 {
32606 return synthesize_bov_expression::process((*this), operation, branch);
32607 }
32608 else if (cob_optimisable(operation, branch))
32609 {
32610 return synthesize_cob_expression::process((*this), operation, branch);
32611 }
32612 else if (boc_optimisable(operation, branch))
32613 {
32614 return synthesize_boc_expression::process((*this), operation, branch);
32615 }
32616 #ifndef exprtk_disable_enhanced_features
32617 else if (cov_optimisable(operation, branch))
32618 {
32619 return synthesize_cov_expression::process((*this), operation, branch);
32620 }
32621 #endif
32622 else if (binext_optimisable(operation, branch))
32623 {
32624 return synthesize_binary_ext_expression::process((*this), operation, branch);
32625 }
32626 else
32627 return synthesize_expression<binary_node_t,2>(operation, branch);
32628 }
bool coboc_optimisable(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:32258
bool boc_optimisable(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:32233
bool cov_optimisable(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:32197
expression_node_ptr synthesize_veceqineqlogic_operation_expression(const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:34849
bool is_invalid_string_op(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:32365
bool is_invalid_assignment_op(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:32310
expression_node_ptr synthesize_swap_expression(expression_node_ptr(&branch)[2])
Definition exprtk.hpp:35027
bool is_null_present(expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:32438
bool synthesize_expression(const details::operator_type &operation, expression_node_ptr(&branch)[2], expression_node_ptr &result)
Definition exprtk.hpp:36210
bool is_vector_eqineq_logic_operation(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:32446
bool binext_optimisable(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:32301
expression_node_ptr synthesize_shortcircuit_expression(const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:35109
expression_node_ptr synthesize_uvouv_expression(const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:41003
bool is_string_operation(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:32406
bool is_constpow_operation(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:32339
bool is_vector_arithmetic_operation(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:32468
bool is_invalid_break_continue_op(expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:32355
expression_node_ptr synthesize_string_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:41407
expression_node_ptr synthesize_assignment_expression(const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:34498
bool vob_optimisable(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:32283
expression_node_ptr synthesize_null_expression(const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:41610
expression_node_ptr synthesize_assignment_operation_expression(const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:34577
expression_node_ptr synthesize_vecarithmetic_operation_expression(const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:34941
bool cob_optimisable(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:32224
expression_node_ptr cardinal_pow_optimisation(const T &v, const T &c)
Definition exprtk.hpp:35218
bool bov_optimisable(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:32292
bool is_shortcircuit_expression(const details::operator_type &operation) const
Definition exprtk.hpp:32424
bool uvouv_optimisable(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:32274
bool cocob_optimisable(const details::operator_type &operation, expression_node_ptr(&branch)[2]) const
Definition exprtk.hpp:32242
std::string to_str(int i)
Definition exprtk.hpp:302
static expression_node_ptr process(expression_generator< Type > &expr_gen, const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:35282
static expression_node_ptr process(expression_generator< Type > &expr_gen, const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:35731
static expression_node_ptr process(expression_generator< Type > &expr_gen, const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:35507
static expression_node_ptr process(expression_generator< Type > &expr_gen, const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:35593
static expression_node_ptr process(expression_generator< Type > &expr_gen, const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:36055
static expression_node_ptr process(expression_generator< Type > &expr_gen, const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:35850
static expression_node_ptr process(expression_generator< Type > &expr_gen, const details::operator_type &operation, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:35432

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

32631 {
32632 if (
32633 (0 == branch[0]) ||
32634 (0 == branch[1]) ||
32635 (0 == branch[2])
32636 )
32637 {
32639
32643 "ERR253 - Invalid branches operator '" + details::to_str(operation) + "'",
32645
32646 return error_node();
32647 }
32648 else if (is_invalid_string_op(operation, branch))
32649 {
32653 "ERR254 - Invalid branches for string operator '" + details::to_str(operation) + "'",
32655
32656 return error_node();
32657 }
32658 else if (is_string_operation(operation, branch))
32659 {
32660 return synthesize_string_expression(operation, branch);
32661 }
32662 else
32663 return synthesize_expression<trinary_node_t,3>(operation, branch);
32664 }

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

32667 {
32668 return synthesize_expression<quaternary_node_t,4>(operation,branch);
32669 }

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

31938 {
31940 }
details::string_literal_node< T > string_literal_node_t
Definition exprtk.hpp:22496

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

31948 {
31950 }
expression_node< typename node_type::value_type > * allocate_tt(T1 t1, T2 t2) const
Definition exprtk.hpp:19384
details::const_string_range_node< T > const_string_range_node_t
Definition exprtk.hpp:22498

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

31932 {
31934 }

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

31953 {
31954 if (is_generally_string_node(branch))
31956 else
31957 return error_node();
31958 }
details::generic_string_range_node< T > generic_string_range_node_t
Definition exprtk.hpp:22499

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

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

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

32984 {
32985 if (!break_continue_present && details::is_constant_node(condition))
32986 {
32987 if (
32988 details::is_true(condition) &&
32990 )
32991 {
32992 free_node(*node_allocator_,condition);
32993
32994 return branch;
32995 }
32996
32999
33000 return error_node();
33001 }
33002 else if (details::is_null_node(condition))
33003 {
33005
33006 return branch;
33007 }
33008
33010
33011 if (!break_continue_present)
33012 {
33013 if (rtc)
33015 (condition, branch, rtc);
33016 else
33018 (condition, branch);
33019 }
33020 #ifndef exprtk_disable_break_continue
33021 else
33022 {
33023 if (rtc)
33025 (condition, branch, rtc);
33026 else
33028 (condition, branch);
33029 }
33030 #else
33031 return error_node();
33032 #endif
33033 }
details::repeat_until_loop_node< T > repeat_until_loop_node_t
Definition exprtk.hpp:22468
details::repeat_until_loop_bc_node< T > repeat_until_loop_bc_node_t
Definition exprtk.hpp:22475
details::repeat_until_loop_bc_rtc_node< T > repeat_until_loop_bc_rtc_node_t
Definition exprtk.hpp:22478
details::repeat_until_loop_rtc_node< T > repeat_until_loop_rtc_node_t
Definition exprtk.hpp:22471

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

34106 {
34107 if (!all_nodes_valid(arg_list))
34108 {
34110 return error_node();
34111 }
34112
34113 typedef details::return_node<Type> alloc_type;
34114
34116 allocate_rr<alloc_type>(arg_list,parser_->results_ctx());
34117
34118 alloc_type* return_node_ptr = static_cast<alloc_type*>(result);
34119
34120 assert(return_node_ptr);
34121
34122 if (return_node_ptr->init_branches())
34123 {
34124 if (result && result->valid())
34125 {
34126 parser_->state_.activate_side_effect("return_call()");
34127 return result;
34128 }
34129
34132 token_t(),
34133 "ERR268 - Failed to synthesize node: return_node",
34135
34137 return error_node();
34138 }
34139 else
34140 {
34143
34144 return error_node();
34145 }
34146 }
results_context_t & results_ctx()
Definition exprtk.hpp:42061

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

34151 {
34152 typedef details::return_envelope_node<Type> alloc_type;
34153
34155 allocate_cr<alloc_type>(body,(*rc));
34156
34157 return_invoked = static_cast<alloc_type*>(result)->retinvk_ptr();
34158
34159 return result;
34160 }

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

31888 {
31889 node_allocator_ = &na;
31890 }

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

31868 {
31869 binary_op_map_ = &binary_op_map;
31870 }

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

31873 {
31874 inv_binary_op_map_ = &inv_binary_op_map;
31875 }
inv_binary_op_map_t * inv_binary_op_map_
Definition exprtk.hpp:41799

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

31858 {
31859 parser_ = &p;
31860 }

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

31878 {
31879 sf3_map_ = &sf3_map;
31880 }

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

31883 {
31884 sf4_map_ = &sf4_map;
31885 }

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

31893 {
31895 }

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

31863 {
31864 unary_op_map_ = &unary_op_map;
31865 }

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

32010 {
32011 typename sf3_map_t::const_iterator itr = sf3_map_->find(sf3id);
32012
32013 if (sf3_map_->end() == itr)
32014 return false;
32015 else
32016 operation = itr->second.second;
32017
32018 return true;
32019 }

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

31986 {
31987 typename sf3_map_t::const_iterator itr = sf3_map_->find(sf3id);
31988
31989 if (sf3_map_->end() == itr)
31990 return false;
31991 else
31992 tfunc = itr->second.first;
31993
31994 return true;
31995 }

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

32022 {
32023 typename sf4_map_t::const_iterator itr = sf4_map_->find(sf4id);
32024
32025 if (sf4_map_->end() == itr)
32026 return false;
32027 else
32028 operation = itr->second.second;
32029
32030 return true;
32031 }

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

31998 {
31999 typename sf4_map_t::const_iterator itr = sf4_map_->find(sf4id);
32000
32001 if (sf4_map_->end() == itr)
32002 return false;
32003 else
32004 qfunc = itr->second.first;
32005
32006 return true;
32007 }

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

33541 {
33542 if (!all_nodes_valid(branch))
33543 return error_node();
33544 else if (is_constant_foldable(branch))
33545 return const_optimise_sf3(operation,branch);
33546 else if (all_nodes_variables(branch))
33547 return varnode_optimise_sf3(operation,branch);
33548 else
33549 {
33550 switch (operation)
33551 {
33552 #define case_stmt(op) \
33553 case details::e_sf##op : return node_allocator_-> \
33554 allocate<details::sf3_node<Type,details::sf##op##_op<Type> > > \
33555 (operation, branch); \
33556
33557 case_stmt(00) case_stmt(01) case_stmt(02) case_stmt(03)
33558 case_stmt(04) case_stmt(05) case_stmt(06) case_stmt(07)
33559 case_stmt(08) case_stmt(09) case_stmt(10) case_stmt(11)
33560 case_stmt(12) case_stmt(13) case_stmt(14) case_stmt(15)
33561 case_stmt(16) case_stmt(17) case_stmt(18) case_stmt(19)
33562 case_stmt(20) case_stmt(21) case_stmt(22) case_stmt(23)
33563 case_stmt(24) case_stmt(25) case_stmt(26) case_stmt(27)
33564 case_stmt(28) case_stmt(29) case_stmt(30) case_stmt(31)
33565 case_stmt(32) case_stmt(33) case_stmt(34) case_stmt(35)
33566 case_stmt(36) case_stmt(37) case_stmt(38) case_stmt(39)
33567 case_stmt(40) case_stmt(41) case_stmt(42) case_stmt(43)
33568 case_stmt(44) case_stmt(45) case_stmt(46) case_stmt(47)
33569 #undef case_stmt
33570 default : return error_node();
33571 }
33572 }
33573 }
expression_node_ptr varnode_optimise_sf3(const details::operator_type &operation, expression_node_ptr(&branch)[3])
Definition exprtk.hpp:33508
expression_node_ptr const_optimise_sf3(const details::operator_type &operation, expression_node_ptr(&branch)[3])
Definition exprtk.hpp:33470
bool all_nodes_variables(expression_node< T > *const (&b)[N])
Definition exprtk.hpp:6029

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

33648 {
33649 if (!all_nodes_valid(branch))
33650 return error_node();
33651 else if (is_constant_foldable(branch))
33652 return const_optimise_sf4(operation,branch);
33653 else if (all_nodes_variables(branch))
33654 return varnode_optimise_sf4(operation,branch);
33655 switch (operation)
33656 {
33657 #define case_stmt(op) \
33658 case details::e_sf##op : return node_allocator_-> \
33659 allocate<details::sf4_node<Type,details::sf##op##_op<Type> > > \
33660 (operation, branch); \
33661
33662 case_stmt(48) case_stmt(49) case_stmt(50) case_stmt(51)
33663 case_stmt(52) case_stmt(53) case_stmt(54) case_stmt(55)
33664 case_stmt(56) case_stmt(57) case_stmt(58) case_stmt(59)
33665 case_stmt(60) case_stmt(61) case_stmt(62) case_stmt(63)
33666 case_stmt(64) case_stmt(65) case_stmt(66) case_stmt(67)
33667 case_stmt(68) case_stmt(69) case_stmt(70) case_stmt(71)
33668 case_stmt(72) case_stmt(73) case_stmt(74) case_stmt(75)
33669 case_stmt(76) case_stmt(77) case_stmt(78) case_stmt(79)
33670 case_stmt(80) case_stmt(81) case_stmt(82) case_stmt(83)
33671 case_stmt(84) case_stmt(85) case_stmt(86) case_stmt(87)
33672 case_stmt(88) case_stmt(89) case_stmt(90) case_stmt(91)
33673 case_stmt(92) case_stmt(93) case_stmt(94) case_stmt(95)
33674 case_stmt(96) case_stmt(97) case_stmt(98) case_stmt(99)
33675 #undef case_stmt
33676 default : return error_node();
33677 }
33678 }
expression_node_ptr varnode_optimise_sf4(const details::operator_type &operation, expression_node_ptr(&branch)[4])
Definition exprtk.hpp:33613
expression_node_ptr const_optimise_sf4(const details::operator_type &operation, expression_node_ptr(&branch)[4])
Definition exprtk.hpp:33575

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

33714 {
33715 return (
33716 (details::e_sum == operation) ||
33717 (details::e_prod == operation) ||
33718 (details::e_avg == operation) ||
33719 (details::e_min == operation) ||
33720 (details::e_max == operation)
33721 );
33722 }

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

34033 {
34034 if (!all_nodes_valid(arg_list))
34035 {
34037 return error_node();
34038 }
34039
34042
34043 const std::size_t no_psi = std::numeric_limits<std::size_t>::max();
34044
34046 std::string node_name = "Unknown";
34047
34048 if (no_psi == param_seq_index)
34049 {
34050 result = node_allocator_->allocate<alloc_type1>(gf,arg_list);
34051 node_name = "string_function_node<igeneric_function_t>";
34052 }
34053 else
34054 {
34055 result = node_allocator_->allocate<alloc_type2>(gf, param_seq_index, arg_list);
34056 node_name = "multimode_strfunction_node<igeneric_function_t>";
34057 }
34058
34059 alloc_type1* strfunc_node_ptr = static_cast<alloc_type1*>(result);
34060
34061 assert(strfunc_node_ptr);
34062
34063 if (
34064 !arg_list.empty() &&
34065 !gf->has_side_effects() &&
34066 is_constant_foldable(arg_list)
34067 )
34068 {
34069 strfunc_node_ptr->init_branches();
34070
34071 const Type v = result->value();
34072
34074
34076 }
34077 else if (strfunc_node_ptr->init_branches())
34078 {
34079 if (result && result->valid())
34080 {
34081 parser_->state_.activate_side_effect("string_function_call()");
34082 return result;
34083 }
34084
34087 token_t(),
34088 "ERR267 - Failed to synthesize node: " + node_name,
34090
34092 return error_node();
34093 }
34094 else
34095 {
34098
34099 return error_node();
34100 }
34101 }

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

33306 {
33307 if (arg_list.empty())
33308 return error_node();
33309 else if (
33310 !all_nodes_valid(arg_list) ||
33311 (!default_statement_present && (arg_list.size() < 2))
33312 )
33313 {
33315
33316 return error_node();
33317 }
33318 else if (is_constant_foldable(arg_list))
33319 return const_optimise_switch(arg_list);
33320
33321 switch ((arg_list.size() - 1) / 2)
33322 {
33323 #define case_stmt(N) \
33324 case N : \
33325 return node_allocator_-> \
33326 allocate<details::switch_n_node \
33327 <Type,typename switch_nodes::switch_impl_##N > >(arg_list); \
33328
33329 case_stmt(1)
33330 case_stmt(2)
33331 case_stmt(3)
33332 case_stmt(4)
33333 case_stmt(5)
33334 case_stmt(6)
33335 case_stmt(7)
33336 #undef case_stmt
33337
33338 default : return node_allocator_->allocate<details::switch_node<Type> >(arg_list);
33339 }
33340 }
expression_node_ptr const_optimise_switch(Sequence< expression_node_ptr, Allocator > &arg_list)
Definition exprtk.hpp:33130

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

34499 {
34500 if (assign_immutable_symbol(branch[0]))
34501 {
34502 return error_node();
34503 }
34504 else if (details::is_variable_node(branch[0]))
34505 {
34507 return synthesize_expression<assignment_node_t,2>(operation,branch);
34508 }
34509 else if (details::is_vector_elem_node(branch[0]) || details::is_vector_celem_node(branch[0]))
34510 {
34511 lodge_assignment(e_st_vecelem,branch[0]);
34512 return synthesize_expression<assignment_vec_elem_node_t, 2>(operation, branch);
34513 }
34515 {
34516 lodge_assignment(e_st_vecelem,branch[0]);
34517 return synthesize_expression<assignment_vec_elem_rtc_node_t, 2>(operation, branch);
34518 }
34519 else if (details::is_rebasevector_elem_node(branch[0]))
34520 {
34521 lodge_assignment(e_st_vecelem,branch[0]);
34522 return synthesize_expression<assignment_rebasevec_elem_node_t, 2>(operation, branch);
34523 }
34524 else if (details::is_rebasevector_elem_rtc_node(branch[0]))
34525 {
34526 lodge_assignment(e_st_vecelem,branch[0]);
34527 return synthesize_expression<assignment_rebasevec_elem_rtc_node_t, 2>(operation, branch);
34528 }
34529 else if (details::is_rebasevector_celem_node(branch[0]))
34530 {
34531 lodge_assignment(e_st_vecelem,branch[0]);
34532 return synthesize_expression<assignment_rebasevec_celem_node_t, 2>(operation, branch);
34533 }
34534 #ifndef exprtk_disable_string_capabilities
34535 else if (details::is_string_node(branch[0]))
34536 {
34537 lodge_assignment(e_st_string,branch[0]);
34538 return synthesize_expression<assignment_string_node_t,2>(operation, branch);
34539 }
34540 else if (details::is_string_range_node(branch[0]))
34541 {
34542 lodge_assignment(e_st_string,branch[0]);
34543 return synthesize_expression<assignment_string_range_node_t,2>(operation, branch);
34544 }
34545 #endif
34546 else if (details::is_vector_node(branch[0]))
34547 {
34548 lodge_assignment(e_st_vector,branch[0]);
34549
34550 if (details::is_ivector_node(branch[1]))
34551 return synthesize_expression<assignment_vecvec_node_t,2>(operation, branch);
34552 else
34553 return synthesize_expression<assignment_vec_node_t,2>(operation, branch);
34554 }
34555 else if (details::is_literal_node(branch[0]))
34556 {
34560 "ERR274 - Cannot assign value to const variable",
34562
34563 return error_node();
34564 }
34565 else
34566 {
34570 "ERR275 - Invalid branches for assignment operator '" + details::to_str(operation) + "'",
34572
34573 return error_node();
34574 }
34575 }
void lodge_assignment(symbol_type cst, expression_node_ptr node)
Definition exprtk.hpp:34369
bool assign_immutable_symbol(expression_node_ptr node)
Definition exprtk.hpp:34469

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

34579 {
34580 if (assign_immutable_symbol(branch[0]))
34581 {
34582 return error_node();
34583 }
34584
34586 std::string node_name = "Unknown";
34587
34588 if (details::is_variable_node(branch[0]))
34589 {
34591
34592 switch (operation)
34593 {
34594 #define case_stmt(op0, op1) \
34595 case op0 : result = node_allocator_-> \
34596 template allocate_rrr<typename details::assignment_op_node<Type,op1<Type> > > \
34597 (operation, branch[0], branch[1]); \
34598 node_name = "assignment_op_node"; \
34599 break; \
34600
34601 case_stmt(details::e_addass , details::add_op)
34602 case_stmt(details::e_subass , details::sub_op)
34603 case_stmt(details::e_mulass , details::mul_op)
34604 case_stmt(details::e_divass , details::div_op)
34605 case_stmt(details::e_modass , details::mod_op)
34606 #undef case_stmt
34607 default : return error_node();
34608 }
34609 }
34610 else if (details::is_vector_elem_node(branch[0]))
34611 {
34612 lodge_assignment(e_st_vecelem,branch[0]);
34613
34614 switch (operation)
34615 {
34616 #define case_stmt(op0, op1) \
34617 case op0 : result = node_allocator_-> \
34618 template allocate_rrr<typename details::assignment_vec_elem_op_node<Type,op1<Type> > > \
34619 (operation, branch[0], branch[1]); \
34620 node_name = "assignment_vec_elem_op_node"; \
34621 break; \
34622
34623 case_stmt(details::e_addass , details::add_op)
34624 case_stmt(details::e_subass , details::sub_op)
34625 case_stmt(details::e_mulass , details::mul_op)
34626 case_stmt(details::e_divass , details::div_op)
34627 case_stmt(details::e_modass , details::mod_op)
34628 #undef case_stmt
34629 default : return error_node();
34630 }
34631 }
34632 else if (details::is_vector_elem_rtc_node(branch[0]))
34633 {
34634 lodge_assignment(e_st_vecelem,branch[0]);
34635
34636 switch (operation)
34637 {
34638 #define case_stmt(op0, op1) \
34639 case op0 : result = node_allocator_-> \
34640 template allocate_rrr<typename details::assignment_vec_elem_op_rtc_node<Type,op1<Type> > > \
34641 (operation, branch[0], branch[1]); \
34642 node_name = "assignment_vec_elem_op_rtc_node"; \
34643 break; \
34644
34645 case_stmt(details::e_addass , details::add_op)
34646 case_stmt(details::e_subass , details::sub_op)
34647 case_stmt(details::e_mulass , details::mul_op)
34648 case_stmt(details::e_divass , details::div_op)
34649 case_stmt(details::e_modass , details::mod_op)
34650 #undef case_stmt
34651 default : return error_node();
34652 }
34653 }
34654 else if (details::is_vector_celem_rtc_node(branch[0]))
34655 {
34656 lodge_assignment(e_st_vecelem,branch[0]);
34657
34658 switch (operation)
34659 {
34660 #define case_stmt(op0, op1) \
34661 case op0 : result = node_allocator_-> \
34662 template allocate_rrr<typename details::assignment_vec_celem_op_rtc_node<Type,op1<Type> > > \
34663 (operation, branch[0], branch[1]); \
34664 node_name = "assignment_vec_celem_op_rtc_node"; \
34665 break; \
34666
34667 case_stmt(details::e_addass , details::add_op)
34668 case_stmt(details::e_subass , details::sub_op)
34669 case_stmt(details::e_mulass , details::mul_op)
34670 case_stmt(details::e_divass , details::div_op)
34671 case_stmt(details::e_modass , details::mod_op)
34672 #undef case_stmt
34673 default : return error_node();
34674 }
34675 }
34676 else if (details::is_rebasevector_elem_node(branch[0]))
34677 {
34678 lodge_assignment(e_st_vecelem,branch[0]);
34679
34680 switch (operation)
34681 {
34682 #define case_stmt(op0, op1) \
34683 case op0 : result = node_allocator_-> \
34684 template allocate_rrr<typename details::assignment_rebasevec_elem_op_node<Type,op1<Type> > > \
34685 (operation, branch[0], branch[1]); \
34686 node_name = "assignment_rebasevec_elem_op_node"; \
34687 break; \
34688
34689 case_stmt(details::e_addass , details::add_op)
34690 case_stmt(details::e_subass , details::sub_op)
34691 case_stmt(details::e_mulass , details::mul_op)
34692 case_stmt(details::e_divass , details::div_op)
34693 case_stmt(details::e_modass , details::mod_op)
34694 #undef case_stmt
34695 default : return error_node();
34696 }
34697 }
34698 else if (details::is_rebasevector_celem_node(branch[0]))
34699 {
34700 lodge_assignment(e_st_vecelem,branch[0]);
34701
34702 switch (operation)
34703 {
34704 #define case_stmt(op0, op1) \
34705 case op0 : result = node_allocator_-> \
34706 template allocate_rrr<typename details::assignment_rebasevec_celem_op_node<Type,op1<Type> > > \
34707 (operation, branch[0], branch[1]); \
34708 node_name = "assignment_rebasevec_celem_op_node"; \
34709 break; \
34710
34711 case_stmt(details::e_addass , details::add_op)
34712 case_stmt(details::e_subass , details::sub_op)
34713 case_stmt(details::e_mulass , details::mul_op)
34714 case_stmt(details::e_divass , details::div_op)
34715 case_stmt(details::e_modass , details::mod_op)
34716 #undef case_stmt
34717 default : return error_node();
34718 }
34719 }
34720 else if (details::is_rebasevector_elem_rtc_node(branch[0]))
34721 {
34722 lodge_assignment(e_st_vecelem,branch[0]);
34723
34724 switch (operation)
34725 {
34726 #define case_stmt(op0, op1) \
34727 case op0 : result = node_allocator_-> \
34728 template allocate_rrr<typename details::assignment_rebasevec_elem_op_rtc_node<Type,op1<Type> > > \
34729 (operation, branch[0], branch[1]); \
34730 node_name = "assignment_rebasevec_elem_op_rtc_node"; \
34731 break; \
34732
34733 case_stmt(details::e_addass , details::add_op)
34734 case_stmt(details::e_subass , details::sub_op)
34735 case_stmt(details::e_mulass , details::mul_op)
34736 case_stmt(details::e_divass , details::div_op)
34737 case_stmt(details::e_modass , details::mod_op)
34738 #undef case_stmt
34739 default : return error_node();
34740 }
34741 }
34742 else if (details::is_rebasevector_celem_rtc_node(branch[0]))
34743 {
34744 lodge_assignment(e_st_vecelem,branch[0]);
34745
34746 switch (operation)
34747 {
34748 #define case_stmt(op0, op1) \
34749 case op0 : result = node_allocator_-> \
34750 template allocate_rrr<typename details::assignment_rebasevec_celem_op_rtc_node<Type,op1<Type> > > \
34751 (operation, branch[0], branch[1]); \
34752 node_name = "assignment_rebasevec_celem_op_rtc_node"; \
34753 break; \
34754
34755 case_stmt(details::e_addass , details::add_op)
34756 case_stmt(details::e_subass , details::sub_op)
34757 case_stmt(details::e_mulass , details::mul_op)
34758 case_stmt(details::e_divass , details::div_op)
34759 case_stmt(details::e_modass , details::mod_op)
34760 #undef case_stmt
34761 default : return error_node();
34762 }
34763 }
34764 else if (details::is_vector_node(branch[0]))
34765 {
34766 lodge_assignment(e_st_vector,branch[0]);
34767
34768 if (details::is_ivector_node(branch[1]))
34769 {
34770 switch (operation)
34771 {
34772 #define case_stmt(op0, op1) \
34773 case op0 : result = node_allocator_-> \
34774 template allocate_rrr<typename details::assignment_vecvec_op_node<Type,op1<Type> > > \
34775 (operation, branch[0], branch[1]); \
34776 node_name = "assignment_rebasevec_celem_op_node"; \
34777 break; \
34778
34779 case_stmt(details::e_addass , details::add_op)
34780 case_stmt(details::e_subass , details::sub_op)
34781 case_stmt(details::e_mulass , details::mul_op)
34782 case_stmt(details::e_divass , details::div_op)
34783 case_stmt(details::e_modass , details::mod_op)
34784 #undef case_stmt
34785 default : return error_node();
34786 }
34787 }
34788 else
34789 {
34790 switch (operation)
34791 {
34792 #define case_stmt(op0, op1) \
34793 case op0 : result = node_allocator_-> \
34794 template allocate_rrr<typename details::assignment_vec_op_node<Type,op1<Type> > > \
34795 (operation, branch[0], branch[1]); \
34796 node_name = "assignment_vec_op_node"; \
34797 break; \
34798
34799 case_stmt(details::e_addass , details::add_op)
34800 case_stmt(details::e_subass , details::sub_op)
34801 case_stmt(details::e_mulass , details::mul_op)
34802 case_stmt(details::e_divass , details::div_op)
34803 case_stmt(details::e_modass , details::mod_op)
34804 #undef case_stmt
34805 default : return error_node();
34806 }
34807 }
34808 }
34809 #ifndef exprtk_disable_string_capabilities
34810 else if (
34811 (details::e_addass == operation) &&
34812 details::is_string_node(branch[0])
34813 )
34814 {
34816
34817 lodge_assignment(e_st_string,branch[0]);
34818
34819 result = synthesize_expression<addass_t,2>(operation,branch);
34820 node_name = "assignment_string_node<T,details::asn_addassignment>";
34821 }
34822 #endif
34823 else
34824 {
34828 "ERR276 - Invalid branches for assignment operator '" + details::to_str(operation) + "'",
34830
34831 return error_node();
34832 }
34833
34834 if (result && result->valid())
34835 {
34836 return result;
34837 }
34838
34841 token_t(),
34842 "ERR277 - Failed to synthesize node: " + node_name,
34844
34846 return error_node();
34847 }

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

41287 {
41288 const std::string s0 = static_cast<details::string_literal_node<Type>*>(branch[0])->str();
41289 const std::string s1 = static_cast<details::string_literal_node<Type>*>(branch[1])->str();
41290
41292
41293 if (details::e_add == opr)
41295 else if (details::e_in == opr)
41297 else if (details::e_like == opr)
41299 else if (details::e_ilike == opr)
41301 else
41302 {
41303 expression_node_ptr temp = synthesize_sos_expression_impl<const std::string, const std::string>(opr, s0, s1);
41304
41305 const Type v = temp->value();
41306
41308
41310 }
41311
41313
41314 return result;
41315 }
static T process(const T &, const T &)
Definition exprtk.hpp:15927
static T process(const T &, const T &)
Definition exprtk.hpp:15905
static T process(const T &, const T &)
Definition exprtk.hpp:15916

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

41318 {
41319 const std::string s0 = static_cast<details::string_literal_node<Type>* >(branch[0])->str ();
41320 std::string s1 = static_cast<details::const_string_range_node<Type>*>(branch[1])->str ();
41321 range_t rp1 = static_cast<details::const_string_range_node<Type>*>(branch[1])->range();
41322
41323 static_cast<details::const_string_range_node<Type>*>(branch[1])->range_ref().clear();
41324
41327
41328 return synthesize_str_xoxr_expression_impl<const std::string, const std::string>(opr, s0, s1, rp1);
41329 }
details::range_pack< T > range_t
Definition exprtk.hpp:22493

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

41233 {
41234 std::string s0 = static_cast<details::string_literal_node<Type>*>(branch[0])->str();
41235 std::string& s1 = static_cast<details::stringvar_node<Type>* >(branch[1])->ref();
41236
41238
41239 return synthesize_sos_expression_impl<const std::string,std::string&>(opr, s0, s1);
41240 }

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

41243 {
41244 std::string s0 = static_cast<details::string_literal_node<Type>*>(branch[0])->str ();
41245 std::string& s1 = static_cast<details::string_range_node<Type>* >(branch[1])->ref ();
41246 range_t rp1 = static_cast<details::string_range_node<Type>* >(branch[1])->range();
41247
41248 static_cast<details::string_range_node<Type>*>(branch[1])->range_ref().clear();
41249
41252
41253 return synthesize_str_xoxr_expression_impl<const std::string,std::string&>(opr, s0, s1, rp1);
41254 }

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

41361 {
41362 const std::string s0 = static_cast<details::const_string_range_node<Type>*>(branch[0])->str ();
41363 const std::string s1 = static_cast<details::string_literal_node<Type>* >(branch[1])->str ();
41364 const range_t rp0 = static_cast<details::const_string_range_node<Type>*>(branch[0])->range();
41365
41366 static_cast<details::const_string_range_node<Type>*>(branch[0])->range_ref().clear();
41367
41369
41370 return synthesize_str_xrox_expression_impl<const std::string,std::string>(opr, s0, s1, rp0);
41371 }

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

41374 {
41375 const std::string s0 = static_cast<details::const_string_range_node<Type>*>(branch[0])->str ();
41376 const std::string s1 = static_cast<details::const_string_range_node<Type>*>(branch[1])->str ();
41377 const range_t rp0 = static_cast<details::const_string_range_node<Type>*>(branch[0])->range();
41378 const range_t rp1 = static_cast<details::const_string_range_node<Type>*>(branch[1])->range();
41379
41380 static_cast<details::const_string_range_node<Type>*>(branch[0])->range_ref().clear();
41381 static_cast<details::const_string_range_node<Type>*>(branch[1])->range_ref().clear();
41382
41384
41385 return synthesize_str_xroxr_expression_impl<const std::string, const std::string>(opr, s0, s1, rp0, rp1);
41386 }

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

41332 {
41333 std::string s0 = static_cast<details::const_string_range_node<Type>*>(branch[0])->str ();
41334 std::string& s1 = static_cast<details::stringvar_node<Type>* >(branch[1])->ref ();
41335 range_t rp0 = static_cast<details::const_string_range_node<Type>*>(branch[0])->range();
41336
41337 static_cast<details::const_string_range_node<Type>*>(branch[0])->range_ref().clear();
41338
41340
41341 return synthesize_str_xrox_expression_impl<const std::string,std::string&>(opr, s0, s1, rp0);
41342 }

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

41345 {
41346 const std::string s0 = static_cast<details::const_string_range_node<Type>*>(branch[0])->str ();
41347 std::string& s1 = static_cast<details::string_range_node<Type>* >(branch[1])->ref ();
41348 const range_t rp0 = static_cast<details::const_string_range_node<Type>*>(branch[0])->range();
41349 const range_t rp1 = static_cast<details::string_range_node<Type>* >(branch[1])->range();
41350
41351 static_cast<details::const_string_range_node<Type>*>(branch[0])->range_ref().clear();
41352 static_cast<details::string_range_node<Type>*> (branch[1])->range_ref().clear();
41353
41356
41357 return synthesize_str_xroxr_expression_impl<const std::string,std::string&>(opr, s0, s1, rp0, rp1);
41358 }

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

36213 {
36214 result = error_node();
36215
36216 if (!operation_optimisable(operation))
36217 return false;
36218
36219 const std::string node_id = branch_to_id(branch);
36220
36221 const typename synthesize_map_t::iterator itr = synthesize_map_.find(node_id);
36222
36223 if (synthesize_map_.end() != itr)
36224 {
36225 result = itr->second((*this), operation, branch);
36226
36227 return true;
36228 }
36229 else
36230 return false;
36231 }

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

41708 {
41709 if (
41710 (details::e_in == operation) ||
41711 (details::e_like == operation) ||
41712 (details::e_ilike == operation)
41713 )
41714 {
41716
41717 return error_node();
41718 }
41719 else if (!details::all_nodes_valid<N>(branch))
41720 {
41722
41723 return error_node();
41724 }
41725 else if ((details::e_default != operation))
41726 {
41727 // Attempt simple constant folding optimisation.
41728 expression_node_ptr expression_point = node_allocator_->allocate<NodeType>(operation,branch);
41729
41730 if (is_constant_foldable<N>(branch))
41731 {
41732 const Type v = expression_point->value();
41733 details::free_node(*node_allocator_,expression_point);
41734
41736 }
41737
41738 if (expression_point && expression_point->valid())
41739 {
41740 return expression_point;
41741 }
41742
41745 token_t(),
41746 "ERR281 - Failed to synthesize node: NodeType",
41748
41749 details::free_node(*node_allocator_, expression_point);
41750 }
41751
41752 return error_node();
41753 }

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

41757 {
41758 if (!details::all_nodes_valid<N>(branch))
41759 {
41761
41762 return error_node();
41763 }
41764
41765 typedef typename details::function_N_node<T,ifunction_t,N> function_N_node_t;
41766
41767 // Attempt simple constant folding optimisation.
41768
41769 expression_node_ptr expression_point = node_allocator_->allocate<NodeType>(f);
41770 function_N_node_t* func_node_ptr = dynamic_cast<function_N_node_t*>(expression_point);
41771
41772 if (0 == func_node_ptr)
41773 {
41775
41776 return error_node();
41777 }
41778 else
41779 func_node_ptr->init_branches(branch);
41780
41781 if (is_constant_foldable<N>(branch) && !f->has_side_effects())
41782 {
41783 Type v = expression_point->value();
41784 details::free_node(*node_allocator_,expression_point);
41785
41787 }
41788
41789 parser_->state_.activate_side_effect("synthesize_expression(function<NT,N>)");
41790
41791 return expression_point;
41792 }

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

41611 {
41612 /*
41613 Note: The following are the type promotion rules
41614 that relate to operations that include 'null':
41615 0. null ==/!= null --> true false
41616 1. null operation null --> null
41617 2. x ==/!= null --> true/false
41618 3. null ==/!= x --> true/false
41619 4. x operation null --> x
41620 5. null operation x --> x
41621 */
41622
41623 typedef typename details::null_eq_node<T> nulleq_node_t;
41624
41625 const bool b0_null = details::is_null_node(branch[0]);
41626 const bool b1_null = details::is_null_node(branch[1]);
41627
41628 if (b0_null && b1_null)
41629 {
41631
41632 if (details::e_eq == operation)
41633 result = node_allocator_->allocate_c<literal_node_t>(T(1));
41634 else if (details::e_ne == operation)
41635 result = node_allocator_->allocate_c<literal_node_t>(T(0));
41636
41637 if (result)
41638 {
41641
41642 return result;
41643 }
41644
41646
41647 return branch[0];
41648 }
41649 else if (details::e_eq == operation)
41650 {
41652 allocate_rc<nulleq_node_t>(branch[b0_null ? 0 : 1],true);
41653
41654 details::free_node(*node_allocator_,branch[b0_null ? 1 : 0]);
41655
41656 return result;
41657 }
41658 else if (details::e_ne == operation)
41659 {
41661 allocate_rc<nulleq_node_t>(branch[b0_null ? 0 : 1],false);
41662
41663 details::free_node(*node_allocator_,branch[b0_null ? 1 : 0]);
41664
41665 return result;
41666 }
41667 else if (b0_null)
41668 {
41670 branch[0] = branch[1];
41671 branch[1] = error_node();
41672 }
41673 else if (b1_null)
41674 {
41676 branch[1] = error_node();
41677 }
41678
41679 if (
41680 (details::e_add == operation) || (details::e_sub == operation) ||
41681 (details::e_mul == operation) || (details::e_div == operation) ||
41682 (details::e_mod == operation) || (details::e_pow == operation)
41683 )
41684 {
41685 return branch[0];
41686 }
41687
41689
41690 if (
41691 (details::e_lt == operation) || (details::e_lte == operation) ||
41692 (details::e_gt == operation) || (details::e_gte == operation) ||
41693 (details::e_and == operation) || (details::e_nand == operation) ||
41694 (details::e_or == operation) || (details::e_nor == operation) ||
41695 (details::e_xor == operation) || (details::e_xnor == operation) ||
41696 (details::e_in == operation) || (details::e_like == operation) ||
41697 (details::e_ilike == operation)
41698 )
41699 {
41701 }
41702
41704 }

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

35110 {
35112
35113 if (details::is_constant_node(branch[0]))
35114 {
35115 if (
35116 (details::e_scand == operation) &&
35117 std::equal_to<T>()(T(0),branch[0]->value())
35118 )
35119 result = node_allocator_->allocate_c<literal_node_t>(T(0));
35120 else if (
35121 (details::e_scor == operation) &&
35122 std::not_equal_to<T>()(T(0),branch[0]->value())
35123 )
35124 result = node_allocator_->allocate_c<literal_node_t>(T(1));
35125 }
35126
35127 if (details::is_constant_node(branch[1]) && (0 == result))
35128 {
35129 if (
35130 (details::e_scand == operation) &&
35131 std::equal_to<T>()(T(0),branch[1]->value())
35132 )
35133 result = node_allocator_->allocate_c<literal_node_t>(T(0));
35134 else if (
35135 (details::e_scor == operation) &&
35136 std::not_equal_to<T>()(T(0),branch[1]->value())
35137 )
35138 result = node_allocator_->allocate_c<literal_node_t>(T(1));
35139 }
35140
35141 if (result)
35142 {
35145
35146 return result;
35147 }
35148 else if (details::e_scand == operation)
35149 {
35150 return synthesize_expression<scand_node_t,2>(operation, branch);
35151 }
35152 else if (details::e_scor == operation)
35153 {
35154 return synthesize_expression<scor_node_t,2>(operation, branch);
35155 }
35156 else
35157 return error_node();
35158 }

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

41223 {
41224 std::string& s0 = static_cast< details::stringvar_node<Type>*>(branch[0])->ref();
41225 std::string s1 = static_cast<details::string_literal_node<Type>*>(branch[1])->str();
41226
41228
41229 return synthesize_sos_expression_impl<std::string&, const std::string>(opr, s0, s1);
41230 }

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

41194 {
41195 std::string& s0 = static_cast<details::stringvar_node<Type>*> (branch[0])->ref ();
41196 std::string s1 = static_cast<details::const_string_range_node<Type>*>(branch[1])->str ();
41197 range_t rp1 = static_cast<details::const_string_range_node<Type>*>(branch[1])->range();
41198
41199 static_cast<details::const_string_range_node<Type>*>(branch[1])->range_ref().clear();
41200
41202
41203 return synthesize_str_xoxr_expression_impl<std::string&, const std::string>(opr, s0, s1, rp1);
41204 }

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

41160 {
41161 std::string& s0 = static_cast<details::stringvar_node<Type>*>(branch[0])->ref();
41162 std::string& s1 = static_cast<details::stringvar_node<Type>*>(branch[1])->ref();
41163
41164 return synthesize_sos_expression_impl<std::string&,std::string&>(opr, s0, s1);
41165 }

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

41146 {
41147 switch (opr)
41148 {
41149 #define case_stmt(op0, op1) \
41150 case op0 : return node_allocator_-> \
41151 allocate_tt<typename details::sos_node<Type,T0,T1,op1<Type> >,T0,T1>(s0, s1); \
41152
41154 #undef case_stmt
41155 default : return error_node();
41156 }
41157 }
#define string_opr_switch_statements
Definition exprtk.hpp:41079

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

41181 {
41182 std::string& s0 = static_cast<details::stringvar_node<Type>*> (branch[0])->ref ();
41183 std::string& s1 = static_cast<details::string_range_node<Type>*>(branch[1])->ref ();
41184 range_t rp1 = static_cast<details::string_range_node<Type>*>(branch[1])->range();
41185
41186 static_cast<details::string_range_node<Type>*>(branch[1])->range_ref().clear();
41187
41189
41190 return synthesize_str_xoxr_expression_impl<std::string&,std::string&>(opr, s0, s1, rp1);
41191 }

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

41257 {
41258 std::string& s0 = static_cast<details::string_range_node<Type>* >(branch[0])->ref ();
41259 std::string s1 = static_cast<details::string_literal_node<Type>*>(branch[1])->str ();
41260 range_t rp0 = static_cast<details::string_range_node<Type>* >(branch[0])->range();
41261
41262 static_cast<details::string_range_node<Type>*>(branch[0])->range_ref().clear();
41263
41266
41267 return synthesize_str_xrox_expression_impl<std::string&, const std::string>(opr, s0, s1, rp0);
41268 }

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

41271 {
41272 std::string& s0 = static_cast<details::string_range_node<Type>* >(branch[0])->ref ();
41273 std::string s1 = static_cast<details::const_string_range_node<Type>*>(branch[1])->str ();
41274 range_t rp0 = static_cast<details::string_range_node<Type>* >(branch[0])->range();
41275 range_t rp1 = static_cast<details::const_string_range_node<Type>*>(branch[1])->range();
41276
41277 static_cast<details::string_range_node<Type>*> (branch[0])->range_ref().clear();
41278 static_cast<details::const_string_range_node<Type>*>(branch[1])->range_ref().clear();
41279
41282
41283 return synthesize_str_xroxr_expression_impl<std::string&, const std::string>(opr, s0, s1, rp0, rp1);
41284 }

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

41168 {
41169 std::string& s0 = static_cast<details::string_range_node<Type>*>(branch[0])->ref ();
41170 std::string& s1 = static_cast<details::stringvar_node<Type>*> (branch[1])->ref ();
41171 range_t rp0 = static_cast<details::string_range_node<Type>*>(branch[0])->range();
41172
41173 static_cast<details::string_range_node<Type>*>(branch[0])->range_ref().clear();
41174
41176
41177 return synthesize_str_xrox_expression_impl<std::string&,std::string&>(opr, s0, s1, rp0);
41178 }

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

41207 {
41208 std::string& s0 = static_cast<details::string_range_node<Type>*>(branch[0])->ref ();
41209 std::string& s1 = static_cast<details::string_range_node<Type>*>(branch[1])->ref ();
41210 range_t rp0 = static_cast<details::string_range_node<Type>*>(branch[0])->range();
41211 range_t rp1 = static_cast<details::string_range_node<Type>*>(branch[1])->range();
41212
41213 static_cast<details::string_range_node<Type>*>(branch[0])->range_ref().clear();
41214 static_cast<details::string_range_node<Type>*>(branch[1])->range_ref().clear();
41215
41218
41219 return synthesize_str_xroxr_expression_impl<std::string&,std::string&>(opr, s0, s1, rp0, rp1);
41220 }

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

41112 {
41113 switch (opr)
41114 {
41115 #define case_stmt(op0, op1) \
41116 case op0 : return node_allocator_-> \
41117 allocate_ttt<typename details::str_xoxr_node<Type,T0,T1,range_t,op1<Type> >,T0,T1> \
41118 (s0, s1, rp1); \
41119
41121 #undef case_stmt
41122 default : return error_node();
41123 }
41124 }

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

41094 {
41095 switch (opr)
41096 {
41097 #define case_stmt(op0, op1) \
41098 case op0 : return node_allocator_-> \
41099 allocate_ttt<typename details::str_xrox_node<Type,T0,T1,range_t,op1<Type> >,T0,T1> \
41100 (s0, s1, rp0); \
41101
41103 #undef case_stmt
41104 default : return error_node();
41105 }
41106 }

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

41130 {
41131 switch (opr)
41132 {
41133 #define case_stmt(op0, op1) \
41134 case op0 : return node_allocator_-> \
41135 allocate_tttt<typename details::str_xroxr_node<Type,T0,T1,range_t,op1<Type> >,T0,T1> \
41136 (s0, s1, rp0, rp1); \
41137
41139 #undef case_stmt
41140 default : return error_node();
41141 }
41142 }

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

41408 {
41409 if ((0 == branch[0]) || (0 == branch[1]))
41410 {
41412
41413 return error_node();
41414 }
41415
41416 const bool b0_is_s = details::is_string_node (branch[0]);
41417 const bool b0_is_cs = details::is_const_string_node (branch[0]);
41418 const bool b0_is_sr = details::is_string_range_node (branch[0]);
41419 const bool b0_is_csr = details::is_const_string_range_node(branch[0]);
41420
41421 const bool b1_is_s = details::is_string_node (branch[1]);
41422 const bool b1_is_cs = details::is_const_string_node (branch[1]);
41423 const bool b1_is_sr = details::is_string_range_node (branch[1]);
41424 const bool b1_is_csr = details::is_const_string_range_node(branch[1]);
41425
41426 const bool b0_is_gen = details::is_string_assignment_node (branch[0]) ||
41428 details::is_string_concat_node (branch[0]) ||
41432 details::is_string_vararg_node (branch[0]) ;
41433
41434 const bool b1_is_gen = details::is_string_assignment_node (branch[1]) ||
41436 details::is_string_concat_node (branch[1]) ||
41440 details::is_string_vararg_node (branch[1]) ;
41441
41442 if (details::e_add == opr)
41443 {
41444 if (!b0_is_cs || !b1_is_cs)
41445 {
41446 return synthesize_expression<string_concat_node_t,2>(opr,branch);
41447 }
41448 }
41449
41450 if (b0_is_gen || b1_is_gen)
41451 {
41452 return synthesize_strogen_expression(opr,branch);
41453 }
41454 else if (b0_is_s)
41455 {
41456 if (b1_is_s ) return synthesize_sos_expression (opr,branch);
41457 else if (b1_is_cs ) return synthesize_socs_expression (opr,branch);
41458 else if (b1_is_sr ) return synthesize_sosr_expression (opr,branch);
41459 else if (b1_is_csr) return synthesize_socsr_expression (opr,branch);
41460 }
41461 else if (b0_is_cs)
41462 {
41463 if (b1_is_s ) return synthesize_csos_expression (opr,branch);
41464 else if (b1_is_cs ) return synthesize_csocs_expression (opr,branch);
41465 else if (b1_is_sr ) return synthesize_csosr_expression (opr,branch);
41466 else if (b1_is_csr) return synthesize_csocsr_expression(opr,branch);
41467 }
41468 else if (b0_is_sr)
41469 {
41470 if (b1_is_s ) return synthesize_sros_expression (opr,branch);
41471 else if (b1_is_sr ) return synthesize_srosr_expression (opr,branch);
41472 else if (b1_is_cs ) return synthesize_srocs_expression (opr,branch);
41473 else if (b1_is_csr) return synthesize_srocsr_expression(opr,branch);
41474 }
41475 else if (b0_is_csr)
41476 {
41477 if (b1_is_s ) return synthesize_csros_expression (opr,branch);
41478 else if (b1_is_sr ) return synthesize_csrosr_expression (opr,branch);
41479 else if (b1_is_cs ) return synthesize_csrocs_expression (opr,branch);
41480 else if (b1_is_csr) return synthesize_csrocsr_expression(opr,branch);
41481 }
41482
41483 return error_node();
41484 }
expression_node_ptr synthesize_sosr_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:41180
expression_node_ptr synthesize_srosr_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:41206
expression_node_ptr synthesize_csros_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:41331
expression_node_ptr synthesize_csosr_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:41242
expression_node_ptr synthesize_csocs_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:41286
expression_node_ptr synthesize_srocs_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:41256
expression_node_ptr synthesize_csos_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:41232
expression_node_ptr synthesize_srocsr_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:41270
expression_node_ptr synthesize_sros_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:41167
expression_node_ptr synthesize_csocsr_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:41317
expression_node_ptr synthesize_csrocs_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:41360
expression_node_ptr synthesize_socsr_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:41193
expression_node_ptr synthesize_csrocsr_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:41373
expression_node_ptr synthesize_strogen_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:41388
expression_node_ptr synthesize_csrosr_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:41344
expression_node_ptr synthesize_socs_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:41222
expression_node_ptr synthesize_sos_expression(const details::operator_type &opr, expression_node_ptr(&branch)[2])
Definition exprtk.hpp:41159
bool is_string_ccondition_node(const expression_node< T > *node)
Definition exprtk.hpp:19166
bool is_string_assignment_node(const expression_node< T > *node)
Definition exprtk.hpp:19142
bool is_string_vararg_node(const expression_node< T > *node)
Definition exprtk.hpp:19172
bool is_string_condition_node(const expression_node< T > *node)
Definition exprtk.hpp:19160
bool is_string_function_node(const expression_node< T > *node)
Definition exprtk.hpp:19154
bool is_genricstring_range_node(const expression_node< T > *node)
Definition exprtk.hpp:19178
bool is_string_concat_node(const expression_node< T > *node)
Definition exprtk.hpp:19148

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

41495 {
41496 if (details::e_inrange != opr)
41497 return error_node();
41498 else if ((0 == branch[0]) || (0 == branch[1]) || (0 == branch[2]))
41499 {
41501
41502 return error_node();
41503 }
41504 else if (
41505 details::is_const_string_node(branch[0]) &&
41506 details::is_const_string_node(branch[1]) &&
41508 )
41509 {
41510 const std::string s0 = static_cast<details::string_literal_node<Type>*>(branch[0])->str();
41511 const std::string s1 = static_cast<details::string_literal_node<Type>*>(branch[1])->str();
41512 const std::string s2 = static_cast<details::string_literal_node<Type>*>(branch[2])->str();
41513
41514 const Type v = (((s0 <= s1) && (s1 <= s2)) ? Type(1) : Type(0));
41515
41517
41519 }
41520 else if (
41521 details::is_string_node(branch[0]) &&
41522 details::is_string_node(branch[1]) &&
41523 details::is_string_node(branch[2])
41524 )
41525 {
41526 std::string& s0 = static_cast<details::stringvar_node<Type>*>(branch[0])->ref();
41527 std::string& s1 = static_cast<details::stringvar_node<Type>*>(branch[1])->ref();
41528 std::string& s2 = static_cast<details::stringvar_node<Type>*>(branch[2])->ref();
41529
41531
41532 return node_allocator_->allocate_type<inrange_t, std::string&, std::string&, std::string&>(s0, s1, s2);
41533 }
41534 else if (
41535 details::is_const_string_node(branch[0]) &&
41536 details::is_string_node(branch[1]) &&
41538 )
41539 {
41540 std::string s0 = static_cast<details::string_literal_node<Type>*>(branch[0])->str();
41541 std::string& s1 = static_cast<details::stringvar_node<Type>* >(branch[1])->ref();
41542 std::string s2 = static_cast<details::string_literal_node<Type>*>(branch[2])->str();
41543
41545
41548
41549 return node_allocator_->allocate_type<inrange_t, std::string, std::string&, std::string>(s0, s1, s2);
41550 }
41551 else if (
41552 details::is_string_node(branch[0]) &&
41553 details::is_const_string_node(branch[1]) &&
41554 details::is_string_node(branch[2])
41555 )
41556 {
41557 std::string& s0 = static_cast<details::stringvar_node<Type>* >(branch[0])->ref();
41558 std::string s1 = static_cast<details::string_literal_node<Type>*>(branch[1])->str();
41559 std::string& s2 = static_cast<details::stringvar_node<Type>* >(branch[2])->ref();
41560
41562
41564
41565 return node_allocator_->allocate_type<inrange_t, std::string&, std::string, std::string&>(s0, s1, s2);
41566 }
41567 else if (
41568 details::is_string_node(branch[0]) &&
41569 details::is_string_node(branch[1]) &&
41571 )
41572 {
41573 std::string& s0 = static_cast<details::stringvar_node<Type>* >(branch[0])->ref();
41574 std::string& s1 = static_cast<details::stringvar_node<Type>* >(branch[1])->ref();
41575 std::string s2 = static_cast<details::string_literal_node<Type>*>(branch[2])->str();
41576
41578
41580
41581 return node_allocator_->allocate_type<inrange_t, std::string&, std::string&, std::string>(s0, s1, s2);
41582 }
41583 else if (
41584 details::is_const_string_node(branch[0]) &&
41585 details:: is_string_node(branch[1]) &&
41586 details:: is_string_node(branch[2])
41587 )
41588 {
41589 std::string s0 = static_cast<details::string_literal_node<Type>*>(branch[0])->str();
41590 std::string& s1 = static_cast<details::stringvar_node<Type>* >(branch[1])->ref();
41591 std::string& s2 = static_cast<details::stringvar_node<Type>* >(branch[2])->ref();
41592
41594
41596
41597 return node_allocator_->allocate_type<inrange_t, std::string, std::string&, std::string&>(s0, s1, s2);
41598 }
41599 else
41600 return error_node();
41601 }
expression_node< typename node_type::value_type > * allocate_type(T1 t1, T2 t2, T3 t3) const
Definition exprtk.hpp:19559

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

41389 {
41390 switch (opr)
41391 {
41392 #define case_stmt(op0, op1) \
41393 case op0 : return node_allocator_-> \
41394 allocate_ttt<typename details::str_sogens_node<Type,op1<Type> > > \
41395 (opr, branch[0], branch[1]); \
41396
41398 #undef case_stmt
41399 default : return error_node();
41400 }
41401 }

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

35028 {
35029 const bool v0_is_ivar = details::is_ivariable_node(branch[0]);
35030 const bool v1_is_ivar = details::is_ivariable_node(branch[1]);
35031
35032 const bool v0_is_ivec = details::is_ivector_node (branch[0]);
35033 const bool v1_is_ivec = details::is_ivector_node (branch[1]);
35034
35035 #ifndef exprtk_disable_string_capabilities
35036 const bool v0_is_str = details::is_generally_string_node(branch[0]);
35037 const bool v1_is_str = details::is_generally_string_node(branch[1]);
35038 #endif
35039
35041 std::string node_name = "Unknown";
35042
35043 if (v0_is_ivar && v1_is_ivar)
35044 {
35045 typedef details::variable_node<T>* variable_node_ptr;
35046
35047 variable_node_ptr v0 = variable_node_ptr(0);
35048 variable_node_ptr v1 = variable_node_ptr(0);
35049
35050 if (
35051 (0 != (v0 = dynamic_cast<variable_node_ptr>(branch[0]))) &&
35052 (0 != (v1 = dynamic_cast<variable_node_ptr>(branch[1])))
35053 )
35054 {
35056 node_name = "swap_node";
35057 }
35058 else
35059 {
35060 result = node_allocator_->allocate<details::swap_generic_node<T> >(branch[0],branch[1]);
35061 node_name = "swap_generic_node";
35062 }
35063 }
35064 else if (v0_is_ivec && v1_is_ivec)
35065 {
35066 result = node_allocator_->allocate<details::swap_vecvec_node<T> >(branch[0],branch[1]);
35067 node_name = "swap_vecvec_node";
35068 }
35069 #ifndef exprtk_disable_string_capabilities
35070 else if (v0_is_str && v1_is_str)
35071 {
35072 if (is_string_node(branch[0]) && is_string_node(branch[1]))
35073 {
35075 (branch[0], branch[1]);
35076 node_name = "swap_string_node";
35077 }
35078 else
35079 {
35081 (branch[0], branch[1]);
35082 node_name = "swap_genstrings_node";
35083 }
35084 }
35085 #endif
35086 else
35087 {
35088 parser_->set_synthesis_error("Only variables, strings, vectors or vector elements can be swapped");
35089 return error_node();
35090 }
35091
35092 if (result && result->valid())
35093 {
35094 parser_->state_.activate_side_effect("synthesize_swap_expression()");
35095 return result;
35096 }
35097
35100 token_t(),
35101 "ERR280 - Failed to synthesize node: " + node_name,
35103
35105 return error_node();
35106 }
bool is_ivariable_node(const expression_node< T > *node)
Definition exprtk.hpp:5812

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

33457 {
33458 switch (operation)
33459 {
33460 #define case_stmt(op0, op1) \
33461 case op0 : return node_allocator_-> \
33462 allocate<typename details::unary_branch_node<Type,op1<Type> > >(branch[0]); \
33463
33465 #undef case_stmt
33466 default : return error_node();
33467 }
33468 }
#define unary_opr_switch_statements
Definition exprtk.hpp:33380

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

33424 {
33425 T& v = static_cast<details::variable_node<T>*>(branch[0])->ref();
33426
33427 switch (operation)
33428 {
33429 #define case_stmt(op0, op1) \
33430 case op0 : return node_allocator_-> \
33431 allocate<typename details::unary_variable_node<Type,op1<Type> > >(v); \
33432
33434 #undef case_stmt
33435 default : return error_node();
33436 }
33437 }

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

33441 {
33442 switch (operation)
33443 {
33444 #define case_stmt(op0, op1) \
33445 case op0 : return node_allocator_-> \
33446 allocate<typename details::unary_vector_node<Type,op1<Type> > > \
33447 (operation, branch[0]); \
33448
33450 #undef case_stmt
33451 default : return error_node();
33452 }
33453 }

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

41004 {
41005 // Definition: uv o uv
41006 details::operator_type o0 = static_cast<details::uv_base_node<Type>*>(branch[0])->operation();
41007 details::operator_type o1 = static_cast<details::uv_base_node<Type>*>(branch[1])->operation();
41008 const Type& v0 = static_cast<details::uv_base_node<Type>*>(branch[0])->v();
41009 const Type& v1 = static_cast<details::uv_base_node<Type>*>(branch[1])->v();
41010 unary_functor_t u0 = reinterpret_cast<unary_functor_t> (0);
41011 unary_functor_t u1 = reinterpret_cast<unary_functor_t> (0);
41012 binary_functor_t f = reinterpret_cast<binary_functor_t>(0);
41013
41014 if (!valid_operator(o0,u0))
41015 return error_node();
41016 else if (!valid_operator(o1,u1))
41017 return error_node();
41018 else if (!valid_operator(operation,f))
41019 return error_node();
41020
41022
41023 if (
41024 (details::e_neg == o0) &&
41025 (details::e_neg == o1)
41026 )
41027 {
41028 switch (operation)
41029 {
41030 // (-v0 + -v1) --> -(v0 + v1)
41031 case details::e_add : result = (*this)(details::e_neg,
41033 allocate_rr<typename details::
41035 exprtk_debug(("(-v0 + -v1) --> -(v0 + v1)\n"));
41036 break;
41037
41038 // (-v0 - -v1) --> (v1 - v0)
41039 case details::e_sub : result = node_allocator_->
41040 allocate_rr<typename details::
41042 exprtk_debug(("(-v0 - -v1) --> (v1 - v0)\n"));
41043 break;
41044
41045 // (-v0 * -v1) --> (v0 * v1)
41046 case details::e_mul : result = node_allocator_->
41047 allocate_rr<typename details::
41049 exprtk_debug(("(-v0 * -v1) --> (v0 * v1)\n"));
41050 break;
41051
41052 // (-v0 / -v1) --> (v0 / v1)
41053 case details::e_div : result = node_allocator_->
41054 allocate_rr<typename details::
41056 exprtk_debug(("(-v0 / -v1) --> (v0 / v1)\n"));
41057 break;
41058
41059 default : break;
41060 }
41061 }
41062
41063 if (0 == result)
41064 {
41065 result = node_allocator_->
41066 allocate_rrrrr<typename details::uvouv_node<Type> >(v0, v1, u0, u1, f);
41067 }
41068
41070 return result;
41071 }
bool valid_operator(const details::operator_type &operation, binary_functor_t &bop)
Definition exprtk.hpp:31902
functor_t::bfunc_t binary_functor_t
Definition exprtk.hpp:22528
functor_t::ufunc_t unary_functor_t
Definition exprtk.hpp:22529

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

34943 {
34944 const bool is_b0_ivec = details::is_ivector_node(branch[0]);
34945 const bool is_b1_ivec = details::is_ivector_node(branch[1]);
34946
34947 #define vector_ops \
34948 case_stmt(details::e_add , details::add_op) \
34949 case_stmt(details::e_sub , details::sub_op) \
34950 case_stmt(details::e_mul , details::mul_op) \
34951 case_stmt(details::e_div , details::div_op) \
34952 case_stmt(details::e_mod , details::mod_op) \
34953
34955 std::string node_name = "Unknown";
34956
34957 if (is_b0_ivec && is_b1_ivec)
34958 {
34959 switch (operation)
34960 {
34961 #define case_stmt(op0, op1) \
34962 case op0 : result = node_allocator_-> \
34963 template allocate_rrr<typename details::vec_binop_vecvec_node<Type,op1<Type> > > \
34964 (operation, branch[0], branch[1]); \
34965 node_name = "vec_binop_vecvec_node"; \
34966 break; \
34967
34969 case_stmt(details::e_pow,details:: pow_op)
34970 #undef case_stmt
34971 default : return error_node();
34972 }
34973 }
34974 else if (is_b0_ivec && !is_b1_ivec)
34975 {
34976 switch (operation)
34977 {
34978 #define case_stmt(op0, op1) \
34979 case op0 : result = node_allocator_-> \
34980 template allocate_rrr<typename details::vec_binop_vecval_node<Type,op1<Type> > > \
34981 (operation, branch[0], branch[1]); \
34982 node_name = "vec_binop_vecval_node(b0ivec,!b1ivec)"; \
34983 break; \
34984
34986 case_stmt(details::e_pow,details:: pow_op)
34987 #undef case_stmt
34988 default : return error_node();
34989 }
34990 }
34991 else if (!is_b0_ivec && is_b1_ivec)
34992 {
34993 switch (operation)
34994 {
34995 #define case_stmt(op0, op1) \
34996 case op0 : result = node_allocator_-> \
34997 template allocate_rrr<typename details::vec_binop_valvec_node<Type,op1<Type> > > \
34998 (operation, branch[0], branch[1]); \
34999 node_name = "vec_binop_vecval_node(!b0ivec,b1ivec)"; \
35000 break; \
35001
35003 #undef case_stmt
35004 default : return error_node();
35005 }
35006 }
35007 else
35008 return error_node();
35009
35010 if (result && result->valid())
35011 {
35012 return result;
35013 }
35014
35017 token_t(),
35018 "ERR279 - Failed to synthesize node: " + node_name,
35020
35022 return error_node();
35023
35024 #undef vector_ops
35025 }
#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 34849 of file exprtk.hpp.

34851 {
34852 const bool is_b0_ivec = details::is_ivector_node(branch[0]);
34853 const bool is_b1_ivec = details::is_ivector_node(branch[1]);
34854
34855 #define batch_eqineq_logic_case \
34856 case_stmt(details::e_lt , details::lt_op ) \
34857 case_stmt(details::e_lte , details::lte_op ) \
34858 case_stmt(details::e_gt , details::gt_op ) \
34859 case_stmt(details::e_gte , details::gte_op ) \
34860 case_stmt(details::e_eq , details::eq_op ) \
34861 case_stmt(details::e_ne , details::ne_op ) \
34862 case_stmt(details::e_equal , details::equal_op) \
34863 case_stmt(details::e_and , details::and_op ) \
34864 case_stmt(details::e_nand , details::nand_op ) \
34865 case_stmt(details::e_or , details::or_op ) \
34866 case_stmt(details::e_nor , details::nor_op ) \
34867 case_stmt(details::e_xor , details::xor_op ) \
34868 case_stmt(details::e_xnor , details::xnor_op ) \
34869
34871 std::string node_name = "Unknown";
34872
34873 if (is_b0_ivec && is_b1_ivec)
34874 {
34875 switch (operation)
34876 {
34877 #define case_stmt(op0, op1) \
34878 case op0 : result = node_allocator_-> \
34879 template allocate_rrr<typename details::vec_binop_vecvec_node<Type,op1<Type> > > \
34880 (operation, branch[0], branch[1]); \
34881 node_name = "vec_binop_vecvec_node"; \
34882 break; \
34883
34885 #undef case_stmt
34886 default : return error_node();
34887 }
34888 }
34889 else if (is_b0_ivec && !is_b1_ivec)
34890 {
34891 switch (operation)
34892 {
34893 #define case_stmt(op0, op1) \
34894 case op0 : result = node_allocator_-> \
34895 template allocate_rrr<typename details::vec_binop_vecval_node<Type,op1<Type> > > \
34896 (operation, branch[0], branch[1]); \
34897 node_name = "vec_binop_vecval_node"; \
34898 break; \
34899
34901 #undef case_stmt
34902 default : return error_node();
34903 }
34904 }
34905 else if (!is_b0_ivec && is_b1_ivec)
34906 {
34907 switch (operation)
34908 {
34909 #define case_stmt(op0, op1) \
34910 case op0 : result = node_allocator_-> \
34911 template allocate_rrr<typename details::vec_binop_valvec_node<Type,op1<Type> > > \
34912 (operation, branch[0], branch[1]); \
34913 node_name = "vec_binop_valvec_node"; \
34914 break; \
34915
34917 #undef case_stmt
34918 default : return error_node();
34919 }
34920 }
34921 else
34922 return error_node();
34923
34924 if (result && result->valid())
34925 {
34926 return result;
34927 }
34928
34931 token_t(),
34932 "ERR278 - Failed to synthesize node: " + node_name,
34934
34936 return error_node();
34937
34938 #undef batch_eqineq_logic_case
34939 }
#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 32103 of file exprtk.hpp.

32104 {
32105 switch (operation)
32106 {
32107 case details::e_add : return "+" ;
32108 case details::e_sub : return "-" ;
32109 case details::e_mul : return "*" ;
32110 case details::e_div : return "/" ;
32111 case details::e_mod : return "%" ;
32112 case details::e_pow : return "^" ;
32113 case details::e_lt : return "<" ;
32114 case details::e_lte : return "<=" ;
32115 case details::e_gt : return ">" ;
32116 case details::e_gte : return ">=" ;
32117 case details::e_eq : return "==" ;
32118 case details::e_ne : return "!=" ;
32119 case details::e_and : return "and" ;
32120 case details::e_nand : return "nand" ;
32121 case details::e_or : return "or" ;
32122 case details::e_nor : return "nor" ;
32123 case details::e_xor : return "xor" ;
32124 case details::e_xnor : return "xnor" ;
32125 default : return "UNKNOWN";
32126 }
32127 }

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

31962 {
31963 return (details::e_abs == operation) || (details::e_acos == operation) ||
31964 (details::e_acosh == operation) || (details::e_asin == operation) ||
31965 (details::e_asinh == operation) || (details::e_atan == operation) ||
31966 (details::e_atanh == operation) || (details::e_ceil == operation) ||
31967 (details::e_cos == operation) || (details::e_cosh == operation) ||
31968 (details::e_exp == operation) || (details::e_expm1 == operation) ||
31969 (details::e_floor == operation) || (details::e_log == operation) ||
31970 (details::e_log10 == operation) || (details::e_log2 == operation) ||
31971 (details::e_log1p == operation) || (details::e_neg == operation) ||
31972 (details::e_pos == operation) || (details::e_round == operation) ||
31973 (details::e_sin == operation) || (details::e_sinc == operation) ||
31974 (details::e_sinh == operation) || (details::e_sqrt == operation) ||
31975 (details::e_tan == operation) || (details::e_tanh == operation) ||
31976 (details::e_cot == operation) || (details::e_sec == operation) ||
31977 (details::e_csc == operation) || (details::e_r2d == operation) ||
31978 (details::e_d2r == operation) || (details::e_d2g == operation) ||
31979 (details::e_g2d == operation) || (details::e_notl == operation) ||
31980 (details::e_sgn == operation) || (details::e_erf == operation) ||
31981 (details::e_erfc == operation) || (details::e_ncdf == operation) ||
31982 (details::e_frac == operation) || (details::e_trunc == operation) ;
31983 }

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

32275 {
32276 if (!operation_optimisable(operation))
32277 return false;
32278 else
32279 return details::is_uv_node(branch[0]) &&
32280 details::is_uv_node(branch[1]) ;
32281 }
bool is_uv_node(const expression_node< T > *node)
Definition exprtk.hpp:19112

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

31903 {
31904 typename binary_op_map_t::iterator bop_itr = binary_op_map_->find(operation);
31905
31906 if (binary_op_map_->end() == bop_itr)
31907 return false;
31908
31909 bop = bop_itr->second;
31910
31911 return true;
31912 }

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

31915 {
31916 typename unary_op_map_t::iterator uop_itr = unary_op_map_->find(operation);
31917
31918 if ((*unary_op_map_).end() == uop_itr)
31919 return false;
31920
31921 uop = uop_itr->second;
31922
31923 return true;
31924 }

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

32081 {
32082 return (details::e_add == operation) ||
32083 (details::e_lt == operation) ||
32084 (details::e_lte == operation) ||
32085 (details::e_gt == operation) ||
32086 (details::e_gte == operation) ||
32087 (details::e_eq == operation) ||
32088 (details::e_ne == operation) ||
32089 (details::e_in == operation) ||
32090 (details::e_like == operation) ||
32091 (details::e_ilike == operation) ||
32092 (details::e_assign == operation) ||
32093 (details::e_addass == operation) ||
32094 (details::e_swap == operation) ;
32095 }

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

33778 {
33779 if (!all_nodes_valid(arg_list))
33780 {
33782
33783 return error_node();
33784 }
33785 else if (is_constant_foldable(arg_list))
33786 return const_optimise_varargfunc(operation,arg_list);
33787 else if ((1 == arg_list.size()) && details::is_ivector_node(arg_list[0]))
33788 return vectorize_func(operation,arg_list);
33789 else if ((1 == arg_list.size()) && special_one_parameter_vararg(operation))
33790 return arg_list[0];
33791 else if (all_nodes_variables(arg_list))
33792 return varnode_optimise_varargfunc(operation,arg_list);
33793
33794 #ifndef exprtk_disable_string_capabilities
33795 if (details::e_smulti == operation)
33796 {
33798 allocate<details::str_vararg_node<Type,details::vararg_multi_op<Type> > >(arg_list);
33799 if (result && result->valid())
33800 {
33801 return result;
33802 }
33803
33806 token_t(),
33807 "ERR262 - Failed to synthesize node: str_vararg_node<vararg_multi_op>",
33809
33811 }
33812 else
33813 #endif
33814 {
33816
33817 switch (operation)
33818 {
33819 #define case_stmt(op0, op1) \
33820 case op0 : result = node_allocator_-> \
33821 allocate<details::vararg_node<Type,op1<Type> > >(arg_list); \
33822 break; \
33823
33824 case_stmt(details::e_sum , details::vararg_add_op )
33825 case_stmt(details::e_prod , details::vararg_mul_op )
33826 case_stmt(details::e_avg , details::vararg_avg_op )
33827 case_stmt(details::e_min , details::vararg_min_op )
33828 case_stmt(details::e_max , details::vararg_max_op )
33829 case_stmt(details::e_mand , details::vararg_mand_op )
33830 case_stmt(details::e_mor , details::vararg_mor_op )
33831 case_stmt(details::e_multi , details::vararg_multi_op)
33832 #undef case_stmt
33833 default : return error_node();
33834 }
33835
33836 if (result && result->valid())
33837 {
33838 return result;
33839 }
33840
33843 token_t(),
33844 "ERR263 - Failed to synthesize node: vararg_node",
33846
33848 }
33849
33850 return error_node();
33851 }
bool special_one_parameter_vararg(const details::operator_type &operation) const
Definition exprtk.hpp:33713
expression_node_ptr const_optimise_varargfunc(const details::operator_type &operation, Sequence< expression_node_ptr, Allocator > &arg_list)
Definition exprtk.hpp:33682
expression_node_ptr varnode_optimise_varargfunc(const details::operator_type &operation, Sequence< expression_node_ptr, Allocator > &arg_list)
Definition exprtk.hpp:33726
expression_node_ptr vectorize_func(const details::operator_type &operation, Sequence< expression_node_ptr, Allocator > &arg_list)
Definition exprtk.hpp:33750

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

33915 {
33916 if (!all_nodes_valid(arg_list))
33917 {
33919
33920 return error_node();
33921 }
33922
33924
33925 expression_node_ptr result = node_allocator_->allocate<alloc_type>(vaf,arg_list);
33926
33927 if (
33928 !arg_list.empty() &&
33929 !vaf->has_side_effects() &&
33930 is_constant_foldable(arg_list)
33931 )
33932 {
33933 const Type v = result->value();
33936 }
33937
33938 parser_->state_.activate_side_effect("vararg_function_call()");
33939
33940 if (result && result->valid())
33941 {
33942 return result;
33943 }
33944
33947 token_t(),
33948 "ERR265 - Failed to synthesize node: vararg_function_node<ivararg_function_t>",
33950
33952 return error_node();
33953 }

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

33509 {
33510 typedef details::variable_node<Type>* variable_ptr;
33511
33512 const Type& v0 = static_cast<variable_ptr>(branch[0])->ref();
33513 const Type& v1 = static_cast<variable_ptr>(branch[1])->ref();
33514 const Type& v2 = static_cast<variable_ptr>(branch[2])->ref();
33515
33516 switch (operation)
33517 {
33518 #define case_stmt(op) \
33519 case details::e_sf##op : return node_allocator_-> \
33520 allocate_rrr<details::sf3_var_node<Type,details::sf##op##_op<Type> > > \
33521 (v0, v1, v2); \
33522
33523 case_stmt(00) case_stmt(01) case_stmt(02) case_stmt(03)
33524 case_stmt(04) case_stmt(05) case_stmt(06) case_stmt(07)
33525 case_stmt(08) case_stmt(09) case_stmt(10) case_stmt(11)
33526 case_stmt(12) case_stmt(13) case_stmt(14) case_stmt(15)
33527 case_stmt(16) case_stmt(17) case_stmt(18) case_stmt(19)
33528 case_stmt(20) case_stmt(21) case_stmt(22) case_stmt(23)
33529 case_stmt(24) case_stmt(25) case_stmt(26) case_stmt(27)
33530 case_stmt(28) case_stmt(29) case_stmt(30) case_stmt(31)
33531 case_stmt(32) case_stmt(33) case_stmt(34) case_stmt(35)
33532 case_stmt(36) case_stmt(37) case_stmt(38) case_stmt(39)
33533 case_stmt(40) case_stmt(41) case_stmt(42) case_stmt(43)
33534 case_stmt(44) case_stmt(45) case_stmt(46) case_stmt(47)
33535 #undef case_stmt
33536 default : return error_node();
33537 }
33538 }

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

33614 {
33615 typedef details::variable_node<Type>* variable_ptr;
33616
33617 const Type& v0 = static_cast<variable_ptr>(branch[0])->ref();
33618 const Type& v1 = static_cast<variable_ptr>(branch[1])->ref();
33619 const Type& v2 = static_cast<variable_ptr>(branch[2])->ref();
33620 const Type& v3 = static_cast<variable_ptr>(branch[3])->ref();
33621
33622 switch (operation)
33623 {
33624 #define case_stmt(op) \
33625 case details::e_sf##op : return node_allocator_-> \
33626 allocate_rrrr<details::sf4_var_node<Type,details::sf##op##_op<Type> > > \
33627 (v0, v1, v2, v3); \
33628
33629 case_stmt(48) case_stmt(49) case_stmt(50) case_stmt(51)
33630 case_stmt(52) case_stmt(53) case_stmt(54) case_stmt(55)
33631 case_stmt(56) case_stmt(57) case_stmt(58) case_stmt(59)
33632 case_stmt(60) case_stmt(61) case_stmt(62) case_stmt(63)
33633 case_stmt(64) case_stmt(65) case_stmt(66) case_stmt(67)
33634 case_stmt(68) case_stmt(69) case_stmt(70) case_stmt(71)
33635 case_stmt(72) case_stmt(73) case_stmt(74) case_stmt(75)
33636 case_stmt(76) case_stmt(77) case_stmt(78) case_stmt(79)
33637 case_stmt(80) case_stmt(81) case_stmt(82) case_stmt(83)
33638 case_stmt(84) case_stmt(85) case_stmt(86) case_stmt(87)
33639 case_stmt(88) case_stmt(89) case_stmt(90) case_stmt(91)
33640 case_stmt(92) case_stmt(93) case_stmt(94) case_stmt(95)
33641 case_stmt(96) case_stmt(97) case_stmt(98) case_stmt(99)
33642 #undef case_stmt
33643 default : return error_node();
33644 }
33645 }

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

33728 {
33729 switch (operation)
33730 {
33731 #define case_stmt(op0, op1) \
33732 case op0 : return node_allocator_-> \
33733 allocate<details::vararg_varnode<Type,op1<Type> > >(arg_list); \
33734
33735 case_stmt(details::e_sum , details::vararg_add_op )
33736 case_stmt(details::e_prod , details::vararg_mul_op )
33737 case_stmt(details::e_avg , details::vararg_avg_op )
33738 case_stmt(details::e_min , details::vararg_min_op )
33739 case_stmt(details::e_max , details::vararg_max_op )
33740 case_stmt(details::e_mand , details::vararg_mand_op )
33741 case_stmt(details::e_mor , details::vararg_mor_op )
33742 case_stmt(details::e_multi , details::vararg_multi_op)
33743 #undef case_stmt
33744 default : return error_node();
33745 }
33746 }

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

34179 {
34181 std::string node_name = "Unknown";
34182
34183 if (details::is_constant_node(index))
34184 {
34185 const std::size_t vec_index = static_cast<std::size_t>(details::numeric::to_int64(index->value()));
34186
34188
34189 if (vec_index >= vector_base->size())
34190 {
34193 token_t(),
34194 "ERR269 - Index of " + details::to_str(vec_index) + " out of range for "
34195 "vector '" + symbol + "' of size " + details::to_str(vector_base->size()),
34197
34199
34200 return error_node();
34201 }
34202
34203 if (vector_base->rebaseable())
34204 {
34206
34207 result = (rtc) ?
34208 node_allocator_->allocate<rebasevector_celem_rtc_node_t>(vec_node, vec_index, vector_base, rtc) :
34209 node_allocator_->allocate<rebasevector_celem_node_t >(vec_node, vec_index, vector_base ) ;
34210
34211 node_name = (rtc) ?
34212 "rebasevector_elem_rtc_node_t" :
34213 "rebasevector_elem_node_t" ;
34214
34215 if (result && result->valid())
34216 {
34217 return result;
34218 }
34219
34222 token_t(),
34223 "ERR270 - Failed to synthesize node: " + node_name + " for vector: " + symbol,
34225
34227 return error_node();
34228 }
34229 else if (details::is_ivector_node(vec_node) && !details::is_vector_node(vec_node))
34230 {
34232
34233 result = (rtc) ?
34234 node_allocator_->allocate<vector_celem_rtc_node_t>(vec_node, vec_index, vector_base, rtc) :
34235 node_allocator_->allocate<vector_celem_node_t >(vec_node, vec_index, vector_base ) ;
34236
34237 node_name = (rtc) ?
34238 "vector_elem_rtc_node_t" :
34239 "vector_elem_node_t" ;
34240
34241 if (result && result->valid())
34242 {
34243 return result;
34244 }
34245
34248 token_t(),
34249 "ERR271 - Failed to synthesize node: " + node_name + " for vector: " + symbol,
34251
34253 return error_node();
34254 }
34255
34256 const scope_element& se = parser_->sem_.get_element(symbol,vec_index);
34257
34258 if (se.index == vec_index)
34259 {
34260 result = se.var_node;
34262 }
34263 else
34264 {
34265 scope_element nse;
34266 nse.name = symbol;
34267 nse.active = true;
34268 nse.ref_count = 1;
34269 nse.type = scope_element::e_vecelem;
34270 nse.index = vec_index;
34271 nse.depth = parser_->state_.scope_depth;
34272 nse.data = 0;
34273 nse.var_node = node_allocator_->allocate<variable_node_t>((*(*vector_base)[vec_index]));
34274
34275 if (!parser_->sem_.add_element(nse))
34276 {
34277 parser_->set_synthesis_error("Failed to add new local vector element to SEM [1]");
34278
34280
34281 result = error_node();
34282 }
34283
34285
34287
34288 exprtk_debug(("vector_element() - INFO - Added new local vector element: %s\n", nse.name.c_str()));
34289
34290 parser_->state_.activate_side_effect("vector_element()");
34291
34292 result = nse.var_node;
34293 node_name = "variable_node_t";
34294 }
34295 }
34296 else
34297 {
34299
34300 if (vector_base->rebaseable())
34301 {
34302 result = (rtc) ?
34303 node_allocator_->allocate<rebasevector_elem_rtc_node_t>(vec_node, index, vector_base, rtc) :
34304 node_allocator_->allocate<rebasevector_elem_node_t >(vec_node, index, vector_base ) ;
34305
34306 node_name = (rtc) ?
34307 "rebasevector_elem_rtc_node_t" :
34308 "rebasevector_elem_node_t" ;
34309 }
34310 else
34311 {
34312 result = rtc ?
34313 node_allocator_->allocate<vector_elem_rtc_node_t>(vec_node, index, vector_base, rtc) :
34314 node_allocator_->allocate<vector_elem_node_t >(vec_node, index, vector_base ) ;
34315
34316 node_name = (rtc) ?
34317 "vector_elem_rtc_node_t" :
34318 "vector_elem_node_t" ;
34319 }
34320 }
34321
34322 if (result && result->valid())
34323 {
34324 return result;
34325 }
34326
34329 token_t(),
34330 "ERR272 - Failed to synthesize node: " + node_name,
34332
34334 return error_node();
34335 }
vector_access_runtime_check_ptr get_vector_access_runtime_check() const
Definition exprtk.hpp:32912
scope_element & get_element(const std::size_t &index)
Definition exprtk.hpp:22685
bool add_element(const scope_element &se)
Definition exprtk.hpp:22736
std::size_t total_local_symb_size_bytes() const
Definition exprtk.hpp:22839
void free_element(scope_element &se)
Definition exprtk.hpp:22793
std::size_t max_total_local_symbol_size_bytes() const
Definition exprtk.hpp:24522
scope_element_manager sem_
Definition exprtk.hpp:42126
settings_store & settings()
Definition exprtk.hpp:25014
_int64_t to_int64(const T v)
Definition exprtk.hpp:1512
vector_access_runtime_check * vector_access_runtime_check_ptr
Definition exprtk.hpp:2234
expression_node_ptr var_node
Definition exprtk.hpp:22654

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 >::settings_store::max_total_local_symbol_size_bytes(), 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::parser< T >::settings(), exprtk::details::vector_holder< Type >::size(), exprtk::parser< T >::state_, exprtk::details::numeric::to_int64(), exprtk::details::to_str(), exprtk::parser< T >::scope_element_manager::total_local_symb_size_bytes(), 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 33750 of file exprtk.hpp.

33752 {
33753 if (1 == arg_list.size())
33754 {
33755 switch (operation)
33756 {
33757 #define case_stmt(op0, op1) \
33758 case op0 : return node_allocator_-> \
33759 allocate<details::vectorize_node<Type,op1<Type> > >(arg_list[0]); \
33760
33761 case_stmt(details::e_sum , details::vec_add_op)
33762 case_stmt(details::e_prod , details::vec_mul_op)
33763 case_stmt(details::e_avg , details::vec_avg_op)
33764 case_stmt(details::e_min , details::vec_min_op)
33765 case_stmt(details::e_max , details::vec_max_op)
33766 #undef case_stmt
33767 default : return error_node();
33768 }
33769 }
33770 else
33771 return error_node();
33772 }

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

32284 {
32285 if (!operation_optimisable(operation))
32286 return false;
32287 else
32288 return details::is_variable_node(branch[0]) &&
32289 !details::is_variable_node(branch[1]) ;
32290 }

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

32207 {
32208 if (!operation_optimisable(operation))
32209 return false;
32210 else
32211 return details::is_variable_node(branch[0]) &&
32212 details::is_constant_node(branch[1]) ;
32213 }

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

32216 {
32217 if (!operation_optimisable(operation))
32218 return false;
32219 else
32220 return details::is_variable_node(branch[0]) &&
32221 details::is_variable_node(branch[1]) ;
32222 }

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

32920 {
32921 if (
32922 !break_continue_present &&
32924 details::is_constant_node(condition)
32925 )
32926 {
32928 if (details::is_true(condition))
32929 {
32930 // Infinite loops are not allowed.
32931
32935 "ERR260 - Infinite loop condition without 'break' or 'return' not allowed in while-loops",
32937
32938 result = error_node();
32939 }
32940 else
32942
32945
32946 return result;
32947 }
32948 else if (details::is_null_node(condition))
32949 {
32951
32952 return branch;
32953 }
32954
32956
32957 if (!break_continue_present)
32958 {
32959 if (rtc)
32961 (condition, branch, rtc);
32962 else
32964 (condition, branch);
32965 }
32966 #ifndef exprtk_disable_break_continue
32967 else
32968 {
32969 if (rtc)
32971 (condition, branch, rtc);
32972 else
32974 (condition, branch);
32975 }
32976 #else
32977 return error_node();
32978 #endif
32979 }
details::while_loop_bc_rtc_node< T > while_loop_bc_rtc_node_t
Definition exprtk.hpp:22477
details::while_loop_bc_node< T > while_loop_bc_node_t
Definition exprtk.hpp:22474
details::while_loop_rtc_node< T > while_loop_rtc_node_t
Definition exprtk.hpp:22470
details::while_loop_node< T > while_loop_node_t
Definition exprtk.hpp:22467

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 41795 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 41802 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: