Commit Graph

405 Commits

Author SHA1 Message Date
Daniel Kolesa 69857d7f7c eolian/generator: fix memory leak 2015-05-26 17:25:11 +01:00
Daniel Kolesa a7dea04b26 eolian: merge eo_file_parse and eot_file_parse 2015-05-22 17:32:21 +01:00
Daniel Kolesa 54974b074b eolian: remove const_get/const_set support
This was made obsolete by per-accessor values. It was
also hacky and i've wanted to remove it for a while.
2015-05-20 18:05:45 +01:00
Daniel Kolesa 5c199857c9 eolian: distinguish between get/set for property keys/values retrieval 2015-05-20 17:03:37 +01:00
Daniel Kolesa a22ac701b6 eolian: use eolian_property_values_get correctly 2015-05-20 16:39:17 +01:00
Daniel Zaoui e41d1f2cb4 Eolian/Generator: support eot files 2015-05-20 10:37:07 +03:00
Daniel Kolesa 1b47e2e013 eolian: use data_type consistently in the C generator
This change makes it use full class name everywhere (instead of just class name).

@fix
2015-05-19 17:46:11 +01:00
Daniel Kolesa 72dcd2da03 eolian: add a functional "import" statement 2015-05-19 15:26:53 +01:00
Daniel Kolesa 957a89168b eolian: precompute all enum field values (faster runtime, constness) 2015-05-13 18:10:02 +01:00
Daniel Kolesa d2365e6267 eolian: allow forced retrieval of enum field values 2015-05-13 17:57:03 +01:00
Daniel Kolesa 894a1e3cfd eolian: check inherit validity before using it 2015-05-13 13:45:01 +01:00
Daniel Kolesa 01b3803931 eolian: remove unneeded cruft (struct/enum cannot be a base for alias) 2015-05-13 11:26:24 +01:00
Daniel Kolesa ec73644cb6 eolian: generate underscored structs as well as correct opaque struct typedefs 2015-05-13 11:14:49 +01:00
Daniel Kolesa ed58165b50 eolian: butts 2015-05-12 16:25:52 +01:00
Daniel Kolesa 8920a69284 eolian: generation for beta events 2015-05-08 14:45:10 +01:00
Daniel Kolesa f0e40d2c55 eolian: oops... forgot to add a param 2015-05-08 14:23:23 +01:00
Daniel Kolesa 5726cf3b0f eolian: beta funcs generation 2015-05-08 14:19:02 +01:00
Daniel Zaoui b0da753aaa Eolian/Generator: fix enums generation
Typedef word was not generated for enums. Camel case was not respected
for type definition.
Tests have been updated to check enums generation.

@fix T2400
2015-05-07 09:57:23 +03:00
Daniel Kolesa da3684b9bc eolian: actually these should be marked EAPI 2015-04-28 14:18:57 +01:00
Daniel Kolesa 9141298792 eolian: mark _class_get func protos with EOAPI
this is necessary to properly export the funcs on Windows. @fix
2015-04-28 14:12:18 +01:00
Tom Hacohen f62374b08a Eolian generator: remove unusued variable. 2015-04-22 13:03:17 +01:00
Daniel Kolesa 5288b73d5c eolian/generator: use a temporary variable for return in legacy impls
This is so that portability updates to eo_do can be done.
2015-02-23 15:30:59 +00:00
Daniel Zaoui dedd8cef64 Eolian/Generator: support common descriptions for properties. 2014-10-19 13:25:06 +03:00
Daniel Zaoui 503e309e7e Eolian/Generator: Update to use Eolian API.
We now use the Eolian library to retrieve the name of the C function used
to get the Eo_Class pointer (e.g evas_object_class_get).
2014-10-02 13:48:52 +03:00
Daniel Kolesa 8631212e45 eolian: remove the need to pass prefix to eolian_function_full_c_name_get 2014-09-25 15:37:18 +01:00
Daniel Kolesa 13a9650491 eolian: properly replace commas in event_c_name_get and cleanup generator 2014-09-25 15:09:36 +01:00
Daniel Kolesa a1552fe6a9 eolian: new API: eolian_event_c_name_get 2014-09-25 14:58:53 +01:00
Mike Blumenkrantz 5375e154fe fix config.h inclusion across the tree 2014-09-23 15:56:46 -04:00
Jérémy Zurcher cbcb8e29ec eolian: silence uninitialized var in goto end branch 2014-09-23 10:56:57 +02:00
Daniel Zaoui 56bad2beb0 Eolian/Generator: support @empty and @auto.
Local and base class functions are supported.
When @empty is provided, dummy functions (initializing the parameters with default
values if needed) are generated.
When @auto is provided on properties, access to internal data variables is done. On
set, it will assign parameters values to private data members. On get,
parameters are set with private data members values.

