Commit Graph

105 Commits

Author SHA1 Message Date
Cedric BAIL ed9dff8fbd eolian: add support for future.
Future is the read only side of a Promise. For now, I am not removing
Eina_Promise until everything is in place, but eventually the promise
type of eolian will be gone.
2016-09-08 14:58:05 -07:00
Daniel Kolesa ab2e608239 eolian: add support for static and terminated arrays
Adds two new type types, STATIC_ARRAY and TERMINATED_ARRAY. Static arrays are
only allowed as struct members right now - they translate to regular C static
arrays (allowing them elsewhere wouldn't be good, as C isn't very good at
working with the size information). Terminated arrays are basically sequences
of data terminated at the end. The base type of static arrays can be any type
that is not marked ref (explicit ref may get allowed later). The base type of
terminated arrays has the same restriction plus that it has to be either
implicitly reference type (i.e. translating to pointer in C), integer type
or a character. In case of ref types, the terminator is NULL. In case of
integer types, the terminator is a zero. In case of character types, the
terminator is also a zero (null terminator like C strings).

@feature
2016-06-30 16:59:21 +01:00
Daniel Kolesa 7584960377 eolian: implement a stringshare builtin
This implements a new builtin, stringshare, which is replaced with the right
pointer to Eina_Strinshare as necessary. This allows simplifying binding code
(it can call the proper eina APIs, deal with lifetime etc).

It also removes the extern Eina.Stringshare typedef from eina_types.eot, which
was actually incorrect and would generate invalid code in binding generators.

@feature @fix
2016-06-21 14:41:18 +01:00
Daniel Kolesa 922e4e9181 eolian: fix error cursor positioning
Previously, multi-char tokens (such as strings, docs etc) always put the error
cursor to the end of the token. That was confusing, so now the cursor always
appears at the beginning of the token instead (for multiline tokens, currently
only docs, the line number is also adjusted to point to the first line of the
doc token).

@fix
2016-06-13 14:55:15 +01:00
Daniel Kolesa b87c4f6de8 eolian: refine the ref system to suit more cases
Now references are first class (but still restricted to one level). Unlike
pointers they only mark the type instead of introducing a whole new type.
2016-06-08 15:49:09 +01:00
Daniel Kolesa 9752c44a48 eolian: add a new references system to help replace pointers
It's now possible to mark struct fields and function params as "references",
which causes them to become pointers in C (in bindings, they become whatever
is necessary). They're not a part of the type and are much more restricted
than pointers, allowing bindings to be easier. This system will be gradually
utilized and expanded as required.

@feature
2016-06-06 15:28:10 +01:00
Daniel Kolesa 4844034a1a eolian: add core infra to support builtin strings and void pointers 2016-05-26 14:36:41 +01:00
Daniel Kolesa 7782c0bcb9 eolian: add event_prefix and have classes follow that or eo_prefix by default
Previously events used to use class name as a prefix and ignored eo_prefix
when specified. This is no longer the case. Events follow eo_prefix by default
now. In order to get around this for classes where this is undesirable, a new
field event_prefix was added which takes priority over eo_prefix. If neither
is specified, class name is used like previously.

@feature
2016-05-17 17:50:43 +01:00
Daniel Kolesa 7e94eb22b4 eolian: mark pure virtual funcs outside of implements
This is a better syntax and should've been like this in the first place.
2016-05-12 16:15:24 +01:00
Cedric BAIL 842a020e1f eolian: add support for restartable event. 2016-04-20 15:53:16 -07:00
Felipe Magno de Almeida dc954d8dba eolian: add Eolian support for Eina Promises
Add a promise object to allows Eolian interface to include promises
as a way to have asynchronous value return and composibility.

The usage is like this in a .eo file:

class Foo {
   methods {
      bar {
         params {
            @inout promise: Promise<int>;
         }
      }
   }
}

Which will create the following API interface:

void foo_bar(Eo* obj, Eina_Promise** promise);

and a Eina_Promise_Owner for the implementation, like this:

