Commit Graph

174 Commits

Author SHA1 Message Date
Daniel Kolesa 9da5cf20aa eolian: remove old ownership system 2017-09-15 17:52:55 +02:00
Daniel Kolesa 010650663b eolian: store ownership info in types
Even though ownership info belongs to params/returns/etc at syntax
level, we can still store it in the type and turn several API funcs
into one this way.
2017-09-15 16:30:52 +02:00
Daniel Kolesa 792855a1fa eolian: parsing of new @owned syntax for complex types 2017-09-15 16:24:46 +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 59347d4c4b eolian: include terminatable checks in ownable check 2017-09-14 00:28:32 +02:00
Daniel Kolesa 10fd3c32e8 eolian: remove c_only
Unused and of questionable value.
2017-08-30 19:46:41 +02:00
Daniel Kolesa 706de57b9f eolian: implement proper return type serialization
This accounts for const so that you can't generate functions
that return const values, as that makes no sense.

@fix T5024
2017-08-10 12:41:03 +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 d4c835545b eolian: pass unit in internal type serialization 2017-05-30 17:15:54 +02:00
Daniel Kolesa 4125e3f34b eolian: more expr system unit updates 2017-05-30 17:15:54 +02:00
Daniel Kolesa 91411c5389 eolian: units will contain multiple files 2017-05-30 17:15:53 +02:00
Daniel Kolesa 5f4c2f7b79 eolian: initial structure for units
Units are Eolian files (eo/eot). Each unit contains information
about its class, dependencies, variables and types. This allows
for saner checking to be done.
2017-05-30 17:15:53 +02: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 5f8172a589 eolian: add syntax for overridding docs in implements 2017-01-18 15:33:44 +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 baaa482ebf eolian: fine-grained is_auto/is_empty for implements 2017-01-11 19:26:21 +01:00
Daniel Kolesa 3dc9d28279 eolian: fill ctor class early on 2017-01-02 15:28:45 +01:00
Daniel Kolesa f399e77a92 eolian: rename is_ref API to is_ptr to match syntax 2016-11-03 14:22:21 +01:00
Daniel Kolesa 82ef73ca18 eolian: remove type silencing stuff entirely
this was useful during transition, but not anymore
2016-10-25 18:02:23 +02: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 33c147f6d4 eolian: remove the unnecessary subtypes API
Inner type can now be retrieved as a base type of the type.
If the type has two inner types or more, there is a new API that allows you to
get the second inner type by calling it on the first one (same would apply to
getting third via second etc.).

This API is simpler to use and doesn't require an iterator.
2016-06-10 14:28:19 +01: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 7cf7cba88e eolian: remove the c_type_named_get APIs
These have inconsistent behavior and are generally unnecessary, so I'm
removing them. Use the c_type_get funcs instead.
2016-06-06 15:50:15 +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 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 8df2686d90 eolian: lift restriction on namespace/class name conflicts in library
This will allow us to name classes the same as namespaces.
2016-05-06 12:57:01 +01:00
Cedric BAIL 842a020e1f eolian: add support for restartable event. 2016-04-20 15:53:16 -07:00
Daniel Kolesa e061d49aac eolian: completely clean up the type system 2016-03-03 18:58:11 +00:00
Daniel Kolesa 1f58ccb49f eolian: clean up some temporary hashes 2016-03-03 18:58:11 +00:00
Daniel Kolesa c3a33653f3 eolian: separate type_to_str for decls 2016-03-03 18:58:11 +00:00
Daniel Kolesa 5401c775ec eolian: remove database_type_print (unused) 2016-03-03 18:58:11 +00:00
Daniel Kolesa 8514c1846f eolian: add api to deal with typedecl free funcs 2016-03-03 18:58:11 +00:00
Daniel Kolesa c0287a2752 eolian: add some missing typedecl APIs 2016-03-03 18:58:11 +00:00
Daniel Kolesa cf9dbaa7da eolian: add matching APIs to get typedecls by file 2016-03-03 18:58:11 +00:00
Daniel Kolesa 2be79061fd eolian: remove unneeded hashes 2016-03-03 18:58:11 +00:00
Daniel Kolesa 1425523bd4 eolian: actually generate typedecls as necessary 2016-03-03 18:58:11 +00:00
Daniel Kolesa 8944cc44c1 eolian: add typedecl delete func and init hashes correctly 2016-03-03 18:58:11 +00:00
Daniel Kolesa 67f17f1068 eolian: rename typedef to typedecl to clear name confusion 2016-03-03 18:58:11 +00:00
Daniel Kolesa 87c763ac8b eolian: add a structure + hashes representing type decls 2016-03-03 18:58:11 +00:00
Daniel Kolesa 30bc1d285b eolian: allow silencing of type errors in validation
This allows generators to silence type errors in validation in order
to reduce duplicate error messages when generating multiple files.
Also adjusted the C generator to only emit type errors when generating
Eo header files.

@feature
2016-02-10 16:05:07 +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
Stefan Schmidt 1d34318938 eolian: use void to force empty function parameters
We have to use void in a function declaration if we want no function
parameters. Using just empty parenthesis means the function takes an
unspecified number of parameters.

We had it correct for most declarations and this series fixes it for
the rest.
2015-11-26 17:25:06 +01:00
Daniel Kolesa c0d82ba900 eolian: preliminary doc dependency detection for external files
This doesn't quite work yet as path sanitization needs to be done for it to
work correctly. For now this code path is disabled and will be enabled once
all paths are correctly sanitized.
2015-09-23 17:17:50 +01:00
Daniel Kolesa 3f1d29f1ec eolian: remove support for old style docs completely 2015-09-03 15:42:01 +01:00
Daniel Kolesa 950322fd12 eolian: remove support for old event doc syntax 2015-06-11 17:14:51 +01:00