Commit Graph

774 Commits

Author SHA1 Message Date
Daniel Kolesa d48baf533f eolian: require semicolon after get/set in new property impl syntax 2016-12-27 16:05:22 +01:00
Daniel Kolesa 757cc83413 eolian: implement new partial property impl syntax
Instead of

    Other.Class.some_prop.get;
    Other.Class.some_prop.set;

you can write

    Other.Class.some_prop { get; set; }

The other syntax is deprecated from now on.
2016-12-23 17:28:11 +01:00
Daniel Kolesa 2ebea22bc3 eolian: add dev warning for old style property implements 2016-12-23 17:17:11 +01:00
Daniel Kolesa df55f75ace eolian implements: prepare API for whole-property implements 2016-12-23 16:31:37 +01:00
Cedric BAIL 8a57cb44b2 eolian: silence clobbered variable warning. 2016-12-15 10:44:22 -08:00
Daniel Kolesa 3dfb7a6ba8 eolian: enable typechecked expression validation
This code was formerly disabled, but it's safe now.
2016-12-15 13:31:58 +01:00
Daniel Kolesa e444d43bbb eolian: handle pointer types in typechecking expr eval
Also improve expr error messages and fix Eolian tests.
2016-12-14 18:23:16 +01:00
Daniel Kolesa d123978718 eolian: handle pointers in aliased_base_get 2016-12-14 18:23:16 +01:00
Daniel Kolesa c813e94606 eolian: unary expr eval for floats and add a signed number mask
This adds a new mask for all signed numbers (sint + float) and
fixes unary expr evaluation for floats, as well as fixes eval
error messages.
2016-12-14 18:23:16 +01:00
Daniel Kolesa 7df8625c40 eolian: clean up unnecessary logic in eolian_documentation_string_split
Fixes CID1366824.
2016-12-08 13:53:03 +01:00
Daniel Kolesa 246288fff7 eolian: forgotten free() (leaks memory otherwise) 2016-12-07 14:06:02 +01:00
Daniel Kolesa 5fa81d9fab eolian: switch reference validation to new tokenizer 2016-12-07 13:56:35 +01:00
Daniel Kolesa 2ffc93ddf9 eolian: add a reference resolver
New API function eolian_doc_token_ref_get will resolve the kind of
reference in the given token and extract the necessary data you
might need for further use, for example class and function for
methods, or struct and field for struct field. It also supports
event references that will be added into Eolian later.

EFL will be switched to the new resolver (by changing the validator
code) during the next step.
2016-12-06 19:11:17 +01:00
Daniel Kolesa 66b48f8f5d eolian: remove handling of short refs in tokenizer
Already expanded in the main lexer.
2016-12-01 17:22:19 +01:00
Daniel Kolesa d2105f99d4 eolian: add documentation tokenizer
This provides an API to tokenize Eolian docstrings. It does not
yet switch the rest of the infra to it, but it does have tests.
It doesn't verify correctness of references, as that's Eolian's
job. Therefore it's also your job to provide it with strings that
do not contain invalid references. Lua bindings are to come and
a complete switch will be done later.

