Commit Graph

96 Commits

Author SHA1 Message Date
Daniel Zaoui 0efeeaf1c0 Eolian: modify APIs to return iterators instead of lists.
The change affects the C and the C++ generators.
2014-07-23 13:45:25 +01:00
Savio Sena 721d8ca144 eolian-cxx: Oops. Fixing function_return_is_explicit_void the right way. 2014-07-21 22:56:31 -03:00
Savio Sena b3bd72cd11 eolian-cxx: Handle exclicitly void-return getters.
Whenever a getter explicitly defines a void return the generated code
shall not convert single-parameter getters in any ways.

Actually the correct approach would be to delegate all conversions to
Eolian Database instead of for the generators.
2014-07-21 22:13:54 -03:00
Savio Sena 6e8c063f27 eolian-cxx: Added missing keyword.
Keyword "register" is also used in Elementary.
2014-07-21 21:11:33 -03:00
Savio Sena 07b75b9997 eolian-cxx: Handle C++ keywords in function names.
When function names are C++ keywords append '_' to it.
2014-07-21 20:17:44 -03:00
Felipe Magno de Almeida 7e84cc0154 eo-cxx: Added a few complex types to lookup table 2014-07-18 18:57:14 -03:00
Felipe Magno de Almeida 3abc94696e Fixed type looking up for complex types 2014-07-18 18:57:14 -03:00
Felipe Magno de Almeida 2ff390e087 Changed uses of std::abort to assert's with better description 2014-07-18 18:57:14 -03:00
Savio Sena e807421f60 eolian-cxx: Fixed complex-types. 2014-07-18 18:57:13 -03:00
Savio Sena 5d61edabd8 eolian-cxx: Fixed the translation of classnames 2014-07-18 18:57:13 -03:00
Felipe Magno de Almeida 637a97a0f5 eolian-cxx: Fixed using eo::base for extension_inheritance
Extended the logic for rewriting the eo::base to efl::eo::base for
parents to extension inheritance.
2014-07-18 18:57:13 -03:00
Savio Sena 67e187bebc eolian-cxx: Fixed the translation of the native type. 2014-07-18 18:57:13 -03:00
Savio Sena 78e396ac19 eolian-cxx: Initial version of complex types / callbacks / events implementation. 2014-07-18 18:57:13 -03:00
Tom Hacohen 076d816364 Eolian generator: Disable system dir scan.
This was causing trouble for cross compilation.

Thanks to q66 for the fix and cedric for reporting.
2014-07-17 16:07:57 +01:00
Daniel Kolesa 883c4ca7df eolian: events now use Eolian_Type* instead of stringshare 2014-07-11 11:47:37 +01:00
Daniel Kolesa a26546bc6b eolian: the entire API is now const correct 2014-07-09 21:31:03 +01:00
Daniel Kolesa dc1ea844a7 eolian_cxx: pass everything by ref 2014-07-09 21:02:41 +01:00
Daniel Kolesa 580aea04cd eolian: refactoring step six
Move Eolian_Function as well, plus fix const correctness of several API funcs.
2014-07-09 20:59:31 +01:00
Savio Sena 012b586c8b eolian-cxx: Pass references instead of pointers.
Fix Eolian-Cxx API to pass references instead of pointers.
2014-07-09 15:55:24 -03:00
Daniel Kolesa accdd50f50 eolian: refactoring step five
Move from all instances of Eolian_Type to Eolian_Type*.
2014-07-09 17:18:02 +01:00
Daniel Kolesa 1a4f87d365 eolian: refactoring step four
Move from all isntances of Eolian_Function_Parameter to Eolian_Function_Parameter* plus const fixes.
2014-07-09 17:01:19 +01:00
Daniel Kolesa c9119b0c88 eolian: refactoring step three
Move from all instances of Eolian_Event and Eolian_Implement to Eolian_Event* and Eolian_Implement*.
2014-07-09 16:45:58 +01:00
Daniel Kolesa 96eaaaf074 eolian: refactoring step two
Move from all instances of Eolian_Class to Eolian_Class*.
2014-07-09 16:33:19 +01:00
Daniel Kolesa 5168297fdb eolian: new API: eolian_system_directory_scan, use it 2014-07-07 16:48:54 +01:00
Savio Sena 4e6825d6ac eolian-cxx: Removed Wshadow warnings.
Summary:
Removes Wshadow warnings by prepending/appending radices to
the target variables and parameters.

