Remove unnecessary field ATN.stateNumber

This commit is contained in:
Sam Harwell 2013-03-21 11:41:44 -05:00
parent 36abbda44f
commit 8b6c994694
1 changed files with 5 additions and 6 deletions

View File

@ -75,9 +75,6 @@ public class ATN {
@NotNull
public final List<TokensStartState> modeToStartState = new ArrayList<TokensStartState>();
/** used during construction from grammar AST */
int stateNumber = 0;
/** Used for runtime deserialization of ATNs from strings */
public ATN() { }
@ -103,10 +100,12 @@ public class ATN {
}
public void addState(@Nullable ATNState state) {
if ( state==null ) { states.add(null); stateNumber++; return; }
state.atn = this;
if (state != null) {
state.atn = this;
state.stateNumber = states.size();
}
states.add(state);
state.stateNumber = stateNumber++;
}
public void removeState(@NotNull ATNState state) {