The Battle for Wesnoth  1.15.2+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:
Inheritance graph

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 227 of file function.hpp.

Member Enumeration Documentation

◆ builtins_tag_t

Enumerator
builtins_tag 

Definition at line 249 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 1424 of file function.cpp.

◆ function_symbol_table() [2/2]

wfl::function_symbol_table::function_symbol_table ( builtins_tag_t  )
inlineprivate

Definition at line 250 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 1429 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 1434 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 238 of file function.hpp.

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 1452 of file function.cpp.

References custom_formulas_, and parent.

Member Data Documentation

◆ custom_formulas_

functions_map wfl::function_symbol_table::custom_formulas_
private

Definition at line 247 of file function.hpp.

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

◆ parent

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

Definition at line 246 of file function.hpp.

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


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