See the supplied tests as examples.

@feature
2014-09-08 10:11:01 +03:00
Daniel Kolesa dff8d56475 eolian: use implements only to retrieve functions list
This also changes the implements list so that it also includes virtual functions.
2014-09-05 11:54:29 +01:00
Daniel Kolesa e75ded5e3f eolian: prepare for implements list expansion
As the implements list will soon contain all methods and properties,
do some preparations. The Eolian library now fills in class field in
implements early on when the implement is local. The Eolian C generator
now checks for local implements and skips them (so that things don't break).
2014-09-04 15:03:00 +01:00
Daniel Zaoui ffa9ad7daf Eolian/Generator: support params initialization.
This is needed when get properties or methods have to return a
value in case of failure or to initialize parameters.
The way used is to generate an intermediate function that will
initialize the parameters and then invoke the "user" function.
2014-09-03 08:36:20 +03:00
Daniel Kolesa 4785353baf eolian: APIs to check if an implement references get/set 2014-08-29 15:30:51 +01:00
Daniel Kolesa 14d67f31d0 eolian: use EINA_C_ARRAY_LENGTH 2014-08-28 09:55:41 +01:00
Daniel Kolesa 1eb870e3d3 eolian/generator: use size of the array instead of fixed int 2014-08-28 09:49:57 +01:00
Carsten Haitzler 94f9d106c8 eolian generator - fix num of types handled
there are only 2 types in the ftype array... not 3!

fix CID 1232782
2014-08-28 08:45:09 +09:00
Daniel Kolesa 1a76690abf eolian/generator: remove support for custom constructors 2014-08-27 15:43:47 +01:00
Daniel Kolesa 901d1343fd eolian: no need to concat name in this case 2014-08-27 11:38:26 +01:00
Carsten Haitzler 0c99a2f156 eolian - fix possible leak of name string
fixes CID 1232734
2014-08-27 11:25:40 +09:00
Daniel Kolesa d09262b011 eolian: stub header generator
This adds functionality into eolian_gen to generate a "stub header".
The main use for this is to deal with cyclic dependencies between Eo files.
2014-08-26 17:10:14 +01:00
Daniel Kolesa c562b38588 eolian: properly get the legacy attribute of a method/property 2014-08-22 17:01:36 +01:00
Daniel Kolesa b75014a024 eolian: refactor the struct/enum field APIs 2014-08-22 16:56:41 +01:00
Daniel Kolesa f35b5e35df eolian: guard eo types in legacy headers 2014-08-22 14:40:01 +01:00
Daniel Kolesa 19d8209266 eolian: clean up type generation + fix function pointers 2014-08-22 14:04:22 +01:00
Daniel Kolesa 189bc4512d eolian: fix type generation for function pointers 2014-08-22 13:45:20 +01:00
Daniel Kolesa cdd4860520 eolian: turn db validation into separate API 2014-08-21 16:35:59 +01:00
Daniel Kolesa fce1e61ff5 eolian: fix shadow warnings 2014-08-21 09:26:06 +01:00
Daniel Kolesa 423cfb5f61 eolian/generator: support for legacy-only functions 2014-08-21 09:26:05 +01:00
Daniel Kolesa e6954d143d eolian: drop Eina_Value
Because of Eina_Value being less than optimal in our usage, we're dropping it in Eolian.
This simplifies the code and makes it easier to bind to other languages, which
will aid new generators. Also, we're dropping long double support from eo files
and expressions as it causes an ABI breakage in gcc 4.4.
2014-08-21 09:26:05 +01:00
Daniel Kolesa 913e0f09fa eolian: get rid of the data hash in Eolian_Function 2014-08-21 09:26:05 +01:00
Daniel Kolesa 1688749ce9 eolian: add support for opaque struct types (+ tests) 2014-08-21 09:26:05 +01:00
Daniel Kolesa 2df5eae338 eolian/generator: support for private and protected events 2014-08-21 09:26:04 +01:00
Daniel Kolesa 93726c86a3 eolian: get rid of eolian_parameter_information_get 2014-08-21 09:26:04 +01:00
Daniel Kolesa ad3dbe834b eolian: API refactoring
Remove eolian_implement_information_get. Also, fix some nasty lookup problems.
2014-08-21 09:26:04 +01:00
Daniel Kolesa 057e01d67f eolian: API refactoring
Start getting rid of the terrible _information_get APIs, starting with events.
2014-08-21 09:26:04 +01:00
Daniel Kolesa ffbf149da1 eolian: new API: eolian_class_event_scope_get 2014-08-21 09:26:04 +01:00
Daniel Kolesa a5964f0252 eolian: add comments containing original expressions to generated enum fields
This required a new API, eolian_expression_serialize.
2014-08-21 09:26:04 +01:00
Daniel Kolesa 18c2b5082e eolian: allow usage of stack Eina_Value in expr API 2014-08-21 09:26:04 +01:00
Daniel Kolesa 732e3f417e eolian: new API: eolian_type_enum_legacy_prefix_set + generator changes
This change adds a new API to retrieve the legacy prefix for enum members
and also adds support for generating enums into the C generator. Besides that,
it prevents generation of entire struct contents when the .eo file declares
a named struct inside of a typedef - as the struct itself gets generated later on.
2014-08-21 09:26:04 +01:00
Daniel Kolesa 2e3887b994 eolian: struct/enum fixes and initial test for enums 2014-08-21 09:26:04 +01:00
Daniel Kolesa 8c1b9ed3e2 eolian: initial API for expression evaluation
This commit also does several side (related) changes. Particularly, it updates
the Eolian C generator to use the new API, it adds missing expr types (null, char)
and masks, updates the API dealing with default return values to use expressions
instead of strings and does several fixes (mainly in lexer) around the place.
It also disallows single quoted strings as those are reserved for characters.
2014-08-21 09:26:03 +01:00
Daniel Kolesa 520275c66b eolian: use newly created implicit typedefs in legacy API
Also update tests accordingly.
2014-08-21 09:26:03 +01:00
Daniel Kolesa bb24b60638 eolian: generate implicit typedef for each class
And use these typedefs instead of just Eo in API.
2014-08-21 09:26:03 +01:00
Carsten Haitzler c77accc0b9 eolain impl generator - fix possible null access
fix CID 1231994
2014-08-20 09:05:58 +09:00
Carsten Haitzler 2574f1578a eolian - warning-- for eolian impl generator 2014-08-18 14:56:53 +09:00
Carsten Haitzler d444e8f5f3 eolain_gen - fix implementation generation - it didn't even compile
so the test suites were useless because they didn't ecompile what was
generated. it was missing a ) at the end of calling eo_do_super to
start with. it was missing a call to do_uper fo destructors too. also
it didnt deal with the #include "blah.eo.c" at the file end either so
it produced uncompilable src at the start. again - also fix. this also
fixes test case comparisons to match the now correct generation that
compiles.
2014-08-16 13:09:17 +09:00
Daniel Zaoui 99888ceaec Eolian/Generator: fix generation of class functions.
The generation for legacy was missing. The patch removes too the EINA_UNUSED
flag for static functions data.
2014-08-07 16:06:22 +03:00
Daniel Kolesa 8c677a1f0e eolian: fread fix
Instead of 1 element of size N, we should read N elements of size 1 in
order to sensibly compare the result with the result of calling ftell.
2014-08-04 10:56:35 +01:00
Daniel Kolesa 91bf465d52 eolian/generator: coverity fix
Fixes CID 1229130 (ignoring number of bytes read)
2014-08-04 09:59:36 +01:00
Daniel Kolesa 64c2b292ba eolian: preliminary eo file support for builtin true/false/null
Real API will use the new expression system, but that won't get into 1.11.
2014-07-28 10:16:15 +01:00
Daniel Kolesa 58a9de0309 eolian/generator: properly generate the data arg on class methods
For class methods, we need to generate unused void*, not a pointer to data struct.
2014-07-24 15:32:34 +01:00
Daniel Kolesa 178022ab65 eolian/generator: add support for class methods/properties 2014-07-24 12:15:55 +01:00
Daniel Zaoui 805d746910 Eolian: Generate typedefs and structs.
This patch permits the generation of typedefs and structs in the
legacy and Eo header files. It includes tests.
2014-07-24 11:59:34 +03:00
Daniel Zaoui fe3602b0d8 Eolian: little refactoring of the C generator.
This change is a preparation for the generation of the types and a
little cleaning.
2014-07-24 11:59:34 +03:00
Daniel Kolesa 0c3487cd3d eolian/generator: fix coverity issues
Fixes CID 1228663 and 1228634.
2014-07-24 00:32:06 +01:00
Daniel Kolesa a3182948ad eolian: use libgen.h basename 2014-07-23 19:37:03 +01:00
Daniel Kolesa 315d5de11d eolian: use just filename (not path) for eolian_class_get_by_file 2014-07-23 17:15:00 +01:00
Daniel Kolesa 88cc1167e9 eolian: eolian_parameters_get -> eolian_function_parameters_get 2014-07-23 14:17:19 +01:00
Daniel Kolesa fd0210f30e eolian: list_get -> get, find_by -> get_by 2014-07-23 14:13:21 +01:00
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
Daniel Zaoui 48d0570786 Eolian/Generator: simplify eo_do invocation.
Since eo_do returns the Eo operation result, we can generate:
{
   return eo_do(obj, ...);
}
instead of:
{
   int ret;
   eo_do(obj, ret = ...);
   return ret;
}
2014-07-22 13:44:51 +03:00
Daniel Kolesa 3b8a03cf7b eolian/generator: remove check_same 2014-07-21 17:13:43 +01:00
Daniel Kolesa a19adb71b9 eolian/generator: add code to check if the newly generated output is the same as old output - disabled for now because of build system issues 2014-07-21 16:00:57 +01: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 5d4cc031f9 eolian: s/dflt/default/g 2014-07-11 14:30:22 +01:00
Daniel Kolesa 888dc3b6fe eolian: remove eolian_show and replace it with variants for class/struct/typedef/all. 2014-07-11 13:10:04 +01:00
Daniel Kolesa a26546bc6b eolian: the entire API is now const correct 2014-07-09 21:31:03 +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
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 892c5cba5f eolian: fix coverity defects 2014-07-09 10:19:42 +01:00
Daniel Kolesa 53fb9515e9 eolian/generator: add asterisk on inout too 2014-07-08 14:15:36 +01:00
Daniel Kolesa 5168297fdb eolian: new API: eolian_system_directory_scan, use it 2014-07-07 16:48:54 +01:00
Daniel Kolesa dd22cf8148 eolian/generator: shadow fix 2014-06-30 21:53:08 +01:00
Daniel Kolesa 14a85859c5 eolian: _CLASS -> _CLASS/INTERFACE/MIXIN 2014-06-30 21:29:50 +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 c0576cee73 eolian: new API: eolian_function_full_c_name_get - reduces duplication of code 2014-06-30 17:20:06 +01:00
Daniel Kolesa 7a8ef6d02a eolian: introducing support for .eot files
.eot files are similar to .eo, but they can't contain classes; all .eot files found in include paths
are parsed and information is added into the database. They're there for typedefs and eventually also
enums, structs and constants.

