From 0e064e415bf127fd7e709981e6b35afc5934e8af Mon Sep 17 00:00:00 2001 From: Wouter van Oortmerssen <wvo@google.com> Date: Fri, 31 Jul 2015 12:26:23 -0700 Subject: [PATCH] Fixed small inaccurracies in the schema grammar. Change-Id: I6e9e66c3d7d67c54617bc892f612b7341bebd7e0 --- docs/html/md__grammar.html | 15 +++++++++------ docs/html/navtree.js | 2 +- docs/html/pages.html | 2 +- docs/source/Grammar.md | 13 +++++++++---- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/docs/html/md__grammar.html b/docs/html/md__grammar.html index 33d6b8c1..7431c6dc 100644 --- a/docs/html/md__grammar.html +++ b/docs/html/md__grammar.html @@ -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> @@ -55,7 +55,7 @@ $(document).ready(function(){initNavTree('md__grammar.html','');}); <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> @@ -68,13 +68,16 @@ $(document).ready(function(){initNavTree('md__grammar.html','');}); <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 --> diff --git a/docs/html/navtree.js b/docs/html/navtree.js index 58cf1e6c..58fba48a 100644 --- a/docs/html/navtree.js +++ b/docs/html/navtree.js @@ -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 ] ] ] ]; diff --git a/docs/html/pages.html b/docs/html/pages.html index 69d49a3b..cbbe8464 100644 --- a/docs/html/pages.html +++ b/docs/html/pages.html @@ -70,7 +70,7 @@ $(document).ready(function(){initNavTree('pages.html','');}); <tr id="row_7_"><td class="entry"><span style="width:16px;display:inline-block;"> </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;"> </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;"> </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;"> </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;"> </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 --> diff --git a/docs/source/Grammar.md b/docs/source/Grammar.md index cafc0548..bcc5f749 100755 --- a/docs/source/Grammar.md +++ b/docs/source/Grammar.md @@ -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]+)? -- GitLab