Commit Graph

124 Commits

Author SHA1 Message Date
Daniel Kolesa f9868b541e eolian: store unit inside lexer 2017-12-14 16:38:35 +01:00
Daniel Kolesa 9a5c3cfbe2 eolian: remove internal state struct (rely on external Eolian state) 2017-12-06 15:07:31 +01:00
Jean-Philippe Andre 43a6fddf1f eolian: Add builtin type "strbuf"
Refers to Eina_Strbuf*
2017-12-05 10:09:58 +09:00
Lauro Moura 0931696a4f eolian: Add inarray and inlist 2017-12-04 15:47:48 -03:00
Daniel Kolesa eab6f009e2 eolian: add @cref as alternative to @in
This is a "pass by reference to const" equivalent. There is no explicit pointer
and currently it's the same as ptr(const(x)) on the type. However, it is also
usable on properties.
2017-11-01 12:40:39 +01:00
Daniel Kolesa 62e46e70ef eolian: initial parsing for parts in eo files 2017-10-24 17:33:07 +02:00
Daniel Kolesa 9009d3dae4 eolian: add any_value_ptr
Because pointer Eina_Values and value Eina_Values have slightly
different semantics (when it comes to resource management) it's
better to split them.
2017-09-22 20:25:31 +02:00
Daniel Kolesa 3d8081d085 eolian: rename generic_value to any_value 2017-09-22 20:16:06 +02:00
Daniel Kolesa 1577c576e6 eolian: remove static_array and terminated_array
These types are of questionable value and the API was not entirely
thought out - remove for now, and if a legitimate use is found
later, they may be readded (with a better API), but typically it
seems best to redesign the bad APIs around safe containers...
2017-09-22 18:01:15 +02:00
Daniel Kolesa f36e5bd543 eolian: add mstring
This is a new type representing a mutable string (no const).
Regular strings cannot be made mutable with @owned because
they might be hidden behind typedefs.
2017-09-22 17:10:42 +02:00
Daniel Kolesa 9da5cf20aa eolian: remove old ownership system 2017-09-15 17:52:55 +02:00
Daniel Kolesa 11ad2b94ff eolian: initial parsing for @owned
This is the new ownership system for Eolian, working on params,
returns, struct fields or events directly rather than specifying
ownership at type level. As the new system will evolve it will
gain missing features and necessary checks.
2017-09-15 15:51:25 +02:00
Daniel Kolesa 10fd3c32e8 eolian: remove c_only
Unused and of questionable value.
2017-08-30 19:46:41 +02:00
Lauro Moura 1634c14169 eolian: function pointers
First steps toward explicit function pointer support in eolian.

To declare a function pointer type, use the following syntax, similar to
a regular eolian method declaration.

function FunctionName {
  params {
    ...
  }
  return: Return type
}
2017-06-18 12:09:22 -03:00
Daniel Kolesa da43c63ce1 eo: move event related structures and callback to C
We don't need to keep this in eo files anymore because the APIs
using them are now fully in C. This also allows removal of the
event callback builtin from Eolian.
2017-04-21 15:48:31 +02:00
Daniel Kolesa cb3f8304e0 eolian: change eo file syntax @virtual_pure -> @pure_virtual 2017-01-13 15:44:09 +01:00
Cedric BAIL 144ef9dad3 eolian: remove Eina_Promise. 2016-11-07 13:43:11 -08:00
Daniel Kolesa c4f64a3390 eolian: rename ref to ptr to avoid confusion with eo refs 2016-11-02 13:06:38 +01:00
Cedric BAIL 36bc9aa187 eolian: add a builtin to handle a free callback. 2016-09-08 14:58:05 -07:00
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