[antlr-interest] Antlr v3.0ea8 : @header nottakenintoaccountinautomatically generated lexer java code...

Don Caton dcaton at shorelinesoftware.com
Fri May 5 09:54:28 PDT 2006


Jim:		

> Understood in an ANTLR2 context - however, at least for C 
> actions, I intend to produce the Visual Studio 2005 plug-in 
> that is able to deal with this. ANTLR3 makes it pretty easy 
> to switch between embedded languages. 

You're not going to be able to do this with a simple plug-in, you're going
to need to write a language service package, and implement among other
things, the IVsContainedLanuage interface.  I've written a language service
for VS, but not one that implements "contained" languages, and it's not a
trivial undertaking.  I'm up to my eyeballs in work and will be for the
forseeable future, or else I'd offer to help.

> However, the C generator is such that you will be able to 
> deal with code that is not action code in a 'more elegant 
> fashion' ;-). The grammar will produce a .h file that you can 
> include in other C files and reference the parser/lexer 
> elements. Hence you will get teh intellisense etc in the 
> natural fashion, and compile and link the individual source files.

Not following you here.  The C++ code generator already generates .hpp files
that can be used to reference parser/lexer elements.  I'm talking about
action code.  In general, I really dislike the way you have to have C++ (or
whatever) language embedded in the .g file.  I'd love to see some sort of
code-behind model that associates .g files with .cpp (or whatever) files,
like the model used for ASP.NET.

> I deliberately constructed the header and typedefs and so on ...

All this sounds good, at least for C users.  I hope the C++ codegen does the
same.  Personally, I don't have any need for C code generation.

Don




More information about the antlr-interest mailing list