Commit Graph

149 Commits

Author SHA1 Message Date
Daniel Kolesa 13ddc5dbc1 eolian: rename @warn_unused and its associated API
@warn_unused in syntax is now called @no_unused - this is because
"warning about unused" is a C thing (or rather, an extension to C)
and various languages might want to use stricter behavior for this.

Its associated API does the reverse now - it lets you query whether
being unused is allowed at all. This is to match future behavior
of Eolian (once it supports versioning) that will likely reverse it.

@feature
2019-05-26 17:41:22 +02:00
Daniel Kolesa d0fed247bb eolian: remove param @nonull
This has been deprecated for a while and is not strictly necessary
- as a part of an effort to stabilize Eolian, remove this. Eolian
will eventually gain support for versioning and use a reversed
behavior (i.e. no NULL by default), but the API it wlll use for
that will be very different. Features can always be added, it's
much harder to drop them.

@feature
2019-05-26 17:25:15 +02:00
Daniel Kolesa 5ea0195661 eolian: remove @nullable keyword
This was an experiment that never properly took off and was never
used by any generator. Its use was highly variable, so it could
not be relied upon. We will still want to reverse the current
behavior eventually (no null by default), but that will be
done with eo file versioning in the future.

@feature
2019-05-21 16:04:35 +02:00
Daniel Kolesa 6312cafe20 eolian: move from eo_prefix to c_prefix 2019-05-09 16:17:44 +02:00
Xavi Artigas 68c530080b docs: Fix common misspellings in H files
Fixed all appearances of words from this list in H files:
https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines
2019-04-02 13:28:48 +02:00
Daniel Kolesa cf200a7d28 eolian: remove legacy handling API and most of generation
Summary:
This removes all Eolian API that deals with handling of legacy
code. It also removes the code using it in the generator as well
as bindings, but for now keeps generation of .eo.legacy.h types,
as there are still instances in our codebase where things are
otherwise broken. We can remove the rest once that is resolved.

Reviewers: zmike, cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8255
2019-03-08 10:12:09 -05:00
Daniel Kolesa 4b1622b5fc eolian: remove support for inlist/inarray
This feature was kind of ill-conceived and never worked properly.
Since there isn't enough time to make it work right at this point
and there are no users of it in the API, remove it for now.

It might get added in the next release cycle, in a proper form.

@feature
2019-02-28 20:28:24 +01:00
Daniel Kolesa dc492b1586 eolian: introduce typed slice types
Summary:
This adds two new complex types, slice<T> and rw_slice<T>. This
is necessary to make the type useful to bindings, as Eina_Slice
on its own says nothing about what it's carrying and that prevents
useful code from being generated outside of C.

@feature

Reviewers: bu5hm4n, segfaultxavi, lauromoura, cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7980
2019-02-22 16:18:49 +01:00
Daniel Kolesa 7feeda0410 eolian: add support for composite section into regular classes
Each regular class can now have a section called 'composite',
which can contain interfaces and interfaces only. This defines
a list of interfaces that are allowed to be unimplemented on the
class, as it is assumed the class will be composited with some
other class implementing those interfaces.

Only regular classes can have this, as only regular classes can
be instantiated.

It will also be necessary to check whether the classes in the
section appear somewhere within the inheritance tree. For now,
this testing is not being done.

Example of usage:

composite {
    Some.Magic.Interface;
    Another.Magic.Interface;
}

directly in the class body.
2019-01-21 17:19:14 +01:00
Marcel Hollerbach 455dedd49d eolian: introduce the keyword required
This introduces a new keyword called required. It only works on mixins.
You can specify a list of regular/abstract classes in there.
Classes specified after the required keyword are later used to verify
the usage of the mixin. With this feature a mixin can define a list of
types that the inheriting object (the object that inherits from a mixin)
needs to fullfill, if one class that is required is not in the
implemented classes, then eolian will bail out.

Differential Revision: https://phab.enlightenment.org/D7584
2019-01-11 12:37:27 +01:00
Daniel Kolesa c8e0a1d2e2 eolian: implement new syntax for inheritance
This new syntax separates the parent class from extensions, in
a familiar way to similar to e.g. Java. Since changing everything
at once is a lot of effort, implement it alongside for the time
being.
2018-11-23 13:57:07 +01:00
Felipe Magno de Almeida 1933735635 eolian: Add @ctor_param parameter to constructors
Summary:
This tagging keyword explicitly asks, for bindings that support it,
that the constructor's parameters are added to the class constructor.

Allowing the user to instantiate the class and call the constructor in
a straightforward way.

Reviewers: q66, woohyun, bu5hm4n, Jaehyun_Cho, segfaultxavi

Reviewed By: q66

Subscribers: cedric, #reviewers, #committers, lauromoura

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7221
2018-10-31 02:47:58 +01:00
Daniel Kolesa c116695311 eolian: add builtin type for Eina_Future 2018-05-03 17:14:39 +02:00
Cedric BAIL 042de32421 eolian: remove old support for Efl_Future. 2018-05-01 10:39:01 -07:00
Daniel Kolesa 591567a6ac eolian: add 'parse' directive
This is much like 'import' but doesn't add the imported file into
the dependency list for the current file. This is to enable doc
reference validation to remain functional without needlessly
introducing file dependencies just to satisfy it.
2018-04-20 16:10:55 +02:00
Daniel Kolesa 2db8e8e914 eolian: make use of panics for certain alloc errors 2018-03-20 17:34:51 +01:00
Daniel Kolesa a848278782 eolian: simplify lexer init 2018-03-16 14:49:35 +01:00
Daniel Kolesa df83efcef9 eolian: remove the temps system 2018-03-15 16:34:39 +01:00
Daniel Kolesa 5178b15ac5 eolian: manage exprs through node system 2018-03-15 16:34:39 +01:00
Daniel Kolesa 80445f5160 eolian: manage class/vars through new node system 2018-03-15 16:34:39 +01:00
Daniel Kolesa aa313ccfb6 eolian: store types in node hash 2018-03-15 16:34:39 +01:00
Daniel Kolesa cd49130df7 eolian: generic dtor management for lexer 2018-03-15 16:34:39 +01:00
Daniel Kolesa 916c8cb046 eolian: unified node allocation api 2018-03-15 16:34:39 +01:00
Daniel Kolesa 938acf22c0 eolian: in-lexer-state current class storage 2018-03-15 16:34:39 +01:00
Daniel Kolesa 6a284e48c9 eolian: eolian_* -> eolian_state_*, Eolian -> Eolian_State 2018-02-27 16:12:35 +01:00
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