@feature
2014-06-30 17:20:06 +01:00
Daniel Kolesa 43e2349203 eolian/generator: public api func name deduplication, spank tasn if it breaks 2014-06-20 17:09:03 +01:00
Daniel Kolesa 74181192ad eolian: fix error handling and memory leaks 2014-06-19 16:04:08 +01:00
Daniel Zaoui 2160d0f27a Eolian/Generator: use a specific define for the Eo APIs.
The generation of EOAPI instead of EAPI for the Eo functions is only
needed for code readibility.
2014-06-10 07:57:09 +03:00
Daniel Zaoui 4c1cf87419 Eolian/Generator: Fix comments generation.
This patch:
- removes the @def from Doxygen, as it is not correct for API
functions.
- fixes the generation of class comments. When no class description is
supplied, no comment should be added.
2014-06-09 10:09:15 +03:00
Daniel Zaoui 233650ed9d Eolian/Generator: concentrate the function name calculation to one
place.

Instead of having the calculation (class name + function name + set/get)
in many places in the code, it is now in one place and accessible via a
function environment structure.
2014-06-08 12:41:18 +03:00
Daniel Zaoui fc2a983ab9 Eolian/Generator: remove unused code.
The removed code was needed for Eo1 and is no more necessary.
2014-06-08 12:40:42 +03:00
Daniel Zaoui e7faaf9fc5 Eolian/Generator: Fix Windows issue during string manipulation.
For Windows, it is simpler to replace all the \r\n with \n after having
read the file.
2014-06-05 11:34:44 +03:00
Daniel Zaoui 5c55ce49e6 Eolian: rename internal files.
This files were needed to be renamed a long time ago :-)
2014-06-05 10:11:13 +03:00
Daniel Zaoui 97913753ea Eolian: Fix Coverity issue.
In a certain case, the function was returning without releasing all the
resources.

