Talk:Backus–Naur form
From Wikipedia, the free encyclopedia
The BNF of BNF is redundant. <Expression> is unnecessary, as its only production is <whitespace> and an <Or-Expression>. <Or-Expression> also begins with <whitespace>. Correct me if I'm wrong, but I think <Expression> should be eliminated and <Or-Expression> should be retitled <Expression>.
--Michael A. Ball 18:47, 17 July 2006 (UTC)
Hirzel, I think the "see also" is a bit redundant, but since you put it in, I'll leave it. It is my opinion that a "see also X" is nice but embedding the link in the article and explaining there *why* one should "also see X", is better. Having both seems a bit redundant to me, but that's just me. -- Jan Hidders 03:44 Aug 14, 2002 (PDT)
This translates into English as:
- A postal address consists of a name-part, followed by a street-address part, followed by a zip-code part.
- A personal-part consists of either a first name or an initial followed by a dot.
- A name-part consists of either: a personal-part followed by a last name followed by an optional "jr-part" (Jr., Sr., or dynastic number) and end-of-line, or a personal part followed by a name part (this rule illustrates the use of recursion in BNFs, covering the case of people who use multiple first and middle names and/or initials).
- A street address consists of an optional apartment specifier, followed by a street number, followed by a street name.
- A zip-part consists of a town-name, followed by a comma, followed by a state code, followed by a ZIP-code followed by an end-of-line."
Note that many things (such as the format of a personal-part, apartment specifier, or ZIP-code) are left unspecified here. If necessary, they may be described using additional BNF rules, or left as abstraction if irrelevant for the purpose at hand.
Isn't personal-part specified? I didn't want to remove the mention of it being unspecified because I'm a beginner, but this one seems pretty obvious...
The "See Also" link Syntax Diagram page has been deleted, page history shows multiple deletes (with rubbish content) Should this link be kept?
[edit] The formal syntax is under "Further Examples"
The formal syntax is specified in thechapter "Further Examples", without exlanation.
I would prefer to have a formal syntax definition in one seperate chapter (named as such), and an additional informal explanation.
The informal explanation could be similar to what I found in the UML2.0 spec:
- All non-terminals are in italics and enclosed between angle brackets (e.g. <non-terminal>)
- All terminals (keywords, strings, etc.), are enclosed between single quotes (e.g., ‘or’)
- Non-terminal production rule definitions are signified with the ‘::=’ operator
- Repetition of an item is signified by an asterisk placed after that item: ‘*’
- Alternative choices in a production are separated by the ‘|’ symbol (e.g., <alternative-A> | <alternative-B>)
- Items that are optional are enclosed in square brackets (e.g., [<item-x>])
- Where items need to be grouped they are enclosed in simple parenthesis; for example:
-
(<item-1> | <item-2>) *
- signifies a sequence of one or more items, each of which is <item-1> or <item-2>
—The preceding unsigned comment was added by 82.174.19.103 (talk • contribs) .