cbor-wg / edn-e-ref

draft-ietf-cbor-edn-e-ref: External References to Values in CBOR Diagnostic Notation (EDN)
Other
1 stars 1 forks source link

Both app-strings are missing ABNF #1

Open rohanmahy opened 4 weeks ago

rohanmahy commented 4 weeks ago

This document defines new app strings but defines no syntax for those app-strings.

If the single-layer ABNF approach is defined in draft-ietf-cbor-edn-literals as proposed in EDN literals PR#49, the following ABNF should do the trick. It is copied from RFC 3986 with the following changes:

When appended to the ABNF in EDN literals PR#49, this runs through bap -o RFC7405 without errors or warnings.

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
                    / "*" / "+" / "," / ";" / "="
cabo commented 4 weeks ago

This document defines new app strings but defines no syntax for those app-strings.

Indeed, I thought we might first agree on the details of what is in there before putting in a lot of grammar. See Section 5.