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  print
 
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_tattribute_dependency_t
 
typedef std::vector< attribute_dependency_tdependencies_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
 

Typedef Documentation

◆ ast_node

using ast::ast_node = typedef boost::variant<ast::scope>

◆ attribute_dependency_t

◆ attribute_path_element

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] )

◆ built_in_function

template<typename T >
using ast::built_in_function = typedef std::function<eval_result_type<T>(std::vector<eval_result_type<T> > &)>

◆ dependencies_t

◆ eval_result_type

template<typename T >
using ast::eval_result_type = typedef boost::optional<T>

◆ mapper_function_map

template<typename T >
using ast::mapper_function_map = typedef std::map<std::string, built_in_function<T> >

◆ operand

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.

◆ scope_settings_t

using ast::scope_settings_t = typedef std::vector<scope_setting>

Type for Scope settings list.

◆ value_type_t

typedef char ast::value_type_t

Enumeration Type Documentation

◆ AssignmentType

Enumerator
REGULAR 
INSTANCE 
CLEARANCE 

◆ operator_ids

Definitions of operators When the parser encounters the string representation of operators, they are parsed into one of the following enums.

Enumerator
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 

Function Documentation

◆ check_cyclic_dependencies()

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.

Parameters
relationsreference to relation table
ast
Returns
true cyclic dependencies are detected
false cyclic dependencies are not detected.

◆ get_built_in_functions() [1/2]

template<typename T >
const mapper_function_map< T > & ast::get_built_in_functions ( )

Gets the map of built-in functions, containing names and pointers.

Returns
const mapper_function_map

◆ get_built_in_functions() [2/2]

template const mapper_function_map< float > & ast::get_built_in_functions ( )

◆ operator<<() [1/4]

std::ostream & ast::operator<< ( std::ostream &  s,
const assignment d 
)
inline

◆ operator<<() [2/4]

std::ostream & ast::operator<< ( std::ostream &  s,
const ast_tree d 
)
inline

◆ operator<<() [3/4]

std::ostream & ast::operator<< ( std::ostream &  s,
const attribute d 
)
inline

◆ operator<<() [4/4]

std::ostream & ast::operator<< ( std::ostream &  s,
const attribute_dependency_t d 
)
inline

◆ operator==() [1/11]

bool ast::operator== ( const assignment a,
const assignment b 
)

◆ operator==() [2/11]

bool ast::operator== ( const attribute a,
const attribute b 
)

◆ operator==() [3/11]

bool ast::operator== ( const attribute_path_subscript a,
const attribute_path_subscript b 
)

◆ operator==() [4/11]

bool ast::operator== ( const condition a,
const condition b 
)

◆ operator==() [5/11]

bool ast::operator== ( const expression a,
const expression b 
)

◆ operator==() [6/11]

bool ast::operator== ( const function_invokation a,
const function_invokation b 
)

◆ operator==() [7/11]

bool ast::operator== ( const nil a,
const nil b 
)

◆ operator==() [8/11]

bool ast::operator== ( const operand a,
const operand b 
)

◆ operator==() [9/11]

bool ast::operator== ( const operation a,
const operation b 
)

◆ operator==() [10/11]

bool ast::operator== ( const scope_setting a,
const scope_setting b 
)

◆ operator==() [11/11]

bool ast::operator== ( const signed_ a,
const signed_ b 
)

◆ Parse()

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

Parameters
string_to_parseString to parse
astOutput AST
Returns
true If parse was successfull.
false False is parse did not succeed.

Variable Documentation

◆ built_in_functions

template<typename T >
const mapper_function_map<T> ast::built_in_functions
Initial value:
= {
{std::string("min_value"), &min_value<T>},
{std::string("max_value"), &max_value<T>},
{std::string("average_value"), &average_value<T>},
{std::string("absolute_value"), &absolute_value<T>},
{std::string("are_all_defined"), &are_all_defined<T>},
{std::string("is_any_defined"), &is_any_defined<T>},
{std::string("are_all_undefined"), &are_all_undefined<T>},
{std::string("is_any_undefined"), &is_any_undefined<T>},
{std::string("log10"), &log10<T>},
}