Commit Graph

51 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 6312cafe20 eolian: move from eo_prefix to c_prefix 2019-05-09 16:17:44 +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 1a17aff85f eolian: add support for marking type declarations beta
Summary:
This also simplifies the beta checking API by unifying it under
objects (makes much more sense that way) and reworks the validator
to have betaness support within its context state, allowing checks
to be done easily in any place.

The betaness checks are disabled for types for the time being,
because otherwise there are too many errors (types are assumed
to be stable as they are not tagged beta, but they reference beta
classes all over the place). Set EOLIAN_TYPEDECL_BETA_WARN to 1
in your environment to force enable the checks.

Reviewers: zmike, bu5hm4n, stefan_schmidt, lauromoura, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl, #eolian

Differential Revision: https://phab.enlightenment.org/D8102
2019-03-08 08:17:01 -05:00
Daniel Kolesa 35d9ef2dd2 eolian: make more name APIs into inline helpers 2018-03-12 16:16:43 +01:00
Daniel Kolesa 2248131295 eolian: give objects names, and reduce duplication 2018-03-08 19:47:28 +01:00
Jean-Philippe Andre 43a6fddf1f eolian: Add builtin type "strbuf"
Refers to Eina_Strbuf*
2017-12-05 10:09:58 +09: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 95181f2d36 eolian: move base function doc API into implements
This allows us to unify retrieval of docs for both regular and
overridden funcs without having two separate APIs. It's currently
missing validation and docgen is still not adjusted properly for
it either, but at least there's this. Enables retrieval of docs
for overridden funcs by default as well.
2017-01-19 15:09:07 +01:00
Daniel Kolesa 35c5e89269 eolian: remove/add APIs and clean up implements system
As there is no need to have separate is_auto, is_empty and
is_pure_virtual for functions and implements (each function has
its own base implement by default) I removed the function ones.
Instead, I added a way to retrieve a function's base implement
so that you can instead do the checks on the implement even when
you only have the function.

I also moved base implement build directly into the parser instead
of the database filler. That allows for significant cleanup. I
also removed distinction of implement pointers in Eolian_Function
for get and set as implements now always contain an entire thing
so the pointer was always the same anyway.

Things should still behave more or less the same, but ordering
of generated functions has changed because ordering of implements
has changed.
2017-01-16 15:55:06 +01:00
Daniel Kolesa 692ae7adb6 eolian: use consistent pure_virtual naming in API
Previously one API used just virtual (incorrect) and one used
virtual_pure (which just sounds weird). So unify with a single
name, pure_virtual, similar as in other lanugages.

This does not change eo file syntax yet.
2017-01-13 15:40:29 +01:00
Daniel Kolesa a70645e154 eolian: consistent and cleaner error values from APIs
Now all error/unknown/etc values returned from APIs are zero,
previously it was a mix of zeroes and minus ones. Also, some
enums that had no error/invalid value before have one now, which
allows for better distinction between what is an error and what
is an intended result.
2017-01-13 15:26:05 +01:00
Daniel Kolesa 078a4eef71 eolian: strict function type input checks in APIs
Strictness of various Eolian APIs has been enhanced, for example
eolian_class_function_get_by_name now won't return anything if
you request an EOLIAN_PROPERTY and the found func is just an
EOLIAN_PROP_GET, and various APIs won't accept arbitrary inputs
like EOLIAN_UNRESOLVED or EOLIAN_PROPERTY now, instead you will
need to provide EOLIAN_PROP_GET, EOLIAN_PROP_SET or EOLIAN_METHOD
explicitly.

The purpose of this is to reduce potential bugs and fix ambiguous
behavior. Thanks to use of EINA_SAFETY, appropriate errors should
be printed into terminal when an API is used incorrectly.
2017-01-12 16:56:49 +01:00
Daniel Kolesa 289287f497 eolian: remove function_is_implemented
Its design does not match current Eolian and will be replaced later.
There isn't any generator using it right now, so it's safe to remove.
2017-01-11 19:26:21 +01:00
Jee-Yong Um 0e2a2cbacf eolian: remove all duplicated affix
Summary:
Currently eolian abbreviates when only the last word of class name and
the first word of method name are same, but this patch abbreviates
generated c name of function to remove all duplicated affix.
For example, "efl_io_closer_fd_closer_fd_set" will be "efl_io_closer_fd_set".

Reviewers: jpeg

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D4430

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-11-28 11:35:27 -08:00
Daniel Kolesa 375179b47f eolian: support @protected for accessors (get/set)
Previously it was only possible to set it for the whole property.

