Commit Graph

1082 Commits

Author SHA1 Message Date
Daniel Zaoui f3ce7031e2 Eolian: Fix class look up.
If a class (e.g Evas_Object) is expected as a base class but is not
present in the existing expected file (e.g evas_object.eo), it will not
fail.
This patch fixes it by checking the existence of the class into the
database after the parsing of the file.

@fix
2014-06-02 17:13:34 +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 70f530e2d6 Eolian: fix issue for Windows.
On Windows, '\' are used to separate the names of a path. It was not
supported.
This patch fixes that. Thanks to Vincent Torri for catching it (and good
luck in Windows ;-))
2014-05-28 09:36:30 +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 8e4700ce65 Eolian: add support of namespaces.
It is now possible to define a class in a .eo file as e.g:
Elm::Widgets::Button.
Elm and Widgets will be the namespaces of the class Button.

@feature
2014-05-26 13:56:06 +03:00
Daniel Zaoui eb58e70ce9 Eolian: remove unused structures.
These structs were belonging to a feature that has been removed cause
not considered as needed.
2014-05-26 13:56:06 +03:00
Daniel Zaoui 5b2ce095a3 Eolian/Tests: add test for events. 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 e4444d2518 Eolian: add support for typedefs.
It includes parser updates, database fill and tests on basic and complex
types.

One can define types in this way:
type Evas_Coord: int; /* Simple type definition */
type List_Objects: Eina_List * <Eo *>;

@feature
2014-05-26 13:56:05 +03:00
Daniel Zaoui e1abaf7c37 Eolian: fix class lookup during parsing.
If classes A and B are stored in a same file, when A inherits from B,
and A needs to be generated, the generator, even if B is parsed, will
not search the class in the database but will look for some b.eo.

This patch fixes that issue by checking the existence of the classes
into the database before looking for a corresponding file.
2014-05-21 15:55:28 +03:00
Daniel Zaoui 23b97bd30d Eolian/Lexer: fix support of const parameters.
The syntax to define a parameter of a property as const is as following:

set {
   data: const;
}

When no space was present between ':' and "const", a syntax error was
occurring.
2014-05-18 14:25:25 +03:00
Jérémy Zurcher f8c2c57406 do not use EINA_FALSE instead of NULL 2014-05-07 17:45:11 +02:00
Daniel Zaoui 56fd4ef704 Eolian: fix type resolving for implement functions.
The type of the virtual functions implemented in a class was let unresolved
and led to inconsistency when working with them.
In fact, the type can be resolved easily after all the classes that the
specific class inherits from are parsed and stored in the database.

Fix T1228
2014-05-07 09:13:11 +03:00
Daniel Zaoui 05963f4052 Eolian: Fix support of virtual constructors. 2014-05-04 09:36:02 +03:00
Daniel Zaoui 0fdd06c73b Eolian: fix prints 2014-04-30 14:07:09 +03:00
Daniel Zaoui 183ecab18b Eolian: add API to retrieve the file name of a class 2014-04-28 08:46:19 +03:00
Daniel Zaoui fea029a0a3 Eolian: add API to parse all the .eo files. 2014-04-27 16:25:23 +03:00
Daniel Zaoui 1c19d274d8 Eolian: Valgrind fixes. 2014-04-27 10:57:50 +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 6797e12bc3 Eolian/Tests: add test for complex type.
It includes too fixes for the complex type. If I had listened to Tasn,
I would have detected them a long time ago.
But he didn't insist enough. He just said:
"Write your tests, ?#@*&%! french!"
2014-04-25 16:26:05 +03:00
Daniel Zaoui 64e947512a Eolian: Remove support of legacy into implement section.
It has been decided that this support is not needed.
2014-04-24 16:51:04 +03:00
Daniel Zaoui cc84a36734 Eolian: Removal of the support for custom destructors.
For no reason, I added it a long time ago.
2014-04-24 16:30:40 +03:00
Daniel Zaoui 0dda45961f Eolian/Tests: Clean makefile + add return comment tests. 2014-04-24 14:20:21 +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
Jérémy Zurcher 010ae10d60 Eolian: fix properties and methods scope support
define scope keywords 'protected' and 'public'
disallow scope keywords as property or method name
use move_ts action to move token start after scope modifier if found
use end_property_scope and end_method_scope actions to handle it
2014-04-22 20:24:27 +02:00
Daniel Zaoui a046f34590 Eolian/Lexer: Fix coverity issues.
Fix CID 1203411
Fix CID 1203412
2014-04-18 09:21:35 +03:00
Daniel Zaoui 438452d67e Eolian/Lexer: fix when function name is composed of only one letter. 2014-04-18 09:05:20 +03:00
Daniel Zaoui 7aab226a81 Eolian/Lexer: support of complex types
Complex types are now supported in .eo files:
Eina_List * @own <Eo *>

