org.antlr.runtime.Parser.reportError()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(141)

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

Parser.reportError介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-modelimpl

public void reportError(RecognitionException re) {
  super.reportError(re);
  hasErrorOccurred = true;
}

代码示例来源:origin: net.rapture/CodeGenLib

@Override
  public void reportError(RecognitionException e) {
    super.reportError(e);
    throw new IllegalArgumentException("Failed");
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr-runtime

@Override
  public void reportError(RecognitionException e) {
    super.reportError(e);
    dbg.recognitionException(e);
  }
}

代码示例来源:origin: antlr/antlr3

@Override
  public void reportError(RecognitionException e) {
    super.reportError(e);
    dbg.recognitionException(e);
  }
}

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

@Override
  public void reportError(RecognitionException e) {
    super.reportError(e);
    dbg.recognitionException(e);
  }
}

代码示例来源:origin: antlr/antlr3

@Override
  public void reportError(RecognitionException e) {
    super.reportError(e);
    dbg.recognitionException(e);
  }
}

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

@Override
  public void reportError(RecognitionException e) {
    super.reportError(e);
    dbg.recognitionException(e);
  }
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

public void reportError(RecognitionException e) {
    super.reportError(e);
    dbg.recognitionException(e);
  }
}

代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.ide

@Override
public void reportError(RecognitionException e) {
  if (strict) {
    if (state.errorRecovery) {
      return;
    }
    if (e.index != input.size()) {
      // don't count errors at EOF in strict mode
      state.syntaxErrors++;
    }
    state.errorRecovery = true;
  } else {
    super.reportError(e);
  }
}

代码示例来源:origin: org.hibernate.jpql/hibernate-jpql-parser

public void reportError(RecognitionException e) {
  errorMessages.add(
    generateError(
      getRuleInvocationStack( e, this.getClass().getName() ),
        this.getTokenNames(),
        e
      )
  );
  super.reportError( e );
}

代码示例来源:origin: org.daisy.libs/jstyleparser

/**
 * Recovers and logs error, prepares tree part replacement
 */
public Object invalidFallback(int ttype, String ttext, RecognitionException re) {
  parser.reportError(re);
  parser.recover(input, re);
  return invalidReplacement(ttype, ttext);
}

代码示例来源:origin: net.rapture/Reflex

@Override
public void reportError(RecognitionException e) {
  emitErrorMessage(ErrorHandler.getParserExceptionDetails(e));
  super.reportError(e);
}

代码示例来源:origin: org.daisy.libs/jstyleparser

/**
 * Recovers and logs error, using custom follow set,
 * prepares tree part replacement
 */
public Object invalidFallbackGreedy(int ttype, String ttext, BitSet follow, RecognitionException re) {
  parser.reportError(re);
  if ( state.lastErrorIndex==input.index() ) {
    // uh oh, another error at same token index; must be a case
    // where LT(1) is in the recovery token set so nothing is
    // consumed; consume a single token so at least to prevent
    // an infinite loop; this is a failsafe.
    input.consume();
  }
  state.lastErrorIndex = input.index();
  parser.beginResync();
  consumeUntilGreedy(input, follow);
  parser.endResync();
  return invalidReplacement(ttype, ttext);
  
}

代码示例来源:origin: org.daisy.libs/jstyleparser

/**
 * Recovers and logs error inside a function, using custom follow set,
 * prepares tree part replacement
 */
public Object invalidFallback(int ttype, String ttext, BitSet follow, CSSLexerState.RecoveryMode mode, CSSLexerState ls, RecognitionException re) {
  parser.reportError(re);
  if ( state.lastErrorIndex==input.index() ) {
    // uh oh, another error at same token index; must be a case
    // where LT(1) is in the recovery token set so nothing is
    // consumed; consume a single token so at least to prevent
    // an infinite loop; this is a failsafe.
    input.consume();
  }
  state.lastErrorIndex = input.index();
  parser.beginResync();
  consumeUntil(input, follow, mode, ls);
  parser.endResync();
  return invalidReplacement(ttype, ttext);
  
}

代码示例来源:origin: org.daisy.libs/jstyleparser

/**
 * Recovers and logs error inside a function, using custom follow set,
 * prepares tree part replacement
 */
public Object invalidFallbackGreedy(int ttype, String ttext, BitSet follow, CSSLexerState.RecoveryMode mode, CSSLexerState ls, RecognitionException re) {
  parser.reportError(re);
  if ( state.lastErrorIndex==input.index() ) {
    // uh oh, another error at same token index; must be a case
    // where LT(1) is in the recovery token set so nothing is
    // consumed; consume a single token so at least to prevent
    // an infinite loop; this is a failsafe.
    input.consume();
  }
  state.lastErrorIndex = input.index();
  parser.beginResync();
  consumeUntilGreedy(input, follow, mode, ls);
  parser.endResync();
  return invalidReplacement(ttype, ttext);
  
}

相关文章