mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-03 12:21:23 +00:00
Adding an API reference for the supported languages. General docs cleanup, including a new `tutorial` section that supports all of the supported languages. Added samples for each supported language to mirror the new tutorial page. Cleaned up all the links by making them `@ref` style links, instead of referencing the names of the generated `.html` files. Removed all generated files that were unnecessarily committed. Also fixed the C# tests (two were failing due to a missing file). Bug: b/25801305 Tested: Tested all samples on Ubuntu, Mac, and Android. Docs were generated using doxygen and viewed on Chrome. Change-Id: I2acaba6e332a15ae2deff5f26a4a25da7bd2c954
49 lines
1.4 KiB
Markdown
Executable File
49 lines
1.4 KiB
Markdown
Executable File
Grammar of the schema language {#flatbuffers_grammar}
|
|
==============================
|
|
|
|
schema = include*
|
|
( namespace\_decl | type\_decl | enum\_decl | root\_decl |
|
|
file_extension_decl | file_identifier_decl |
|
|
attribute\_decl | object )*
|
|
|
|
include = `include` string\_constant `;`
|
|
|
|
namespace\_decl = `namespace` ident ( `.` ident )* `;`
|
|
|
|
attribute\_decl = `attribute` string\_constant `;`
|
|
|
|
type\_decl = ( `table` | `struct` ) ident metadata `{` field\_decl+ `}`
|
|
|
|
enum\_decl = ( `enum` | `union` ) ident [ `:` type ] metadata `{` commasep(
|
|
enumval\_decl ) `}`
|
|
|
|
root\_decl = `root_type` ident `;`
|
|
|
|
field\_decl = ident `:` type [ `=` scalar ] metadata `;`
|
|
|
|
type = `bool` | `byte` | `ubyte` | `short` | `ushort` | `int` | `uint` |
|
|
`float` | `long` | `ulong` | `double`
|
|
| `string` | `[` type `]` | ident
|
|
|
|
enumval\_decl = ident [ `=` integer\_constant ]
|
|
|
|
metadata = [ `(` commasep( ident [ `:` single\_value ] ) `)` ]
|
|
|
|
scalar = integer\_constant | float\_constant
|
|
|
|
object = { commasep( ident `:` value ) }
|
|
|
|
single\_value = scalar | string\_constant
|
|
|
|
value = single\_value | object | `[` commasep( value ) `]`
|
|
|
|
commasep(x) = [ x ( `,` x )\* ]
|
|
|
|
file_extension_decl = `file_extension` string\_constant `;`
|
|
|
|
file_identifier_decl = `file_identifier` string\_constant `;`
|
|
|
|
integer\_constant = -?[0-9]+ | `true` | `false`
|
|
|
|
float\_constant = -?[0-9]+.[0-9]+((e|E)(+|-)?[0-9]+)?
|