The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
wfl Namespace Reference

Namespaces

 actions
 
 builtins
 
 gamestate
 
 tokenizer
 

Classes

class  action_callable
 
class  action_function_symbol_table
 
class  ai_function_symbol_table
 
class  attack_callable
 
class  attack_candidate_action
 
class  attack_map_callable
 
class  attack_type_callable
 
class  base_breakpoint
 
class  base_candidate_action
 
class  builtin_formula_function
 
struct  call_stack_manager
 
struct  callable_die_subscriber
 
class  candidate_action_with_filters
 
class  config_callable
 
class  debug_info
 
class  decimal_expression
 
class  dot_callable
 
class  dot_expression
 
class  end_breakpoint
 
struct  fai_variant_visitor
 
class  fallback_callable
 
class  formula
 
class  formula_callable
 
class  formula_callable_with_backup
 
class  formula_debugger
 
struct  formula_error
 
class  formula_expression
 
class  formula_function
 
class  formula_function_expression
 
struct  formula_input
 
class  formula_variant_callable_with_backup
 
class  function_expression
 
class  function_list_expression
 Classes that encapsulate and handle the various formula functions. More...
 
class  function_symbol_table
 
class  gamemap_callable
 
class  gamestate_function_symbol_table
 
class  identifier_expression
 
class  integer_expression
 
class  key_value_pair
 
class  list_callable
 
class  list_expression
 
class  location_callable
 
class  map_callable
 
class  map_expression
 
class  map_formula_callable
 
class  move_callable
 
class  move_candidate_action
 
class  move_map_callable
 
class  move_partial_callable
 
class  next_breakpoint
 
class  null_expression
 
class  operator_expression
 
class  outcome_callable
 
class  position_callable
 
class  recall_callable
 
class  recruit_callable
 
class  safe_call_callable
 
class  safe_call_result
 
class  set_unit_var_callable
 
class  set_var_callable
 
class  square_bracket_expression
 
class  step_in_breakpoint
 
class  step_out_breakpoint
 
class  string_callable
 
class  string_expression
 
class  team_callable
 
class  terrain_callable
 
struct  type_error
 
class  unary_operator_expression
 
class  unit_callable
 
struct  unit_formula_compare
 
class  unit_type_callable
 
class  user_formula_function
 
class  variant
 
class  variant_callable
 
class  variant_container
 Generalized implementation handling container variants. More...
 
class  variant_decimal
 
class  variant_int
 
class  variant_iterator
 Iterator class for the variant. More...
 
class  variant_list
 
class  variant_map
 
class  variant_numeric
 Base class for numeric variant values. More...
 
class  variant_string
 
class  variant_value_base
 Base class for all variant types. More...
 
class  where_expression
 
class  where_variables
 
class  wrapper_formula
 

Typedefs

typedef std::pair
< unit_map::unit_iterator, int > 
unit_formula_pair
 
typedef std::multiset
< unit_formula_pair,
unit_formula_compare
unit_formula_set
 
typedef std::map< std::string,
const_formula_ptr
candidate_action_filters
 
typedef std::shared_ptr
< base_candidate_action
candidate_action_ptr
 
using map_formula_callable_ptr = std::shared_ptr< map_formula_callable >
 
using const_map_formula_callable_ptr = std::shared_ptr< const map_formula_callable >
 
using formula_input_vector = std::vector< formula_input >
 
using formula_callable_ptr = std::shared_ptr< formula_callable >
 
using const_formula_callable_ptr = std::shared_ptr< const formula_callable >
 
using formula_seen_stack = std::vector< const_formula_callable_ptr >
 
typedef std::shared_ptr
< base_breakpoint
breakpoint_ptr
 
using expr_table = std::map< std::string, expression_ptr >
 
using expr_table_evaluated = std::map< std::string, variant >
 
using expr_table_ptr = std::shared_ptr< expr_table >
 
using expression_ptr = std::shared_ptr< formula_expression >
 
typedef std::shared_ptr< formulaformula_ptr
 
typedef std::shared_ptr< const
formula
const_formula_ptr
 
typedef std::shared_ptr
< function_expression
function_expression_ptr
 
typedef std::shared_ptr
< formula_function
formula_function_ptr
 
typedef std::map< std::string,
formula_function_ptr
functions_map
 
using variant_vector = std::vector< variant >
 
using variant_map_raw = std::map< variant, variant >
 
using value_base_ptr = std::shared_ptr< variant_value_base >
 

Enumerations

enum  FORMULA_ACCESS_TYPE { FORMULA_READ_ONLY, FORMULA_WRITE_ONLY, FORMULA_READ_WRITE }
 

Functions

