@Override
    public void consume() {
		if (p >= n) {
			assert LA(1) == IntStream.EOF;
			throw new IllegalStateException("cannot consume EOF");
		}

		//System.out.println("prev p="+p+", c="+(char)data[p]);
        if ( p < n ) {
            p++;
			//System.out.println("p moves to "+p+" (c='"+(char)data[p]+"')");
        }
    }
Reset the stream so that it's in the same state it was
 when the object was created *except* the data array is not
 touched.
runtime/Java/src/org/antlr/v4/runtime/ANTLRInputStream.java