CID 1220084
2014-06-05 07:40:26 +03:00
Guillaume Friloux 732f1c2a1b Fix gcc warning about uninitialized variable. 2014-06-03 16:37:50 +02:00
Daniel Zaoui 03647b4279 Eolian: Use class name and not prefix in the class macro.
So for example a class called Eo_Base with prefix: eo, used to be
generated to EO_CLASS instead of EO_BASE_CLASS.
2014-06-03 11:26:58 +01:00
Daniel Zaoui 7a83c9c659 Eolian: Fix bad behavior when the .eo is incorrect
In this case, the section 'implements' contains bad information about the
function to override. If the first (at least) function is correct, it
will never fail but use the last correct information retrieved from the
database.
The patch fixes it by checking the result of the database function
eolian_implement_information_get.

@fix
2014-06-03 08:58:05 +03: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 fb6209f083 Eolian: modify generators to use internal variables environment. 2014-05-29 10:04:01 +03:00
Daniel Zaoui d9e177e61b Eolian: add the super invocation for developer code generation.
Now the eo_do_super is invoked for constructors overridding in a
inheriting class.
2014-05-29 10:03:45 +03:00
Daniel Zaoui cb499ab28e Eolian: Add an internal environment for class variables.
To reduce the invocations to strings conversions, we store the
classname, the Eo prefix in upper and lower cases in global variables.
The problem comes when we have to handle overriding functions. A lot of
conflicts between class base and class inheriting can happen.

