[html5] r4449 - [e] (0) Let's try adding an ABNF for the wire protocol.

whatwg at whatwg.org whatwg at whatwg.org
Wed Dec 16 12:44:03 PST 2009


Author: ianh
Date: 2009-12-16 12:44:01 -0800 (Wed, 16 Dec 2009)
New Revision: 4449

Modified:
   complete.html
   source
Log:
[e] (0) Let's try adding an ABNF for the wire protocol.

Modified: complete.html
===================================================================
--- complete.html	2009-12-16 17:12:47 UTC (rev 4448)
+++ complete.html	2009-12-16 20:44:01 UTC (rev 4449)
@@ -65755,7 +65755,7 @@
   specifications to implement buffering and piecing together of
   messages manually.</p>
 
-  <hr><p>The protocol is designed to support other frame types in
+  <p>The protocol is designed to support other frame types in
   future. Instead of the 0x00 byte, other bytes might in future be
   defined. Frames denoted by bytes that do not have the high bit set
   (0x00 to 0x7F) are treated as described above (a stream of bytes
@@ -65765,11 +65765,37 @@
   set for all but the last byte. The remainder of the frame is then as
   much data as was specified.</p>
 
+  <p>This wire format for the data transfer part is described by the
+  following non-normative ABNF, which is given in two alternative
+  forms: the first describing the wire format as allowed by this
+  specification, and the second describing how an arbitrary bytestream
+  would be parsed.
+  <a href=#refsABNF>[ABNF]</a>
+
+  </p>
+
+  <pre>; the wire protocol as allowed by this specification
+frames        = *frame
+frame         = text-frame
+text-frame    = (%x00) *( UTF8-char ) %xFF
+
+; the wire protocol including error-handling and forward-compatible parsing rules
+frames        = *frame
+frame         = text-frame / binary-frame
+text-frame    = (%x00-%x7F) *( UTF8-char / %x80-%x7E ) %xFF
+binary-frame  = (%x80-%xFF) length < as many bytes as given by the length >
+length        = *(%x80-%xFF) (%x00-%x7F)</pre>
+
+  <p>The UTF8-char rule is defined in the UTF-8 specification. <a href=#refsRFC3629>[RFC3629]</a></p>
+
+  <p class=note>The above ABNF is intended for a binary octet
+  environment.</p>
+
   <hr><p>The following diagrams summarise the protocol:</p>
 
   <pre>Handshake
    |
-  \|/
+   V
 Frame type byte <-------------------------------------.
    |      |                                           |
    |      `-- (0x00 to 0x7F) --> Data... --> 0xFF -->-+

Modified: source
===================================================================
--- source	2009-12-16 17:12:47 UTC (rev 4448)
+++ source	2009-12-16 20:44:01 UTC (rev 4449)
@@ -75000,8 +75000,6 @@
   specifications to implement buffering and piecing together of
   messages manually.</p>
 
-  <hr>
-
   <p>The protocol is designed to support other frame types in
   future. Instead of the 0x00 byte, other bytes might in future be
   defined. Frames denoted by bytes that do not have the high bit set
@@ -75012,13 +75010,43 @@
   set for all but the last byte. The remainder of the frame is then as
   much data as was specified.</p>
 
+  <p>This wire format for the data transfer part is described by the
+  following non-normative ABNF, which is given in two alternative
+  forms: the first describing the wire format as allowed by this
+  specification, and the second describing how an arbitrary bytestream
+  would be parsed.
+<!--END complete-->
+  <a href="#refsRFC5234">[RFC5234]</a>
+<!--START complete--><!--END websocket-protocol-->
+  <a href="#refsABNF">[ABNF]</a>
+<!--START websocket-protocol-->
+  </p>
+
+  <pre>; the wire protocol as allowed by this specification
+frames        = *frame
+frame         = text-frame
+text-frame    = (%x00) *( UTF8-char ) %xFF
+
+; the wire protocol including error-handling and forward-compatible parsing rules
+frames        = *frame
+frame         = text-frame / binary-frame
+text-frame    = (%x00-%x7F) *( UTF8-char / %x80-%x7E ) %xFF
+binary-frame  = (%x80-%xFF) length < as many bytes as given by the length >
+length        = *(%x80-%xFF) (%x00-%x7F)</pre>
+
+  <p>The UTF8-char rule is defined in the UTF-8 specification. <a
+  href="#refsRFC3629">[RFC3629]</a></p>
+
+  <p class="note">The above ABNF is intended for a binary octet
+  environment.</p>
+
   <hr>
 
   <p>The following diagrams summarise the protocol:</p>
 
   <pre>Handshake
    |
-  \|/
+   V
 Frame type byte <-------------------------------------.
    |      |                                           |
    |      `-- (0x00 to 0x7F) --> Data... --> 0xFF -->-+




More information about the Commit-Watchers mailing list