summaryrefslogtreecommitdiff
path: root/src/lib/eolian_cxx/grammar/class_implementation.hpp
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-06-06 02:54:36 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-06-06 02:54:36 -0300
commit2a3d7860dbc11458425e162cd69ee399e9025251 (patch)
tree84c5b21b644c4cf8806a8eee07b4ed81922c92b4 /src/lib/eolian_cxx/grammar/class_implementation.hpp
parent4d1b3191d94fcc70472552b1bb554984a9cb0288 (diff)
eolian-cxx: Rewrite to accomodate new features of the C++ binding
Diffstat (limited to 'src/lib/eolian_cxx/grammar/class_implementation.hpp')
-rw-r--r--src/lib/eolian_cxx/grammar/class_implementation.hpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/lib/eolian_cxx/grammar/class_implementation.hpp b/src/lib/eolian_cxx/grammar/class_implementation.hpp
new file mode 100644
index 0000000000..a3c1d01f54
--- /dev/null
+++ b/src/lib/eolian_cxx/grammar/class_implementation.hpp
@@ -0,0 +1,56 @@
1#ifndef EOLIAN_CXX_CLASS_IMPLEMENTATION_HH
2#define EOLIAN_CXX_CLASS_IMPLEMENTATION_HH
3
4#include "grammar/generator.hpp"
5#include "grammar/klass_def.hpp"
6
7#include "grammar/string.hpp"
8#include "grammar/indentation.hpp"
9#include "grammar/list.hpp"
10#include "grammar/alternative.hpp"
11#include "grammar/type.hpp"
12#include "grammar/parameter.hpp"
13#include "grammar/function_definition.hpp"
14#include "grammar/namespace.hpp"
15#include "grammar/type_impl.hpp"
16#include "grammar/attribute_reorder.hpp"
17
18namespace efl { namespace eolian { namespace grammar {
19
20struct class_implementation_generator
21{
22 template <typename OutputIterator, typename Context>
23 bool generate(OutputIterator sink, attributes::klass_def const& cls, Context const& ctx) const
24 {
25 return as_generator
26 (
27 (namespaces
28 [*function_definition(get_klass_name(cls))]
29 // << "namespace eo_cxx {\n"
30 // << namespaces
31 // [*function_definition(get_klass_name(cls))]
32 // << "}\n\n"
33 )).generate(sink, std::make_tuple(cls.namespaces, cls.functions), ctx)
34 && as_generator
35 (
36 "namespace eo_cxx {\n"
37 << namespaces
38 [*function_definition(get_klass_name(cls))]
39 << "}\n\n"
40 ).generate(sink, std::make_tuple(cls.namespaces, cls.functions), ctx);
41 }
42};
43
44template <>
45struct is_eager_generator<class_implementation_generator> : std::true_type {};
46
47namespace type_traits {
48template <>
49struct attributes_needed<class_implementation_generator> : std::integral_constant<int, 1> {};
50}
51
52class_implementation_generator const class_implementation;
53
54} } }
55
56#endif