Received: from localhost by CS.UTK.EDU with SMTP (cf v2.9s-UTK) id NAA09668; Fri, 15 Mar 1996 13:40:10 -0500 Received: by CS.UTK.EDU (bulk_mailer v1.4); Fri, 15 Mar 1996 13:39:37 -0500 Received: from relay-2.mail.demon.net by CS.UTK.EDU with SMTP (cf v2.9s-UTK) id NAA09530; Fri, 15 Mar 1996 13:39:26 -0500 Received: from post.demon.co.uk ([158.152.1.72]) by relay-2.mail.demon.net id am13022; 15 Mar 96 18:09 GMT Received: from pillar.turnpike.com ([194.70.55.2]) by relay-3.mail.demon.net id aa19680; 15 Mar 96 18:02 GMT Message-ID: Date: Fri, 15 Mar 1996 18:01:35 +0000 To: drums@cs.utk.edu From: Paul Overell Subject: Re: I-D ACTION:draft-ietf-drums-abnf-00.txt In-Reply-To: <9603141106.aa18415@IETF.CNRI.Reston.VA.US> MIME-Version: 1.0 X-Mailer: Turnpike Version 1.12 The ABNF draft has the form of a list of modification to a (presumed) existing BNF standard. It assumes that the reader is familiar with BNF and can simply adjust to the differences. Now while it may be true that anyone who reads it probably is familiar with BNF (or rather BNF-like metalanguages) surely now is the time to get some *rigor* into the language and give a full and complete definition of ABNF. The draft is incomplete or lacks rigor in the following areas: 1) it does not mention the "=" symbol as in name = rule 2) does not give the meaning of concatenated rules as in rule1 rule2 3) uses, but does not define, "element". 4) does not give operator precedence does "rule1 rule2 / rule3" mean "rule1 (rule2 / rule3)" or (rule1 rule2) / rule3? (I know the answer, but the draft doesn't say it!) 5) Does not give a formal syntax 6) Has no representation for terminals that contain the quote character. The quote character by itself in RFC822's syntax is represented as <"> but how represent the terminal abc"def>ghi1. INTRODUCTION [snip] >The differences between standard BNF and ABNF involve naming >rules and indicating repetition and "local" alternatives. The >current document adds value-ranges. This needs a reference to what is meant by "standard BNF", the only BNF standard I know is that given in the Algol 60 report. If this is the standard referred to then there are two other differences: ABNF uses "=" where as BNF uses "::="; ABNF uses "/" where BNF uses "|". I think that it would be better if ABNF did not attempt to list differences between ABNF and BNF but simply gave a complete rigorous definition of ABNF and just mention BNF in passing. >2. RULE NAMING > >Angle brackets ("<", ">") are not used, in general. The name >of a rule is simply the name itself, rather than "". >Quotation-marks enclose literal text (which may be upper and/or >lower case). Certain basic rules are in uppercase, such as >SPACE, TAB, CRLF, DIGIT, ALPHA, etc. Angle brackets are used in >rule definitions, and in the rest of this document, whenever >their presence will facilitate discerning the use of rule names. The basic rules SPACE etc. must be defined. I don't think that this is very clear on how < and > are actually used in ABNF. Looking at examples in RFC822 it seems that they are used for two distinct purposes: 1) to represent the terminal quote character as <"> 2) to represent a rule which is given in English rather than in ABNF, e.g. , RFC822 p44. >5. *RULE: REPETITION > >The character "*" preceding an element indicates repetition. The >full form is: > > *element > >indicating at least and at most occurrences of element. >Default values are 0 and infinity so that "*(element)" allows any >number, including zero; "1*element" requires at least one; and >"1*2element" allows one or two. "element" is undefined. Does "element" mean "rule"? in which case ******some-rule would be legal or is element restricted to name, terminal or "(" rule ")"? >7. NRULE: SPECIFIC REPETITION > >"(element)" is equivalent to "*(element)"; that is, >exactly occurrences of (element). Thus 2DIGIT is a 2-digit >number, and 3ALPHA is a string of three alphabetic characters. Are the parentheses required? The first sentence seems to suggest that they are, but the example in the second sentence has none. "element" is undefined. >10. VALUE RANGES > >Elements separated by double periods ("..") specify a range of >values. Therefore "foo..bar" represents the range of data >values from foo to bar, inclusively. This need some semantics, "a".."b" clearly means "a" / "b" / "c" but what does foo..bar mean? "element" undefined. Other points ------------ The symbol connecting a name to a rule needs to be defined. In BNF it is "::=", in RFC822 it is "=". A quick look at the syntaxes in RFCs claiming to use ABNF I found RFC1894 uses "=", RFC1521 uses ":=" and RFC1845 uses "::=". ABNF is a formal language so it should have a formal syntax definition. What better language to define ABNF in than ABNF itself! It would also serve as an illustration of the use of the language. Here is my effort at defining ABNF in ABNF. production = name "=" rule [comment] comment = ";" *CHAR name = ALPHA *(ALPHA / DIGIT / "-") rule = 1*term *("/" 1*term) term = element / option / repetition / specific-repetition / list / range element = terminal / name / "(" rule ")" option = "[" rule "] repetition = [number] "*" [number] element specific-repetition = number element list = [number] "#" [number] element range = QCHAR ".." QCHAR number = 1*DIGIT non-terminal = "\"" *QCHAR "\"" CHAR = QCHAR = / "\\" CHAR ALPHA = "a".."z" / "A".."Z" DIGIT = "0".."9" It may be of interest that there is a BSI standard metalanguage BS6154. I don't have a copy but I did read it many years ago. I not suggesting using it but it may give some help on how to standardize a syntactic metalanguage. I don't wish to simply criticize - I am quite prepared to help in developing this standard. My key point is that ABNF should not be built on a nebulous "standard BNF" but should stand alone as a fully defined metalanguage in its own right. Do you agree? -- Paul Overell T U R N P I K E Ltd