void (Message message) { if (message instanceof SyntaxErrorMessage) { SyntaxErrorMessage syntaxErrorMessage = (SyntaxErrorMessage) message; addErrorMessage(syntaxErrorMessage.getCause()); } else if (message instanceof ExceptionMessage) { ExceptionMessage exceptionMessage = (ExceptionMessage) message; processException(exceptionMessage.getCause(), ""); } else if (message instanceof SimpleMessage) { addErrorMessage((SimpleMessage) message); } else { addMessageWithoutLocation("An unknown error occurred: " + message, true); } }