#include <algorithm>
#include <vector>
#include <boost/spirit/include/qi.hpp>
#include <boost/phoenix/core.hpp>
#include <boost/phoenix/operator.hpp>
#include <boost/fusion/include/adapt_struct.hpp>
#include <boost/variant/variant.hpp>
#include <boost/variant/recursive_wrapper.hpp>
Go to the source code of this file.
|
#define | BOOST_SPIRIT_USE_PHOENIX_V3 |
|
#define | FOREACH_SPIRIT_PO_BINARY_OP(X_) X_(eq_op, ==) X_(neq_op, !=) X_(ge_op, >=) X_(le_op, <=) X_(gt_op, >) X_(lt_op, <) X_(mod_op, %) |
|
#define | FOREACH_SPIRIT_PO_CONJUNCTION(X_) X_(and_op, &&) X_(or_op, ||) |
|
#define | FWD_DECL_(name, op) struct name ; \ |
|
#define | WRAP_(name, op) boost::recursive_wrapper< name >, \ |
|
#define | DECL_(name, op) struct name { expr e1, e2; }; \ |
|
#define | EVAL_OP_(name, OPERATOR) uint operator()(const name & op) const { return (boost::apply_visitor(*this, op.e1)) OPERATOR (boost::apply_visitor(*this, op.e2)); } \ |
|
#define | ADAPT_STRUCT_(name, op) |
|
#define | ENUMERATE(X, Y) X, |
|
#define | EMIT_OP_(name, op) |
|
#define | MACHINE_ASSERT(...) do {} while(0) |
|
#define | STACK_MACHINE_CASE_(name, op) |
|
◆ ADAPT_STRUCT_
#define ADAPT_STRUCT_ |
( |
|
name, |
|
|
|
op |
|
) |
| |
Value:BOOST_FUSION_ADAPT_STRUCT(spirit_po::default_plural_forms:: name, \
◆ BOOST_SPIRIT_USE_PHOENIX_V3
#define BOOST_SPIRIT_USE_PHOENIX_V3 |
◆ DECL_
#define DECL_ |
( |
|
name, |
|
|
|
op |
|
) |
| struct name { expr e1, e2; }; \ |
◆ EMIT_OP_
#define EMIT_OP_ |
( |
|
name, |
|
|
|
op |
|
) |
| |
Value: std::vector<instruction> operator()(const name & o) const { \
std::move(temp.begin(), temp.end(), std::back_inserter(result)); \
result.emplace_back(op_code::name); \
return result; \
}
V::result_t apply_visitor(typename V::param_t state, T &&... args)
Helper function to apply the result of a specified visitor to a variable_info object.
◆ ENUMERATE
#define ENUMERATE |
( |
|
X, |
|
|
|
Y |
|
) |
| X, |
◆ EVAL_OP_
#define EVAL_OP_ |
( |
|
name, |
|
|
|
OPERATOR |
|
) |
| uint operator()(const name & op) const { return (boost::apply_visitor(*this, op.e1)) OPERATOR (boost::apply_visitor(*this, op.e2)); } \ |
◆ FOREACH_SPIRIT_PO_BINARY_OP
#define FOREACH_SPIRIT_PO_BINARY_OP |
( |
|
X_ | ) |
X_(eq_op, ==) X_(neq_op, !=) X_(ge_op, >=) X_(le_op, <=) X_(gt_op, >) X_(lt_op, <) X_(mod_op, %) |
◆ FOREACH_SPIRIT_PO_CONJUNCTION
#define FOREACH_SPIRIT_PO_CONJUNCTION |
( |
|
X_ | ) |
X_(and_op, &&) X_(or_op, ||) |
◆ FWD_DECL_
#define FWD_DECL_ |
( |
|
name, |
|
|
|
op |
|
) |
| struct name ; \ |
◆ MACHINE_ASSERT
#define MACHINE_ASSERT |
( |
|
... | ) |
do {} while(0) |
◆ STACK_MACHINE_CASE_
#define STACK_MACHINE_CASE_ |
( |
|
name, |
|
|
|
op |
|
) |
| |
Value: case op_code::name: { \
MACHINE_ASSERT(stack_.size() >= 2); \
uint parm2 = pop_one(); \
\
if (op_code::name == op_code::mod_op) { \
MACHINE_ASSERT(parm2 && "Division by zero when evaluating gettext plural form expression"); \
} \
\
stack_.back() = (stack_.back() op parm2); \
return 1; \
}
◆ WRAP_
#define WRAP_ |
( |
|
name, |
|
|
|
op |
|
) |
| boost::recursive_wrapper< name >, \ |