Skip to content

Both app-strings are missing ABNF #1

@rohanmahy

Description

@rohanmahy

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:

  • allow RFC 6874 zone IDs in IP URI literals
  • remove single quote from sub-delims (they can be included almost anywhere when percent encoded)
  • make the contents of the app-string use URI-reference (either a complete URI or a relative reference)
  • remove roughly half a dozen completely unused productions

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
                    / "*" / "+" / "," / ";" / "="

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions