org.antlr.runtime.MissingTokenException Java Examples

The following examples show how to use org.antlr.runtime.MissingTokenException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DRL6StrictParser.java    From kogito-runtimes with Apache License 2.0 5 votes vote down vote up
void failMissingTokenException() throws MissingTokenException {
    if (state.backtracking > 0) {
        state.failed = true;
    } else {
        throw new MissingTokenException(DRL6Lexer.STRING,
                input,
                null);
    }
}
 
Example #2
Source File: DRL6Parser.java    From kogito-runtimes with Apache License 2.0 5 votes vote down vote up
void failMissingTokenException() throws MissingTokenException {
    if (state.backtracking > 0) {
        state.failed = true;
    } else {
        throw new MissingTokenException(DRL6Lexer.STRING,
                input,
                null);
    }
}
 
Example #3
Source File: DRL5Parser.java    From kogito-runtimes with Apache License 2.0 5 votes vote down vote up
private void failMissingTokenException() throws MissingTokenException {
    if ( state.backtracking > 0 ) {
        state.failed = true;
    } else {
        throw new MissingTokenException( DRL5Lexer.STRING,
                                         input,
                                         null );
    }
}
 
Example #4
Source File: PhoenixParserException.java    From phoenix with Apache License 2.0 5 votes vote down vote up
public static SQLExceptionCode getErrorCode(Throwable e) {
    if (e instanceof MissingTokenException) {
        return SQLExceptionCode.MISSING_TOKEN;
    } else if (e instanceof UnwantedTokenException) {
        return SQLExceptionCode.UNWANTED_TOKEN;
    } else if (e instanceof MismatchedTokenException) {
        return SQLExceptionCode.MISMATCHED_TOKEN;
    } else if (e instanceof UnknownFunctionException) {
        return SQLExceptionCode.UNKNOWN_FUNCTION;
    } else {
        return SQLExceptionCode.PARSER_ERROR;
    }
}
 
Example #5
Source File: PhoenixParserException.java    From phoenix with Apache License 2.0 5 votes vote down vote up
public static SQLExceptionCode getErrorCode(Throwable e) {
    if (e instanceof MissingTokenException) {
        return SQLExceptionCode.MISSING_TOKEN;
    } else if (e instanceof UnwantedTokenException) {
        return SQLExceptionCode.UNWANTED_TOKEN;
    } else if (e instanceof MismatchedTokenException) {
        return SQLExceptionCode.MISMATCHED_TOKEN;
    } else if (e instanceof UnknownFunctionException) {
        return SQLExceptionCode.UNKNOWN_FUNCTION;
    } else {
        return SQLExceptionCode.PARSER_ERROR;
    }
}
 
Example #6
Source File: PhoenixParserException.java    From phoenix with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public static SQLExceptionCode getErrorCode(Throwable e) {
    if (e instanceof MissingTokenException) {
        return SQLExceptionCode.MISSING_TOKEN;
    } else if (e instanceof UnwantedTokenException) {
        return SQLExceptionCode.UNWANTED_TOKEN;
    } else if (e instanceof MismatchedTokenException) {
        return SQLExceptionCode.MISMATCHED_TOKEN;
    } else if (e instanceof UnknownFunctionException) {
        return SQLExceptionCode.UNKNOWN_FUNCTION;
    } else {
        return SQLExceptionCode.PARSER_ERROR;
    }
}