mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-04 04:33:23 +00:00
Schemas now support include files.
Bug: 15521443 Change-Id: I2e1ef97e7225a1a0ecf2ca65e31d49d443003747 Tested: on Linux.
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
# Formal Grammar of the schema language
|
||||
|
||||
schema = namespace\_decl | type\_decl | enum\_decl | root\_decl | object
|
||||
schema = include*
|
||||
( namespace\_decl | type\_decl | enum\_decl | root\_decl | object )*
|
||||
|
||||
include = `include` string\_constant `;`
|
||||
|
||||
namespace\_decl = `namespace` ident ( `.` ident )* `;`
|
||||
|
||||
|
||||
@@ -141,6 +141,20 @@ These will generate the corresponding namespace in C++ for all helper
|
||||
code, and packages in Java. You can use `.` to specify nested namespaces /
|
||||
packages.
|
||||
|
||||
### Includes
|
||||
|
||||
You can include other schemas files in your current one, e.g.:
|
||||
|
||||
include "mydefinitions.fbs"
|
||||
|
||||
This makes it easier to refer to types defined elsewhere. `include`
|
||||
automatically ensures each file is parsed just once, even when referred to
|
||||
more than once.
|
||||
|
||||
When using the `flatc` compiler to generate code for schema definitions,
|
||||
only definitions in the current file will be generated, not those from the
|
||||
included files (those you still generate separately).
|
||||
|
||||
### Root type
|
||||
|
||||
This declares what you consider to be the root table (or struct) of the
|
||||
|
||||
Reference in New Issue
Block a user