private char lookahead(){
  return curCharIndex < pattern.length() - 1 ? pattern.charAt(curCharIndex + 1) : EOF;
}

private char lookahead ( ) { return curCharIndex < pattern . length ( ) - 1 ? pattern . charAt ( curCharIndex + 1 ) : EOF ; }
returns the next character in the input pattern without advancing .
