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

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

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

Parser.getTokenStream介绍

暂无

代码示例

代码示例来源:origin: org.apache.cassandra/cassandra-all

/**
 * Appends a query snippet to the message to help the user to understand the problem.
 *
 * @param parser the parser used to parse the query
 * @param builder the <code>StringBuilder</code> used to build the error message
 */
private void appendQuerySnippet(Parser parser, StringBuilder builder)
{
  TokenStream tokenStream = parser.getTokenStream();
  int index = tokenStream.index();
  int size = tokenStream.size();
  Token from = tokenStream.get(getSnippetFirstTokenIndex(index));
  Token to = tokenStream.get(getSnippetLastTokenIndex(index, size));
  Token offending = tokenStream.get(getOffendingTokenIndex(index, size));
  appendSnippet(builder, from, to, offending);
}

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

/**
 * Appends a query snippet to the message to help the user to understand the problem.
 *
 * @param parser the parser used to parse the query
 * @param builder the <code>StringBuilder</code> used to build the error message
 */
private void appendQuerySnippet(Parser parser, StringBuilder builder)
{
  TokenStream tokenStream = parser.getTokenStream();
  int index = tokenStream.index();
  int size = tokenStream.size();
  Token from = tokenStream.get(getSnippetFirstTokenIndex(index));
  Token to = tokenStream.get(getSnippetLastTokenIndex(index, size));
  Token offending = tokenStream.get(getOffendingTokenIndex(index, size));
  appendSnippet(builder, from, to, offending);
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

/**
 * Appends a query snippet to the message to help the user to understand the problem.
 *
 * @param parser the parser used to parse the query
 * @param builder the <code>StringBuilder</code> used to build the error message
 */
private void appendQuerySnippet(Parser parser, StringBuilder builder)
{
  TokenStream tokenStream = parser.getTokenStream();
  int index = tokenStream.index();
  int size = tokenStream.size();
  Token from = tokenStream.get(getSnippetFirstTokenIndex(index));
  Token to = tokenStream.get(getSnippetLastTokenIndex(index, size));
  Token offending = tokenStream.get(getOffendingTokenIndex(index, size));
  appendSnippet(builder, from, to, offending);
}

相关文章