digitalmars.D - D grammar for ANTLR?
- Michael Butscher (8/8) Jun 08 2005 Hi,
- J C Calvarese (6/11) Jun 08 2005 You might try this: http://aegisknight.org/~andy/d/d.g
- Michael Butscher (3/10) Jun 09 2005 Thank you, exactly what I searched for. Is anybody actively working on t...
- Klaus Oberhofer (17/21) Jun 09 2005 I've currently modified lapg (see http://lapg.sf.net) to produce D outpu...
- Michael Butscher (8/23) Jun 10 2005 Because nobody seems to work currently on such a generator, I will try t...
Hi, has somebody tried to create an ANTLR grammar for D or is working on it? I found a few articles about that in the archives but no working links to grammars and the attachments are not stored by the web interface of the newsgroup. Another interesting thing would be an ANTLR extension to create lexers/parsers in D. Somebody working on that? Michael
Jun 08 2005
In article <MPG.1d1154989a91cd6698968b news.digitalmars.com>, Michael Butscher says...Hi, has somebody tried to create an ANTLR grammar for D or is working on it? I found a few articles about that in the archives but no working links to grammars and the attachments are not stored by the web interface of the newsgroup.You might try this: http://aegisknight.org/~andy/d/d.g There's some more grammar odds-and-ends here that may be of some use: http://www.prowiki.org/wiki4d/wiki.cgi?GrammarParsers jcc7
Jun 08 2005
J C Calvarese wrote:You might try this: http://aegisknight.org/~andy/d/d.g There's some more grammar odds-and-ends here that may be of some use: http://www.prowiki.org/wiki4d/wiki.cgi?GrammarParsers jcc7Thank you, exactly what I searched for. Is anybody actively working on this yet? Michael
Jun 09 2005
Michael Butscher <mbutscher gmx.de> wrote in news:MPG.1d1154989a91cd6698968b news.digitalmars.com:Another interesting thing would be an ANTLR extension to create lexers/parsers in D. Somebody working on that?I've currently modified lapg (see http://lapg.sf.net) to produce D output. lapg supports lexical scanner generation and LALR(1) grammars. I've also tried to create a D grammar for lapg but there are some D constructs which are context sensitive and needs >1 lookahead. The semantic and syntactic predicates of ANTLR would be very handy for this. I had a look at the ANTLR source and mailing list but I have not found a starting point or document how to create a custom language output generator, yet. If you have more luck, let me know :-) Greets Klaus BTW creating a custom language binding for ANTLR seems to be a nontrivial task. For lapg more or less changing a text template and recompilation was needed. Langage support in ANTLR consists of two parts: a code generator and a support library (base classes and AST handling). The one(s) who create such a monster will probably be condemned to maintain it :-)
Jun 09 2005
Klaus Oberhofer wrote:The semantic and syntactic predicates of ANTLR would be very handy for this. I had a look at the ANTLR source and mailing list but I have not found a starting point or document how to create a custom language output generator, yet. If you have more luck, let me know :-)Because nobody seems to work currently on such a generator, I will try to create one, but I don't know how far I will come.Greets Klaus BTW creating a custom language binding for ANTLR seems to be a nontrivial task. For lapg more or less changing a text template and recompilation was needed. Langage support in ANTLR consists of two parts: a code generator and a support library (base classes and AST handling). The one(s) who create such a monster will probably be condemned to maintain it :-)One nice thing with open source software is that nobody needs to be responsible forever for his/her software. At first glance the rewrite of the support library should be possible with reasonable effort because of the similarity of Java and D. Michael
Jun 10 2005