Thanks Jim.
--- On Fri, 2/13/09, Jim Idle <[email protected]> wrote: > From: Jim Idle <[email protected]> > Subject: Re: [antlr-interest] c runtime with templates > To: > Cc: [email protected] > Date: Friday, February 13, 2009, 9:32 AM > Carter Cheng wrote: > > Thanks for the reply. > > > > I did actually manage to find a semi workaround for > this though it is a bit cumbersome (involves manually > editing the extern "C" scopes in the tree grammar > .h generated file). I am a bit of a C++ newbie and part of > me is curious if this extern "C" stuff is really > needed here since I am compiling everything with g++. > > > > Unfortunately given how the declarations look in the > header it seems that since in certain cases I am returning > stl types these show up in some of the generated structs in > the header i suspect that #ifdefing them out of the header > would mean the header would not compile. > > > > > In the latest source I think that the #ifdefs are more > selective, but > you probably want to put your #includes inside @preincludes > and not > @header. Chack the docs on the various sections. Also > don't put any of > your classes and things directly into the grammar, place > them in .cpp > files and the include the headers the define the classes in > the > preincludes sections. Then your classes won't be marked > as extern "C". > There are comments about the approach you take to structure > in the > examples - separate include that includes your headers and > the > parser/lexer headers and so on. Keep as much of your own > code as > possible out of the .g file and the generated headers > basically. > > Jim > > List: http://www.antlr.org/mailman/listinfo/antlr-interest > Unsubscribe: > http://www.antlr.org/mailman/options/antlr-interest/your-email-address List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~---