The chosen solution is to create independent environments storing the
converted strings.
2014-05-29 09:58:27 +03:00
Daniel Zaoui b10a1b11f1 Eolian: fix coverity issues.
CID 1216274
CID 1216275
CID 1216276
CID 1216277
CID 1216278
CID 1216279
CID 1216280
2014-05-27 08:22:40 +03:00
Daniel Zaoui 0b33a142b1 Eolian: fix generation when optimization is set.
When using -O2 or -O3, the Eina_Bool legacy_support (unsigned char) was
overriding the int eo_needed.

The result was a failure during options check:
Eo flag is not specified (use --eo). Aborting eo generation.

@fix
2014-05-26 15:37:33 +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
Daniel Zaoui 04cc813813 Eolian: add test for generator.
The test checks the dev code generator.
2014-05-26 13:56:06 +03:00
Daniel Zaoui a541aecf76 Eolian/Generator: add support for implementation source file.
By using -gi option, the generator appends the functions that are
present into the given eo file and missing into the developer file
(given via -o option as an in/out file).

@feature
2014-05-26 13:56:06 +03:00
Daniel Zaoui 0782e96c36 Eolian/Generator: fix the class description generation.
The class description was not used during the generation of the legacy
and Eo headers.
2014-05-14 14:52:58 +03:00
Daniel Zaoui 9cd038fb36 Eolian: Fix Coverity issue CID1210805.
The list is not used anymore so it can be removed.
2014-05-04 07:41:46 +03:00
Daniel Zaoui 7f90088232 Eolian/Generator: only requests .eo files parsing when needed.
Before this change, all the .eo files of the directories given with -I
option were parsed. Most of this information was not necessary at all,
since only the classes belonging to the inheritance of the class given
as parameter were needed.
Now, during the parsing of the given class, the inherits classes are
searched and parsed.

A condition is needed to make it work well. To find a filename for a
class, we consider the lowercase of the class name as the filename we
have to parse.
e.g, Elm_Button -> elm_button -> elm_button.eo

It considerably reduces the generation time.

A fix in the tests was needed.
2014-04-27 10:03:39 +03:00
Daniel Zaoui e42b68534b Eolian: remove --eo1 support totally 2014-04-27 08:04:00 +03:00
Daniel Zaoui f36fac8ec6 Eolian: Remove useless functions.
Default ctor/dtor are considered as implemented functions and no more as
special functions.
2014-04-23 16:28:33 +03:00
Yossi Kantor 026d7210c6 Eolian: Space after const missing in function parameters of legacy header 2014-04-23 10:35:04 +03:00
Daniel Zaoui 5ea1ffac5b Eolian/Generator: support --eo.
--eo1 is still supported but it will be removed soon.
2014-04-23 08:55:15 +03:00
Daniel Zaoui 60fb57a3e5 Eolian/Generator: Fix coverity issues.
Fix CID 1203409
Fix CID 1203410
2014-04-18 09:05:20 +03:00
Daniel Zaoui 38b993c29b Eolian/Generator: remove Eo1 generation 2014-04-17 15:50:22 +03:00
Daniel Zaoui fc9682bd7f Eolian: fix generation of Eo2 functions definitions.
When keys are used in property, the Eo2 macro was not well chosen.
2014-04-13 11:30:39 +03:00
Mike Blumenkrantz bdb8542e3b eolian no longer generates return statements for void functions 2014-04-11 10:33:20 -04:00
Daniel Zaoui 1a48d11fb9 Eolian: Fix generation of Eo APIs.
When return is forced to void, even if the function contains only
one parameter, the return type will be void.
2014-04-10 11:24:04 +03:00
Tom Hacohen 2b34ab4cf7 Eolian: Generate Eo2. 2014-04-10 04:20:21 +01:00
Daniel Zaoui 87776ff0fa Eolian: add support for functions scope.
This patch adds support for protected functions.

In the .eo file, the scope (public by default) has to be added before
the function name e.g:
protected foo ...

To access the protected APIs, #define (CLASS)_PROTECTED is needed e.g:
 #define ELM_BUTTON_PROTECTED