Reviewers: felipealmeida

CC: cedric

Differential Revision: https://phab.enlightenment.org/D1118
2014-07-04 20:04:32 -03:00
Daniel Kolesa 84451db638 eolian: have eolian_all_classes_list_get instead of eolian_class_names_list_get 2014-07-03 22:12:31 +01:00
Daniel Kolesa a1588f66e5 eolian_cxx: no need to normalize 2014-07-01 16:10:21 +01:00
Savio Sena ce63b16f40 eolian-cxx: Make proper handling of namespaces.
Summary:
The generation of class prefixes was not taking into account the full
classname -- the namespace was not being prepended to it. Fixed that and
also re-organized the code a bit, removed some Wshadow warnings also.

This commit fixes 'make examples' and 'make check'.

Reviewers: tasn, cedric, q66

CC: felipealmeida, smohanty, cedric

Differential Revision: https://phab.enlightenment.org/D1100
2014-07-01 10:55:45 +01:00
Daniel Kolesa 14a85859c5 eolian: _CLASS -> _CLASS/INTERFACE/MIXIN 2014-06-30 21:29:50 +01:00
Daniel Kolesa c05493b480 eolian-cxx: Added namespaces and more (see below)
Implemented namespaces
Added eolian_wrappers.hh with C++ code wrapping Eolain API
Changed eolian_cxx program options. Now they're eolian_gen's
Added functions to safe_str.hh (safe_lower, safe_upper, normalize_spaces, path_base)
Added a mocked version of type_lookup.hh in advance. The full
version will come as soon as complex-types are added.

Made apply again by Daniel Kolesa, original implementation by Savio Sena.
2014-06-30 19:35:06 +01:00
Daniel Kolesa 7b54a0101c eolian: new type API
This new API supports function pointer types, multiple type subtypes, const attribute without parsing
the name string, own attribute for any partial type and more. This commit also updates the C and C++
generators so that they compile and generate correct code.

@feature
2014-06-30 17:20:39 +01:00
Daniel Kolesa 8a82e0fdf4 eolian_cxx: use the new eolian dedup API 2014-06-30 17:20:07 +01:00
Daniel Kolesa 5e5655463c eolian_cxx/generator: support for eot files 2014-06-30 17:20:06 +01:00
Daniel Kolesa cc3809d295 eolian_cxx: support API deduplication like the main generator 2014-06-20 21:11:21 +01:00
Tom Hacohen 26ea65b470 Eolian CXX: Remove unneeded Eo.h include.
Eo.h depends on things that are generated by normal Eolian, and because Eolian C++
is generating code pre-build (WHY THE FUCK???), the dependencies are missing.

This removes the stupid include, but a more proper fix would be to move eolian_cxx
to be part of the build process and not pre-build.
2014-06-03 13:41:38 +01:00
Tom Hacohen 62a3522fcc Eolian cxx: Fix it to use the right class names.
This is following the class name change in normal eolian.
2014-06-03 11:28:01 +01:00
Daniel Zaoui dc3178404f Eolian: modify 'implement' API parameters.
The function eolian_implement_information_get was returning strings for
the class and the function. It was written in this way at the beginning
because it was not needed to verify the correctness of the class and
the function.
Now that we have the namespace feature, this function must check it,
meaning that the class and the function are now known.
So we can return them instead of returning the strings.

The generators had to find the class from the classname. It is no more
needed.

The C++ generator has been adapted to this new API.
2014-05-29 14:48:05 +03:00
Daniel Zaoui a1e72dee0d Eolian/Generator: add support to namespaces.
The C generators now support namespaces generation.
2014-05-26 13:56:06 +03:00
Daniel Zaoui 62082548bc Eolian: modify API to allow future scalability
Until now, the functions giving access to class information were taking
the class name as parameter.
Except the fact that we needed to search into a hash table for the internal
class structure, no flexibility is possible.

