[antlr-interest] hack for crash

James Briant jab.antlr at species.org
Wed Mar 31 21:25:55 PDT 2010


in the org.antlr.analysis.DFA class, I hacked in the for loop. Total hackery
on my part, but it works. Fixes symptoms not disease.

public int getNumberOfStates() {
if ( getUserMaxLookahead()>0 ) {
// if using fixed lookahead then uniqueSets not set
return states.size();
}
for(int i = 0; i < states.size(); ++i) {
DFAState state = states.get(i);
int s = state.stateNumber;
if ( s>=numberOfStates) {
numberOfStates=s+1;
}
}
return numberOfStates;
}


More information about the antlr-interest mailing list