Fixed small inaccurracies in the schema grammar.

Change-Id: I6e9e66c3d7d67c54617bc892f612b7341bebd7e0
This commit is contained in:
Wouter van Oortmerssen
2015-07-31 12:26:23 -07:00
parent 4998ad7365
commit 0e064e415b
4 changed files with 20 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
# Formal Grammar of the schema language
# Grammar of the schema language
schema = include*
( namespace\_decl | type\_decl | enum\_decl | root\_decl |
@@ -26,13 +26,15 @@ type = `bool` | `byte` | `ubyte` | `short` | `ushort` | `int` | `uint` |
enumval\_decl = ident [ `=` integer\_constant ]
metadata = [ `(` commasep( ident [ `:` scalar ] ) `)` ]
metadata = [ `(` commasep( ident [ `:` single\_value ] ) `)` ]
scalar = integer\_constant | float\_constant | `true` | `false`
scalar = integer\_constant | float\_constant
object = { commasep( ident `:` value ) }
value = scalar | object | string\_constant | `[` commasep( value ) `]`
single\_value = scalar | string\_constant
value = single\_value | object | `[` commasep( value ) `]`
commasep(x) = [ x ( `,` x )\* ]
@@ -40,3 +42,6 @@ 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]+)?