类 BeetlAntlrErrorStrategy

java.lang.Object
org.antlr.v4.runtime.DefaultErrorStrategy
org.beetl.core.parser.BeetlAntlrErrorStrategy
所有已实现的接口:
org.antlr.v4.runtime.ANTLRErrorStrategy

public class BeetlAntlrErrorStrategy extends org.antlr.v4.runtime.DefaultErrorStrategy
antlr 语法解析错的处理策略。对所有语法错误,都抛出以阻止继续解析
作者:
xiandafu
  • 字段概要

    从类继承的字段 org.antlr.v4.runtime.DefaultErrorStrategy

    errorRecoveryMode, lastErrorIndex, lastErrorStates, nextTokensContext, nextTokensState
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    protected String
     
    protected GrammarToken
    getGrammarToken(org.antlr.v4.runtime.Token token)
     
    void
    recover(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.RecognitionException e)
     
    org.antlr.v4.runtime.Token
    recoverInline(org.antlr.v4.runtime.Parser recognizer)
    Make sure we don't attempt to recover inline; if the parser successfully recovers, it won't throw an exception.
    void
    reportError(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.RecognitionException e)
     
    protected void
    reportFailedPredicate(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.FailedPredicateException e)
     
    protected void
    reportInputMismatch(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.InputMismatchException e)
     
    protected void
    reportMissingToken(org.antlr.v4.runtime.Parser recognizer)
     
    protected void
    reportNoViableAlternative(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.NoViableAltException e)
     
    protected void
    reportUnwantedToken(org.antlr.v4.runtime.Parser recognizer)
     
    void
    sync(org.antlr.v4.runtime.Parser recognizer)
    Make sure we don't attempt to recover from problems in subrules.

    从类继承的方法 org.antlr.v4.runtime.DefaultErrorStrategy

    beginErrorCondition, consumeUntil, endErrorCondition, escapeWSAndQuote, getErrorRecoverySet, getExpectedTokens, getMissingSymbol, getSymbolText, getSymbolType, getTokenErrorDisplay, inErrorRecoveryMode, reportMatch, reset, singleTokenDeletion, singleTokenInsertion

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • BeetlAntlrErrorStrategy

      public BeetlAntlrErrorStrategy()
  • 方法详细资料

    • recover

      public void recover(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.RecognitionException e)
      指定者:
      recover 在接口中 org.antlr.v4.runtime.ANTLRErrorStrategy
      覆盖:
      recover 在类中 org.antlr.v4.runtime.DefaultErrorStrategy
    • reportError

      public void reportError(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.RecognitionException e)
      指定者:
      reportError 在接口中 org.antlr.v4.runtime.ANTLRErrorStrategy
      覆盖:
      reportError 在类中 org.antlr.v4.runtime.DefaultErrorStrategy
    • reportNoViableAlternative

      protected void reportNoViableAlternative(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.NoViableAltException e)
      覆盖:
      reportNoViableAlternative 在类中 org.antlr.v4.runtime.DefaultErrorStrategy
    • reportInputMismatch

      protected void reportInputMismatch(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.InputMismatchException e)
      覆盖:
      reportInputMismatch 在类中 org.antlr.v4.runtime.DefaultErrorStrategy
    • reportFailedPredicate

      protected void reportFailedPredicate(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.FailedPredicateException e)
      覆盖:
      reportFailedPredicate 在类中 org.antlr.v4.runtime.DefaultErrorStrategy
    • sync

      public void sync(org.antlr.v4.runtime.Parser recognizer)
      Make sure we don't attempt to recover from problems in subrules.
      指定者:
      sync 在接口中 org.antlr.v4.runtime.ANTLRErrorStrategy
      覆盖:
      sync 在类中 org.antlr.v4.runtime.DefaultErrorStrategy
    • recoverInline

      public org.antlr.v4.runtime.Token recoverInline(org.antlr.v4.runtime.Parser recognizer) throws org.antlr.v4.runtime.RecognitionException
      Make sure we don't attempt to recover inline; if the parser successfully recovers, it won't throw an exception.
      指定者:
      recoverInline 在接口中 org.antlr.v4.runtime.ANTLRErrorStrategy
      覆盖:
      recoverInline 在类中 org.antlr.v4.runtime.DefaultErrorStrategy
      抛出:
      org.antlr.v4.runtime.RecognitionException
    • reportMissingToken

      protected void reportMissingToken(org.antlr.v4.runtime.Parser recognizer)
      覆盖:
      reportMissingToken 在类中 org.antlr.v4.runtime.DefaultErrorStrategy
    • reportUnwantedToken

      protected void reportUnwantedToken(org.antlr.v4.runtime.Parser recognizer)
      覆盖:
      reportUnwantedToken 在类中 org.antlr.v4.runtime.DefaultErrorStrategy
    • getErrorKey

      protected String getErrorKey(String key)
    • getGrammarToken

      protected GrammarToken getGrammarToken(org.antlr.v4.runtime.Token token)