The parser is in charge of creating a list of formatted basic types.
2014-04-17 15:15:17 +03:00
Daniel Zaoui b3bc687f6c Eolian/Lexer: disable INFO and DEBUG.
They are not needed on normal build. Two flags have been added to
enable/disable INF and DBG.
Two warnings have been removed since they are not printing interesting
and relevant information.
2014-04-14 07:56:45 +03: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 1d89978c5b Eolian: clean API.
defines used as keys for internal hash tables are now replaced by
functions giving access to the internal data.
2014-04-08 04:27: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
Jérémy Zurcher c68ba35169 updates to eo_lexer.c missing from 3a0e160 2014-03-31 10:32:16 +02:00
zmike 3a4ffad811 Revert "eolian gitignore"
This reverts commit 8d13f9384c.
2014-03-30 00:07:25 -04:00
zmike ae504c0f4a Revert "eolian stop tracking your generated files in git plz"
This reverts commit 65fa5e3d25.
2014-03-30 00:07:19 -04:00
zmike 8d13f9384c eolian gitignore 2014-03-29 16:15:56 -04:00
zmike 65fa5e3d25 eolian stop tracking your generated files in git plz 2014-03-29 16:12:23 -04:00
zmike 3a0e160869 eolian stop failing on single character tokens plz
regexes are hrrd. "token1+" + "token2+" does not match a single character string.
2014-03-29 16:10:49 -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 5f497750f6 Eolian/Lexer: fix function names parsing.
Properties and methods names should be able to begin with a number.

@fix
2014-03-27 08:52:53 +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 149509249b Eolian: move the beta API ifdef to cover all the H types and functions.
@fix
2014-03-27 08:52:53 +02:00
Daniel Zaoui bfbcc47d44 Eolian/Lexer: fix parsing of parameters direction.
strncmp bytes number was not correct. A problem in the generation was
occurring when the parameter is @inout, as it is considered as @in and
the type was "out ...".
2014-03-20 10:22:20 +02:00
Daniel Zaoui 9b0a502562 Eolian/Lexer: increase buffer length for .eo files
@fix
2014-03-19 07:04:28 +02:00
Daniel Zaoui 6fd341a449 Eolian: Fix ctor/dtor generation 2014-03-19 07:04:28 +02:00
Daniel Zaoui a94ea3a8b2 Eolian/Lexer: Fix warnings 2014-03-16 15:58:14 +02:00
Daniel Zaoui b467fa9cd6 Eolian/Lexer: fix Windows compilation.
strndup is not supported.
2014-03-16 09:40:06 +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 66e1cc29bc Eolian/Lexer: support of @own tag on parameter and return values.
This tag indicates that the ownership of the parameter/return
value changes.
It is needed by generators (C++/LUA...) to determine if it has to be
freed or not, if it can be used as is or need to be copied...
2014-03-14 13:21:51 +02:00
Daniel Zaoui 6f2657c3fb Eolian/Lexer: support of legacy overriding for properties. 2014-03-11 15:20:54 +02:00
Jérémy Zurcher c69b28dac0 eolian: regroup buffer allocation and read checks 2014-03-11 14:00:32 +01:00
Jérémy Zurcher 1e2f00e654 eolian: silence uninitialized var warning 2014-03-11 14:00:32 +01:00
Daniel Zaoui 0f80ed9008 Eolian/Lexer: fix EOF issue.
When a new line was added before the last } in a .eo file, the parsing
was resulting in an error. It was due to the fact that some pointer
indicating the eof was not set when the parsing was done from memory.
2014-03-11 11:22:06 +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 b013815bfd Eolian/Lexer: error handling
Print and return error if no class has been parsed in the given file.
2014-03-09 13:19:07 +02:00
Daniel Zaoui a660bbe966 Eolian: fix warnings 2014-03-07 18:02:44 +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
Daniel Zaoui 445059e706 Eolian/Lexer: parse from memory 2014-03-07 17:42:13 +02:00
Daniel Zaoui a9748e6445 Eolian/Lexer: fix parsing for functions description.
If the first character of the description was not an alphanumeric, it was
not finalizing the parsing of the description and was not inserting it
in the database.
It was occurring when "@since" was the first word in the description of
the function.
2014-03-06 15:12:51 +02:00
Daniel Zaoui 2e0b5742e3 Eolian: Fix build for Windows
The definition of EAPI was missing in Eolian.h.

Spank on you, Tom! I expect you to be perfect and to tell me those
things before I push all the stuff ;-)
2014-03-04 11:40:46 +02:00
Daniel Zaoui 49822ec28d Eolian: remove Ecore_File dependency 2014-03-03 18:14:14 +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 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 7b42be92d5 Eolian/Library: oops, use INF before log domain creation 2014-03-03 14:09:56 +02:00
Daniel Zaoui 748a01c47f Eolian/Library: add log domain and NULL checks 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 4d7e908e49 Eolian/Lexer: support class::constructor/destructor 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 ba2cdd723d Eolian/Lexer: fix bug occuring during generation.
A string set by the lexer and used by the generator was set to NULL
instead of "constructor"/"destructor".
2014-03-03 14:09:55 +02:00
Daniel Zaoui b8cc668a9f Eolian/Lexer: inherits now is specified near the class name.
No more section inherits is supported.
2014-03-03 14:09:55 +02:00
Daniel Zaoui 857bdca899 Eolian/Lexer: remove default ctor/dtor.
They are now supported inside the section implements.
2014-03-03 14:09:55 +02:00
Daniel Zaoui 2f34bcac4b Eolian/Lexer: support of class types.
Now, .eo format has to supply the class type class, abstract, mixin or
interface.

Example: class Elm_Button {...
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 4ec1ae2d0f Eolian/Lexer: the ';' is now optional after '}'. 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
Tom Hacohen 036e3eeaa3 Eolian: Add EAPI to API calls. 2014-03-03 14:09:53 +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