|BNF notation for Delphi Grammar firstname.lastname@example.org (2005-05-31)|
|Re: BNF notation for Delphi Grammar email@example.com (2005-06-02)|
|Re: BNF notation for Delphi Grammar firstname.lastname@example.org (George Neuner) (2005-06-06)|
|Re: BNF notation for Delphi Grammar DrDiettrich@compuserve.de (Hans-Peter Diettrich) (2005-06-08)|
|Re: BNF notation for Delphi Grammar email@example.com (Franck Pissotte) (2005-06-08)|
|Re: BNF notation for Delphi Grammar firstname.lastname@example.org (George Neuner) (2005-06-08)|
|Re: BNF notation for Delphi Grammar email@example.com (2005-06-12)|
|From:||Hans-Peter Diettrich <DrDiettrich@compuserve.de>|
|Date:||8 Jun 2005 15:59:36 -0400|
|Posted-Date:||08 Jun 2005 15:59:36 EDT|
George Neuner wrote:
> The Borland Pascal's used to contain the language BNF in the manual
> appendixes. Did they discontinue this practice with Delphi?
The practice is continued, but the grammar is neither complete nor valid
nor up-to-date since the introduction of case-else.
I found railroad diagrams supplied with Delphi 2, that already differed
from what the compiler accepts. Later versions come with some kind of
extended BNF syntax, with the same problems and a missing description
for the grammar syntax or semantics.
Some people have tried to construct EBNF grammars for various Delphi
versions in the past, but the results are questionable, for several
- "directives" are reserved words in specific context.
- the semantics are too far away from the syntax, in detail
- semicolons can have unexpected (context sensitive) effects.
My favorite example:
case i of
0: if a then b
; //<----- illegal, optional or required?
Normally a semicolon is illegal in this place, because it's intended to
only separate multiple case-labels. In this special case the marked
semicolon is not optional, in fact it indicates whether the following
dangling "else" is part of the "if" or of the "case" statement.
Now try to construct an according context-free grammar :-(
Return to the
Search the comp.compilers archives again.