digitalmars.D - EBNF grammar for D?
- Philippe Sigaud (6/6) Mar 11 2012 Hello,
- Alix Pexton (7/13) Mar 12 2012 Rainer Schuetze pulled all the grammar out of the docs and fixed them up...
- Rainer Schuetze (4/21) Mar 12 2012 There is also a script to generate the grammar text file here:
- Philippe Sigaud (4/6) Mar 12 2012 The resulting text file is quite good. Heck, I think I could modify a
- bcs (6/23) Mar 12 2012 IIRC the grammar in the docs has tended to be out of date one in a
- James Miller (8/37) Mar 12 2012 I agree, automatic generation of the grammar rules would be incredibly
- Andrei Alexandrescu (4/9) Mar 12 2012 I think being up-to-date is becoming less of a matter now that the
- James Miller (6/16) Mar 12 2012 True, in that case we need to make sure we actually have a completely
- =?UTF-8?B?QWxleCBSw7hubmUgUGV0ZXJzZW4=?= (4/23) Mar 12 2012 Visual D's parser would be a good place to start, I suppose.
- Andrei Alexandrescu (4/28) Mar 12 2012 I'd love to embed a D parser inside Phobos, even though it's not the
- H. S. Teoh (10/12) Mar 12 2012 [...]
- Philippe Sigaud (8/11) Mar 12 2012 a while back as part of his work on Visual D. Its not in straight EBNF a...
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: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.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
Rainer SchuetzeThere is also a script to generate the grammar text file here: http://www.dsource.org/projects/visuald/browser/grammarThe 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.
Mar 12 2012
On 03/12/2012 03:17 AM, Alix Pexton wrote:On 11/03/2012 16:49, Philippe Sigaud wrote: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).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 13 March 2012 16:02, bcs <bcs example.com> wrote:On 03/12/2012 03:17 AM, Alix Pexton 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. -- James MillerOn 11/03/2012 16:49, Philippe Sigaud wrote: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).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/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 March 2012 16:47, Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> wrote:On 3/12/12 10:36 PM, James Miller wrote: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 MillerI 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:Visual D's parser would be a good place to start, I suppose. -- - AlexOn 3/12/12 10:36 PM, James Miller wrote: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 MillerI 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 3/12/12 11:03 PM, Alex Rønne Petersen wrote:On 13-03-2012 05:00, James Miller wrote:I'd love to embed a D parser inside Phobos, even though it's not the implementation used inside the compiler. AndreiOn 13 March 2012 16:47, Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> wrote:Visual D's parser would be a good place to start, I suppose.On 3/12/12 10:36 PM, James Miller wrote: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 MillerI 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 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
Alix Pexton:Rainer Schuetze pulled all the grammar out of the docs and fixed them upa 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!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.
Mar 12 2012