eolian: add support for static and terminated arrays
authorDaniel Kolesa <d.kolesa@osg.samsung.com>
Thu, 30 Jun 2016 13:04:03 +0000 (14:04 +0100)
committerDaniel Kolesa <d.kolesa@osg.samsung.com>
Thu, 30 Jun 2016 15:59:21 +0000 (16:59 +0100)
commitab2e608239d0518241454bd7cb6abe3f680764c1
tree950be0f34dffe5e3962c6f850e54bd770459fd21
parentff7a5e4f1b1286b1226fb0a9a1729759d1f72e18
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
13 files changed:
src/bin/eolian/types_generator.c
src/bindings/luajit/eolian.lua
src/lib/eolian/Eolian.h
src/lib/eolian/database_type.c
src/lib/eolian/database_type_api.c
src/lib/eolian/database_validate.c
src/lib/eolian/eo_lexer.c
src/lib/eolian/eo_lexer.h
src/lib/eolian/eo_parser.c
src/lib/eolian/eolian_database.h
src/tests/eolian/data/struct.eo
src/tests/eolian/data/struct_ref.c
src/tests/eolian/eolian_parsing.c