[antlr-interest] using ANTLR for IDL compiling/code generation

Tim Black timblack0 at gmail.com
Wed Jun 24 09:51:06 PDT 2009


Thanks, Damien.

I'm largely interested in modeling the public interfaces between objects in
my distributed (C++) embedded system. I basically want an IDL that provides
a single place for defining (a) the layout of simple data structures that
are involved in these interfaces, and (b) the interfaces themselves
(function prototypes essentially). Now that I've gotten through a few
examples, I can sort of see how I can use ANTLR to define the grammar of my
IDL and generate an AST of it, and then walk that AST using a tree parser to
generate custom code. My main hesitation is that it looks like I am still
going to have to implement a preprocessor of sorts to allow #including other
.idl files. Is there anything like support for this in ANTLR?

I read the DiaSpec/DiaGen home page and it looks like it provides a layer
above CORBA. So you can implement a distributed system with the freedom to
later and easily change its "underlying distributed system technology". I'm
not sure why I would want to do that, but it looks like a very interesting
project/product.

Tim

On Wed, Jun 24, 2009 at 12:55 AM, Damien Cassou <damien.cassou at gmail.com>wrote:

> Hi Tim,
>
> On Tue, Jun 23, 2009 at 11:11 PM, Tim Black<timblack0 at gmail.com> wrote:
> > Can someone point me in the right direction?
>
> we are doing something very similar in my research group. We have a
> lightweight ADL (https://diaspec.bordeaux.inria.fr/) from which we
> generate a dedicated framework in Java.
>
> Source-code is available in
>
> https://gforge.inria.fr/plugins/scmsvn/viewcvs.php/diagen/branches/v2/?root=diagen
> (see projects DiaSpec-Parser and DiaSpec-Generator).
>
> Basically, we have a grammar file DiaSpec.g which generates an AST
> with specific node classes (Program, Device, TypeRef...). Then,
> DiaSpec_SEM_1.g verifies different things on the AST, this is the
> semantic pass. Finally, I use a visitor on the AST and StringTemplate
> to generate java files (in DiaSpec-Generator).
>
> --
> Damien Cassou
> http://damiencassou.seasidehosting.st
>
> "Lambdas are relegated to relative obscurity until Java makes them
> popular by not having them." James Iry
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090624/003a8958/attachment.html 


More information about the antlr-interest mailing list