summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSavio Sena <savio@expertisesolutions.com.br>2014-07-24 16:00:10 -0300
committerSavio Sena <savio@expertisesolutions.com.br>2014-07-24 19:52:23 -0300
commitbd68d29968533ba5a5fd81bce8257486c46ec092 (patch)
treecd50de3ec0d8a779de72c6bd141dfe36ef30d987
parent425f220f92db35d709ff3ef4d0692c70905f00fe (diff)
eolian-cxx: Added grammar rule parameters_cxx_list.
Now with the correct semantics: list parameters converting to C++.
-rw-r--r--src/lib/eolian_cxx/grammar/inheritance_base_generator.hh2
-rw-r--r--src/lib/eolian_cxx/grammar/parameters_generator.hh10
2 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/eolian_cxx/grammar/inheritance_base_generator.hh b/src/lib/eolian_cxx/grammar/inheritance_base_generator.hh
index 5c32498ea6..12f6550d97 100644
--- a/src/lib/eolian_cxx/grammar/inheritance_base_generator.hh
+++ b/src/lib/eolian_cxx/grammar/inheritance_base_generator.hh
@@ -111,7 +111,7 @@ operator<<(std::ostream& out, inheritance_wrappers const& x)
111 << tab(1) 111 << tab(1)
112 << (!function_is_void(func) ? "return ": "") 112 << (!function_is_void(func) ? "return ": "")
113 << "static_cast<T*>(self->this_)->" 113 << "static_cast<T*>(self->this_)->"
114 << func.name << "(" << parameters_c_list(func.params) << ");" << endl 114 << func.name << "(" << parameters_cxx_list(func.params) << ");" << endl
115 << "}" << endl << endl; 115 << "}" << endl << endl;
116 } 116 }
117 return out; 117 return out;
diff --git a/src/lib/eolian_cxx/grammar/parameters_generator.hh b/src/lib/eolian_cxx/grammar/parameters_generator.hh
index 12c09b6560..f25c6d0b4e 100644
--- a/src/lib/eolian_cxx/grammar/parameters_generator.hh
+++ b/src/lib/eolian_cxx/grammar/parameters_generator.hh
@@ -154,6 +154,16 @@ parameters_cxx_list
154inline std::ostream& 154inline std::ostream&
155operator<<(std::ostream& out, parameters_cxx_list const& x) 155operator<<(std::ostream& out, parameters_cxx_list const& x)
156{ 156{
157 auto first = x._params.cbegin(), last = x._params.cend();
158 for (auto it = first; it != last; ++it)
159 {
160 if (it != first)
161 out << ", ";
162 out << to_cxx(it->type, it->name);
163 }
164 return out;
165}
166
157struct 167struct
158constructor_parameters_list 168constructor_parameters_list
159{ 169{