summaryrefslogtreecommitdiff
path: root/src/lib/eolian_cxx/grammar (unfollow)
AgeCommit message (Collapse)Author
2020-06-09cxx: Fix uses of intrinsic eolian binbuf typeFelipe Magno de Almeida
Add special binbuf and Eina_Strbuf conversions Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11950
2020-02-18C#: Add error checking for Eina.Success_Flag return typeFelipe Magno de Almeida
When a get and/or set from property is defined to return, explicitly, a Eina.Success_Flag, the mono generator will check the return value and generate an exception if the call fails. Resolves T8383. Reviewed-by: João Paulo Taylor Ienczak Zanette <joao.tiz@expertisesolutions.com.br> Differential Revision: https://phab.enlightenment.org/D11281
2020-02-18eolian-mono: Make Get/Set internal for generated propertiesFelipe Magno de Almeida
Make Get and Set methods internal for properties that get the property syntax generated. Reviewed-by: João Paulo Taylor Ienczak Zanette <joao.tiz@expertisesolutions.com.br> Differential Revision: https://phab.enlightenment.org/D11252
2020-01-21Revert "csharp: Property Indexer implementation"Yeongjong Lee
Summary: This reverts commit 0954e501fd4008c40b3848de1f2c91bcd53b2f71. According to Framework Design Guidelines of MS, most of indexed properties are not recommended in EFL#. (see, https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/property) It is better to leave properties which have a key as methods. Reviewers: woohyun, felipealmeida Reviewed By: woohyun Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11114
2020-01-17C++: Fix use of @c_type tag in struct definitionFelipe Magno de Almeida
Summary: Depends on D11090 Reviewers: zmike Reviewed By: zmike Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11099
2019-12-23csharp: Property Indexer implementationLauro Moura
Use Indexers to use brackets, eg [i], syntax. Keys now can be used as following: var someVal = obj.SomeProperty[key]; obj.SomeProperty[key] = someNewVal; And for multiple keys: var someVal = obj.SomeProperty[(key1, key2)]; obj.SomeProperty[(key1, key2)] = someNewVal; T8384 Reviewed-by: WooHyun Jung <wh0705.jung@samsung.com> Differential Revision: https://phab.enlightenment.org/D10791
2019-12-12eolian_mono: proper parsing of doc notes and paragraphsXavi Artigas
Summary: The documentation tokenizer relies on proper separation of paragraphs, and we were not doing that. This fixes detection of Note:, Warning:, Remark: and TODO: tags. Additionally, we were removing the blank line between the summary and the description, artificially joining them. Test Plan: Everything builds and passes tests, and docs with `Note:` tags are correctly rendered (like `Efl.Loop_Consumer.new_promise`, for example) Reviewers: lauromoura Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10868
2019-12-12csharp: Add implicit conversion from tuples to structs.João Paulo Taylor Ienczak Zanette
Summary: Also generates implicit conversion for 1-field structs. Usage examples: ``` // With tuples Point2D p = (1, 2); obj.SetPoint((1, 2)); // With 1-field structs StringWrapper sw = "Must be handled by wrapper."; ``` Due to limitations of MSC compiler, implicit conversions are generated only if struct has 4 fields or less. Ref T8489. Reviewers: brunobelo, cedric, lauromoura, segfaultxavi Reviewed By: lauromoura Subscribers: #reviewers, #committers Tags: #efl Maniphest Tasks: T8489 Differential Revision: https://phab.enlightenment.org/D10801
2019-11-26csharp: Add more since tags to membersLauro Moura
Summary: - Class constructors and other members - Aliases fields ref T8359 Reviewers: felipealmeida, segfaultxavi, brunobelo, woohyun Reviewed By: felipealmeida Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8359 Differential Revision: https://phab.enlightenment.org/D10419
2019-11-22csharp: Fix helper functionLauro Moura
Summary: Was failing if the suffix were equal to the source string Reviewers: felipealmeida, segfaultxavi, YOhoho, brunobelo Reviewed By: brunobelo Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10708
2019-10-28eolian_cxx: Add key/value to function_defLauro Moura
Summary: This commit adds explicit eolian key/value/return info to function_def. The original parameter/return types are kept for compatibility. parameter/return -> Mimics the behavior of the generated C API (i.e. single-valued getters have their lone value translated to be their return type) explicit_return -> The actual return value for that block in the EO file. keys/values -> The values for respectively key and values blocks. This should help working with properties in the generators instead of fumbling with paremeter/return directly Fixes T8431 Test Plan: extra tests in the diff Reviewers: felipealmeida, brunobelo, segfaultxavi, YOhoho Reviewed By: brunobelo Subscribers: cedric, #reviewers, #committers, woohyun Tags: #efl Maniphest Tasks: T8431 Differential Revision: https://phab.enlightenment.org/D10494
2019-10-24cxx: Add license to CXX bindings.Felipe Magno de Almeida
Summary: Like C#, it will also be Apache 2.0 Depends on D9414 Reviewers: vitor.sousa, woohyun, jpeg, lauromoura Reviewed By: lauromoura Subscribers: jpeg, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9418
2019-10-12eolian-cxx: Make events inherit beta info from klass.Lauro Moura
To mimic function behavior Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br> Differential Revision: https://phab.enlightenment.org/D10381
2019-10-12eolian-cxx: Rename fields to standard namingLauro Moura
Summary: bool fields were missing the `is_` prefix. Reviewers: felipealmeida, brunobelo, segfaultxavi, woohyun Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10380
2019-10-09csharp: Respect beta for type aliasesLauro Moura
Summary: Also add beta info to `alias_def` in eolian_cxx. Reviewers: brunobelo, felipealmeida, woohyun, segfaultxavi Reviewed By: segfaultxavi Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10315
2019-09-30eolian_mono: Respect beta for enumYeongjong Lee
Summary: this prevent generating beta enum with `-Dmono-beta=false`. Test Plan: meson setup -Dbindings=mono,cxx -Dmono-beta=false Reviewers: lauromoura, Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10245
2019-09-26eolian_cxx: Possible infinite loop, if called.Bruno da Silva Belo
Reviewers: lauromoura, felipealmeida Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10200
2019-09-26eolian: rename param direction enum and fields for consistencyDaniel Kolesa
2019-09-25eolian: expose most API as stableDaniel Kolesa
There is still some TODO with builtin types, parameter directions and prefixes, which will be resolved in the next commits.
2019-09-24eolian: remove support for globalsDaniel Kolesa
This was meant to happen but did not previously happen. It is not ideal to do it now but better do it while we still can. In short, this removes one half of the variables API (keeps constants as they are) and repurposes the API to be only for constants. This is also better for consistency to match errors.
2019-09-23cxx: Fix some warnings from -WextraLauro Moura
Summary: - As we don't have C++17's [[fallthrough]], rely on GCC'd detection of fallthrough comments. See https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/ - Replaced some copy constructors with typecast operators. Previously, a constructor with remove_const/remove_cv were used to allow const iterators to be constructed from non-const iterators. This had the side effect of making these constructors actual copy constructors for non const lists. As we did not define other special constructors/operators, the rule of 5 were violated for these cases. This commit replaces these constructors with actual typecast operators that promote non const iterators to their const counterparts. - Cast a Eina_Bool/bool narrowing conversion - Add a missing break statement from D10050 Reviewers: zmike, brunobelo, felipealmeida Reviewed By: brunobelo Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9934
2019-09-20eolian: rename any_value_ptr -> any_value_ref for consistencyDaniel Kolesa
2019-09-20csharp: Add support for default param references in documentationLauro Moura
Summary: This also adds the information of default values in `parameter_def`. This will help adding actual default parameter support in the C# bindings. Thanks to @segfaultxavi for improved formatting and escaping. Fixes T8224 Reviewers: segfaultxavi, felipealmeida, brunobelo Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, segfaultxavi, #committers Tags: #efl Maniphest Tasks: T8224 Differential Revision: https://phab.enlightenment.org/D10050
2019-09-16Revert "cxx: Fix some warnings from -Wextra"Mike Blumenkrantz
This reverts commit bdb8505f3b7318b024530d1f9559c91978a3b421. more review pending on this
2019-09-16cxx: Fix some warnings from -WextraLauro Moura
Summary: - As we don't have C++17's [[fallthrough]], rely on GCC'd detection of fallthrough comments. See https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/ - Add some missing copy assignment operators as reported by -Wdeprecated-copy - Cast a Eina_Bool/bool narrowing conversion Reviewers: zmike, brunobelo, felipealmeida Reviewed By: zmike Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9934
2019-09-16eolian: drop @ctor_param and the associated APIsDaniel Kolesa
This has been unused for a while, and has been just lingering around the code, so drop it so it doesn't make it into a release.
2019-09-10csharp: Skip non-public members from interfacesLauro Moura
Summary: Eolian allows non-public members in interfaces and mixins (usually @protected). As both kinds are converted to C# interfaces, this causes problem as non-public members are forbidden in C# interfaces. This commit changes eolian_mono by removing those members from the C# interfaces. If a generated class implements the interface, the method is generated as if it were a protected member of the class directly. For mixed properties like `Efl.Io.Reader.CanRead { get; set @protected; }`, the interface has only the public getter and the the implementing class has both the public getter and the protected setter. With this, C# devs won't be able to directly implement protected Eo methods from interfaces. (But this really does not make sense from the C# point of view). ref T7494 Reviewers: segfaultxavi, felipealmeida, YOhoho Reviewed By: YOhoho Subscribers: cedric, brunobelo, Jaehyun_Cho, #reviewers, woohyun, #committers Tags: #efl Maniphest Tasks: T7494 Differential Revision: https://phab.enlightenment.org/D9800
2019-09-09eolian: remove second parameter for eolian_type_c_type_getDaniel Kolesa
This has been replaced by newer APIs.
2019-09-09eolian_cxx: Add support for @by_refLauro Moura
Summary: It will coexist with `eolian_type_is_ptr` while we phase out the latter. Fixes: T8211 Depends on D9866 Reviewers: q66, felipealmeida Reviewed By: q66 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9867
2019-09-07eolian_cxx: Remove last usage of type_is_ownedLauro Moura
Reviewers: q66, felipealmeida Reviewed By: q66 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9866
2019-09-05eolian_cxx: Replace type_is_owned with is_moveLauro Moura
Summary: is_owned is being replaced with the is_move family of functions. This commit changes only the libeolian usage inside libeolian_cxx, keeping the has_own naming in the generators for a simpler patch during this freeze period. Fixes T8199 Reviewers: q66, felipealmeida Reviewed By: q66 Subscribers: cedric, #reviewers, brunobelo, #committers Tags: #efl Maniphest Tasks: T8199 Differential Revision: https://phab.enlightenment.org/D9843
2019-09-04eolian: remove the expression eval_type APIDaniel Kolesa
This is unnecessary because for all contexts where type is relevant the validator already makes sure the type and expression match correctly, so you don't ever need to re-validate it. If you are doing a generic case and are not sure, just use MASK_ALL.
2019-08-23eolian-mono: Add support for multi-value properties with tuplesFelipe Magno de Almeida
Summary: T8133 Reviewers: woohyun, segfaultxavi, felipealmeida Reviewed By: felipealmeida Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9577
2019-08-16eolian: rename is_class api for functions to is_staticDaniel Kolesa
Still needs restriction to classes only etc to be done later. Ref https://phab.enlightenment.org/T8118 Ref https://phab.enlightenment.org/T7675
2019-08-16eolian-mono: Use correct allocator to free with free, and not deleteFelipe Magno de Almeida
T8137 Differential Revision: https://phab.enlightenment.org/D9576
2019-08-07cxx: Fix funcptr c_args declaration.Lauro Moura
Summary: The internal wrapper was generating the argument types directly instead of passing through the translation generator `grammar::c_type`. This caused the type in the `caller` callback to be different from the actual C type of the declared function pointer, like in `@out` parameters. Reviewers: tasn, felipealmeida Reviewed By: felipealmeida Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9524
2019-08-05csharp: fix ownership of value types in arrays and listsVitor Sousa
Summary: `eolian_mono` now considers the implicit ownership of value types in arrays and lists when generating ownership flags. Also, update manual bindings for arrays and lists to no longer free elements in the `Dispose` method when the container has ownership of the elements but C# itself does not have ownership of the container; the elements will be freed by whoever owns the container. Modifying and removing elements will still free them though. Re-enabled unit tests that required ownership of value type elements. Reviewers: felipealmeida, q66, vitor.sousa Reviewed By: felipealmeida Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9457
2019-08-01mono-docs: Add misc struct docsXavi Artigas
Summary: Structs have a convenience constructor which was missing parameter documentation. Struct fields need a <value> tag or there is a hole in the generated docs. The documentation for the type of the field has been used, when available. Test Plan: Build docs and look at generated pages for structs. Reviewers: lauromoura, vitor.sousa, felipealmeida Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9478
2019-07-31eolian-cxx: Add special type tags to make function_wrapper specializations ↵Felipe Magno de Almeida
unique Reviewers: lauromoura, bu5hm4n, woohyun Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9469
2019-07-26eolian-cxx: Add binbuf and event keywords handlingFelipe Magno de Almeida
n Summary: Add support in Eolian-Cxx for binbuf and event keywords and tests. It will generate the C type while the manual binding in C++ for the types do not exist. Reviewers: q66, lauromoura Reviewed By: q66 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9412
2019-07-23mono-docs: Allow HTML codes in documentationXavi Artigas
Summary: All comments from EO files are HTML-escaped (i.e. "<" is turned into "&lt;"), and this is good. However all text added by the mono code generator is HTML-escaped too, and that is a pity. Circumventing the escaping in the generator involves serious code changes so it is simpler to allow "escaping" characters to avoid escaping... "<" is turned into "&lt;" but "\<" is turned into "<" If you are giving these strings from C, remember that the backslash needs to be escaped too! For example: "\\<b\\>Hello\\</b\\>" This is intended for use in the generators, NOT in the EO docs. Test Plan: Everything works as before, but now HTML codes can be added from the generators. Reviewers: lauromoura, vitor.sousa, felipealmeida Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9380
2019-07-12cxx: remove compilation warnings in C++ code, from both gcc and clangVitor Sousa
Summary: Remove almost all the compilation warnings from C++ code. Only explicit warnings using the `#warning` preprocessor directive remain. Some warnings had to be suppressed with `#pragma` directives because the behavior they were warning about is intended in some specific places. Code comments were added in such situations. Added a generator that creates `#pragma` directives in order to suppress warnings in all generated C++ headers. Currently `-Wignored-qualifiers` is the only warning category being suppressed. The innocuous const qualifiers that it points are inoffensive and have no effect in compilation at all. They are also hard to track in generation since they can emerge from different types in many places. To ease the generation of the warning suppressors an utility constructor was added to `efl::eolian::grammar::attributes::unused_type`. Add constructors to `eolian_mono::class_context` to default initialize its internal string and avoid field initialization warnings. Test Plan: `meson test` Reviewers: lauromoura, felipealmeida, zmike, segfaultxavi Reviewed By: zmike Subscribers: cedric, #reviewers, #committers Tags: #efl_language_bindings Differential Revision: https://phab.enlightenment.org/D9275
2019-07-08eolian_cxx: update eolian_cxx to recognize slice and rw_sliceVitor Sousa
Summary: Update eolian_cxx to recognize the new keywords `slice` and `rw_slice`, so it can generate the corresponding types `Eina_Slice` and `Eina_Rw_Slice`. Reviewers: lauromoura, felipealmeida, q66 Reviewed By: q66 Subscribers: cedric, bu5hm4n, #reviewers, segfaultxavi, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9237
2019-06-24eolian_mono: support eo access modifiersYeongjong Lee
Summary: Because in C# interface members can't include access modifiers, eolian_mono ignore function scope tags in eo interfaces. ref T7494 Reviewers: q66, felipealmeida, lauromoura, segfaultxavi, Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T7494 Differential Revision: https://phab.enlightenment.org/D9128
2019-05-29eolian-cxx: Fix some warnings from cppcheckLauro Moura
Differential Revision: https://phab.enlightenment.org/D9052
2019-05-16eolian: rename eolian_event_c_name_getDaniel Kolesa
This is for consistency with the new eolian_class_c_macro_get as well as for better clarity, as c_name_get is already provided by Object and refers to something else.
2019-05-16eolian: rename eolian_typedecl_enum_field_c_name_getDaniel Kolesa
This is to allow for better object oriented APIs, as the `c_name` field would be inherited from Object. This also makes it more clear in C.
2019-03-26eolian_cxx: rework context code, also more flexible scope indentation generatorVitor Sousa
Summary: Context management classes now store constant copies of the tags they are supposed to hold. So, they are immutable objects now. Functions that manipulate context create new object copies as needed. `constexpr` was added for class constructor and functions. Indentation generator now used four space by default. Also, the amount of desired spaces can now be specified at call site. Added helper methods to return 'indented' and 'unindented' version of a given indentation generator object. Test Plan: ninja test Reviewers: felipealmeida, lauromoura Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8467
2019-03-20mono-docs: Use @since tags properlyXavi Artigas
Summary: Only the number was being used, and in places were it should not be. Now the Since version appears only in <summary> tags, with proper context (Since EFL 1.22). Test Plan: make && gendoc should produce DocFX pages which make more sense. Reviewers: lauromoura, zmike, bu5hm4n Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8012
2019-03-11eolian-cxx: Add beta information to *_defLauro Moura
Summary: Fixes T7732 Reviewers: cedric, felipealmeida, vitor.sousa, bu5hm4n Reviewed By: vitor.sousa Subscribers: #reviewers, #committers Tags: #efl Maniphest Tasks: T7732 Differential Revision: https://phab.enlightenment.org/D8267