[antlr-interest] BitSets and 64bit Longs

Benjamin Niemann pink at odahoda.de
Mon May 19 11:55:32 PDT 2008


Hi Jeff,

the BitSet class is just an internal implementation detail of the Java
runtime - probably because Java has poor or slow support for real
sets.
For Python I use the set() class to store token types. Use whatever is
most appropriate in JS to manage sets and supports the basic set
operations required by ANTLR. My guess is (but that's a pure guess)
that in such a high level language as JS the overhead of fiddling with
bits is bigger than the use of a less memory efficient, but more
native implementation.

-Ben

On Mon, May 19, 2008 at 6:27 PM, Jeff Saremi <jeffsaremi at yahoo.com> wrote:
>
> THis is more for the ones who have had experience with implementing
> different "rumtime"s for Antlr.
> I am half way through creating a runtime for Javascript however i'm stuck
> with the fact that i cannot do the "long" operations needed by BitSet.
> I'm wondering if anyone knows the ramifications of using 32bit ops such as
> (bit << 31) instead of (bit << 63) and so on?
> thanks
> jeff
>


More information about the antlr-interest mailing list