Files
flatbuffers-bigfoot/docs/source/Grammar.md
Wouter van Oortmerssen 26a30738a4 Initial commit of the FlatBuffers code.
Change-Id: I4c9f0f722490b374257adb3fec63e44ae93da920
Tested: using VS2010 / Xcode / gcc on Linux.
2014-06-10 13:53:28 -07:00

899 B
Executable File

Formal Grammar of the schema language

schema = namespace_decl | type_decl | enum_decl | root_decl | object

namespace_decl = namespace ident ( . ident )* ;

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 = type : ident [ = 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 [ : scalar ] ) ) ]

scalar = integer_constant | float_constant | true | false

object = { commasep( ident : value ) }

value = scalar | object | string_constant | [ commasep( value ) ]

commasep(x) = [ x ( , x )* ]