The Battle for Wesnoth  1.19.0-dev
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
wfl::function_symbol_table Class Reference

#include <function.hpp>

Inheritance diagram for wfl::function_symbol_table:

Public Member Functions

 function_symbol_table (std::shared_ptr< function_symbol_table > parent=nullptr)
 
void add_function (const std::string &name, formula_function_ptr &&fcn)
 
expression_ptr create_function (const std::string &fn, const std::vector< expression_ptr > &args) const
 
std::set< std::string > get_function_names () const
 
bool empty () const
 

Static Public Member Functions

static std::shared_ptr< function_symbol_tableget_builtins ()
 

Private Types

enum  builtins_tag_t { builtins_tag }
 

Private Member Functions

 function_symbol_table (builtins_tag_t)
 

Private Attributes

std::shared_ptr< function_symbol_tableparent
 
functions_map custom_formulas_
 

Detailed Description

Definition at line 232 of file function.hpp.

Member Enumeration Documentation

◆ builtins_tag_t

Enumerator
builtins_tag 

Definition at line 254 of file function.hpp.

Constructor & Destructor Documentation

◆ function_symbol_table() [1/2]

wfl::function_symbol_table::function_symbol_table ( std::shared_ptr< function_symbol_table parent = nullptr)
explicit

Definition at line 1485 of file function.cpp.

◆ function_symbol_table() [2/2]

wfl::function_symbol_table::function_symbol_table ( builtins_tag_t  )
inlineprivate

Definition at line 255 of file function.hpp.

Member Function Documentation

◆ add_function()

void wfl::function_symbol_table::add_function ( const std::string &  name,
formula_function_ptr &&  fcn 
)

Definition at line 1490 of file function.cpp.

References custom_formulas_.

Referenced by ai::formula_ai::add_formula_function(), and wfl::parse_expression().

◆ create_function()

expression_ptr wfl::function_symbol_table::create_function ( const std::string &  fn,
const std::vector< expression_ptr > &  args 
) const

Definition at line 1495 of file function.cpp.

References custom_formulas_, i, and parent.

Referenced by wfl::parse_expression().

◆ empty()

bool wfl::function_symbol_table::empty ( ) const
inline

Definition at line 243 of file function.hpp.

References custom_formulas_, and parent.

Referenced by get_builtins().

◆ get_builtins()

std::shared_ptr< function_symbol_table > wfl::function_symbol_table::get_builtins ( )
static

◆ get_function_names()

std::set< std::string > wfl::function_symbol_table::get_function_names ( ) const

Definition at line 1513 of file function.cpp.

References custom_formulas_, and parent.

Referenced by wfl::function_list_expression::execute().

Member Data Documentation

◆ custom_formulas_

functions_map wfl::function_symbol_table::custom_formulas_
private

Definition at line 252 of file function.hpp.

Referenced by add_function(), create_function(), empty(), and get_function_names().

◆ parent

std::shared_ptr<function_symbol_table> wfl::function_symbol_table::parent
private

Definition at line 251 of file function.hpp.

Referenced by create_function(), empty(), get_builtins(), and get_function_names().


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