org.antlr.v4.runtime.InputMismatchException.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(199)

本文整理了Java中org.antlr.v4.runtime.InputMismatchException.<init>()方法的一些代码示例,展示了InputMismatchException.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。InputMismatchException.<init>()方法的具体详情如下:
包路径:org.antlr.v4.runtime.InputMismatchException
类名称:InputMismatchException
方法名:<init>

InputMismatchException.<init>介绍

暂无

代码示例

代码示例来源:origin: prestodb/presto

@Override
  public Token recoverInline(Parser recognizer)
      throws RecognitionException
  {
    if (nextTokensContext == null) {
      throw new InputMismatchException(recognizer);
    }
    else {
      throw new InputMismatchException(recognizer, nextTokensState, nextTokensContext);
    }
  }
});

代码示例来源:origin: checkstyle/checkstyle

@Override
public Token recoverInline(Parser recognizer) {
  reportError(recognizer, new InputMismatchException(recognizer));
  return super.recoverInline(recognizer);
}

代码示例来源:origin: org.antlr/antlr4-runtime

/** Make sure we don't attempt to recover inline; if the parser
 *  successfully recovers, it won't throw an exception.
 */
@Override
public Token recoverInline(Parser recognizer)
  throws RecognitionException
{
  InputMismatchException e = new InputMismatchException(recognizer);
  for (ParserRuleContext context = recognizer.getContext(); context != null; context = context.getParent()) {
    context.exception = e;
  }
  throw new ParseCancellationException(e);
}

代码示例来源:origin: org.antlr/antlr4-runtime

e = new InputMismatchException(recognizer);
} else {
  e = new InputMismatchException(recognizer, nextTokensState, nextTokensContext);

代码示例来源:origin: com.facebook.presto/presto-parser

@Override
  public Token recoverInline(Parser recognizer)
      throws RecognitionException
  {
    if (nextTokensContext == null) {
      throw new InputMismatchException(recognizer);
    }
    else {
      throw new InputMismatchException(recognizer, nextTokensState, nextTokensContext);
    }
  }
});

代码示例来源:origin: io.prestosql/presto-parser

@Override
  public Token recoverInline(Parser recognizer)
      throws RecognitionException
  {
    if (nextTokensContext == null) {
      throw new InputMismatchException(recognizer);
    }
    else {
      throw new InputMismatchException(recognizer, nextTokensState, nextTokensContext);
    }
  }
});

代码示例来源:origin: prestosql/presto

@Override
  public Token recoverInline(Parser recognizer)
      throws RecognitionException
  {
    if (nextTokensContext == null) {
      throw new InputMismatchException(recognizer);
    }
    else {
      throw new InputMismatchException(recognizer, nextTokensState, nextTokensContext);
    }
  }
});

代码示例来源:origin: syhily/elasticsearch-jdbc

/**
 * Make sure we don't attempt to recover inline; if the parser successfully recovers, it won't
 * throw an exception.
 */
@Override
public Token recoverInline(Parser recognizer) {
  throw new InputMismatchException(recognizer);
}

代码示例来源:origin: org.antlr/antlr4-runtime

throw new InputMismatchException(recognizer);

代码示例来源:origin: org.antlr/antlr4

@Override
    public Token recoverInline(Parser recognizer) throws RecognitionException {
      int errIndex = recognizer.getInputStream().index();
      if ( firstErrorTokenIndex == -1 ) {
        firstErrorTokenIndex = errIndex; // latch
      }
//            System.err.println("recoverInline: error at " + errIndex);
      InputMismatchException e = new InputMismatchException(recognizer);
//            TokenStream input = recognizer.getInputStream(); // seek EOF
//            input.seek(input.size() - 1);
      throw e;
    }

代码示例来源:origin: com.tunnelvisionlabs/antlr4

@Override
    public Token recoverInline(Parser recognizer) throws RecognitionException {
      int errIndex = recognizer.getInputStream().index();
      if ( firstErrorTokenIndex == -1 ) {
        firstErrorTokenIndex = errIndex; // latch
      }
//            System.err.println("recoverInline: error at " + errIndex);
      InputMismatchException e = new InputMismatchException(recognizer);
//            TokenStream input = recognizer.getInputStream(); // seek EOF
//            input.seek(input.size() - 1);
      throw e;
    }

