Commit Graph

28 Commits

Author SHA1 Message Date
Daniel Kolesa 27291b4486 eolian: fix potential ABI violation in expr serialization
While this may seem safe, and likely is on any 64-bit system,
it may not be entirely well defined. And in this case we should
not have to worry about copying.

Maybe fixes T8276...
2019-09-30 11:32:41 +02:00
Daniel Kolesa 6751f011c1 eolian: remove the expression eval_type API
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-09-04 18:02:47 +02:00
Daniel Kolesa dd90488b69 eolian: add capturing of variables/typedecls in expr eval
This will be used from validation to properly count actual
dependencies of a unit.
2018-04-20 16:10:55 +02:00
Daniel Kolesa dd2e579fec eolian: do not require unit for expr eval APIs
The necessary information is now stored directly in the expr
during database validation.

Also enable expr validation for params.
2018-01-16 16:37:52 +01:00
Daniel Kolesa b70604d018 eolian: cache enum expr in the database 2018-01-16 16:37:52 +01:00
Daniel Kolesa 29a9b9ad44 eolian: expose _eval_type to internals 2018-01-16 16:37:52 +01:00
Daniel Kolesa 19c16b671e eolian: type_typedecl_get doesn't need a unit 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 a6e5caba10 eolian: remove leftover code 2017-09-22 18:08:36 +02:00
Daniel Kolesa 4bae2a7385 eolian: merge REGULAR and COMPLEX types 2017-09-22 17:46:02 +02:00
Daniel Kolesa c234b5ee69 eolian: expr eval APIs now take units 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 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 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
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 4c4fbfae0b eolian: remove most of the old type APIs 2016-03-03 18:58:11 +00: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 ed58165b50 eolian: butts 2015-05-12 16:25:52 +01:00
Mike Blumenkrantz 5375e154fe fix config.h inclusion across the tree 2014-09-23 15:56:46 -04:00
Daniel Kolesa 0998f2af5c eolian: new APIs for expression analysis
This adds a few new APIs to retrieve the type of an expression, operators
for binary and unary expressions, lhs/rhs for binary expressions, expr for
unary expressions and value for other expressions.
2014-09-02 13:33:04 +01:00
Daniel Kolesa 9ffe700aac eolian: simplify expr serialize and fix null/bool case 2014-09-02 13:07:16 +01:00
Daniel Kolesa e6954d143d eolian: drop Eina_Value
Because of Eina_Value being less than optimal in our usage, we're dropping it in Eolian.
This simplifies the code and makes it easier to bind to other languages, which
will aid new generators. Also, we're dropping long double support from eo files
and expressions as it causes an ABI breakage in gcc 4.4.
2014-08-21 09:26:05 +01:00
Daniel Kolesa a5964f0252 eolian: add comments containing original expressions to generated enum fields
This required a new API, eolian_expression_serialize.
2014-08-21 09:26:04 +01:00
Daniel Kolesa 18c2b5082e eolian: allow usage of stack Eina_Value in expr API 2014-08-21 09:26:04 +01:00
Daniel Kolesa 7ef5c78792 eolian: fix null serialization 2014-08-21 09:26:03 +01:00
Daniel Kolesa 788386c86c eolian: eolian_type_name_get now returns the eo name, not c name
so instead of "unsigned int" you get "uint". This is important for handling of
expressions and cross-language interoperability. You can use c_type_get on the
base type to get the C name. Also, append the appropriate suffix to number literals
when calling eolian_expression_value_to_literal.
2014-08-21 09:26:03 +01:00
Daniel Kolesa eab668bb0f eolian: expression improvements
Character literals now allow escape sequences. Strings created by
eolian_expression_value_to_literal are now fully escaped.
2014-08-21 09:26:03 +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