@feature
2016-06-09 16:55:24 +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 1637c21a76 eolian: support @ref on returns
This adds basic support for @ref on return types.
2016-06-07 15:26:09 +01:00
Daniel Kolesa 1a0566452f eolian: do not generate legacy without explicit class legacy_prefix 2016-05-12 17:27:34 +01:00
Daniel Kolesa 3f1d29f1ec eolian: remove support for old style docs completely 2015-09-03 15:42:01 +01:00
Daniel Kolesa 825349c7b8 eolian: improve function_full_c_name_get API
It's now generalized to work properly with legacy functions
as well as correctly append suffixes. Thus, it can be easily
used with the documentation generator and in other places.

@feature
2015-07-08 12:10:20 +01:00
Daniel Kolesa ba033a4cfc eolian: add documentation handling API
This adds new APIs that deal with the new documentation syntax
provided by Eolian. The old doc comment APIs are considered
deprecated from now on and will be removed.

@feature
2015-06-03 16:46:47 +01:00
Daniel Kolesa 6b91b1bd12 eolian: allow keys/values in property get/set
Sometimes it is necessary to specify a different set of values for a
getter or a setter. This commit allows such specializations. This also
renders @const_get and @const_set useless (soon to be removed).

To function correctly, this required adjustment of several public APIs
as well as deprecation of eolian_function_parameter_get_by_name.

This function was not used in any generator and was pretty much
useless in the first place, so it was removed.

@fix
2015-05-20 17:42:44 +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 0c07b9bea4 eolian: is_beta API plus tests 2015-05-08 14:12:27 +01:00
Jean-Philippe Andre 92a844fd36 Eolian: Fix clang warnings
Return proper type (NULL, not bool)
2015-04-21 20:11:01 +09:00
Daniel Zaoui b191379d1d Eolian: add API to determine if a function is implemented.
This is needed in Erigo to determine if a virtual pure function can be
invoked via eo_do, as we don't want error messages to be displayed in
case of a non implementation in the Eo object.
This function works with non virtual functions too.

Tests have been provided.

@feature
2015-03-19 12:37:38 +02:00
Daniel Zaoui 57a4cae33b Eolian: add API to return the class from a function.
@feature
2015-03-16 17:32:30 +02: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 Zaoui af513b6af3 Eolian: add support for property descriptions.
For properties, set and get descriptions were supported but common
comment was not.
2014-10-19 13:25:06 +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
Mike Blumenkrantz 5375e154fe fix config.h inclusion across the tree 2014-09-23 15:56:46 -04:00
Savio Sena 2d39b359fb eolian: Added eolian_function_is_constructor().
This patch adds a list of strings called 'ctor_of' to
_Eolian_Function. This list will contain all classes in which this
function is a constructing function.

ctor_of is filled in two moments:

* When filling the constructors of a class, class->full_name is inserted
  in the 'ctor_of' of each constructor's function.

* When filling the implements of a class, if the function is a
  constructor of its superclass it also becomes a constructor of the
  current class, so class->full_name is also inserted in the 'ctor_of'
  of each implement's function.

eolian_function_is_constructor gets a func and klass arguments. It goes
through ctor_of of func and returns EINA_TRUE if klass->full_name is
found, otherwise it returns EINA_FALSE.
2014-09-12 16:51:37 -03:00
Daniel Kolesa 5827486c3d eolian: APIs to check auto/empty on a function 2014-09-03 14:26:09 +01:00
Daniel Kolesa d2702a4fad eolian: remove @constructor syntax 2014-09-01 16:02:40 +01:00
Daniel Kolesa b69b90832f eolian: remove constructors section cruft 2014-08-27 15:43:47 +01:00
Daniel Kolesa 58a2025c25 eolian: new API: eolian_function_is_constructing 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 913e0f09fa eolian: get rid of the data hash in Eolian_Function 2014-08-21 09:26:05 +01:00
Daniel Kolesa ffbf149da1 eolian: new API: eolian_class_event_scope_get 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 a5ad792780 eolian: add support for class functions 2014-07-24 12:05:12 +01:00
Daniel Kolesa 572b7aa92f eolian: eolian_function_parameter_get -> eolian_function_parameter_get_by_name 2014-07-23 14:22:25 +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 Kolesa e26be1aca6 eolian: fix NULL checks in APIs that return iterators + fix tests 2014-07-23 13:45:25 +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 Kolesa 5d4cc031f9 eolian: s/dflt/default/g 2014-07-11 14:30:22 +01:00
Daniel Kolesa 1293dce967 eolian: API refactoring 2014-07-10 14:04:13 +01:00