2014-04-10 05:55:16 +03:00
Daniel Zaoui bbba6a20b4 Eolian: generation of Eo2.
The generation of Eo2 can be enabled by defining EO flag in
common_funcs.h.
2014-04-10 04:20:02 +03:00
Yossi Kantor bff7e65d24 Eolian: Legacy generator generates const return value for legacy header if needed 2014-04-09 04:08:57 +03:00
Yossi Kantor b437457657 Eolian: Legacy generator - no semicolon after EINA_WARN_UNUSED_RESULT 2014-04-09 04:08:57 +03:00
Yossi Kantor 01c1626977 Eolian: Fix legacy generation.
Semicolon was misplaced when function flags are needed.
2014-04-08 09:33:01 +03:00
Daniel Zaoui 912409df3c Eolian: rename enums.
Add the EOLIAN namespace to the function types.
2014-04-08 04:27:01 +03:00
Daniel Zaoui 0eb092d157 Eolian/Lexer: support data type for events. 2014-04-02 14:27:12 +03:00
Daniel Zaoui f2b857dcb3 Eolian: fix warnings. 2014-04-02 10:08:27 +03:00
Daniel Zaoui bddee1554f Eolian/Generator: don't generate legacy if legacy_prefix is "null".
For new classes that don't need legacy, instead of setting legacy null
for all the functions, legacy_prefix can be set to "null" to not
generate legacy.
However, if, for example, only one function among 50 need legacy, you
can specify it by setting for this function the legacy token.
2014-04-02 10:05:37 +03:00
Yossi Kantor 277c3e2ef3 Eolian: Explicit generation of either method or property in implemented functions 2014-04-02 10:05:37 +03:00
Daniel Zaoui 9780b403ee Eolian: Proper use of legacy prefix in legacy function definition. 2014-04-01 16:36:59 +03:00
Yossi Kantor dfaa1d5722 Eolian: Legacy generator - dont generate @param[out] ret if return value is specified 2014-04-01 16:32:35 +03:00
Yossi Kantor 5c6a6b586a Eolian: No need for --eo version when generating legacy header 2014-04-01 16:32:35 +03:00
Mike Blumenkrantz 7c018bba0d eolian should use "wb" for file opening to not break windows use 2014-03-28 16:39:52 -04:00
Daniel Zaoui fd25b44cab Eolian: extend const attributes for parameters to 'set' properties.
When const is used for parameters into 'set' properties, the generator
doesn't prepend 'const'.
This fixes this bad behavior.
2014-03-27 15:19:22 +02:00
Daniel Zaoui eb65cac12d Eolian/Generator: enable forcing return type as void.
For get properties, if only one parameter is given, the generator sets this one as return type.

There are cases where this parameter must stay a parameter (legacy API).

For example, elm_thumb_compress_get must be like:
void elm_thumb_compress_get(const Eo *obj, int *compress).
Eolian was generating the function as:
int elm_thumb_compress_get(const Eo *obj);

By setting "return void;" in the .eo file, you force the function to
return void.
2014-03-27 13:15:02 +02:00
Daniel Zaoui c863154a79 Eolian: fix virtual pure support.
When a property needs be defined as virtual pure, its type could not be
given.
It means that, even it was explicit that e.g only the get property if
virtual pure, both (set and get) were considered as virtual pure.

@fix
2014-03-27 08:52:53 +02:00
Daniel Zaoui 4092dc6277 Eolian/Generator: more stuff.
Better support of empty events/funcs lists
Better support of class constructor
Preparation for Eo2: separate Eo1 specific code and common code
2014-03-24 08:14:30 +02:00
Daniel Zaoui 0987b31247 Eolian/Generator: detach Eo1 from Legacy generator.
This step is needed to clean the code and to prepare the integration of
Eo2 inside Eolian.
Except the eo_do invocation, there is no reason why legacy has to know
about Eo.
2014-03-24 08:14:30 +02:00
Daniel Zaoui cc9526cd7f Eolian/Generator: generate Eo * instead of Evas_Object * 2014-03-23 08:04:22 +02:00
Stefan Schmidt 44a54caa16 eolian/eo1_generator: Fix leak in error path
We allocated tmpstr so we should free it before we return in the error case.

CID 1191926
2014-03-19 16:40:52 +01:00
Daniel Zaoui d5256d442d Eolian/Generator: Don't generate sub ids structure if not needed.
If no methods and properties are declared for a class, no base id and
sub_ids structure are generated.

