Skip to content

Commit

Permalink
Fixed small inaccurracies in the schema grammar.
Browse files Browse the repository at this point in the history
Change-Id: I6e9e66c3d7d67c54617bc892f612b7341bebd7e0
  • Loading branch information
Wouter van Oortmerssen committed Jul 31, 2015
1 parent 4998ad7 commit 0e064e4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
15 changes: 9 additions & 6 deletions docs/html/md__grammar.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.7"/>
<title>FlatBuffers: Formal Grammar of the schema language</title>
<title>FlatBuffers: Grammar of the schema language</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
Expand Down Expand Up @@ -55,7 +55,7 @@
<div id="doc-content">
<div class="header">
<div class="headertitle">
<div class="title">Formal Grammar of the schema language </div> </div>
<div class="title">Grammar of the schema language </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>schema = include* ( namespace_decl | type_decl | enum_decl | root_decl | file_extension_decl | file_identifier_decl | attribute_decl | object )*</p>
Expand All @@ -68,13 +68,16 @@
<p>field_decl = ident <code>:</code> type [ <code>=</code> scalar ] metadata <code>;</code></p>
<p>type = <code>bool</code> | <code>byte</code> | <code>ubyte</code> | <code>short</code> | <code>ushort</code> | <code>int</code> | <code>uint</code> | <code>float</code> | <code>long</code> | <code>ulong</code> | <code>double</code> | <code>string</code> | <code>[</code> type <code>]</code> | ident</p>
<p>enumval_decl = ident [ <code>=</code> integer_constant ]</p>
<p>metadata = [ <code>(</code> commasep( ident [ <code>:</code> scalar ] ) <code>)</code> ]</p>
<p>scalar = integer_constant | float_constant | <code>true</code> | <code>false</code></p>
<p>metadata = [ <code>(</code> commasep( ident [ <code>:</code> single_value ] ) <code>)</code> ]</p>
<p>scalar = integer_constant | float_constant</p>
<p>object = { commasep( ident <code>:</code> value ) }</p>
<p>value = scalar | object | string_constant | <code>[</code> commasep( value ) <code>]</code></p>
<p>single_value = scalar | string_constant</p>
<p>value = single_value | object | <code>[</code> commasep( value ) <code>]</code></p>
<p>commasep(x) = [ x ( <code>,</code> x )* ]</p>
<p>file_extension_decl = <code>file_extension</code> string_constant <code>;</code></p>
<p>file_identifier_decl = <code>file_identifier</code> string_constant <code>;</code> </p>
<p>file_identifier_decl = <code>file_identifier</code> string_constant <code>;</code></p>
<p>integer_constant = -?[0-9]+ | <code>true</code> | <code>false</code></p>
<p>float_constant = -?[0-9]+.[0-9]+((e|E)(+|-)?[0-9]+)? </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- Google Analytics -->
Expand Down
2 changes: 1 addition & 1 deletion docs/html/navtree.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var NAVTREE =
[ "Benchmarks", "md__benchmarks.html", null ],
[ "FlatBuffers white paper", "md__white_paper.html", null ],
[ "FlatBuffer Internals", "md__internals.html", null ],
[ "Formal Grammar of the schema language", "md__grammar.html", null ]
[ "Grammar of the schema language", "md__grammar.html", null ]
] ]
];

Expand Down
2 changes: 1 addition & 1 deletion docs/html/pages.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<tr id="row_7_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="md__benchmarks.html" target="_self">Benchmarks</a></td><td class="desc"></td></tr>
<tr id="row_8_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="md__white_paper.html" target="_self">FlatBuffers white paper</a></td><td class="desc"></td></tr>
<tr id="row_9_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="md__internals.html" target="_self">FlatBuffer Internals</a></td><td class="desc"></td></tr>
<tr id="row_10_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="md__grammar.html" target="_self">Formal Grammar of the schema language</a></td><td class="desc"></td></tr>
<tr id="row_10_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="md__grammar.html" target="_self">Grammar of the schema language</a></td><td class="desc"></td></tr>
</table>
</div><!-- directory -->
</div><!-- contents -->
Expand Down
13 changes: 9 additions & 4 deletions docs/source/Grammar.md
Original file line number Diff line number Diff line change
@@ -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 |
Expand Down Expand Up @@ -26,17 +26,22 @@ 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 )\* ]

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

0 comments on commit 0e064e4

Please sign in to comment.