Class SyntaxErrorMessageProvider

  • public class SyntaxErrorMessageProvider
    extends Object
    Special provider for syntax error messages. Using for replacing base messages from BaseRecognizer and localizing them
    • Constructor Detail

      • SyntaxErrorMessageProvider

        public SyntaxErrorMessageProvider()
    • Method Detail

      • initTokenNames

        public static String[] initTokenNames​(String[] oldTokens,
                                              Map<String,​String> newTokenNames)
        Updates tokens set
        oldTokens - old token set, can't be null
        newTokenNames - mapping between old token and new token, can't be null
        updated tokens, never null
      • getErrorMessage

        public String getErrorMessage​(org.antlr.runtime.BaseRecognizer recognizer,
                                      org.antlr.runtime.RecognitionException e,
                                      String[] tokenNames)
        Return syntax error message corresponding to the RecognitionException
        recognizer - current BaseRecognizer, can't be null
        e - actual RecognitionException for creating error message, can't be null
        tokenNames - all available token names for this context, can't be null
        syntax error message corresponding to the RecognitionException, never null