#ifndef EOLIAN_CXX_ATTRIBUTE_REPLACE_HH #define EOLIAN_CXX_ATTRIBUTE_REPLACE_HH #include "grammar/generator.hpp" namespace efl { namespace eolian { namespace grammar { template struct functional_attribute_replace_generator { template bool generate(OutputIterator sink, Attribute const& attribute, Context const& ctx) const { return as_generator(g).generate(sink, f(attribute), ctx); } F f; G g; }; template struct is_eager_generator> : std::true_type {}; template struct functional_attribute_replace_directive { template functional_attribute_replace_generator operator[](G g) const { return {f, g}; } template bool generate(OutputIterator, Attribute const& attribute, Context const&) const { return f(attribute); } F f; }; template struct is_eager_generator> : std::true_type {}; struct attribute_replace_terminal { template functional_attribute_replace_directive operator()(F f) const { return {f}; } } const attribute_replace = {}; namespace type_traits { template struct attributes_needed> : attributes_needed {}; template struct attributes_needed> : std::integral_constant {}; } } } } #endif