At the moment, the BNF of the D language is scattered about the
documentation, and there are bits missing.
We ought to round up the full BNF grammar and publish it in one place.
This would make it easier:
- to see if the grammar is complete, and hence work towards getting the
D spec up to scratch
- to look at a sample piece of code and see if it's syntactically valid
- to clear up misunderstandings/misreadings of the spec, which have led
to arguments here over whether a piece of code is syntactically valid
- for D compiler writers to write a correct parsing algorithm
Maybe we could start rounding it up on Wiki4D. I suggest that we have a
main page with subpages for different aspects of the D grammar. Each
would start as a direct copy of the grammar as given on the Digital Mars
site, and provide room for corrections and omissions to be pointed out.
And we should include on the relevant pages the disambiguation rules,
for example:
- the classic if-if-else issue
- if it's parseable as a DeclarationStatement then it's a
DeclarationStatement....
Stewart.
--
My e-mail is valid but not my primary mailbox. Please keep replies on
the 'group where everyone may benefit.

At the moment, the BNF of the D language is scattered about the
documentation, and there are bits missing.

I have filed bugs on this at least twice---and you forget that the
docs are contradictory on some elements of the language.
I am unable to read the tricks that digitalmars is using out of the
code and have not received any answers on my claims that the
grammar is incomplete: so i believe that digitalmars is
- not interested or
- unable
to give the complete unambiguated grammar.
-manfred

At the moment, the BNF of the D language is scattered about the
documentation, and there are bits missing.

[...]
I have filed bugs on this at least twice---and you forget that the
docs are contradictory on some elements of the language.

Forget? How do you work that out?

I am unable to read the tricks that digitalmars is using out of the
code

I wasn't expecting anybody to reverse engineer the grammar out of the
compiler. Simply to work towards getting the grammar of the _language_
properly documented. Though we probably ought to make notes of compiler
bugs while we're at it.

and have not received any answers on my claims that the
grammar is incomplete: so i believe that digitalmars is
- not interested or
- unable
to give the complete unambiguated grammar.

Either is a problem in itself. If unable, then they're also unable to
write a correct D compiler.
Stewart.
--
My e-mail is valid but not my primary mailbox. Please keep replies on
the 'group where everyone may benefit.