code: public static String printParseError(ParseError error, Formatter<InvalidInputError> formatter) {
          checkArgNotNull(error, "error");
          checkArgNotNull(formatter, "formatter");
          String message = error.getErrorMessage() != null ? error.getErrorMessage() :
                  error instanceof InvalidInputError ?
                          formatter.format((InvalidInputError) error) : error.getClass().getSimpleName();
          return printErrorMessage("%s (line %s, pos %s):", message,
                  error.getStartIndex(), error.getEndIndex(), error.getInputBuffer());
      }
docs: Pretty prints the given parse error showing its location in the given input buffer.
  
  @param error       the parse error
  @param formatter   the formatter for InvalidInputErrors
  @return the pretty print text