[antlr-interest] Bug in Java API

Jaak Niit jack at icefire.ee
Thu Nov 1 14:25:22 PDT 2007


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