[antlr-interest] static antlr c++ BitSets

Jim Idle jimi at temporal-wave.com
Tue Feb 26 10:03:14 PST 2008


Brian,

This isn't likely to change in ANTLR 2.x I am afraid as efforts are on 
ANTLR 3 now. Ric, the author of that runtime may have something to say 
about this though as I think he still reads the list.

As of 3.1 the C runtime supports C++ integration, I dont know if this 
is of help to you, as you may be inextricably bound to 2.7.x of course, 
but the bitsets there are static C and perform no runtime allocations.

Jim


> -----Original Message-----
> From: Brian Meidell Andersen [mailto:brian at gameequation.com]
> Sent: Tuesday, February 26, 2008 8:06 AM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] static antlr c++ BitSets
> 
> Hi,
> 
> I am using antlr 2.7.3.
> The parser I am generating is creating some static class members
> (tokenSet stuff) that are BitSets. BitSets in turn use std::vector.
> This causes heap allocations to occur during the pre-main() static
> allocation step, and I'd very much like this to not happen.
> 
> Is this something that can be configured away somehow? Is it something
> that has been changed so it doesn't happen in later antlr versions?
> 
> Here's an example line from my generated parser that causes the
> problem:
> const ANTLR_USE_NAMESPACE(antlr)BitSet
> ShaderParser::_tokenSet_0(_tokenSet_0_data_,4);
> 
> --
> 
> Brian Meidell Andersen
> The Game Equation
> http://www.thegameequation.com
> 




More information about the antlr-interest mailing list