26#ifndef ATTRIBUTE_MAPPER_AST_HPP
27#define ATTRIBUTE_MAPPER_AST_HPP
31#include <boost/spirit/home/x3.hpp>
32#include <boost/spirit/home/x3/support/ast/variant.hpp>
33#include <boost/fusion/include/adapt_struct.hpp>
34#include <boost/spirit/include/qi_optional.hpp>
40namespace x3 = boost::spirit::x3;
53struct ast_tree :
public std::vector<ast_node> {};
91 x3::forward_ast<attribute>,
92 x3::forward_ast<signed_>,
93 x3::forward_ast<expression>,
94 x3::forward_ast<condition>,
95 x3::forward_ast<function_invokation>>;
104 = boost::variant<ast::nil, ast::operand, uint32_t, attribute_path_subscript>;
267BOOST_FUSION_ADAPT_STRUCT(
ast::condition, cond_value, cond_true, cond_false)
268BOOST_FUSION_ADAPT_STRUCT(
ast::attribute, value_type, attribute_path)
272 (std::string, setting_name),
273 (boost::optional<unsigned int>, setting_value))
274BOOST_FUSION_ADAPT_STRUCT(
ast::scope, priority, settings, assignments)
float result_type_t
Definition: attribute_mapper_ast.hpp:36
Definition: attribute_mapper_ast.hpp:39
boost::variant< ast::scope > ast_node
Definition: attribute_mapper_ast.hpp:52
boost::variant< ast::nil, ast::operand, uint32_t, attribute_path_subscript > attribute_path_element
Attribute path element.
Definition: attribute_mapper_ast.hpp:104
operator_ids
Definitions of operators When the parser encounters the string representation of operators,...
Definition: attribute_mapper_ast.hpp:60
@ operator_modulo
Definition: attribute_mapper_ast.hpp:72
@ operator_div
Definition: attribute_mapper_ast.hpp:65
@ operator_bitand
Definition: attribute_mapper_ast.hpp:66
@ operator_bitxor
Definition: attribute_mapper_ast.hpp:68
@ operator_minus
Definition: attribute_mapper_ast.hpp:62
@ operator_bitor
Definition: attribute_mapper_ast.hpp:67
@ operator_mult
Definition: attribute_mapper_ast.hpp:64
@ operator_or
Definition: attribute_mapper_ast.hpp:71
@ operator_less_than_or_eq
Definition: attribute_mapper_ast.hpp:75
@ operator_exponent
Definition: attribute_mapper_ast.hpp:73
@ operator_greater_than_or_eq
Definition: attribute_mapper_ast.hpp:76
@ operator_greater_than
Definition: attribute_mapper_ast.hpp:70
@ operator_plus
Definition: attribute_mapper_ast.hpp:61
@ operator_less_than
Definition: attribute_mapper_ast.hpp:69
@ operator_equals
Definition: attribute_mapper_ast.hpp:63
@ operator_neq
Definition: attribute_mapper_ast.hpp:74
bool operator==(const nil &a, const nil &b)
AssignmentType
Definition: attribute_mapper_ast.hpp:203
@ REGULAR
Definition: attribute_mapper_ast.hpp:203
@ INSTANCE
Definition: attribute_mapper_ast.hpp:203
@ CLEARANCE
Definition: attribute_mapper_ast.hpp:203
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
std::vector< scope_setting > scope_settings_t
Type for Scope settings list.
Definition: attribute_mapper_ast.hpp:226
Assignment.
Definition: attribute_mapper_ast.hpp:193
ast::attribute lhs
left hand side of the assignment
Definition: attribute_mapper_ast.hpp:199
int type
Definition: attribute_mapper_ast.hpp:198
expression rhs
right hand side of the assignment
Definition: attribute_mapper_ast.hpp:200
Definition: attribute_mapper_ast.hpp:53
Attribute path subscript.
Definition: attribute_mapper_ast.hpp:160
operand identifier
Definition: attribute_mapper_ast.hpp:161
operand index
Definition: attribute_mapper_ast.hpp:162
Attribute.
Definition: attribute_mapper_ast.hpp:177
std::vector< attribute_path_element > attribute_path
Definition: attribute_mapper_ast.hpp:179
char value_type
Definition: attribute_mapper_ast.hpp:178
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
std::vector< expression > arguments
Definition: attribute_mapper_ast.hpp:211
std::string function_name
Definition: attribute_mapper_ast.hpp:210
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
operator_ids operator_
+,-,*,/ etc.
Definition: attribute_mapper_ast.hpp:124
operand operand_
right hand side operand
Definition: attribute_mapper_ast.hpp:125
Scope setting A scope setting consists of a setting name and an associated value.
Definition: attribute_mapper_ast.hpp:218
boost::optional< unsigned int > setting_value
Definition: attribute_mapper_ast.hpp:220
std::string setting_name
Definition: attribute_mapper_ast.hpp:219
Scope.
Definition: attribute_mapper_ast.hpp:234
std::vector< assignment > assignments
Definition: attribute_mapper_ast.hpp:237
scope_settings_t settings
Definition: attribute_mapper_ast.hpp:236
int priority
Definition: attribute_mapper_ast.hpp:235
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