public override State Next(char c) { State nextState = this; if ('0' <= c && c <= '9') { nextState = new DecimalPointState(); } else { throw new Exception($"InvalidState {c} from InitialDecimalPointState"); } return(nextState); }
public override State Next(char c) { State nextState = this; if ('0' <= c && c <= '9') { } else if (c == '.') { nextState = new DecimalPointState(); } else if (c == 'e') { nextState = new ExponentState(); } else { throw new Exception($"InvalidState {c} from IntegerPotionState"); } return(nextState); }