Zigbee Protocol Controller 1.6.0
|
AST reducer. More...
#include <attribute_mapper_ast_reducer.hpp>
Public Member Functions | |
reducer () | |
operand | operator() (const nil &x) const |
operand | operator() (uint32_t n) const |
operand | operator() (float n) const |
operand | operator() (const attribute &a) const |
operand | operator() (const signed_ &x) const |
operand | operator() (const condition &x) const |
operand | operator() (const function_invokation &f) const |
operand | operator() (const expression &x) const |
operation | reduce_operation (const operation &x) const |
This function reduces an operation. More... | |
expression | reduce_expression (const expression &x) const |
Reduce an expression. More... | |
assignment | operator() (const assignment &x) const |
scope | operator() (const scope &x) const |
ast_tree | operator() (const ast_tree &ast) const |
Private Attributes | |
eval< result_type_t > | evaluator |
AST reducer.
This class is an ast evaluator which outputs a copy of the ast in reduced form.
The ast reducer works by going though the ast and try evaluate operands with a normal value evaluator which has an undefined context. This means that the evaluator will only succeed if the operand is a constant, ie does not depend on an attribute.
As the other evaluators this evaluator operates on a functor which uses pattern matchin to evaluate the boost::variant ast components using the boost::apply_visitor.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Reduce an expression.
This is the main entrypoint of reducer. An expession is also a operand though the pattern "( <expression> )". So this reducer is accessed though the operator()(const expression &x).
x | input expression |
This function reduces an operation.
this is not one of the boost::variant operators since the operation data type is not an operand
x | input operation |
|
private |