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

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

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

IntStream.consume介绍

暂无

代码示例

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

/** Match the wildcard: in a symbol */
public void matchAny(IntStream input) {
  state.errorRecovery = false;
  state.failed = false;
  input.consume();
}

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

/** Match the wildcard: in a symbol */
public void matchAny(IntStream input) {
  state.errorRecovery = false;
  state.failed = false;
  input.consume();
}

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

/** Match the wildcard: in a symbol */
public void matchAny(IntStream input) {
  state.errorRecovery = false;
  state.failed = false;
  input.consume();
}

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

/** Match the wildcard: in a symbol */
public void matchAny(IntStream input) {
  state.errorRecovery = false;
  state.failed = false;
  input.consume();
}

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

/** Match the wildcard: in a symbol */
public void matchAny(IntStream input) {
  state.errorRecovery = false;
  state.failed = false;
  input.consume();
}

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

/** Match the wildcard: in a symbol */
public void matchAny(IntStream input) {
  state.errorRecovery = false;
  state.failed = false;
  input.consume();
}

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

public void consumeUntil(IntStream input, int tokenType) {
  //System.out.println("consumeUntil "+tokenType);
  int ttype = input.LA(1);
  while (ttype != Token.EOF && ttype != tokenType) {
    input.consume();
    ttype = input.LA(1);
  }
}

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

public void consumeUntil(IntStream input, int tokenType) {
  //System.out.println("consumeUntil "+tokenType);
  int ttype = input.LA(1);
  while (ttype != Token.EOF && ttype != tokenType) {
    input.consume();
    ttype = input.LA(1);
  }
}

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

public void consumeUntil(IntStream input, int tokenType) {
  //System.out.println("consumeUntil "+tokenType);
  int ttype = input.LA(1);
  while (ttype != Token.EOF && ttype != tokenType) {
    input.consume();
    ttype = input.LA(1);
  }
}

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

public void consumeUntil(IntStream input, int tokenType) {
  //System.out.println("consumeUntil "+tokenType);
  int ttype = input.LA(1);
  while (ttype != Token.EOF && ttype != tokenType) {
    input.consume();
    ttype = input.LA(1);
  }
}

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

public void consumeUntil(IntStream input, int tokenType) {
  //System.out.println("consumeUntil "+tokenType);
  int ttype = input.LA(1);
  while (ttype != Token.EOF && ttype != tokenType) {
    input.consume();
    ttype = input.LA(1);
  }
}

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

public void consumeUntil(IntStream input, int tokenType) {
  //System.out.println("consumeUntil "+tokenType);
  int ttype = input.LA(1);
  while (ttype != Token.EOF && ttype != tokenType) {
    input.consume();
    ttype = input.LA(1);
  }
}

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

/** Consume tokens until one matches the given token set */
public void consumeUntil(IntStream input, BitSet set) {
  //System.out.println("consumeUntil("+set.toString(getTokenNames())+")");
  int ttype = input.LA(1);
  while (ttype != Token.EOF && !set.member(ttype) ) {
    //System.out.println("consume during recover LA(1)="+getTokenNames()[input.LA(1)]);
    input.consume();
    ttype = input.LA(1);
  }
}

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

/** Consume tokens until one matches the given token set */
public void consumeUntil(IntStream input, BitSet set) {
  //System.out.println("consumeUntil("+set.toString(getTokenNames())+")");
  int ttype = input.LA(1);
  while (ttype != Token.EOF && !set.member(ttype) ) {
    //System.out.println("consume during recover LA(1)="+getTokenNames()[input.LA(1)]);
    input.consume();
    ttype = input.LA(1);
  }
}

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

/** Consume tokens until one matches the given token set */
public void consumeUntil(IntStream input, BitSet set) {
  //System.out.println("consumeUntil("+set.toString(getTokenNames())+")");
  int ttype = input.LA(1);
  while (ttype != Token.EOF && !set.member(ttype) ) {
    //System.out.println("consume during recover LA(1)="+getTokenNames()[input.LA(1)]);
    input.consume();
    ttype = input.LA(1);
  }
}

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

/** Consume tokens until one matches the given token set */
public void consumeUntil(IntStream input, BitSet set) {
  //System.out.println("consumeUntil("+set.toString(getTokenNames())+")");
  int ttype = input.LA(1);
  while (ttype != Token.EOF && !set.member(ttype) ) {
    //System.out.println("consume during recover LA(1)="+getTokenNames()[input.LA(1)]);
    input.consume();
    ttype = input.LA(1);
  }
}

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

/** Consume tokens until one matches the given token set */
public void consumeUntil(IntStream input, BitSet set) {
  //System.out.println("consumeUntil("+set.toString(getTokenNames())+")");
  int ttype = input.LA(1);
  while (ttype != Token.EOF && !set.member(ttype) ) {
    //System.out.println("consume during recover LA(1)="+getTokenNames()[input.LA(1)]);
    input.consume();
    ttype = input.LA(1);
  }
}

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

/** Consume tokens until one matches the given token set */
public void consumeUntil(IntStream input, BitSet set) {
  //System.out.println("consumeUntil("+set.toString(getTokenNames())+")");
  int ttype = input.LA(1);
  while (ttype != Token.EOF && !set.member(ttype) ) {
    //System.out.println("consume during recover LA(1)="+getTokenNames()[input.LA(1)]);
    input.consume();
    ttype = input.LA(1);
  }
}

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

/** Recover from an error found on the input stream.  This is
 *  for NoViableAlt and mismatched symbol exceptions.  If you enable
 *  single token insertion and deletion, this will usually not
 *  handle mismatched symbol exceptions but there could be a mismatched
 *  token that the match() routine could not recover from.
 */
public void recover(IntStream input, RecognitionException 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();
  BitSet followSet = computeErrorRecoverySet();
  beginResync();
  consumeUntil(input, followSet);
  endResync();
}

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

/** Recover from an error found on the input stream.  This is
 *  for NoViableAlt and mismatched symbol exceptions.  If you enable
 *  single token insertion and deletion, this will usually not
 *  handle mismatched symbol exceptions but there could be a mismatched
 *  token that the match() routine could not recover from.
 */
public void recover(IntStream input, RecognitionException 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();
  BitSet followSet = computeErrorRecoverySet();
  beginResync();
  consumeUntil(input, followSet);
  endResync();
}

相关文章