Files
flatbuffers/docs/source/Grammar.md
Mark Klara 69a31b807a Revamping the FlatBuffers docs.
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
2016-01-19 14:31:17 -08:00

1.4 KiB
Executable File

Grammar of the schema language

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]+)?