Commit Graph

125 Commits

Author SHA1 Message Date
Daniel Kolesa 70bf1eac24 eolian: add infrastructure for globals and constants
Nothing parses yet, and no API is exposed. Also, move the remaining instances of file
inside of existing structures to Eolian_Object and parse basename only once.
2014-08-21 09:26:04 +01:00
Daniel Kolesa a57c729b10 eolian: consume private/protected modifier on events 2014-08-21 09:26:04 +01:00
Daniel Kolesa 1be7656af6 eolian: expression mode for lexer
This way we can only lex expr related tokens (operators etc.) when actually
about to parse an expression. That allows stuff like nested complex types
without the lexer treating the endings as right shift.
2014-08-21 09:26:03 +01:00
Tom Hacohen a0c419aa4a Eolian parser: Allow tagging properties with @constructor.
Thanks to Quaker for the exact directions.
2014-08-21 09:26:03 +01:00
Daniel Kolesa d3aedb5506 eolian: consume the comment token in properties
This is to add syntax for later combined get/set property docs functionality.
2014-08-21 09:26:03 +01:00
Daniel Kolesa 459638c2b9 eolian: more consistent syntax
"legacy foo" is now "legacy: foo" and "return foo" is now "return: foo".
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 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
Daniel Kolesa d7ca6dc1c3 eolian: initial support for expression evaluation
There are now functions that let you evaluate Eolian_Expression. They're not exposed
yet. Further improvements will come as well as public API.
2014-08-21 09:26:03 +01:00
Daniel Kolesa 96f360a7d1 eolian: lexing of multichar binary operators 2014-08-21 09:26:03 +01:00
Daniel Kolesa 62541ce484 eolian: rename public enum members to a namespaced form 2014-08-21 09:26:03 +01:00
Daniel Kolesa 436a37f0b9 eolian: initial support for expression parsing 2014-08-21 09:26:03 +01:00
Daniel Kolesa e3192796b6 eolian: actually fill in the line/column info in the handles 2014-08-21 09:26:03 +01:00
Daniel Kolesa 8d74261a30 eolian: fix a bug that caused wrong comparisons of class and file name
This also renames ecore_poll files to ecore_poller so that the class name matches.
2014-08-21 09:26:03 +01:00
Daniel Kolesa 6aa99c0026 eolian: better error information + fix tests
This provides better location info when failing to resolve EOLIAN_TYPE_CLASS.
Also fixes tests I forgot to push before.
2014-08-21 09:26:02 +01:00
Daniel Kolesa c88c0d9347 eolian: fix tests and fix class name comparison in parser
This fixes the Eolian testsuite as well as adds a better way to compare where a class
comes from, allowing us to guess EOLIAN_TYPE_CLASS correctly.
2014-08-21 09:26:02 +01:00
Daniel Kolesa 0e4860f215 eolian: add support for referencing classes as types
For this purpose, several other changes were made. There can now only be 1 class per file
and the class name has to match the file name. Also, I replaced the list of classes with
a hash, allowing for fast indexing (crucial for parser performance - otherwise it was
very slow).

