digitalmars.D - EBNF grammar for D?
- "Philippe Sigaud" <philippe.sigaud gmail.com> Mar 11 2012
- Alix Pexton <alix.DOT.pexton gmail.DOT.com> Mar 12 2012
- Rainer Schuetze <r.sagitario gmx.de> Mar 12 2012
- bcs <bcs example.com> Mar 12 2012
- James Miller <james aatch.net> Mar 12 2012
- James Miller <james aatch.net> Mar 12 2012
- "H. S. Teoh" <hsteoh quickfur.ath.cx> Mar 12 2012
- Philippe Sigaud <philippe.sigaud gmail.com> Mar 12 2012
- Philippe Sigaud <philippe.sigaud gmail.com> Mar 12 2012
Hello, I'm looking for a D grammar in (E)BNF form. Did any of you write something like that or do you think I can use the grammar parts on dlang.org? I remember different threads on this subject and saw the docs being updated regularly on github, but my google-fu is weak today.
Mar 11 2012
On 11/03/2012 16:49, Philippe Sigaud wrote:Hello, I'm looking for a D grammar in (E)BNF form. Did any of you write something like that or do you think I can use the grammar parts on dlang.org? I remember different threads on this subject and saw the docs being updated regularly on github, but my google-fu is weak today.
Rainer Schuetze pulled all the grammar out of the docs and fixed them up a while back as part of his work on Visual D. Its not in straight EBNF and it may not be 100% up to date, but it may be a good place to start. http://www.dsource.org/projects/visuald/wiki/GrammarComparison I hope that is of some use! A...
Mar 12 2012
On 3/12/2012 11:17 AM, Alix Pexton wrote:On 11/03/2012 16:49, Philippe Sigaud wrote:Hello, I'm looking for a D grammar in (E)BNF form. Did any of you write something like that or do you think I can use the grammar parts on dlang.org? I remember different threads on this subject and saw the docs being updated regularly on github, but my google-fu is weak today.
Rainer Schuetze pulled all the grammar out of the docs and fixed them up a while back as part of his work on Visual D. Its not in straight EBNF and it may not be 100% up to date, but it may be a good place to start. http://www.dsource.org/projects/visuald/wiki/GrammarComparison I hope that is of some use! A...
There is also a script to generate the grammar text file here: http://www.dsource.org/projects/visuald/browser/grammar I have not run it lately, though.
Mar 12 2012
On 03/12/2012 03:17 AM, Alix Pexton wrote:On 11/03/2012 16:49, Philippe Sigaud wrote:Hello, I'm looking for a D grammar in (E)BNF form. Did any of you write something like that or do you think I can use the grammar parts on dlang.org? I remember different threads on this subject and saw the docs being updated regularly on github, but my google-fu is weak today.
Rainer Schuetze pulled all the grammar out of the docs and fixed them up a while back as part of his work on Visual D. Its not in straight EBNF and it may not be 100% up to date, but it may be a good place to start. http://www.dsource.org/projects/visuald/wiki/GrammarComparison I hope that is of some use! A...
IIRC the grammar in the docs has tended to be out of date one in a while. I'd love to see the source for the grammar rules become the parser source (either generating the parser from a grammar, generating a grammar from the parser or embed the documentation of each grammar rule in the comments next to the code that implements it).
Mar 12 2012
On 3/12/12 10:36 PM, James Miller wrote:I agree, automatic generation of the grammar rules would be incredibly useful for D tools. It doesn't necessarily have to be in a human-readable format, or even in a specific grammar format, just up to date. We can always have something to convert it into a specific format for whatever we are doing. We are programmers after all.
I think being up-to-date is becoming less of a matter now that the language is stable. Changes in syntax are already very rare. Andrei
Mar 12 2012
On 13-03-2012 05:00, James Miller wrote:On 13 March 2012 16:47, Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> wrote:On 3/12/12 10:36 PM, James Miller wrote:I agree, automatic generation of the grammar rules would be incredibly useful for D tools. It doesn't necessarily have to be in a human-readable format, or even in a specific grammar format, just up to date. We can always have something to convert it into a specific format for whatever we are doing. We are programmers after all.
I think being up-to-date is becoming less of a matter now that the language is stable. Changes in syntax are already very rare. Andrei
True, in that case we need to make sure we actually have a completely up to date grammar for the language somewhere then. All in one place. -- James Miller
Visual D's parser would be a good place to start, I suppose. -- - Alex
Mar 12 2012
On 3/12/12 11:03 PM, Alex Rønne Petersen wrote:On 13-03-2012 05:00, James Miller wrote:On 13 March 2012 16:47, Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> wrote:On 3/12/12 10:36 PM, James Miller wrote:I agree, automatic generation of the grammar rules would be incredibly useful for D tools. It doesn't necessarily have to be in a human-readable format, or even in a specific grammar format, just up to date. We can always have something to convert it into a specific format for whatever we are doing. We are programmers after all.
I think being up-to-date is becoming less of a matter now that the language is stable. Changes in syntax are already very rare. Andrei
True, in that case we need to make sure we actually have a completely up to date grammar for the language somewhere then. All in one place. -- James Miller
Visual D's parser would be a good place to start, I suppose.
I'd love to embed a D parser inside Phobos, even though it's not the implementation used inside the compiler. Andrei
Mar 12 2012
On 13 March 2012 16:02, bcs <bcs example.com> wrote:On 03/12/2012 03:17 AM, Alix Pexton wrote:On 11/03/2012 16:49, Philippe Sigaud wrote:Hello, I'm looking for a D grammar in (E)BNF form. Did any of you write something like that or do you think I can use the grammar parts on dlang.org? I remember different threads on this subject and saw the docs being updated regularly on github, but my google-fu is weak today.
Rainer Schuetze pulled all the grammar out of the docs and fixed them up a while back as part of his work on Visual D. Its not in straight EBNF and it may not be 100% up to date, but it may be a good place to start. http://www.dsource.org/projects/visuald/wiki/GrammarComparison I hope that is of some use! A...
IIRC the grammar in the docs has tended to be out of date one in a while. I'd love to see the source for the grammar rules become the parser source (either generating the parser from a grammar, generating a grammar from the parser or embed the documentation of each grammar rule in the comments next to the code that implements it).
I agree, automatic generation of the grammar rules would be incredibly useful for D tools. It doesn't necessarily have to be in a human-readable format, or even in a specific grammar format, just up to date. We can always have something to convert it into a specific format for whatever we are doing. We are programmers after all. -- James Miller
Mar 12 2012
On 13 March 2012 16:47, Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> wrote:On 3/12/12 10:36 PM, James Miller wrote:I agree, automatic generation of the grammar rules would be incredibly useful for D tools. It doesn't necessarily have to be in a human-readable format, or even in a specific grammar format, just up to date. We can always have something to convert it into a specific format for whatever we are doing. We are programmers after all.
I think being up-to-date is becoming less of a matter now that the language is stable. Changes in syntax are already very rare. Andrei
True, in that case we need to make sure we actually have a completely up to date grammar for the language somewhere then. All in one place. -- James Miller
Mar 12 2012
On Mon, Mar 12, 2012 at 11:10:14PM -0500, Andrei Alexandrescu wrote: [...]I'd love to embed a D parser inside Phobos, even though it's not the implementation used inside the compiler.
That will *certainly* be a big bonus. It will open up the opportunity for many, many user-contributed tools for manipulating D code. Like pretty printers, class hierarchy navigators, code analyzers, VIM tags, and all sorts of über-cool stuff. T -- If Java had true garbage collection, most programs would delete themselves upon execution. -- Robert Sewell
Mar 12 2012
--20cf302ef992e5a3e204bb1999f5 Content-Type: text/plain; charset=UTF-8 Alix Pexton:Rainer Schuetze pulled all the grammar out of the docs and fixed them up
it may not be 100% up to date, but it may be a good place to start.http://www.dsource.org/projects/visuald/wiki/GrammarComparison I hope that is of some use!
It is! Thanks Alix and thanks Rainer, the page is clean and readable. I'll use it at once. I admit reading the spec in detail for the first time yesterday, and I had a few WAT moments. No with the way it's written per se, but for what is seemingly allowed by the D grammar. --20cf302ef992e5a3e204bb1999f5 Content-Type: text/html; charset=UTF-8 <p>Alix Pexton:</p> <p>> Rainer Schuetze pulled all the grammar out of the docs and fixed them up a while back as part of his work on Visual D. Its not in straight EBNF and it may not be 100% up to date, but it may be a good place to start.<br> ><br> > <a href="http://www.dsource.org/projects/visuald/wiki/GrammarComparison">http://www.dsource.org/projects/visuald/wiki/GrammarComparison</a><br> ><br> > I hope that is of some use!</p> <p>It is! Thanks Alix and thanks Rainer, the page is clean and readable. I'll use it at once.</p> <p>I admit reading the spec in detail for the first time yesterday, and I had a few WAT moments. No with the way it's written per se, but for what is seemingly allowed by the D grammar.</p> --20cf302ef992e5a3e204bb1999f5--
Mar 12 2012
--00235433307a79137e04bb19b8ba Content-Type: text/plain; charset=UTF-8 Rainer SchuetzeThere is also a script to generate the grammar text file here: http://www.dsource.org/projects/visuald/browser/grammar
The resulting text file is quite good. Heck, I think I could modify a parser generator I'm writing to accept it directly. I'll use that also, thanks for your work, Rainer. --00235433307a79137e04bb19b8ba Content-Type: text/html; charset=UTF-8 <p><br> Rainer Schuetze<br> > There is also a script to generate the grammar text file here:<br> ><br> > <a href="http://www.dsource.org/projects/visuald/browser/grammar">http://www.dsource.org/projects/visuald/browser/grammar</a></p> <p>The resulting text file is quite good. Heck, I think I could modify a parser generator I'm writing to accept it directly.</p> <p>I'll use that also, thanks for your work, Rainer.<br> </p> --00235433307a79137e04bb19b8ba--
Mar 12 2012









Rainer Schuetze <r.sagitario gmx.de> 