/** * Read the next character and set the isEofReached and nextChar * @throws IOException */ void readNextChar() throws IOException { int ch; if ( !eofReached ) { ch = reader.read(); eofReached = (ch == -1); nextChar = (char) ch; if ( ch == '\n' ) { position.newLine(); } else { position.newChar(); } } }