W3C home > Mailing lists > Public > uri@w3.org > May 2003

Re: Syntax Issues/Experience with RFC2396bis and abnf2re

From: Roy T. Fielding <fielding@apache.org>
Date: Tue, 6 May 2003 16:32:50 -0700
Cc: Graham Klyne <GK@ninebynine.org>, uri@w3.org
To: Rob Cameron <cameron@cs.sfu.ca>
Message-Id: <0D578E29-801B-11D7-8C85-000393753936@apache.org>

> I think I would prefer your interpretation that HEXDIG allows
> upper or lower case.   But in a literal reading of RFC2234
> and other reference materials, the following three
> counterarguments concern me.
>
> (1)	The reference ABNF parser available from IETF does not
>         permit lower case values for HEXDIGIT.
> 	http://www.ops.ietf.org/abnf/

You mean the example parser.  Someone should ask Harald to fix it.

> (2)	The HEXDIG production satisfies the individual character
> 	specification constraint of RFC 2234:
>
> 	"To specify a rule which IS case SENSITIVE, specify
> 	the characters individually."
>
> 	HEXDIG         =  DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
>
> 	(If specification by numeric value is required, and not
> 	just an option as shown in the examples, then why doesn't
>         RFC2234 say "by numeric value" rather than "individually?")

Because there is no other way to specify a character individually.
The string syntax doesn't just specify the character, it also specifies
that it is case-insensitive and ASCII.  The ABNF for the ABNF specifies
char-val independent of the number of characters inside the string.

> (3)	Section 3.4 of RFC 2234 shows that a range of numeric
> 	values has an equivalent specification as individual characters.
>
> 	DIGIT =  %x30-39
> 	is equivalent to:
> 	DIGIT =  "0" / "1" / "2" / "3" / "4" / "5" / "6" / "7" / "8" / "9"

It does not refer to those as individual characters.

> 	Therefore, one should be able to say that %x41-46 is
> 	equivalent to "A" / "B" / "C" / "D" / "E" / "F"
> 	and hence
> 	HEXDIG         =  DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
> 	is equivalent to
> 	HEXDIG         =   %x30-39 / %x41-46

I do not agree with that conclusion.  If the authors had intended to
specify it as case-sensitive, then they would have specified it using
a numeric range and not as quoted character strings.  A mechanical
interpretation of the ABNF syntax cannot choose whether they are
case-sensitive or -insensitive based on the length of the string.

....Roy
Received on Tuesday, 6 May 2003 19:30:39 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 13 January 2011 12:15:31 GMT