Namespaces | |
actions | |
builtins | |
gamestate | |
tokenizer | |
Enumerations | |
enum class | formula_access { read_only , write_only , read_write } |
Functions | |
static void | msg (const char *act, debug_info &i, const char *to="", const char *result="") |
formula_debugger * | add_debug_info (formula_debugger *fdb, int arg_number, const std::string &f_name) |
variant | evaluate_arg_callback (formula_debugger &fdb, const formula_expression &expression, const formula_callable &variables) |
variant | evaluate_formula_callback (formula_debugger &fdb, const formula &f, const formula_callable &variables) |
variant | evaluate_formula_callback (formula_debugger &fdb, const formula &f) |
static std::string | tokens_to_string (const tk::token *i1, const tk::token *i2) |
expression_ptr | parse_expression (const tk::token *i1, const tk::token *i2, function_symbol_table *symbols) |
static int | operator_precedence (const tk::token &t) |
Functions to handle the actual parsing of WFL. More... | |
static void | parse_function_args (const tk::token *&i1, const tk::token *i2, std::vector< std::string > *res) |
static void | parse_args (const tk::token *i1, const tk::token *i2, std::vector< expression_ptr > *res, function_symbol_table *symbols) |
static void | parse_set_args (const tk::token *i1, const tk::token *i2, std::vector< expression_ptr > *res, function_symbol_table *symbols) |
static void | parse_where_clauses (const tk::token *i1, const tk::token *i2, const expr_table_ptr &res, function_symbol_table *symbols) |
static value_base_ptr | null_value (new variant_value_base) |
static std::string | variant_type_to_string (formula_variant::type type) |
static std::string | was_expecting (const std::string &message, const variant &v) |
template<typename T > | |
static std::shared_ptr< T > | value_cast (value_base_ptr ptr) |
Casts a variant_value_base shared pointer to a new derived type. More... | |
template<typename T > | |
static T & | value_ref_cast (variant_value_base &ptr) |
Casts a variant_value_base reference to a new derived type. More... | |
Variables | |
static thread_local std::deque< std::string > | call_stack |
For printing error messages when WFL parsing or evaluation fails, this contains the names of the WFL functions being evaluated. More... | |
typedef std::shared_ptr<base_breakpoint> wfl::breakpoint_ptr |
Definition at line 38 of file debugger_fwd.hpp.
typedef std::map< std::string, const_formula_ptr > wfl::candidate_action_filters |
Definition at line 35 of file candidates.hpp.
typedef std::shared_ptr<base_candidate_action> wfl::candidate_action_ptr |
Definition at line 36 of file candidates.hpp.
using wfl::const_formula_callable_ptr = typedef std::shared_ptr<const formula_callable> |
Definition at line 44 of file callable_fwd.hpp.
typedef std::shared_ptr<const formula> wfl::const_formula_ptr |
Definition at line 24 of file formula_fwd.hpp.
using wfl::const_map_formula_callable_ptr = typedef std::shared_ptr<const map_formula_callable> |
Definition at line 313 of file callable.hpp.
using wfl::expr_table = typedef std::map<std::string, expression_ptr> |
Definition at line 61 of file formula.cpp.
using wfl::expr_table_evaluated = typedef std::map<std::string, variant> |
Definition at line 62 of file formula.cpp.
using wfl::expr_table_ptr = typedef std::shared_ptr<expr_table> |
Definition at line 63 of file formula.cpp.
typedef std::shared_ptr< formula_expression > wfl::expression_ptr |
Definition at line 29 of file formula.hpp.
using wfl::formula_callable_ptr = typedef std::shared_ptr<formula_callable> |
Definition at line 43 of file callable_fwd.hpp.
typedef std::shared_ptr<formula_function> wfl::formula_function_ptr |
Definition at line 229 of file function.hpp.
using wfl::formula_input_vector = typedef std::vector<formula_input> |
Definition at line 42 of file callable_fwd.hpp.
typedef std::shared_ptr<formula> wfl::formula_ptr |
Definition at line 23 of file formula_fwd.hpp.
using wfl::formula_seen_stack = typedef std::vector<const_formula_callable_ptr> |
Definition at line 45 of file callable_fwd.hpp.
using wfl::formula_variant = typedef string_enums::enum_base<formula_variant_defines> |
Definition at line 34 of file formula_variant.hpp.
typedef std::shared_ptr<function_expression> wfl::function_expression_ptr |
Definition at line 172 of file function.hpp.
typedef std::map<std::string, formula_function_ptr> wfl::functions_map |
Definition at line 230 of file function.hpp.
using wfl::map_formula_callable_ptr = typedef std::shared_ptr<map_formula_callable> |
Definition at line 312 of file callable.hpp.
typedef std::pair< unit_map::unit_iterator, int> wfl::unit_formula_pair |
typedef std::multiset< unit_formula_pair, unit_formula_compare > wfl::unit_formula_set |
using wfl::value_base_ptr = typedef std::shared_ptr<variant_value_base> |
Definition at line 36 of file variant_value.hpp.
using wfl::variant_map_raw = typedef std::map<variant, variant> |
Definition at line 35 of file variant_value.hpp.
using wfl::variant_vector = typedef std::vector<variant> |
Definition at line 34 of file variant_value.hpp.
|
strong |
Enumerator | |
---|---|
read_only | |
write_only | |
read_write |
Definition at line 32 of file callable_fwd.hpp.
formula_debugger * wfl::add_debug_info | ( | formula_debugger * | fdb, |
int | arg_number, | ||
const std::string & | f_name | ||
) |
Definition at line 27 of file debugger_fwd.cpp.
References wfl::formula_debugger::add_debug_info().
Referenced by wfl::gamestate::DEFINE_WFL_FUNCTION(), wfl::builtins::DEFINE_WFL_FUNCTION(), wfl::actions::DEFINE_WFL_FUNCTION(), wfl::list_expression::execute(), wfl::map_expression::execute(), wfl::unary_operator_expression::execute(), wfl::dot_expression::execute(), wfl::square_bracket_expression::execute(), wfl::operator_expression::execute(), wfl::where_expression::execute(), wfl::string_expression::execute(), and wfl::where_variables::get_value().
variant wfl::evaluate_arg_callback | ( | formula_debugger & | fdb, |
const formula_expression & | expression, | ||
const formula_callable & | variables | ||
) |
Definition at line 37 of file debugger_fwd.cpp.
References wfl::formula_debugger::evaluate_arg_callback().
Referenced by wfl::formula_expression::evaluate().
variant wfl::evaluate_formula_callback | ( | formula_debugger & | fdb, |
const formula & | f | ||
) |
Definition at line 49 of file debugger_fwd.cpp.
References wfl::formula_debugger::evaluate_formula_callback(), and f.
variant wfl::evaluate_formula_callback | ( | formula_debugger & | fdb, |
const formula & | f, | ||
const formula_callable & | variables | ||
) |
Definition at line 43 of file debugger_fwd.cpp.
References wfl::formula_debugger::evaluate_formula_callback(), and f.
Referenced by wfl::formula::evaluate().
|
static |
Definition at line 109 of file debugger.cpp.
Referenced by display_chat_manager::add_chat_message(), gui2::dialogs::lua_interpreter::lua_model::add_dialog_message(), game_events::event_handlers::add_event_handler(), lua_kernel_base::add_log_to_console(), wesnothd::server::adminmsg_handler(), server_base::async_send_error(), server_base::async_send_warning(), gui2::builder_grid::builder_grid(), events::menu_handler::can_recruit(), spirit_po::catalog< hashmap_type, pf_compiler >::catalog(), ng::depcheck::manager::change_era(), events::chat_handler::change_logging(), ng::depcheck::manager::change_scenario(), chat_message(), addons_client::connect(), mapgen_lua_kernel::create_map(), lua_map_generator::create_map(), mapgen_lua_kernel::create_scenario(), lua_map_generator::create_scenario(), deprecated_message(), ai::readonly_context_proxy::diagnostic(), ai::readonly_context_impl::diagnostic(), gui2::dialogs::mp_create_game::dialog_exit_hook(), ai::formula_ai::display_message(), set_scontext_synced::do_final_checkup(), do_gameloop(), events::menu_handler::do_search(), simple_wml::error::error(), wfl::formula_debugger::evaluate_arg_callback(), wfl::formula_debugger::evaluate_formula_callback(), ng::depcheck::manager::failure_dialog(), game_events::wml_event_pump::fill_wml_messages_map(), gui2::event::dispatcher::fire(), spirit_po::catalog< hashmap_type, pf_compiler >::form_index(), help::generate_contents(), spirit_po::catalog< hashmap_type, pf_compiler >::get(), get_addon_pbl_info(), editor::terrain_palette::get_help_string(), config::get_old_attribute(), gui2::dialogs::get_title_suffix(), wesnothd::server::handle_message(), campaignd::server::handle_upload(), wesnothd::server::handle_whisper(), impl_warn(), spirit_po::catalog< hashmap_type, pf_compiler >::insert_message(), intf_deprecated_message(), intf_find_path(), lua_map_location::intf_get_direction(), game_lua_kernel::intf_log(), intf_log(), playsingle_controller::hotkey_handler::load_autosave(), editor::context_manager::load_map(), application_lua_kernel::load_script_from_string(), lua_kernel_base::load_string(), lua_kernel_base::log_error(), game_lua_kernel::log_error(), ai::readonly_context_proxy::log_message(), ai::readonly_context_impl::log_message(), ai_testing::log_turn(), game_lua_kernel::lua_chat(), lua_map_generator::lua_map_generator(), luaW_type_error(), gui2::parse_linked_group_definitions(), wesnothd::game::perform_controller_tweaks(), wesnothd::server::pm_handler(), wesnothd::server::process_command(), replay::process_error(), wesnothd::game::process_message(), play_controller::process_oos(), wesnothd::game::process_turn(), wesnothd::game::process_whiteboard(), lua_kernel_base::protected_call(), gui2::dialogs::addon_manager::publish_addon(), events::menu_handler::recall(), actions::undo_list::redo(), editor::map_context::save_map(), events::menu_handler::save_map(), editor::map_context::save_scenario(), editor::map_context::save_schedule(), events::menu_handler::search(), campaignd::server::send_error(), campaignd::server::send_message(), wesnothd::server::send_password_request(), wesnothd::game::send_server_message(), wesnothd::server::send_server_message(), display::set_diagnostic(), gui2::show_error_message(), gui2::show_message(), lua_gui2::show_popup_dialog(), prefs::show_wesnothd_server_search(), game_events::wml_event_pump::show_wml_messages(), wesnothd::game::start_game(), lua_kernel_base::throw_exception(), wesnothd::game::transfer_side_control(), lua_map_generator::user_config(), vgettext_impl(), vngettext_impl(), and editor::wrap_exc().
|
static |
|
static |
Functions to handle the actual parsing of WFL.
Definition at line 1075 of file formula.cpp.
Referenced by parse_expression().
|
static |
Definition at line 1141 of file formula.cpp.
References parse_expression(), and wfl::tokenizer::token::type.
Referenced by parse_expression().
expression_ptr wfl::parse_expression | ( | const tk::token * | i1, |
const tk::token * | i2, | ||
function_symbol_table * | symbols | ||
) |
Definition at line 1263 of file formula.cpp.
References wfl::function_symbol_table::add_function(), wfl::tokenizer::token::begin, wfl::function_symbol_table::create_function(), wfl::formula::create_optional_formula(), e, wfl::tokenizer::token::end, f, wfl::tokenizer::token::filename, wfl::function_symbol_table::get_builtins(), i, filesystem::is_map(), wfl::tokenizer::token::line_number, n, operator_precedence(), parse_args(), parse_function_args(), parse_set_args(), parse_where_clauses(), utils::stoi(), tokens_to_string(), and wfl::tokenizer::token::type.
Referenced by wfl::formula::formula(), parse_args(), parse_set_args(), and parse_where_clauses().
|
static |
Definition at line 1107 of file formula.cpp.
References wfl::tokenizer::token::begin, wfl::tokenizer::token::end, wfl::tokenizer::token::filename, wfl::tokenizer::token::line_number, tokens_to_string(), and wfl::tokenizer::token::type.
Referenced by parse_expression().
|
static |
Definition at line 1164 of file formula.cpp.
References wfl::tokenizer::token::filename, wfl::tokenizer::token::line_number, parse_expression(), tokens_to_string(), and wfl::tokenizer::token::type.
Referenced by parse_expression().
|
static |
Definition at line 1202 of file formula.cpp.
References wfl::tokenizer::token::begin, wfl::tokenizer::token::end, wfl::tokenizer::token::filename, wfl::tokenizer::token::line_number, parse_expression(), tokens_to_string(), and wfl::tokenizer::token::type.
Referenced by parse_expression().
Definition at line 67 of file formula.cpp.
References wfl::tokenizer::token::begin, and wfl::tokenizer::token::end.
Referenced by wfl::formula::formula(), parse_expression(), parse_function_args(), parse_set_args(), and parse_where_clauses().
|
static |
Casts a variant_value_base shared pointer to a new derived type.
Definition at line 45 of file variant_value.hpp.
|
static |
Casts a variant_value_base reference to a new derived type.
Definition at line 57 of file variant_value.hpp.
|
static |
Definition at line 39 of file variant.cpp.
References string_enums::enum_base< Definition >::get_string().
Referenced by wfl::variant::must_be(), and wfl::variant::must_both_be().
|
static |
Definition at line 45 of file variant.cpp.
References wfl::variant::to_debug_string(), and wfl::variant::type_string().
Referenced by wfl::variant::as_decimal(), wfl::variant::concatenate(), wfl::variant::contains(), wfl::variant::must_be(), wfl::variant::num_elements(), and wfl::variant::operator[]().
|
static |
For printing error messages when WFL parsing or evaluation fails, this contains the names of the WFL functions being evaluated.
Two C++ threads might be evaluating WFL at the same; declaring this thread_local is a quick bugfix which should probably be replaced by having a context-object for each WFL evaluation.
Definition at line 50 of file function.cpp.
Referenced by wfl::call_stack_manager::call_stack_manager(), wfl::call_stack_manager::get(), wfl::end_breakpoint::is_break_now(), wfl::step_in_breakpoint::is_break_now(), wfl::step_out_breakpoint::is_break_now(), wfl::next_breakpoint::is_break_now(), and wfl::call_stack_manager::~call_stack_manager().