Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions draft-ietf-cbor-edn-e-ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,15 @@ treated as an error.
Documents that want to use the application extension `ref''` now can
use boilerplate similar to that given above for `e''`.

# ABNF

This document extends the Augmented Backus Naur Form (ABNF) {{!RFC5234}}
grammar of EDN for the two new app-string definitions in this document.

~~~ abnf
{::include edn-e-ref.abnf}
~~~
{: #abnf-grammar "New app-string ABNF definitions" sourcecode-name="edn-e-ref.abnf"}

IANA Considerations
==================
Expand Down
55 changes: 55 additions & 0 deletions edn-e-ref.abnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
known-app-str =/ e / ref

; app-string-e
e = %s"e" SQUOTE inside-e SQUOTE
inside-e = EALPHA *(*("-" / ".") (EALPHA / DIGIT))
EALPHA = ALPHA / "@" / "_" / "$"

; app-string-ref
ref = %s"ref" SQUOTE inside-ref SQUOTE
inside-ref = URI-reference
URI-reference = URI / relative-ref
URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
hier-part = "//" authority path-abempty
/ path-absolute
/ path-rootless
/ path-empty

relative-ref = relative-part [ "?" query ] [ "#" fragment ]
relative-part = "//" authority path-abempty
/ path-absolute
/ path-noscheme
/ path-empty

scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
authority = [ userinfo "@" ] host [ ":" port ]
userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
host = IP-literal / IPv4address / reg-name
port = *DIGIT
IP-literal = "[" ( IPv6address / IPv6addrz / IPvFuture ) "]"
IPv6addrz = IPv6address "%25" ZoneID
ZoneID = 1*( unreserved / pct-encoded )
IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )

reg-name = *( unreserved / pct-encoded / sub-delims )

path-abempty = *( "/" segment )
path-absolute = "/" [ segment-nz *( "/" segment ) ]
path-noscheme = segment-nz-nc *( "/" segment )
path-rootless = segment-nz *( "/" segment )
path-empty = 0<pchar>

segment = *pchar
segment-nz = 1*pchar
segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" )
; non-zero-length segment without any colon ":"

pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
query = *( pchar / "/" / "?" )
fragment = *( pchar / "/" / "?" )

pct-encoded = "%" HEXDIG HEXDIG
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
sub-delims = "!" / "$" / "&" / "(" / ")" ; single-quote not included
/ "*" / "+" / "," / ";" / "="