Re: Compiler "Phonics"

Joachim Durchholz <joachim_d@gmx.de>
9 Mar 2003 17:22:57 -0500

          From comp.compilers

Related articles
Compiler "Phonics" aka@mvps.org (Alex K. Angelopoulos) (2003-02-24)
Re: Compiler "Phonics" Trevor.Jenkins@suneidesis.com (2003-03-09)
Re: Compiler "Phonics" joachim_d@gmx.de (Joachim Durchholz) (2003-03-09)
Re: Compiler "Phonics" cgweav@aol.com (2003-03-09)
Re: Compiler "Phonics" aka@mvps.org (Alex K. Angelopoulos) (2003-03-09)
| List of all articles for this month |

From: Joachim Durchholz <joachim_d@gmx.de>
Newsgroups: comp.compilers
Date: 9 Mar 2003 17:22:57 -0500
Organization: Compilers Central
References: 03-02-136
Keywords: administrivia
Posted-Date: 09 Mar 2003 17:22:57 EST

Alex K. Angelopoulos wrote:
>
> How do people say the relationship in BNF grammar rules?
>
> e.g., how would one pronounce '::=' when used as a rule relationship, like this:
>
> IntegralLiteralValue ::= IntLiteral | HexLiteral | OctalLiteral


"is defined as" if read as a specification.
"generates" if read as a generator of valid phrases.


The vertical bar is the "alternative", often read as "or".
I'm not aware of pronounciations for the other BNF symbols. OTOH
"proper" BNF is just "::=" and "|", rules that use "{...}" and "[...]"
can be defined by transforming them into equivalent rules that use just
"|". Since the transformations are trivial, readers don't /need/ more
than a little handwaving to understand how a specific variant of BNF
should be read.


> What's a little disorienting is I am now becoming "aware" of the
> significant variations in specific BNF implementations,


All BNF variants are equivalent and can be implemented using a finite
state automaton. Implementation variations that I'm aware of are just
that: implementation variation; the semantics is always the same.


  > and see
> variant notations for character sets and terminal definitions.
> Technically these are rules as well, but they are very specific types
> of rules.


Again, it's just a matter of convenience. All notational variants can be
translated to "base BNF" that uses just the "|" operator.


> + What's the best on-line source for getting an understanding of the
> concepts behind BNF?
>
> This is said poorly, but I'm seeing "BNFish" stuff everywhere I look
> now (if it isn't there already, I can see ways to describe it with
> BNF). Unfortunately, most of the refs I can find either do armwaving
> and go on, or dive right into particular rulesets using a particular
> notation which they never formalize (and which of course varies from
> the next "diver" I find). I'm most interested in learning what I need
> to know to correctly sight-read BNF rules written by various people.


It's enough to know one notation - the others are just variations,
selected for convenience (read: the whim of the author).


> + Finally - I keep seeing Naur's name mangled into "Noir". Did
> someone make this into an 'in' joke, or am I misreading overeager
> spellchecking? :)


Dunno, but I'd guess it's the latter...


Regards,
Joachim


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.