76#ifndef LIB_DIFF_DIFF_LANGUAGE_H
77#define LIB_DIFF_DIFF_LANGUAGE_H
100 template<
class I,
typename E>
113 template<
template<
typename>
class IP,
typename E>
121 template<
class I,
typename E>
146 template<
class I,
typename E>
158 E
const&
elm() {
return std::get<1>(*
this); }
164 operator string()
const
166 return string(unConst(
this)->
verb())
167 +
"("+string(unConst(
this)->
elm())+
")";
174 verb().applyTo (interpreter,
elm());
217 inline DiffStepBuilder<typename InterpreterScheme<H>::Interpreter>
220 return { handlerFun,
id };
233#define DiffStep_CTOR(_ID_) \
234 const DiffStepBuilder<Interpreter> _ID_ = diffTokenBuilder (&Interpreter::_ID_, STRINGIFY(_ID_));
241 template<
class I,
typename E>
268 template<
class TAR,
typename SEL =
void>
302 for ( ; diff; ++diff )
304 target_.completeDiffApplication();
generic builder to apply a diff description to a given target data structure.
DiffApplicationStrategy< TAR > Interpreter
DiffApplicator(TAR &targetStructure)
void consume(DIFF &&diff)
Any copy and copy construction prohibited.
#define LUMIERA_ERROR_DECLARE(err)
Forward declare an error constant.
Lumiera error handling (C++ interface).
TreeDiffLanguage::DiffStep DiffStep
HandlerFun< I, Val > Handler
DiffStepBuilder< typename InterpreterScheme< H >::Interpreter > diffTokenBuilder(H handlerFun, Literal id)
set up a diff language token generator, based on the specific handler function given.
HandlerFun< I, E > Handler
void(I::*)(E const &) HandlerFun
HandlerFun< Interpreter, Val > Handler
Extension point: define how a specific diff language can be applied to elements in a concrete contain...
< base case is to expect typedef I::Val
Implementation namespace for support and library code.
Action token implemented by double dispatch to a handler function, as defined in the "receiver" inter...
Lumiera public interface.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
DiffStep(DiffVerb verb, E e)
void applyTo(Interpreter &interpreter)
Definition frame for a language to describe differences in data structures.
VerbToken< I, void(E const &)> DiffVerb
std::tuple< DiffVerb, E > DiffToken
static const DiffStep NIL
fixed "invalid" marker token
generator to produce specific language tokens
InterpreterScheme< I > Scheme
DiffLanguage< I, Val > Lang
Step operator()(Val elm) const
CStr cStr(std::string const &rendered)
convenience shortcut: forced conversion to c-String via string.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Building blocks for a simple DSL using double dispatch to a handler function.