static void msg (const char *act, debug_info &i, const char *to="", const char *result="")
 
formula_debuggeradd_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, 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 (VARIANT_TYPE type)
 
static std::string was_expecting (const std::string &message, const variant &v)
 
 MAKE_ENUM (VARIANT_TYPE,(TYPE_NULL,"null")(TYPE_INT,"int")(TYPE_DECIMAL,"decimal")(TYPE_CALLABLE,"object")(TYPE_LIST,"list")(TYPE_STRING,"string")(TYPE_MAP,"map"))
 The various types the variant class is designed to handle. More...
 
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 std::deque< std::string > call_stack
 

Typedef Documentation

typedef std::shared_ptr<base_breakpoint> wfl::breakpoint_ptr

Definition at line 36 of file debugger_fwd.hpp.

typedef std::map< std::string, const_formula_ptr > wfl::candidate_action_filters

Definition at line 33 of file candidates.hpp.

Definition at line 36 of file candidates.hpp.

using wfl::const_formula_callable_ptr = typedef std::shared_ptr<const formula_callable>

Definition at line 43 of file callable_fwd.hpp.

typedef std::shared_ptr<const formula> wfl::const_formula_ptr

Definition at line 23 of file formula_fwd.hpp.

using wfl::const_map_formula_callable_ptr = typedef std::shared_ptr<const map_formula_callable>

Definition at line 306 of file callable.hpp.

using wfl::expr_table = typedef std::map<std::string, expression_ptr>

Definition at line 28 of file formula.cpp.

using wfl::expr_table_evaluated = typedef std::map<std::string, variant>

Definition at line 29 of file formula.cpp.

using wfl::expr_table_ptr = typedef std::shared_ptr<expr_table>

Definition at line 30 of file formula.cpp.

typedef std::shared_ptr< formula_expression > wfl::expression_ptr

Definition at line 28 of file formula.hpp.

using wfl::formula_callable_ptr = typedef std::shared_ptr<formula_callable>

Definition at line 42 of file callable_fwd.hpp.

typedef std::shared_ptr<formula_function> wfl::formula_function_ptr

Definition at line 138 of file function.hpp.

using wfl::formula_input_vector = typedef std::vector<formula_input>

Definition at line 41 of file callable_fwd.hpp.

typedef std::shared_ptr<formula> wfl::formula_ptr

Definition at line 21 of file formula_fwd.hpp.

Definition at line 44 of file callable_fwd.hpp.

Definition at line 103 of file function.hpp.

typedef std::map<std::string, formula_function_ptr> wfl::functions_map

Definition at line 139 of file function.hpp.

using wfl::map_formula_callable_ptr = typedef std::shared_ptr<map_formula_callable>

Definition at line 305 of file callable.hpp.

Definition at line 54 of file ai.hpp.

Definition at line 64 of file ai.hpp.

using wfl::value_base_ptr = typedef std::shared_ptr<variant_value_base>

Definition at line 50 of file variant_value.hpp.

using wfl::variant_map_raw = typedef std::map<variant, variant>

Definition at line 49 of file variant_value.hpp.

using wfl::variant_vector = typedef std::vector<variant>

Definition at line 48 of file variant_value.hpp.

Enumeration Type Documentation

Enumerator
FORMULA_READ_ONLY 
FORMULA_WRITE_ONLY 
FORMULA_READ_WRITE 

Definition at line 31 of file callable_fwd.hpp.

Function Documentation

formula_debugger * wfl::add_debug_info ( formula_debugger *  fdb,
int  arg_number,
const std::string &  f_name 
)
variant wfl::evaluate_arg_callback ( formula_debugger &  fdb,
const formula_expression &  expression,
const formula_callable &  variables 
)
variant wfl::evaluate_formula_callback ( formula_debugger &  fdb,
const formula &  f,
const formula_callable &  variables 
)
variant wfl::evaluate_formula_callback ( formula_debugger &  fdb,
const formula &  f 
)
wfl::MAKE_ENUM ( VARIANT_TYPE  ,
(TYPE_NULL,"null")(TYPE_INT,"int")(TYPE_DECIMAL,"decimal")(TYPE_CALLABLE,"object")(TYPE_LIST,"list")(TYPE_STRING,"string")(TYPE_MAP,"map")   
)

The various types the variant class is designed to handle.

static void wfl::msg ( const char *  act,
debug_info &  i,
const char *  to = "",
const char *  result = "" 
)
static

Definition at line 110 of file debugger.cpp.

References wfl::debug_info::counter(), DBG_FDB, wfl::debug_info::name(), and wfl::debug_info::str().

