22#ifndef ATTRIBUTE_MAPPER_AST_REDUCER_H
23#define ATTRIBUTE_MAPPER_AST_REDUCER_H
28#include <boost/optional.hpp>
78 return boost::apply_visitor(*
this, x.
operand_);
150 bool substitute =
false;
152 reduced_expr.
first = boost::apply_visitor(*
this, x.
first);
154 if (x.
rest.empty()) {
159 switch (x.
rest.begin()->operator_) {
186 for (
const auto &op: x.
rest) {
198 reduced_expr.
first = acc;
205 reduced_expr.
rest.push_back(const_op);
208 reduced_expr.
rest.push_back(const_op);
237 for (
auto &ast_element: reduced) {
238 ast_element = boost::apply_visitor(*
this, ast_element);
attribute store C++ wrapper.
#define ATTRIBUTE_STORE_INVALID_ATTRIBUTE_TYPE
This represents an invalid attribute Type. Shall not be used for nodes in the attribute store.
Definition: attribute_store.h:44
AST reducer.
Definition: attribute_mapper_ast_reducer.hpp:51
operand operator()(const expression &x) const
Definition: attribute_mapper_ast_reducer.hpp:108
operand operator()(float n) const
Definition: attribute_mapper_ast_reducer.hpp:65
operation reduce_operation(const operation &x) const
This function reduces an operation.
Definition: attribute_mapper_ast_reducer.hpp:122
operand operator()(const function_invokation &f) const
Definition: attribute_mapper_ast_reducer.hpp:102
expression reduce_expression(const expression &x) const
Reduce an expression.
Definition: attribute_mapper_ast_reducer.hpp:144
eval< result_type_t > evaluator
Definition: attribute_mapper_ast_reducer.hpp:244
ast_tree operator()(const ast_tree &ast) const
Definition: attribute_mapper_ast_reducer.hpp:234
operand operator()(const signed_ &x) const
Definition: attribute_mapper_ast_reducer.hpp:75
operand operator()(uint32_t n) const
Definition: attribute_mapper_ast_reducer.hpp:60
operand operator()(const attribute &a) const
Definition: attribute_mapper_ast_reducer.hpp:70
scope operator()(const scope &x) const
Definition: attribute_mapper_ast_reducer.hpp:224
operand operator()(const nil &x) const
Definition: attribute_mapper_ast_reducer.hpp:55
assignment operator()(const assignment &x) const
Definition: attribute_mapper_ast_reducer.hpp:216
operand operator()(const condition &x) const
Definition: attribute_mapper_ast_reducer.hpp:87
reducer()
Definition: attribute_mapper_ast_reducer.hpp:53
float result_type_t
Definition: attribute_mapper_ast.hpp:36
Definition: attribute_mapper_ast.hpp:39
operator_ids
Definitions of operators When the parser encounters the string representation of operators,...
Definition: attribute_mapper_ast.hpp:60
@ operator_div
Definition: attribute_mapper_ast.hpp:65
@ operator_minus
Definition: attribute_mapper_ast.hpp:62
@ operator_mult
Definition: attribute_mapper_ast.hpp:64
@ operator_plus
Definition: attribute_mapper_ast.hpp:61
x3::variant< ast::nil, uint32_t, float, x3::forward_ast< attribute >, x3::forward_ast< signed_ >, x3::forward_ast< expression >, x3::forward_ast< condition >, x3::forward_ast< function_invokation > > operand
Operands.
Definition: attribute_mapper_ast.hpp:95
Assignment.
Definition: attribute_mapper_ast.hpp:193
expression rhs
right hand side of the assignment
Definition: attribute_mapper_ast.hpp:200
Definition: attribute_mapper_ast.hpp:53
Attribute.
Definition: attribute_mapper_ast.hpp:177
Condition.
Definition: attribute_mapper_ast.hpp:147
operand cond_true
Truth value.
Definition: attribute_mapper_ast.hpp:149
operand cond_false
False value.
Definition: attribute_mapper_ast.hpp:150
operand cond_value
Selector value.
Definition: attribute_mapper_ast.hpp:148
Expression.
Definition: attribute_mapper_ast.hpp:134
operand first
Definition: attribute_mapper_ast.hpp:135
std::list< operation > rest
Definition: attribute_mapper_ast.hpp:136
Built-in function invokation Example : fn_min_value(r'3, 5, d'5 or 20)
Definition: attribute_mapper_ast.hpp:209
Definition: attribute_mapper_ast.hpp:42
Operation An operation consists of an operator and an right hand side operand. When operations are ev...
Definition: attribute_mapper_ast.hpp:123
operand operand_
right hand side operand
Definition: attribute_mapper_ast.hpp:125
Scope.
Definition: attribute_mapper_ast.hpp:234
std::vector< assignment > assignments
Definition: attribute_mapper_ast.hpp:237
Uniary signed operand.
Definition: attribute_mapper_ast.hpp:111
char sign
Definition: attribute_mapper_ast.hpp:112
operand operand_
Definition: attribute_mapper_ast.hpp:113
pthread_cond_t cond
Definition: uic_stdin_process.c:53