digitalmars.D - [Suggestion] Full D BNF in one place
- Stewart Gordon (23/23) Jun 23 2005 At the moment, the BNF of the D language is scattered about the
- Manfred Nowak (11/13) Jun 25 2005 [...]
- Stewart Gordon (12/28) Jun 30 2005 I wasn't expecting anybody to reverse engineer the grammar out of the
- Manfred Nowak (5/10) Jun 30 2005 There is no entry in the specs on what is allowed in a functionbody. I
- Stewart Gordon (7/20) Jun 30 2005 That's half my point - to help get the spec complete.
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.
Jun 23 2005
Stewart Gordon <smjg_1998 yahoo.com> wrote: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
Jun 25 2005
Manfred Nowak wrote:Stewart Gordon <smjg_1998 yahoo.com> wrote:Forget? How do you work that out?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 codeI 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.
Jun 30 2005
Stewart Gordon <smjg_1998 yahoo.com> wrote:I conclude it from your not mentioning it.you forget that the docs are contradictory on some elements of the language.Forget? How do you work that out?I wasn't expecting anybody to reverse engineer the grammar out of the compiler.There is no entry in the specs on what is allowed in a functionbody. I considered a short look into the code as helpful, but it is not. -manfred
Jun 30 2005
Manfred Nowak wrote:Stewart Gordon <smjg_1998 yahoo.com> wrote:You mean you expected my last post to be a complete brain dump?I conclude it from your not mentioning it.you forget that the docs are contradictory on some elements of the language.Forget? How do you work that out?That's half my point - to help get the spec complete. Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.I wasn't expecting anybody to reverse engineer the grammar out of the compiler.There is no entry in the specs on what is allowed in a functionbody. I considered a short look into the code as helpful, but it is not.
Jun 30 2005