Search in sources :

Example 1 with IValueConverterErrorContext

use of org.eclipse.xtext.parser.antlr.ISyntaxErrorMessageProvider.IValueConverterErrorContext in project xtext-core by eclipse.

the class AbstractInternalAntlrParser method handleValueConverterException.

protected void handleValueConverterException(ValueConverterException vce) {
    hadErrors = true;
    Exception cause = (Exception) vce.getCause();
    if (vce != cause) {
        IValueConverterErrorContext errorContext = createValueConverterErrorContext(vce);
        currentError = syntaxErrorProvider.getSyntaxErrorMessage(errorContext);
        if (vce.getNode() == null) {
            appendError(currentNode.getLastChild());
        } else {
            appendError(vce.getNode());
        }
    } else {
        throw new RuntimeException(vce);
    }
}
Also used : IValueConverterErrorContext(org.eclipse.xtext.parser.antlr.ISyntaxErrorMessageProvider.IValueConverterErrorContext) MissingTokenException(org.antlr.runtime.MissingTokenException) RecognitionException(org.antlr.runtime.RecognitionException) ValueConverterException(org.eclipse.xtext.conversion.ValueConverterException) UnwantedTokenException(org.antlr.runtime.UnwantedTokenException) WrappedException(org.eclipse.emf.common.util.WrappedException) InvocationTargetException(java.lang.reflect.InvocationTargetException) FailedPredicateException(org.antlr.runtime.FailedPredicateException) MismatchedTokenException(org.antlr.runtime.MismatchedTokenException)

Aggregations

InvocationTargetException (java.lang.reflect.InvocationTargetException)1 FailedPredicateException (org.antlr.runtime.FailedPredicateException)1 MismatchedTokenException (org.antlr.runtime.MismatchedTokenException)1 MissingTokenException (org.antlr.runtime.MissingTokenException)1 RecognitionException (org.antlr.runtime.RecognitionException)1 UnwantedTokenException (org.antlr.runtime.UnwantedTokenException)1 WrappedException (org.eclipse.emf.common.util.WrappedException)1 ValueConverterException (org.eclipse.xtext.conversion.ValueConverterException)1 IValueConverterErrorContext (org.eclipse.xtext.parser.antlr.ISyntaxErrorMessageProvider.IValueConverterErrorContext)1