@fix
2014-03-19 07:52:04 +02:00
Daniel Zaoui 15f2bda474 Eolian/Generator: fix generation of events. 2014-03-19 07:04:28 +02:00
Daniel Zaoui 5d1b948508 Eolian/Generator: Retrieve the Eo prefix from the database instead of
guessing it.
2014-03-16 16:00:29 +02:00
Yossi Kantor 6862fa801b Eolian/Generator: Improved event generation
Line breaks in source files and extern definitions
of events in header files.
2014-03-16 09:23:49 +02:00
Daniel Zaoui c203df0b5d Eolian: Support default return values from .eo file.
Now, it is possible to assign a default return value for a
method/property.
It will be used in case the function invocation makes issues, e.g eo_do
failing to find the function...
2014-03-16 08:37:23 +02:00
Daniel Zaoui 81c2a5d217 Eolian/Generator: return values set to 0.
Before eo_do invocation, generated legacy functions returning a value
initialize it to 0.
This change is needed in the case that eo_do fails to find some
function, which leads to an unitialized value and behavior.
2014-03-14 13:21:51 +02:00
Daniel Zaoui dcf94e9dd8 Eolian/Generator: fix generation of headers for const params.
When a parameter of a property is const for get but not for set, the
.eo file indicates it by setting a flag 'const' for this parameter.
The generation was checking this flag for C files generation but not for
H files.
2014-03-13 09:14:14 +02:00
Daniel Zaoui fd67c1692c Eolian/Generator: fix generation for return values.
- Remove space between type and variable if a star is present.
- Initialize return value to NULL before eo_do. It is needed in case the
eo_do invocation fails (NULL object...).
- Add const to the internal return value if needed.
2014-03-11 15:43:46 +02:00
Daniel Zaoui d3f343bdcc Eolian/Generator: fix type when no data type exists.
When data is set as "null", the generator was writing for this data
variable "void * *_pd" instead of "void *_pd".
2014-03-11 15:25:24 +02:00
Daniel Zaoui 0d6fadcab9 Eolian/Generator: fix for virtual pure implementations 2014-03-11 15:20:54 +02:00
Yossi Kantor b070981f8f Eolian: Support of unsigned short as int in va_arg 2014-03-11 07:37:47 +02:00
Daniel Zaoui d96c429179 Eolian/Generator: support NULL pointers for return values.
When an Eo operation returns a value, this one is stored in the last
parameter as an out parameter.
In case the caller doesn't set a pointer there, the storing will be done
in a NULL pointer and will bring to a segfault.

The generator has been modified to handle this case. Now, if the ret
pointer is NULL, the value will not be returned.
2014-03-10 15:07:05 +02:00
Daniel Zaoui 4e33fd16e2 Eolian: add support of eo_prefix and data.
You can add in the .eo file the eo_prefix:... and data:... in case
you want to override respectively the Eo prefix and the data type.
If "data: null" is used, no data type will be added.
2014-03-10 15:07:05 +02:00
Daniel Zaoui a04e80e7f6 Eolian/Generator: fix for legacy function name overriding.
When legacy is specified in the .eo file, the generator was adding the
property/method name after the legacy name.
So if you have 'legacy evas_object_textblock_clear_all' for clear method,
it was adding the function evas_object_textblock_clear_all_clear.
2014-03-10 13:28:03 +02:00
Daniel Zaoui 4be9526cc2 Eolian/Generator: more fixes related to stars to add to params. 2014-03-09 13:19:30 +02:00
Daniel Zaoui a78f779486 Eolian: Fixes into generated files.
- Added Doxygen description to parameters and return
- Added default description for parameters
- Return type needs to be after all the other parameters
- Better handling of stars for pointers: try to figure if a space is
needed between the type and the variable (e.g int *a / int a)
2014-03-07 17:42:41 +02:00
Daniel Zaoui bb8af681f9 Eolian: Coverity fixes 2014-03-07 17:42:41 +02:00
Tom Hacohen 426e95b214 Eolian gen: Have a more useful error message when failing to write file. 2014-03-07 12:01:52 +00:00
Daniel Zaoui 7aebf671bf Eolian/Generator: Switch set/get functions generation.
We want to generate first set properties and then get properties to be
in accordance with the current op ids order.
2014-03-06 15:12:51 +02:00
Daniel Zaoui 232a3cf5fc Eolian/Generator: Fix comments generation in headers.
Trailing whitespaces were added in description empty lines.
2014-03-06 15:12:51 +02:00
Daniel Zaoui fe682d9760 Eolian: Valgrind fixes 2014-03-03 18:14:14 +02:00
Daniel Zaoui 49822ec28d Eolian: remove Ecore_File dependency 2014-03-03 18:14:14 +02:00
Daniel Zaoui e8ee7ae24b Eolian: fix warnings.
Don't want Stefan to be angry ;-)
2014-03-03 14:28:30 +02:00
Yossi Kantor 1287177ac2 Eolian: New features/bugs fixes
1) Include files now have include guards
  2) --gh option generates legacy header with --legacy flag and eo header
  without --legacy flag
  3) EOLIAN keyword is introduced to mark functions used by generated
  file.
  4) * for comments when comment text is empty
2014-03-03 14:09:57 +02:00
Yossi Kantor 67dd5ef497 Eolian: New generation feature tested and bugs fixed
1) Underscore for static global names
  2) Escape special characters for in-code descriptions
  3) Proper spaces for generated lines
