Commit Graph

85 Commits

Author SHA1 Message Date
Daniel Kolesa d47610a732 eolian: do not require unit when stringifying types
As it is no longer necessary to pass unit when evaluating exprs,
it is not necessary to pass it here either. Convert all the APIs
to the new style and update all instances in our tree.
2018-01-16 16:39:05 +01:00
Daniel Kolesa c6436337a4 eolian: aliased_base_get funcs don't need unit 2018-01-12 18:05:13 +01:00
Daniel Kolesa 19c16b671e eolian: type_typedecl_get doesn't need a unit 2018-01-12 18:05:13 +01:00
Daniel Kolesa 707ed05d58 eolian: do not require unit for type_class_get 2018-01-12 18:05:13 +01:00
Daniel Kolesa 18e18ca74c eolian: remove remaining global state (+ modify APIs accordingly) 2017-12-15 17:11:11 +01:00
Daniel Kolesa 9a5c3cfbe2 eolian: remove internal state struct (rely on external Eolian state) 2017-12-06 15:07:31 +01:00
Daniel Kolesa 7491f9353f eolian: move enums to temporary state 2017-12-06 15:07:31 +01:00
Daniel Kolesa 51ec796497 eolian: move structs to temporary state 2017-12-06 15:07:31 +01:00
Daniel Kolesa 8428eaa663 eolian: store aliases in temporary state 2017-12-06 15:07:31 +01:00
Jean-Philippe Andre 8f2e491573 eolian: Fix odd syntax (remove EINA_UNUSED) 2017-11-14 13:40:19 +09:00
Daniel Kolesa c146d6f877 eolian: add a way to query the builtin type of a type 2017-09-22 21:01:12 +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 9da5cf20aa eolian: remove old ownership system 2017-09-15 17:52:55 +02:00
Daniel Kolesa 4b27fe6571 eolian: add API to check for @owned 2017-09-15 16:33:57 +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
Daniel Kolesa e288f5160b eolian: change C type serialization API to account for returns
This will allow proper handling of const.
2017-08-10 12:12:38 +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 d2280f91a1 eolian: use unit in typedecl c_type_get 2017-05-30 17:15:54 +02:00
Daniel Kolesa d4c835545b eolian: pass unit in internal type serialization 2017-05-30 17:15:54 +02:00
Daniel Kolesa 81a1d9659a eolian: type_class_get takes unit 2017-05-30 17:15:54 +02:00
Daniel Kolesa 308a3d91a3 eolian: use unit in all getters for typedecls 2017-05-30 17:15:54 +02:00
Daniel Kolesa 4f88aa424d eolian: use units in by_file getters for typedecls 2017-05-30 17:15:54 +02:00
Daniel Kolesa 67bc32d9ac eolian: pass unit to enum get by name 2017-05-30 17:15:54 +02:00
Daniel Kolesa 9c2dae3531 eolian: pass unit to struct get by name 2017-05-30 17:15:54 +02:00
Daniel Kolesa 52a0255e38 eolian: pass unit to alias get by name 2017-05-30 17:15:54 +02:00
Daniel Kolesa 45a73a0878 eolian: pass unit to class get_by_name/file 2017-05-30 17:15:53 +02:00
Daniel Kolesa d123978718 eolian: handle pointers in aliased_base_get 2016-12-14 18:23:16 +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 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 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 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 9b845e7135 eolian: add APIs to get all things of each type 2016-03-29 15:01:17 +01:00
Daniel Kolesa 32e0b60bb4 eolian: type documentation and other cleanups 2016-03-03 18:58:11 +00: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 4c4fbfae0b eolian: remove most of the old type APIs 2016-03-03 18:58:11 +00:00
Daniel Kolesa 863212f84a eolian: more old type api removals 2016-03-03 18:58:11 +00:00
Daniel Kolesa 4e40b60f06 eolian: remove retrieval funcs for type-style enums/aliases/structs 2016-03-03 18:58:11 +00:00
Daniel Kolesa cb42da514b eolian: initial conversion of C gen and tests to new type APIs 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 6e2497bc01 eolian: add wrappers for most of typedecl APIs 2016-03-03 18:58:11 +00:00
Daniel Kolesa 55be91afc9 eolian: more relaxed safety in types API
This changes the checks in eolian type API so that you can use the various
type funcs on incompatible types, getting a NULL in return; this allows
simplified generator logic, with error handling done on generator side,
without getting annoying messages from the Eolian lib.
2015-11-19 15:29:11 +00:00
Daniel Kolesa e089908545 eolian: add eolian_type_aliased_base_get
This adds a new API function that is there mainly for convenience (see doc).
Also added/updated tests as necessary.

@feature
2015-11-18 16:02:15 +00:00
Daniel Kolesa cd12f938af eolian: remove support for old doc style on types and vars 2015-06-11 16:52:45 +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