void _foo_bar(Eo* obj, Private_Data* pdata, Eina_Promise_Owner* promise);

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2016-04-06 14:34:15 -07:00
Tom Hacohen 7d8cd6c40f Revert "ecore: Create Promises"
Reverting this at Felipe's request following my email. There are many
things I strongly object to in this commit. I've touched the surface of
those on the ML (which doesn't work at the moment), though we need to
better discuss it.

The gist:
1. dlsym is a really bad hack that is not even needed.
2. I don't see why eo should even be aware of promises. It's not aware
of list, hash and etc.
3. The eolian changes were done wrong.

This should have been discussed and consulted before done, even if only
because of the amount of hacks it includes and the cross-domain (ecore,
eo and eolian) nature of it.

This reverts commit f9ba80ab33.
2016-03-08 14:23:57 +00:00
Felipe Magno de Almeida f9ba80ab33 ecore: Create Promises
Add a promise object that allows Eolian interface to include promises
as a way to have asynchronous value return and composibility.

The usage is like this in a .eo file:

class Foo {
   methods {
      bar {
         params {
            promise: Promise<int>;
         }
      }
   }
}

Which will create the following API interface:

void foo_bar(Ecore_Promise** promise);

and the equivalent declaration for implementation.

However, the API function will instantiate the Promise for the
user and the implementer of the class.
2016-03-06 17:55:33 -03:00
Daniel Kolesa e061d49aac eolian: completely clean up the type system 2016-03-03 18:58:11 +00:00
Daniel Kolesa c95350016d eolian: add parsing and generation of hot events
Unfreezable events can now be marked @hot.

@feature
2016-02-02 17:55:01 +00:00
Daniel Kolesa b3867ce395 eolian: turn "undefined type" into its own EOLIAN_TYPE 2015-11-19 14:05:16 +00:00
Daniel Kolesa 7ae6781451 eolian: disable parsing of old style docs 2015-09-03 15:08:08 +01:00
Daniel Kolesa 9a01ab5dd7 eolian: try replacing '.' with locale specific decimal point
This fixes parsing of floating point number with locales that use
a comma as decimal separator, as strtof/strtod follows locale
specific conventions.

@fix
2015-06-25 10:44:01 +01:00
Daniel Kolesa a4485484f1 eolian: Eolian_Object for docs 2015-06-02 18:27:46 +01:00
Daniel Kolesa 0703cc0f5e eolian: initial lexing of documentation 2015-06-02 18:12:09 +01:00
Daniel Kolesa 1a48c31f81 eolian: "generic_value" builtin type 2015-05-29 12:03:57 +01:00
Daniel Kolesa 3efca75615 eolian: reserve __builtin_event_cb 2015-05-29 11:19:27 +01:00
Daniel Kolesa 80000e993e eolian: better error reporting (include correct token info) 2015-05-27 11:30:51 +01:00
Daniel Kolesa b339313e4b eolian: remove obsolete code dealing with multiple classes per file 2015-05-22 16:46:07 +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 8834f8e02d eolian: initial lex/parse for import statement 2015-05-19 14:25:45 +01:00
Daniel Kolesa e0fe487856 eolian: use fprintf(stderr) rather than eina_log for compile errors 2015-05-14 16:33:42 +01:00
Daniel Kolesa b5a7a9b556 eolian: remove old property syntax support 2015-05-07 17:35:33 +01:00
Daniel Kolesa 95a79d5f3b eolian: reserve @beta and @property 2015-05-07 11:35:14 +01:00
Daniel Kolesa be6415d662 eolian: parsing of @nullable and @optional args on func params 2015-02-12 11:14:45 +00:00
Daniel Kolesa 49aebd063e eolian: add eolian_function_is_c_only
This function allows us to mark functions that are not bindable.
Also remove some obsolete code.
2014-12-03 14:59:24 +00:00
Daniel Kolesa 5b9ece9c85 eolian: remove support for function types
These won't be needed because of Eo callbacks. They're also difficult
to handle in bindings, so this will relieve bindings of some effort.
2014-11-27 17:20:21 +00:00
Daniel Kolesa d26152391f eolian: add support for @optional ctor tag
This implements task T1804.
@feature
2014-11-20 15:21:55 +00:00
Daniel Kolesa 0be3aefdc7 eolian: remove some unused funcs 2014-09-22 12:47:30 +01:00
Daniel Kolesa 3d8069f226 eolian: remove str_items from temps 2014-09-12 15:04:18 +01:00
Daniel Kolesa 87559458f2 eolian: get rid of a list 2014-09-12 15:01:10 +01:00
Daniel Kolesa a1646ff61d eolian: remove eo_definitions 2014-09-12 13:42:53 +01:00
Daniel Kolesa 44cecb6a87 eolian: simplify more fill code 2014-09-11 11:48:46 +01:00
Daniel Kolesa f55572d79e eolian: remove Eo_Class_Def (fill bits still remaining) 2014-09-11 10:50:48 +01:00
Daniel Kolesa f86c2d4e5a eolian: remove accessor params feature
Temporarily replace it with @const_get and @const_set tags in values section.
2014-09-10 15:06:43 +01:00
Daniel Kolesa 7786b96359 eolian: builtin complex types
From now on, there are 5 builtin complex types, particularly accessor, array,
iterator, hash and list. All other types are simple - they can't have a complex
part. Also, the <> now binds to the type itself, not the pointer. More builtin
complex types will be added as needed.
2014-09-08 14:53:13 +01:00
Daniel Kolesa d2702a4fad eolian: remove @constructor syntax 2014-09-01 16:02:40 +01:00
Daniel Kolesa 21530bd5d8 eolian: preliminary support for new constructors section 2014-09-01 15:35:50 +01:00
Daniel Kolesa 3e5da03f7d eolian: update virtual to the new syntax (as per wiki) 2014-08-29 11:40:29 +01:00
Daniel Kolesa b69b90832f eolian: remove constructors section cruft 2014-08-27 15:43:47 +01:00
Daniel Kolesa ef380c56b6 eolian: support for setting a free function to values in eo files 2014-08-21 09:26:05 +01:00
Daniel Kolesa 33c39282b1 eolian: support "eo: null;" for legacy only functions/properties 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 be68f9e1fa eolian: initial parsing code and API declarations for enums 2014-08-21 09:26:04 +01:00
Daniel Kolesa 65332eb3ca eolian: var parsing (global and constant)
This makes the API effectively functional. Also, I added new API
eolian_variable_is_extern to match structs and typedefs.
2014-08-21 09:26:04 +01:00