Unify Framework Lib 1.6.0
|
Classes | |
struct | assignment |
Assignment. More... | |
struct | ast_tree |
struct | attribute |
Attribute. More... | |
struct | attribute_path_eval |
The attribute path evaluator evalues a full attribute path and returns the matching attribute store attribute for that attribute path. More... | |
struct | attribute_path_subscript |
Attribute path subscript. More... | |
class | built_in_function_check |
Class that evaluates if we have unknown functions in the AST. More... | |
class | complexity |
struct | condition |
Condition. More... | |
class | dep_eval |
Dependency evaluator. More... | |
class | dep_eval_path |
Attribute path evaluator. More... | |
struct | eval |
AST evaluator. More... | |
struct | expression |
Expression. More... | |
struct | function_invokation |
Built-in function invokation Example : fn_min_value(r'3, 5, d'5 or 20) More... | |
struct | nil |
struct | operation |
Operation An operation consists of an operator and an right hand side operand. When operations are evaluated they are always evaluated in the context of left hand side value. More... | |
class | path_complexity |
class | path_match_eval |
Path Match Evaluation Class. More... | |
class | path_printer |
class | |
class | reducer |
AST reducer. More... | |
struct | scope |
Scope. More... | |
struct | scope_setting |
Scope setting A scope setting consists of a setting name and an associated value. More... | |
struct | signed_ |
Uniary signed operand. More... | |
Typedefs | |
using | ast_node = boost::variant< ast::scope > |
using | operand = 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 > > |
Operands. More... | |
using | attribute_path_element = boost::variant< ast::nil, ast::operand, uint32_t, attribute_path_subscript > |
Attribute path element. More... | |
using | scope_settings_t = std::vector< scope_setting > |
Type for Scope settings list. More... | |
typedef char | value_type_t |
typedef std::pair< attribute_store_type_t, value_type_t > | attribute_dependency_t |
typedef std::vector< attribute_dependency_t > | dependencies_t |
template<typename T > | |
using | eval_result_type = boost::optional< T > |
template<typename T > | |
using | built_in_function = std::function< eval_result_type< T >(std::vector< eval_result_type< T > > &)> |
template<typename T > | |
using | mapper_function_map = std::map< std::string, built_in_function< T > > |
Enumerations | |
enum | operator_ids { operator_plus , operator_minus , operator_equals , operator_mult , operator_div , operator_bitand , operator_bitor , operator_bitxor , operator_less_than , operator_greater_than , operator_or , operator_modulo , operator_exponent , operator_neq , operator_less_than_or_eq , operator_greater_than_or_eq } |
Definitions of operators When the parser encounters the string representation of operators, they are parsed into one of the following enums. More... | |
enum | AssignmentType { REGULAR , INSTANCE , CLEARANCE } |
Functions | |
bool | operator== (const nil &a, const nil &b) |
bool | operator== (const operand &a, const operand &b) |
bool | operator== (const signed_ &a, const signed_ &b) |
bool | operator== (const operation &a, const operation &b) |
bool | operator== (const expression &a, const expression &b) |
bool | operator== (const condition &a, const condition &b) |
bool | operator== (const attribute &a, const attribute &b) |
bool | operator== (const attribute_path_subscript &a, const attribute_path_subscript &b) |
bool | operator== (const assignment &a, const assignment &b) |
bool | operator== (const scope_setting &a, const scope_setting &b) |
bool | operator== (const function_invokation &a, const function_invokation &b) |
std::ostream & | operator<< (std::ostream &s, const attribute_dependency_t &d) |
std::ostream & | operator<< (std::ostream &s, const assignment &d) |
std::ostream & | operator<< (std::ostream &s, const attribute &d) |
std::ostream & | operator<< (std::ostream &s, const ast_tree &d) |
template<typename T > | |
eval_result_type< T > | min_value (std::vector< eval_result_type< T > > &results) |
Find the min value of a set of expressions. More... | |
template<typename T > | |
eval_result_type< T > | max_value (std::vector< eval_result_type< T > > &results) |
Find the max value of a set of expressions. More... | |
template<typename T > | |
eval_result_type< T > | average_value (std::vector< eval_result_type< T > > &results) |
Find the average value of a set of expressions. More... | |
template<typename T > | |
eval_result_type< T > | absolute_value (std::vector< eval_result_type< T > > &results) |
Find the absolute value of the first defined expression. More... | |
template<typename T > | |
eval_result_type< T > | are_all_defined (std::vector< eval_result_type< T > > &results) |
Checks if all the expressions are defined (i.e. have a result) More... | |
template<typename T > | |
eval_result_type< T > | is_any_defined (std::vector< eval_result_type< T > > &results) |
Checks if any of the expressions are defined (i.e. have a result) More... | |
template<typename T > | |
eval_result_type< T > | are_all_undefined (std::vector< eval_result_type< T > > &results) |
Checks if all of the expressions are undefined (i.e. do not have a result) More... | |
template<typename T > | |
eval_result_type< T > | is_any_undefined (std::vector< eval_result_type< T > > &results) |
Checks if any of the expressions are defined (i.e. have a result) More... | |
template<typename T > | |
eval_result_type< T > | log10 (std::vector< eval_result_type< T > > &results) |
Computes the log10 of the first defined argument. More... | |
template<typename T > | |
const mapper_function_map< T > & | get_built_in_functions () |
Gets the map of built-in functions, containing names and pointers. More... | |
template const mapper_function_map< float > & | get_built_in_functions () |
bool | check_cyclic_dependencies (const ast::ast_tree &ast, const std::multimap< ast::attribute_dependency_t, ast::assignment > &relations) |
Check if a list of relations contain cyclic dependencies. More... | |
bool | Parse (const std::string &string_to_parse, ast::ast_tree &ast) |
Parse UAM script and build and AST. More... | |
Variables | |
template<typename T > | |
const mapper_function_map< T > | built_in_functions |
using ast::ast_node = typedef boost::variant<ast::scope> |
typedef std::pair<attribute_store_type_t, value_type_t> ast::attribute_dependency_t |
using ast::attribute_path_element = typedef boost::variant<ast::nil, ast::operand, uint32_t, attribute_path_subscript> |
Attribute path element.
This describes one element in an attribute path. This can either be an operand ( like a integer constant ) or a subscript ( 1234[4] )
using ast::built_in_function = typedef std::function<eval_result_type<T>(std::vector<eval_result_type<T> > &)> |
typedef std::vector<attribute_dependency_t> ast::dependencies_t |
using ast::eval_result_type = typedef boost::optional<T> |
using ast::mapper_function_map = typedef std::map<std::string, built_in_function<T> > |
using ast::operand = typedef 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> > |
Operands.
Example <operand1> + <operand2>,
An operand can be made up of various elements. This structure holds the data of one of the operand types together with information about which type the objects actually is.
using ast::scope_settings_t = typedef std::vector<scope_setting> |
Type for Scope settings list.
typedef char ast::value_type_t |
enum ast::AssignmentType |
enum ast::operator_ids |
Definitions of operators When the parser encounters the string representation of operators, they are parsed into one of the following enums.
bool ast::check_cyclic_dependencies | ( | const ast::ast_tree & | ast, |
const std::multimap< ast::attribute_dependency_t, ast::assignment > & | relations | ||
) |
Check if a list of relations contain cyclic dependencies.
relations | reference to relation table |
ast |
const mapper_function_map< T > & ast::get_built_in_functions | ( | ) |
Gets the map of built-in functions, containing names and pointers.
template const mapper_function_map< float > & ast::get_built_in_functions | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
bool ast::operator== | ( | const assignment & | a, |
const assignment & | b | ||
) |
bool ast::operator== | ( | const attribute_path_subscript & | a, |
const attribute_path_subscript & | b | ||
) |
bool ast::operator== | ( | const expression & | a, |
const expression & | b | ||
) |
bool ast::operator== | ( | const function_invokation & | a, |
const function_invokation & | b | ||
) |
bool ast::operator== | ( | const scope_setting & | a, |
const scope_setting & | b | ||
) |
bool ast::Parse | ( | const std::string & | string_to_parse, |
ast::ast_tree & | ast | ||
) |
Parse UAM script and build and AST.
This function is the entry point of the parser, but actual parser logic is defined in attribute_mapper_grammar.hpp
string_to_parse | String to parse |
ast | Output AST |
const mapper_function_map<T> ast::built_in_functions |