This also adds a new API, eolian_type_class_get.
2014-08-21 09:26:02 +01:00
Daniel Kolesa 5a603c00b6 eolian: remove irrelevant comments
This functionality was already done previously.
2014-07-29 10:05:06 +01:00
Daniel Kolesa ae1ff34dd6 eolian: fix type parsing
I reorganized what's allowed and what is not a bit, particularly, strictened the
rules for named structs and loosened the rules for anonymous structs, and refined
them for void types. It should be all correct now.
2014-07-25 14:51:13 +01:00
Daniel Kolesa e2c51100c7 eolian: add test for class methods/properties
This also fixes a bug in the Eolian parser that handles class properties.
2014-07-24 14:02:46 +01:00
Daniel Kolesa 94404b403c eolian: parser support for constructor qualifier
This will be needed when the constructors {} section goes away.
2014-07-24 13:01:47 +01:00
Daniel Kolesa 214cfac378 eolian: protected ctors 2014-07-24 12:58:29 +01:00
Daniel Kolesa a5ad792780 eolian: add support for class functions 2014-07-24 12:05:12 +01:00
Daniel Kolesa a3182948ad eolian: use libgen.h basename 2014-07-23 19:37:03 +01:00
Daniel Kolesa 315d5de11d eolian: use just filename (not path) for eolian_class_get_by_file 2014-07-23 17:15:00 +01:00
Daniel Kolesa a8c0504ce2 eolian: add comment parsing for typedefs 2014-07-23 10:57:23 +01:00
Daniel Kolesa d8e54e2636 eolian: use new syntax for const methods as per wiki 2014-07-22 17:13:24 +01:00
Daniel Kolesa ab8fe63afa eolian: use @protected syntax as per wiki 2014-07-22 16:35:54 +01:00
Daniel Kolesa 4f1f182a89 eolian: lexer line context push/pop/restore/clear 2014-07-22 15:44:23 +01:00
Daniel Kolesa cbd54f4de0 eolian: include file info in redef errors when different file 2014-07-22 15:01:09 +01:00
Daniel Kolesa f487d44011 eolian: structs and aliases now contain line/column info for better error messages 2014-07-22 14:48:08 +01:00
Daniel Kolesa 71ae2f2c2e eolian: another leak fix 2014-07-22 10:22:21 +01:00
Daniel Kolesa c03a0a2a39 eolian: memory leak fix 2014-07-22 10:15:56 +01:00
Daniel Kolesa b81e05def5 eolian: new API: eolian_type_alias_find_by_name, remove the old APIs that take an alias name, update tests 2014-07-21 17:12:35 +01:00
Daniel Kolesa 058a3c314c eolian: rename _types to _aliases 2014-07-21 16:58:12 +01:00
Daniel Kolesa e797e40478 eolian: remove Eolian_Typedef, use Eolian_Type instead; allow eolian_type_base_type_get on aliases 2014-07-21 16:53:25 +01:00
Daniel Kolesa ac7f5d0f79 eolian: fill in full_name and namespaces properly, and allow parsing dots in type names 2014-07-21 15:17:59 +01:00
Daniel Kolesa c4fd68f08a eolian: add API to retrieve filename for each typedef and struct 2014-07-21 12:26:44 +01:00
Daniel Kolesa 6caf41e288 eolian: only check redef on actual named structs 2014-07-21 11:47:35 +01:00
Daniel Kolesa 5d1cd61c92 eolian: put structs and typedefs right in the respective hashmaps without going through nodes 2014-07-21 11:42:05 +01:00
Daniel Kolesa 6f805a9998 eolian: check redefinitions in the parser instead (provides line info) 2014-07-21 11:34:14 +01:00
Daniel Kolesa fa3e433f6e eolian: disallow the data field in interfaces; it's always null 2014-07-18 17:29:35 +01:00
Daniel Kolesa 6c268d98e5 eolian: lexing of string literals (including support for escape sequences etc.) 2014-07-17 14:17:19 +01:00
Daniel Kolesa c636882158 eolian: remove TOK_EOF, replace with -1 2014-07-16 16:06:04 +01:00
Daniel Kolesa 226f417005 eolian: remove eo_lexer_get_until and allow just single-word value in the data: field of a class 2014-07-16 15:33:11 +01:00
Daniel Kolesa e2bab9ed2c eolian: parse events without get_ident 2014-07-16 14:43:40 +01:00
Daniel Kolesa ae3eb2b942 eolian: make event type syntax consistent 2014-07-15 23:50:34 +01:00
Daniel Kolesa d0e0576f0b eolian: parser cleanup - structs no longer have to lookahead, making our grammar effectively LL(1) 2014-07-15 17:06:47 +01:00
Daniel Kolesa 0d0f6e3743 eolian: support for extern structs and typedefs (including API) 2014-07-15 15:33:22 +01:00
Daniel Kolesa 17a6bb122b eolian: add tests for struct types plus fix a double free and name storage on the way 2014-07-14 12:11:48 +01:00