代码示例来源:origin: com.puppycrawl.tools/checkstyle

@Override
public Token recoverInline(Parser recognizer) {
  reportError(recognizer, new InputMismatchException(recognizer));
  return super.recoverInline(recognizer);
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

@Override
    public Token recoverInline(Parser recognizer) throws RecognitionException {
      int errIndex = recognizer.getInputStream().index();
      if ( firstErrorTokenIndex == -1 ) {
        firstErrorTokenIndex = errIndex; // latch
      }
//            System.err.println("recoverInline: error at " + errIndex);
      InputMismatchException e = new InputMismatchException(recognizer);
//            TokenStream input = recognizer.getInputStream(); // seek EOF
//            input.seek(input.size() - 1);
      throw e;
    }

代码示例来源:origin: uk.co.nichesolutions/antlr4

@Override
    public Token recoverInline(Parser recognizer) throws RecognitionException {
      int errIndex = recognizer.getInputStream().index();
      if ( firstErrorTokenIndex == -1 ) {
        firstErrorTokenIndex = errIndex; // latch
      }
//            System.err.println("recoverInline: error at " + errIndex);
      InputMismatchException e = new InputMismatchException(recognizer);
//            TokenStream input = recognizer.getInputStream(); // seek EOF
//            input.seek(input.size() - 1);
      throw e;
    }

代码示例来源:origin: cn.wanghaomiao/JsoupXpath

@Override
  public Token recoverInline(Parser recognizer) throws RecognitionException {
    InputMismatchException e = new InputMismatchException(recognizer);
    for (ParserRuleContext context = recognizer.getContext(); context != null; context = context.getParent()) {
      context.exception = e;
    }
    throw new ParseCancellationException(e);
  }
}

代码示例来源:origin: zhegexiaohuozi/JsoupXpath

@Override
  public Token recoverInline(Parser recognizer) throws RecognitionException {
    InputMismatchException e = new InputMismatchException(recognizer);
    for (ParserRuleContext context = recognizer.getContext(); context != null; context = context.getParent()) {
      context.exception = e;
    }
    throw new ParseCancellationException(e);
  }
}

代码示例来源:origin: apache/eagle

/** Make sure we don't attempt to recover inline; if the parser
   *  successfully recovers, it won't throw an exception.
   */
  @Override
  public Token recoverInline(Parser recognizer)
    throws RecognitionException {
    InputMismatchException e = new InputMismatchException(recognizer);
    for (ParserRuleContext context = recognizer.getContext(); context != null; context = context.getParent()) {
      context.exception = e;
    }
    return super.recoverInline(recognizer);
  }
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/** Make sure we don't attempt to recover inline; if the parser
 *  successfully recovers, it won't throw an exception.
 */
@Override
public Token recoverInline(Parser recognizer)
  throws RecognitionException
{
  InputMismatchException e = new InputMismatchException(recognizer);
  for (ParserRuleContext context = recognizer.getContext(); context != null; context = context.getParent()) {
    context.exception = e;
  }
  throw new ParseCancellationException(e);
}

代码示例来源:origin: com.tunnelvisionlabs/antlr4-runtime

/** Make sure we don't attempt to recover inline; if the parser
 *  successfully recovers, it won't throw an exception.
 */
@Override
public Token recoverInline(Parser recognizer)
  throws RecognitionException
{
  InputMismatchException e = new InputMismatchException(recognizer);
  for (ParserRuleContext context = recognizer.getContext(); context != null; context = context.getParent()) {
    context.exception = e;
  }
  throw new ParseCancellationException(e);
}

代码示例来源:origin: antlr/intellij-plugin-v4

@Override
    public Token recoverInline(Parser recognizer) throws RecognitionException {
      int errIndex = recognizer.getInputStream().index();
      if ( firstErrorTokenIndex == -1 ) {
        firstErrorTokenIndex = errIndex; // latch
      }
//            System.err.println("recoverInline: error at " + errIndex);
      InputMismatchException e = new InputMismatchException(recognizer);
      TokenStream input = recognizer.getInputStream(); // seek EOF
      input.seek(input.size() - 1);
      throw e; // throw after seek so exception has bad token
    }

相关文章