#include <formula.hpp>
Public Member Functions | |
formula (const std::string &str, function_symbol_table *symbols=nullptr) | |
formula (const tk::token *i1, const tk::token *i2, function_symbol_table *symbols=nullptr) | |
variant | evaluate (const formula_callable &variables, formula_debugger *fdb=nullptr) const |
variant | evaluate (formula_debugger *fdb=nullptr) const |
const std::string & | str () const |
Static Public Member Functions | |
static variant | evaluate (const const_formula_ptr &f, const formula_callable &variables, formula_debugger *fdb=nullptr, variant default_res=variant(0)) |
static formula_ptr | create_optional_formula (const std::string &str, function_symbol_table *symbols=nullptr) |
Static Public Attributes | |
static const char *const | id_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_" |
Private Member Functions | |
variant | execute (const formula_callable &variables, formula_debugger *fdb=nullptr) const |
variant | execute (formula_debugger *fdb) const |
Private Attributes | |
expression_ptr | expr_ |
std::string | str_ |
const std::shared_ptr< function_symbol_table > | managed_symbols_ |
function_symbol_table * | symbols_ |
Friends | |
class | formula_debugger |
Definition at line 34 of file formula.hpp.
wfl::formula::formula | ( | const std::string & | str, |
function_symbol_table * | symbols = nullptr |
||
) |
Definition at line 101 of file formula.cpp.
References e, expr_, wfl::tokenizer::get_token(), wfl::tokenizer::token::line_number, wfl::parse_expression(), str(), symbols_, and wfl::tokens_to_string().
Referenced by create_optional_formula().
wfl::formula::formula | ( | const tk::token * | i1, |
const tk::token * | i2, | ||
function_symbol_table * | symbols = nullptr |
||
) |
Definition at line 239 of file formula.cpp.
References expr_, and wfl::parse_expression().
|
static |
Definition at line 252 of file formula.cpp.
References formula(), and str().
Referenced by wfl::parse_expression().
|
inlinestatic |
Definition at line 40 of file formula.hpp.
References f.
Referenced by BOOST_AUTO_TEST_CASE(), wfl::candidate_action_with_filters::do_filtering(), ai::stage_unit_formulas::do_play_stage(), gui2::image_shape::draw(), gui2::text_shape::draw(), utils::detail::evaluate_formula_impl(), wfl::base_candidate_action::execute_formula(), unit_ability_list::get_extremum(), terrain_filter::match_internal(), side_filter::match_internal(), matches_simple_filter(), game_events::filter_formula::operator()(), gui2::typed_formula< T >::operator()(), image::adjust_alpha_modification::operator()(), image::adjust_channels_modification::operator()(), wfl::variant::serialize_from_string(), and gui2::builder_window::window_resolution::window_resolution().
|
inline |
Definition at line 55 of file formula.hpp.
References wfl::evaluate_formula_callback(), and execute().
|
inline |
Definition at line 64 of file formula.hpp.
References wfl::evaluate_formula_callback(), and execute().
|
private |
Definition at line 261 of file formula.cpp.
References e, expr_, and PLAIN_LOG.
Referenced by evaluate(), and execute().
|
private |
Definition at line 271 of file formula.cpp.
References execute().
|
inline |
Definition at line 73 of file formula.hpp.
References str_.
Referenced by create_optional_formula(), formula(), and game_events::filter_formula::serialize().
|
friend |
Definition at line 88 of file formula.hpp.
|
private |
Definition at line 81 of file formula.hpp.
|
static |
Definition at line 75 of file formula.hpp.
Referenced by lua_callable::get_inputs(), and wfl::config_callable::get_inputs().
|
private |
Definition at line 85 of file formula.hpp.
|
private |
Definition at line 82 of file formula.hpp.
Referenced by str().
|
private |
Definition at line 86 of file formula.hpp.
Referenced by formula().