2014-03-03 14:09:57 +02:00
Daniel Zaoui 87f661e08e Eolian: support non null parameters.
The generation is only needed in legacy headers.
2014-03-03 14:09:57 +02:00
Daniel Zaoui 210051ebb3 Eolian/Generator: fix data type for implement function 2014-03-03 14:09:57 +02:00
Daniel Zaoui 10d7bffc4a Eolian: support warn_unused variables. 2014-03-03 14:09:56 +02:00
Daniel Zaoui 2db3cdb5e3 Eolian: Valgrind cleaning 2014-03-03 14:09:56 +02:00
Daniel Zaoui 21533a0079 Eolian/Generator: errors handling improvement.
Errors occuring during generation are now propagated to the main (i.e
exit code).
Logs have been ported to EINA_LOG instead of printf.
2014-03-03 14:09:56 +02:00
Daniel Zaoui baaf92c93a Eolian/Generator: implementation prototype change
Since we know the type of the private data given as parameter of the
implemented function, we can set it instead of void *.
2014-03-03 14:09:56 +02:00
Daniel Zaoui 60919ecbe6 Eolian/Generator: improve command line arguments and logging.
Now --gh/--gc don't require an additional argument.
If eolian_gen is called with --gc and some file.eo, the tool will
generate file.eo.c.
You can force another filename by using the -o with an argument.

Moreover, logging has been added to the generator.
2014-03-03 14:09:56 +02:00
Yossi Kantor 521701ff70 Eolian: naming convention for implemented functions
The format is now _<current_class>_<inherited_class>_function_name.
2014-03-03 14:09:56 +02:00
Daniel Zaoui 02f4c112ca Eolian/Generator: add private data to the prototypes of implementations 2014-03-03 14:09:56 +02:00
Yossi Kantor c7beca12ec Eolian: Class type and class constructor/destructor generation added 2014-03-03 14:09:56 +02:00
Daniel Zaoui 920c035c57 Eolian: Support of virtual pure functions.
Virtual pure can be defined in Eolian format by adding in the section
implements virtual::class_name::func_name[::func_type].
2014-03-03 14:09:55 +02:00
Daniel Zaoui f7dce9c8c9 Eolian/Generator: update options and return value from main.
-v is used instead of -V
returns 1 when an error occurred
useless print removed when scanning include directories
2014-03-03 14:09:55 +02:00
Daniel Zaoui 5ae7cc962f Eolian: Format changes
- Support keys/values for properties instead of params
- Direction for parameters syntax changed from in to @in...
- obj:const changed to const in .eo
2014-03-03 14:09:55 +02:00
Daniel Zaoui a8661af73e Eolian: update .gitignore 2014-03-03 14:09:55 +02:00
Daniel Zaoui 61b180448a Eolian/Generator: improve the files management.
Now, the .eo file given as parameter doesn't have to be into the given
include paths.
2014-03-03 14:09:55 +02:00
Daniel Zaoui 9add4c695c Eolian: remove --class option.
Now, the .eo file needs to be supplied instead of the class.
2014-03-03 14:09:54 +02:00
Yossi Kantor 17abdbdd43 Eolian: Code review fixes
1) API defined under EFL_BETA_API_SUPPORT
2) Init counters for init and shutdown
3) void for no-parameters functions
2014-03-03 14:09:54 +02:00
Daniel Zaoui 7a114b18af Eolian/Generator: oups, didn't mean to push that. 2014-03-03 14:09:54 +02:00
Daniel Zaoui 8de58b9757 Eolian/Lexer: rename signals to events. 2014-03-03 14:09:54 +02:00
Daniel Zaoui a934780714 Eolian-generator: fix crash during generation
It happens when no description is supplied for an event.
2014-03-03 14:09:54 +02:00
Daniel Zaoui ab8d877150 Eolian/Generator: support legacy as option.
For the moment, the option works for C files. Have to add support for H
files.
2014-03-03 14:09:54 +02:00
Daniel Zaoui 327202ef37 Eolian/Generator: port options to getopt
Even if we want to remove the appending options, we still support them.
We will remove them later.
2014-03-03 14:09:54 +02:00
Daniel Zaoui 5dea8ee0a8 Eolian: first import.
Imported by Tom, from the eolian repo which was written by:
Daniel Zaoui <daniel.zaoui@samsung.com>
Yakov Goldberg <yakov.g@samsung.com>
Yossi Kantor <yossi.kantor@samsung.com>
Savio Sena <savio@expertisesolutions.com.br>
Jérémy Zurcher <jeremy@asynk.ch>

Signed-off-by: Tom Hacohen <tom@stosb.com>
2014-03-03 14:09:53 +02:00