Referenced by unit_type_data::add_advancement(), display_chat_manager::add_chat_message(), wesnothd::server::adminmsg_handler(), gui2::build(), spirit_po::catalog< hashmap_type, pf_compiler >::catalog(), events::chat_handler::change_logging(), checkrepeated(), gui2::chatbox::close_window(), closegoto(), help::convert_to_wml(), mapgen_lua_kernel::create_map(), lua_map_generator::create_map(), mapgen_lua_kernel::create_scenario(), lua_map_generator::create_scenario(), db_traceback(), set_scontext_synced::do_final_checkup(), events::menu_handler::do_recruit(), events::chat_command_handler::do_register(), events::menu_handler::do_search(), errorlimit(), wfl::formula_debugger::evaluate_arg_callback(), wfl::formula_debugger::evaluate_formula_callback(), game_events::wml_event_pump::fill_wml_messages_map(), findloader(), gui2::event::dispatcher::fire(), GCTM(), help::generate_contents(), spirit_po::catalog< hashmap_type, pf_compiler >::get(), editor::terrain_palette::get_help_string(), config::get_old_attribute(), gui2::dialogs::get_title_suffix(), help::help_browser::handle_event(), wesnothd::server::handle_nickserv(), help::help_text_area::handle_ref_cfg(), config::has_old_attribute(), intf_find_path(), lua_map_location::intf_get_direction(), game_lua_kernel::intf_log(), intf_log(), editor::context_manager::load_map(), application_lua_kernel::load_script_from_string(), lua_kernel_base::load_string(), gui2::gui_definition::load_widget_definitions(), ai_testing::log_turn(), lua_map_generator::lua_map_generator(), luaG_runerror(), luaO_pushfstring(), luaW_type_error(), ng::depcheck::MAKE_ENUM(), gui2::parse_linked_group_definitions(), help::parse_text(), suh::password_reminder(), wesnothd::game::perform_controller_tweaks(), wesnothd::server::pm_handler(), wesnothd::server::process_command(), 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(), read_long_string(), events::menu_handler::recall(), events::menu_handler::save_map(), editor::map_context::save_map(), editor::map_context::save_scenario(), events::menu_handler::search(), searchpath(), wesnothd::send_server_message(), wesnothd::game::send_server_message(), help::help_text_area::set_items(), help::show_help(), lua_gui2::show_popup_dialog(), preferences::show_wesnothd_server_search(), game_events::wml_event_pump::show_wml_messages(), wesnothd::game::start_game(), help::help_text_area::str_to_align(), wesnothd::game::transfer_side_control(), typeerror(), undefgoto(), lua_map_generator::user_config(), vgettext(), vngettext(), and editor::wrap_exc().

static value_base_ptr wfl::null_value ( new  variant_value_base)
static
static int wfl::operator_precedence ( const tk::token &  t)
static

Functions to handle the actual parsing of WFL.

Definition at line 1049 of file formula.cpp.

References wfl::tokenizer::token::begin, wfl::tokenizer::token::end, and n.

Referenced by parse_expression().

static void wfl::parse_args ( const tk::token *  i1,
const tk::token *  i2,
std::vector< expression_ptr > *  res,
function_symbol_table *  symbols 
)
static
expression_ptr wfl::parse_expression ( const tk::token *  i1,
const tk::token *  i2,
function_symbol_table *  symbols 
)
static void wfl::parse_function_args ( const tk::token *&  i1,
const tk::token *  i2,
std::vector< std::string > *  res 
)
static
static void wfl::parse_set_args ( const tk::token *  i1,
const tk::token *  i2,
std::vector< expression_ptr > *  res,
function_symbol_table *  symbols 
)
static
static void wfl::parse_where_clauses ( const tk::token *  i1,
const tk::token *  i2,
expr_table_ptr  res,
function_symbol_table *  symbols 
)
static
static std::string wfl::tokens_to_string ( const tk::token *  i1,
const tk::token *  i2 
)
static
template<typename T >
static std::shared_ptr<T> wfl::value_cast ( value_base_ptr  ptr)
static

Casts a variant_value_base shared pointer to a new derived type.

Definition at line 59 of file variant_value.hpp.

Referenced by wfl::variant_list::list_op(), and wfl::variant::value_cast().

template<typename T >
static T& wfl::value_ref_cast ( variant_value_base &  ptr)
static
static std::string wfl::variant_type_to_string ( VARIANT_TYPE  type)
static

Definition at line 42 of file variant.cpp.

Referenced by wfl::variant::must_be(), and wfl::variant::must_both_be().

static std::string wfl::was_expecting ( const std::string &  message,
const variant &  v 
)
static

Variable Documentation

std::deque<std::string> wfl::call_stack
static