Public Member Functions | |
operator_expression (const std::string &op, expression_ptr left, expression_ptr right) | |
std::string | str () const |
Public Member Functions inherited from wfl::formula_expression | |
formula_expression (const std::string &name="") | |
virtual | ~formula_expression () |
variant | evaluate (const formula_callable &variables, formula_debugger *fdb=nullptr) const |
std::string | get_name () const |
Private Types | |
enum | OP { AND , OR , NEQ , LTE , GTE , OP_CAT , OP_IN , GT ='>' , LT ='<' , EQ ='=' , RAN ='~' , ADD ='+' , SUB ='-' , MUL ='*' , DIV ='/' , ADDL , SUBL , MULL , DIVL , DICE ='d' , POW ='^' , MOD ='' } |
Private Member Functions | |
variant | execute (const formula_callable &variables, formula_debugger *fdb) const |
Static Private Member Functions | |
static int | dice_roll (int num_rolls, int faces) |
Private Attributes | |
OP | op_ |
std::string | op_str_ |
expression_ptr | left_ |
expression_ptr | right_ |
Definition at line 696 of file formula.cpp.
|
private |
Enumerator | |
---|---|
AND | |
OR | |
NEQ | |
LTE | |
GTE | |
OP_CAT | |
OP_IN | |
GT | |
LT | |
EQ | |
RAN | |
ADD | |
SUB | |
MUL | |
DIV | |
ADDL | |
SUBL | |
MULL | |
DIVL | |
DICE | |
POW | |
MOD |
Definition at line 802 of file formula.cpp.
|
inline |
|
inlinestaticprivate |
Definition at line 791 of file formula.cpp.
References randomness::generator, and randomness::rng::get_random_int().
Referenced by execute().
|
inlineprivatevirtual |
Implements wfl::formula_expression.
Definition at line 735 of file formula.cpp.
References ADD, wfl::add_debug_info(), ADDL, AND, wfl::variant::as_bool(), wfl::variant::as_int(), wfl::variant::build_range(), wfl::variant::concatenate(), DICE, dice_roll(), DIV, DIVL, EQ, GT, GTE, left_, wfl::variant::list_elements_add(), wfl::variant::list_elements_div(), wfl::variant::list_elements_mul(), wfl::variant::list_elements_sub(), LT, LTE, MOD, MUL, MULL, NEQ, op_, OP_CAT, OP_IN, op_str_, OR, PLAIN_LOG, POW, RAN, right_, SUB, and SUBL.
|
inlinevirtual |
Implements wfl::formula_expression.
Definition at line 727 of file formula.cpp.
|
private |
Definition at line 807 of file formula.cpp.
|
private |
Definition at line 805 of file formula.cpp.
Referenced by execute(), and operator_expression().
|
private |
Definition at line 806 of file formula.cpp.
|
private |
Definition at line 807 of file formula.cpp.