Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
binding.cpp File Reference

Implementation of a binding record to represent a match between two patterns. More...

Go to the source code of this file.

Description

Implementation of a binding record to represent a match between two patterns.

This is used for the Advice System, to record existing connections between advice providers and consumers. But as such, Binding is a generic mechanism and looks like it could be of wider use within the Lumiera application. This is the reason why Binding got a separate implementation cpp file.

Definition in file common/advice/binding.cpp.

#include "common/advice/binding.hpp"
#include "lib/symbol.hpp"
#include "lib/util.hpp"
#include <boost/functional/hash.hpp>
#include <boost/lexical_cast.hpp>
#include <regex>

Namespaces

namespace  lumiera
 Lumiera public interface.
 
namespace  lumiera::advice
 
namespace  lumiera::advice::anonymous_namespace{binding.cpp}
 

Functions

 LUMIERA_ERROR_DEFINE (BINDING_PATTERN_SYNTAX, "Unable to parse the given binding pattern definition")
 
regex findPredicate ("\\s*"+matchSym+"("+matchArg+")?\\s*,?")
 sym(arg), groups: [symbol, parenthesis, argument symbol]
 
uint detectArity (smatch const &match)
 detect the arity of an predicate, as matched by findPredicate.
 
bool operator== (Binding const &b1, Binding const &b2)
 bindings are considered equivalent if, after normalisation, their respective definitions are identical.
 

Variables

const string matchSym = "(\\w+(?:[\\.\\-]\\w+)*)"
 
const string matchArg = "\\‍(\\s*"+matchSym+"?\\s*\\‍)"