This change consists in modifying most of the APIs using the class name
with a new Eolian_Class type and adapt the code of the C and C++
generators accordingly.
2014-05-26 13:56:06 +03:00
Felipe Magno de Almeida 78564fac45 eolian-cxx: fix #include directives generation
Summary: Fix eolian_cxx #include directives generation for relative paths

Reviewers: cedric, stefan, stefan_schmidt

CC: cedric, savio

Differential Revision: https://phab.enlightenment.org/D833

Signed-off-by: Cedric Bail <cedric.bail@free.fr>
2014-05-09 12:39:49 +02:00
Savio Sena 95f5c11703 eolian_cxx: fix install-examples and (post-install) compilation.
Summary:
This patch fixes T1226 by adding a Makefile.examples to
examples/eolian_cxx. It also fixes a bug in bin/eolian_cxx: the
include paths were not being correctly generated for directories
outside EFL tree.

Reviewers: cedric, smohanty, stefan_schmidt, stefan

CC: uartie, wayland-efl, felipealmeida, raster, woohyun, cedric

Maniphest Tasks: T1226

Differential Revision: https://phab.enlightenment.org/D824

Signed-off-by: Cedric Bail <cedric.bail@free.fr>
2014-05-07 23:40:46 +02:00
Daniel Zaoui 935db516b2 Eolian_CXX: Fix generation warnings.
Since there was a bug in Eolian (Spank on you Savio that you didn't tell
me :-)), the cxx generator needed some workaround that is no more
mandatory now.
2014-05-07 09:13:25 +03:00
Savio Sena e61004e30f eolian_cxx: remove warnings from bin and lib.
Reviewers: cedric, smohanty, stefan_schmidt, stefan

CC: felipealmeida, cedric

Differential Revision: https://phab.enlightenment.org/D826

Signed-off-by: Cedric Bail <cedric.bail@free.fr>
2014-05-07 00:18:43 +02:00
Savio Sena 2fdc88b33a eolian-cxx: Fixed the generation .eo.h path.
Summary: This patch fixes T1225

Reviewers: uartie

CC: uartie, wayland-efl, felipealmeida, cedric, smohanty, raster, stefan_schmidt, stefan, woohyun

Maniphest Tasks: T1225

Differential Revision: https://phab.enlightenment.org/D821
2014-05-05 13:09:28 -07:00
Felipe Magno de Almeida 8149823897 eolian-cxx: fix make distcheck and automake files for Eolian C++
Summary:
Fixed distcheck for Eolian C++. Made the generated files as
nodist so it doesn't get picked up for generation way too
early.

Reviewers: cedric, seoz

CC: cedric

Maniphest Tasks: T1220

Differential Revision: https://phab.enlightenment.org/D820

Signed-off-by: Cedric Bail <cedric.bail@free.fr>
2014-05-04 12:21:30 +02:00
Savio Sena 46b6e8a563 eolian_cxx: initial version of the EFL C++ Bindings Generator.
Summary:
This patch adds 'eolian_cxx' -- a C++ bindings generator --
to the EFL tree. Eolian Cxx uses Eolian API to read .eo files and generate
.eo.hh. It relies/depends on Eo Cxx and Eina Cxx (both non-generated
bindings).

src/bin/eolian_cxx: The eolian_cxx program.
src/lib/eolian_cxx: A header-only library that implements the C++ code
generation that binds the .eo classes.

=Examples=

src/examples/eolian_cxx/eolian_cxx_simple_01.cc: The simplest example,
it just uses some "dummy" generated C++ classes.

src/examples/eolian_cxx/eolian_cxx_inherit_01.cc: Illustrates how
pure C++ classes inherit from .eo generated classes.

src/examples/evas/evas_cxx_rectangle.cc: More realistic example using
the generated bindings Evas Cxx. Still a bit shallow because we don't
have full fledged .eo descriptions yet, but will be improved.

=Important=

The generated code is not supported and not a stable API/ABI. It is
here to gather people interest and get review before we set things in
stone for release 1.11.

@feature

Reviewers: cedric, smohanty, raster, stefan_schmidt

CC: felipealmeida, JackDanielZ, cedric, stefan

Differential Revision: https://phab.enlightenment.org/D805

Signed-off-by: Cedric Bail <cedric.bail@free.fr>
2014-05-03 00:56:32 +02:00