@feature
2016-12-01 16:37:28 +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 8002b3b24e eolian: remove parsing of pointers and the corresponding APIs
Everything should be done via the new ptr() system now.
2016-11-10 16:20:19 +01:00
Cedric BAIL 144ef9dad3 eolian: remove Eina_Promise. 2016-11-07 13:43:11 -08: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 c4f64a3390 eolian: rename ref to ptr to avoid confusion with eo refs 2016-11-02 13:06:38 +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 8c9fa54be4 eolian: fix the nonsensical semantics for variables
Both variables and constants can have extern on them (it means the same thing
as in types, they won't get generated in C). This is different from the previous
semantics which only allowed extern on globals, which makes no sense.

Both globals and constants are allowed to have a value (previously only
constants were); constants are required to have a value. Globals having
a value is just a convenience for initialization during source generation.
This is unlike the previous behavior, where the value was optional for both
globals and constants and only allowed when not marked extern, which makes
no sense either.

Obivously, even when globals have a value, they're not allowed to be used
in expressions, as they cannot be evaluated at compile time (they're mutable).
2016-10-19 15:32:22 +02:00
Daniel Kolesa b6113a6bd9 eolian: add API to get the C class datatype 2016-10-13 15:04:20 +02:00
Daniel Kolesa e5d016bb63 eolian: add an API to get the C name used to access the class 2016-10-12 14:56:22 +02: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
Tom Hacohen d5e321466e Efl object: Rename Eo_Event -> Efl_Event.
This is the last step of the Eo renaming efforts.
2016-08-30 13:34:10 +01:00
Daniel Kolesa 1c78d2196b eolian: enforce no get/set as method/property name rule
Fixes T3849.
2016-08-23 13:44:18 +01:00
Gustavo Sverzut Barbieri e3e0a6bd65 eolian: gracefully handle incorrect case of inherit.
If you use "EFl" instead of "Efl", it will find the proper file, but
won't find the type... crashing.

Handle that case and hint the user about it.
2016-08-18 02:13:19 -03:00
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Daniel Kolesa da90173936 eolian: cleanup type serialization logic 2016-07-01 14:34:24 +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 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
Tom Hacohen d648eb5311 Eo event callbacks: Change the way callbacks are stopped.
Instead of using the return value, we now use eo_event_callback_stop()
to stop calling other callbacks.
2016-06-20 18:02:00 +01:00
Daniel Kolesa a7c6086c42 eolian: enable inheritance checks and fix EFL to build with them
Somehow, there was code in the tree that apparently isn't tested at all, even
once - if it was, the eo.c logic that performs inheritance checks would be
triggered. I don't know how this could have happened (actually I do, it's
Cedric's fault and he should be publicly shamed for it) but these checks
make sure this will never happen again. But since the code itself appears
to be untested, I don't know if there isn't any other brokenness in it.
But that's beyond the scope of this change, so for now, let's make sure
all our inheritance is at least formally correct.

Also, enable eo_interface.eo generated code in Eo itself so that Eo.Interface
can be used when inheriting.

@fix
2016-06-15 16:37:15 +01:00
Daniel Kolesa f7e09d3570 eolian: move deferred eo file parsing to the very end
Because of this the cyclic check would occasionally have false positives.
By moving deferred eo parsing to the end of the whole parse process, it
can no longer affect the cyclic checker.

@fix
2016-06-15 16:20:45 +01:00
Daniel Kolesa 70d2866662 eolian: add (for now disabled) inherit validity checks
Somehow I cannot enable this right now because we have issues with existing
eo files that need to be resolved first.
2016-06-14 14:09:13 +01:00
Daniel Kolesa 54590d677e eolian: fix impl func fill
If there is a dot in the remaining part of the implement, it means it
actually implements another class - do not fail in those cases.
2016-06-13 16:24:35 +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 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 1a0928eb14 eolian: we don't support unnamed structs/enums, so don't check 2016-06-06 16:15:14 +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 4844034a1a eolian: add core infra to support builtin strings and void pointers 2016-05-26 14:36:41 +01:00
Daniel Kolesa 2781680b51 eolian: put ownable checks into its own func 2016-05-26 14:17:07 +01:00
Daniel Kolesa 39b9c7564a eolian: add support for warning when pointer type is found (with env var) 2016-05-24 11:48:44 +01:00
Felipe Magno de Almeida b613d6f1d9 eolian: Allow promises to have a second type
Promises can have a second type, which is the progress type
2016-05-23 15:58:11 -03:00
Daniel Kolesa e984e5a11a eolian: remove pointers from complex and class types
Complex types (i.e. list, array, hash, accessor etc.) now do not require
pointers with them anymore (the pointer is implied) and the same goes for
class handles. Eolian now explicitly disallows creating pointers to these
as well. This is the first part of the work to remove pointers from Eolian
completely, with the goal of simplifying the DSL (higher level) and therefore
making it easier for bindings (as well as easier API usage).

@feature
2016-05-23 15:58:33 +01:00
Daniel Kolesa 4bdb1f73b8 eolian: handle invalid keywords correctly
Before this Eolian segfaulted when an invalid keyword was used.

Fixes T3672.
2016-05-23 10:49:42 +01:00
Daniel Kolesa 9be179d740 eolian: add warnings for class/complex types with pointers (with env var) 2016-05-20 17:15:20 +01:00
Daniel Kolesa 7344417306 eolian: enable incorrect property doc warnings with env var
This adds env var EOLIAN_PROPERTY_DOC_WARN which enables extra
warnings for properties that don't have a general doc but have
getter/setter doc. This will eventually become an error and
will be enabled by default. For now it's too verbose.
2016-05-19 16:57:12 +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 1a0566452f eolian: do not generate legacy without explicit class legacy_prefix 2016-05-12 17:27:34 +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
Daniel Kolesa 4126b7faba eolian: fix C type serialization (handle undefined) 2016-05-10 18:06:56 +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
Tom Hacohen cfd7b57006 Eolian: Turn on strict type checking.
Thanks to q66 for the code.
I'm stealing credit here because:
1. I'm lazy.
2. He's lazy and doesn't deserve it.
2016-04-19 17:15:28 +01: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
Daniel Kolesa 9b845e7135 eolian: add APIs to get all things of each type 2016-03-29 15:01:17 +01:00
Daniel Kolesa 22875f066c eolian: builtin support for event callback signature 2016-03-14 17:16:41 +00:00
Daniel Kolesa c420cbe9f0 eolian: refactor database_typedecl_to_str to remove dead code
After the type system transition there was some unnecessary dead code.
Fixes CID 1352512.
2016-03-11 13:04:41 +00: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
Daniel Kolesa bf2c0c3405 eolian: validate eo/legacy prefix to be [a-z_][a-z0-9_]* 2016-03-07 15:01:19 +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 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 5401c775ec eolian: remove database_type_print (unused) 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 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 06c246ee27 eolian: free the hashes (prevent leaks) 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 ff7e2b5b6b eolian: always define the first enum value for consistency 2016-03-03 18:58:11 +00:00
Daniel Kolesa 0d291ac43e eolian: add typedef enumeration for type definitions 2016-03-03 18:58:11 +00:00
Daniel Kolesa eee5cc4fdc eolian: re-enable strict validation 2016-02-18 10:14:41 +00:00
Cedric BAIL 56a21ab5f2 Revert "eolian: strict validation for EFL (errors by default)"
This reverts commit 21a2a8007d.

Please run make check from time to time.
2016-02-17 14:37:42 -08:00
Daniel Kolesa 21a2a8007d eolian: strict validation for EFL (errors by default) 2016-02-17 13:00:41 +00:00
Daniel Kolesa 2998da56e3 eolian: verbose type warnings for EFL by default 2016-02-16 15:13:02 +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 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 b3867ce395 eolian: turn "undefined type" into its own EOLIAN_TYPE 2015-11-19 14:05:16 +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 4ce59a4f08 eolian: fix function parameter memory leak with value 2015-11-03 13:40:17 +00:00
Daniel Kolesa cc0476041f eolian: fix out-of-bounds indexing on tokens
Fixes CID 1324818 @fix
2015-10-04 14:54:21 +01:00
Daniel Kolesa 17b4622f1b eolian: enable doc dependency parsing code 2015-09-24 14:12:07 +01:00
Daniel Kolesa c4b0ae8a90 eolian: no need to double-sanitize paths, only do it when needed 2015-09-24 14:09:03 +01:00
Daniel Kolesa 940209b8b5 eolian: use fully sanitized path names everywhere 2015-09-24 14:04:05 +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 2bf46034b2 eolian: split tokens/keywords for cleaner indexing 2015-09-21 15:26:41 +01:00
Daniel Kolesa 3f1d29f1ec eolian: remove support for old style docs completely 2015-09-03 15:42:01 +01:00
Daniel Kolesa 7ae6781451 eolian: disable parsing of old style docs 2015-09-03 15:08:08 +01:00
Stefan Schmidt 4f42f9a08a eolian: add eolian group as link to main page to find API docs
Fixes T2541
2015-08-11 14:04:51 +02:00
Daniel Kolesa 1701ba6a06 eolian: class members now inherit their class's since tag 2015-08-11 10:31:42 +01:00
Daniel Kolesa 26d0053a0f eolian: do not treat @since specially in validation (not needed) 2015-08-06 17:04:06 +01:00
Daniel Kolesa aa65c7ef5b eolian: @since no longer needs to be its own paragraph in docs
However, it still terminates the doc.
2015-08-06 16:53:41 +01:00
Daniel Kolesa b2bfd64f26 eolian: different error for validating @since 2015-07-31 15:55:24 +01:00
Daniel Kolesa 099bdd7819 eolian: do not use an invalid pointer after updating buffer
Replacing decimal point in buffer resulted in invalidation of the original
string pointer. On Linux, this issue was for some reason not caught, but
it was wrong anyway. Use the updated string correctly now.

@fix
2015-07-15 15:32:53 +01:00
Daniel Kolesa e805dcd370 eolian: enable the new doc validator
This will make Eolian error when the input documentation
is in a wrong format.
2015-07-08 15:51:29 +01:00
Daniel Kolesa 69cccd043a eolian: print more detailed location info for doc validation 2015-07-08 14:47:09 +01:00
Daniel Kolesa b5141e6291 eolian: correct documentation ref validation (disabled for now) 2015-07-08 13:39:46 +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 70b7043731 eolian: initial work on doc syntax validation (disabled for now) 2015-07-07 15:21:45 +01:00
Daniel Kolesa cd7a78f2a5 eolian: add API: eolian_declaration_get_by_name
Sorry for last minute new API, but this one is necessary to implement
proper verification of references in docs, which I would like to have
in 1.15. It allows you to retrieve any kind of declaration by full
namespace, so that you can check for an existence of an Eolian decl,
rather than checking every type individually.

@feature
2015-07-07 10:57:24 +01:00
Daniel Kolesa e9a0904768 eolian: allow trailing comma on last enum item (just like C) 2015-07-03 15:19:12 +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 71a8b9d119 eolian: relax doc parsing a little (no need to check if @since is allowed) 2015-06-23 16:44:17 +01:00
Daniel Kolesa 0fe4d4aa37 eolian: simplify doc parsing logic a bit 2015-06-23 16:37:37 +01:00
Daniel Kolesa c26134df7a eolian: new doc token lexer/parser
This should allow us to more easily extend the format if desired
and overall makes the doc syntax parsing more readable and simpler.
2015-06-23 15:28:46 +01:00
Daniel Kolesa 51f49642b4 eolian: remove the outdated and ugly database printer (needs rework) 2015-06-17 14:26:07 +01:00
Daniel Kolesa f800e8a3bf eolian: check for C type keyword before trying to append as C type keyword
This fixes a segv when non-type Eolian keyword is used.

@fix
2015-06-17 10:29:37 +01:00
Daniel Kolesa 950322fd12 eolian: remove support for old event doc syntax 2015-06-11 17:14:51 +01: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 3c3e52440b eolian: fix a bug in expr serializer with wrong sign insertion 2015-06-11 16:41:32 +01:00
Daniel Kolesa 660e23fd75 eolian: add new __undefined_type builtin to silence warnings 2015-06-10 16:56:37 +01:00
Daniel Kolesa 7ea7f0b68a eolian: fix wrong type keyword check 2015-06-10 16:42:18 +01:00
Daniel Kolesa 6692319c78 eolian: pass rbuf to doc_error
This allows us to correctly free the buffer in error scenarios.

Fixes CID 1304728.

@fix
2015-06-09 13:43:36 +01:00
Daniel Kolesa 7a38f8ec21 eolian: support for @since tag in new doc comments
This is kind of ugly, but I didn't see a better way to do it without turning
this into a much more complicated parser. So this will have to do unless we
find something else to add, in which case a new doc parser will be required.

@feature
2015-06-08 15:57:15 +01:00
Daniel Kolesa 5813dbffe8 eolian: silence static analysis
Add some unreachable returns to fix CID 1304557.
2015-06-08 10:43:20 +01:00
Daniel Kolesa e94fdac885 eolian: remove support for short doc comments (//@) 2015-06-05 16:10:12 +01:00
Daniel Kolesa af2bcfa9d1 eolian: double newline ends summary, not single
This allows you to split the summary on multiple lines
if necessary (for example to satisfy line limit)

@fix
2015-06-04 15:41:52 +01:00
Daniel Kolesa 5892fc630c eolian: remove prototype of non-existent API 2015-06-03 16:47:24 +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 b2c47737b1 eolian: properly fill and free all doc fields 2015-06-03 15:35:20 +01:00
Daniel Kolesa 4bdacafaf1 eolian: start exposing Eolian_Documentation 2015-06-03 15:35:20 +01:00
Daniel Kolesa 5084938c04 eolian: enums can't be opaque, check properly 2015-06-03 12:01:21 +01:00
Daniel Kolesa a6fbe7b6a5 eolian: preliminary parsing of doc syntax 2015-06-03 11:11:12 +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 e58da1faa0 eolian: add actual useful declaration APIs 2015-06-01 14:48:50 +01:00
Daniel Kolesa 522c021a36 eolian: initial exposed declaration API - not yet very useful
This API allows you to retrieve a list of declarations in the file
(classes, types, vars) in the order they were declared in.

@feature
2015-06-01 14:32:45 +01:00
Daniel Kolesa 5cdf202ee4 eolian: more advanced comment parsing (properly skip asterisks etc) 2015-05-29 16:10:40 +01:00
Daniel Kolesa 1a48c31f81 eolian: "generic_value" builtin type 2015-05-29 12:03:57 +01:00
Daniel Kolesa cab1391471 eolian: restrict the complex-type condition 2015-05-29 11:38:54 +01:00
Daniel Kolesa 3efca75615 eolian: reserve __builtin_event_cb 2015-05-29 11:19:27 +01:00
Daniel Kolesa 742d7c394c eolian: allow a filename (rather than path) to be given to eolian_file_parse 2015-05-27 14:32:24 +01:00
Daniel Kolesa 80000e993e eolian: better error reporting (include correct token info) 2015-05-27 11:30:51 +01:00
Daniel Kolesa 0e2dee5b2e eolian: make sure CLASS/COMPLEX type is always pointer backed 2015-05-27 11:00:31 +01:00
Daniel Kolesa a7dea04b26 eolian: merge eo_file_parse and eot_file_parse 2015-05-22 17:32:21 +01:00
Daniel Kolesa d559952117 eolian: reuse the parsed eot hash for eo too (simplify code) 2015-05-22 17:14:38 +01:00
Daniel Kolesa 5d5b60b026 eolian: use eo_parser_database_fill for import 2015-05-22 17:09:14 +01:00
Daniel Kolesa 1ffdcda292 eolian: simplify eolian_eo_file_parse
This also moves the ctor stuff into database_fill,
saving some loops when a class is already parsed.
2015-05-22 16:53:21 +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 9bbc224f96 eolian: initial support for importing eo files 2015-05-22 16:34:48 +01:00
Daniel Kolesa 9214fa3db9 eolian: disallow cyclic dependencies between .eo files
Eo files will now fail to compile if a cycle is detected.

This required some temporary changes in existing eo files
(we had 2 cycles) for which I added a FIXME (they do not
affect C generation).

@feature
2015-05-22 15:03:38 +01:00
Daniel Kolesa adf445e3bd eolian: silence static analysis false positive
Fixes CID 1299412.
2015-05-22 11:26:28 +01:00
Daniel Kolesa 68b8d63e42 eolian: remove unnecessary function 2015-05-21 16:37:30 +01:00
Daniel Kolesa 370f406d2f eolian: properly handle errors in database_fill
Fixes CID 1299294.

@fix
2015-05-20 18:11:02 +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 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 1c5d8d14e8 eolian: remove unused variable 2015-05-20 17:07:09 +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 dfbb777bf1 eolian: keep track of all currently parsing files 2015-05-20 15:41:07 +01:00
Daniel Kolesa dc4c0c64f8 eolian: unify inherits and dependencies for parsing purposes 2015-05-20 15:23:33 +01:00
Daniel Kolesa 5ca43e58c0 eolian: test for possible duplicates in deps list 2015-05-20 14:46:01 +01:00
Daniel Kolesa 30515bc946 eolian: cleaner cyclic import checks 2015-05-19 15:44:33 +01:00
Daniel Kolesa 72dcd2da03 eolian: add a functional "import" statement 2015-05-19 15:26:53 +01:00
Daniel Kolesa 8834f8e02d eolian: initial lex/parse for import statement 2015-05-19 14:25:45 +01:00
Daniel Kolesa 12fa5f5349 eolian: fix eolian_type_enum_field_c_name_get for namespaced enums 2015-05-18 16:37:42 +01:00
Daniel Kolesa 058a9c9d88 eolian: new syntax for params/values/keys
Instead of "@in type name;" we now use "@in name: type;". This change
is done because of consistency with the rest of Eolian; pretty much
every other part of Eolian syntax uses the latter form.

This is a big breaking change in the .eo format, so please update your
.eo files accordingly and compile Elementary together with the EFL.

@feature
2015-05-18 16:14:31 +01:00
Daniel Kolesa 338aa7d10b eolian: use the new decl storage to retrieve REGULAR base types 2015-05-15 15:16:48 +01:00
Daniel Kolesa 8ec7d1cc48 eolian: much better and stricter redefinition checking
We can now check redefinitions between different types of declarations,
such as redefinition of struct as variable etc.

@feature
2015-05-15 15:11:10 +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 8c774a1b90 eolian: force specification of inner type for all complex types 2015-05-14 11:27:00 +01:00
Daniel Kolesa 957a89168b eolian: precompute all enum field values (faster runtime, constness) 2015-05-13 18:10:02 +01:00
Daniel Kolesa d2365e6267 eolian: allow forced retrieval of enum field values 2015-05-13 17:57:03 +01:00
Daniel Kolesa e90e3af8b5 eolian: fix evaluation of "undefined" enum fields 2015-05-13 17:15:45 +01:00
Daniel Kolesa 44d37bb368 eolian: do not check alias/struct/enum base for builtin types 2015-05-12 17:24:17 +01:00
Daniel Kolesa 96d16eabb4 eolian: remove unused variables 2015-05-12 17:07:26 +01:00
Daniel Kolesa 211b650c4b eolian: new API eolian_type_enum_field_c_name_get
This API allows you to retrieve the C name of an arbitrary enum field,
respecting the legacy prefix and properly uppercasing the name.
2015-05-12 17:04:54 +01:00
Daniel Kolesa ed58165b50 eolian: butts 2015-05-12 16:25:52 +01:00
Daniel Kolesa 5f32c178e9 eolian: update eolian_type_base_type_get for REGULAR types 2015-05-12 14:27:24 +01:00
Daniel Kolesa a5ce9e5d75 eolian: API and tests for beta events 2015-05-08 14:37:02 +01:00
Daniel Kolesa c8b0b06971 eolian: parsing for beta events 2015-05-08 14:22:32 +01:00
Daniel Kolesa 0c07b9bea4 eolian: is_beta API plus tests 2015-05-08 14:12:27 +01:00
Daniel Kolesa b33e2b21a1 eolian: parse the @beta qualifier 2015-05-08 14:00:07 +01:00
Daniel Kolesa b5a7a9b556 eolian: remove old property syntax support 2015-05-07 17:35:33 +01:00
Daniel Kolesa e126911ba0 eolian: allow the new property syntax 2015-05-07 14:58:03 +01:00
Daniel Kolesa 95a79d5f3b eolian: reserve @beta and @property 2015-05-07 11:35:14 +01:00
Cedric BAIL c4cb972a83 eolian: remove the need to order the header correctly for Windows. 2015-05-07 09:53:11 +02:00
Daniel Zaoui 2c5ec0b132 Eolian: Add API to retrieve an event of a class by its name
@feature
2015-05-07 09:57:15 +03:00
Daniel Kolesa 9b167d953c eolian: fix lexer assertion failure
The function was missing an "else", so a wrong branch was always
executed with errors at EOF. This fixes that.
@fix
2015-05-01 11:58:05 +01:00
Daniel Kolesa a74000a65c eolian: specialize tmp free for typedef (avoid double free issue)
@fix
2015-05-01 11:48:41 +01:00
Jean-Philippe Andre 92a844fd36 Eolian: Fix clang warnings
Return proper type (NULL, not bool)
2015-04-21 20:11:01 +09:00