[antlr-interest] Bug in Java API

Terence Parr parrt at cs.usfca.edu
Thu Nov 1 15:27:14 PDT 2007


thanks. added:

http://www.antlr.org:8888/browse/ANTLR-192

Ter
On Nov 1, 2007, at 2:25 PM, Jaak Niit wrote:

> Hello
>
> ANTLR Version 3.0.1 seems to have bug in BitSet constuctor
>    /** Construction from a list of integers */
>    public BitSet(List items) {
>        for (int i = 0; i < items.size(); i++) {
>            Integer v = (Integer) items.get(i);
>            add(v.intValue());
>        }
>    }
> where first line should be
> this(BITS);
>
> Problem came out when I try to use
> CommonTokenStream.getTokens(int start, int stop, List types);
> and I get
> Exception in thread "main" java.lang.NullPointerException
>    at org.antlr.runtime.BitSet.add(BitSet.java:118)
>    at org.antlr.runtime.BitSet.<init>(BitSet.java:64)
>    at org.antlr.runtime.CommonTokenStream.getTokens 
> (CommonTokenStream.java:226)
>
> -- 
> # Jaak Niit
>
>
>
>



More information about the antlr-interest mailing list