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

x33g5p2x  于2022-01-16 转载在 其他  
字(8.5k)|赞(0)|评价(0)|浏览(77)

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

BitSet.member介绍

暂无

代码示例

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

/**Is this contained within a? */
/*
public boolean subset(BitSet a) {
  if (a == null || !(a instanceof BitSet)) return false;
  return this.and(a).equals(this);
}
*/
public int[] toArray() {
  int[] elems = new int[size()];
  int en = 0;
  for (int i = 0; i < (bits.length << LOG_BITS); i++) {
    if (member(i)) {
      elems[en++] = i;
    }
  }
  return elems;
}

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

/**Is this contained within a? */
/*
public boolean subset(BitSet a) {
  if (a == null || !(a instanceof BitSet)) return false;
  return this.and(a).equals(this);
}
*/
public int[] toArray() {
  int[] elems = new int[size()];
  int en = 0;
  for (int i = 0; i < (bits.length << LOG_BITS); i++) {
    if (member(i)) {
      elems[en++] = i;
    }
  }
  return elems;
}

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

/**Is this contained within a? */
/*
public boolean subset(BitSet a) {
  if (a == null || !(a instanceof BitSet)) return false;
  return this.and(a).equals(this);
}
*/
public int[] toArray() {
  int[] elems = new int[size()];
  int en = 0;
  for (int i = 0; i < (bits.length << LOG_BITS); i++) {
    if (member(i)) {
      elems[en++] = i;
    }
  }
  return elems;
}

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

/**Is this contained within a? */
/*
public boolean subset(BitSet a) {
  if (a == null || !(a instanceof BitSet)) return false;
  return this.and(a).equals(this);
}
*/
public int[] toArray() {
  int[] elems = new int[size()];
  int en = 0;
  for (int i = 0; i < (bits.length << LOG_BITS); i++) {
    if (member(i)) {
      elems[en++] = i;
    }
  }
  return elems;
}

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

public CommonTree getFirstDescendantWithType(org.antlr.runtime.BitSet types) {
  if ( types.member(getType()) ) return this;
  if ( children==null ) return null;
  for (Object c : children) {
    GrammarAST t = (GrammarAST)c;
    if ( types.member(t.getType()) ) return t;
    CommonTree d = t.getFirstDescendantWithType(types);
    if ( d!=null ) return d;
  }
  return null;
}

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

public CommonTree getFirstDescendantWithType(org.antlr.runtime.BitSet types) {
  if ( types.member(getType()) ) return this;
  if ( children==null ) return null;
  for (Object c : children) {
    GrammarAST t = (GrammarAST)c;
    if ( types.member(t.getType()) ) return t;
    CommonTree d = t.getFirstDescendantWithType(types);
    if ( d!=null ) return d;
  }
  return null;
}

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

/**Is this contained within a? */
/*
public boolean subset(BitSet a) {
  if (a == null || !(a instanceof BitSet)) return false;
  return this.and(a).equals(this);
}
*/
public int[] toArray() {
  int[] elems = new int[size()];
  int en = 0;
  for (int i = 0; i < (bits.length << LOG_BITS); i++) {
    if (member(i)) {
      elems[en++] = i;
    }
  }
  return elems;
}

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

public CommonTree getFirstDescendantWithType(org.antlr.runtime.BitSet types) {
  if ( types.member(getType()) ) return this;
  if ( children==null ) return null;
  for (Object c : children) {
    GrammarAST t = (GrammarAST)c;
    if ( types.member(t.getType()) ) return t;
    CommonTree d = t.getFirstDescendantWithType(types);
    if ( d!=null ) return d;
  }
  return null;
}

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

public CommonTree getFirstDescendantWithType(org.antlr.runtime.BitSet types) {
  if ( types.member(getType()) ) return this;
  if ( children==null ) return null;
  for (Object c : children) {
    GrammarAST t = (GrammarAST)c;
    if ( types.member(t.getType()) ) return t;
    CommonTree d = t.getFirstDescendantWithType(types);
    if ( d!=null ) return d;
  }
  return null;
}

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

public CommonTree getFirstDescendantWithType(org.antlr.runtime.BitSet types) {
  if ( types.member(getType()) ) return this;
  if ( children==null ) return null;
  for (Object c : children) {
    GrammarAST t = (GrammarAST)c;
    if ( types.member(t.getType()) ) return t;
    CommonTree d = t.getFirstDescendantWithType(types);
    if ( d!=null ) return d;
  }
  return null;
}

代码示例来源: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: net.sourceforge.cssbox/jstyleparser

/**
 * Consumes token until lexer state is balanced and
 * token from follow is matched. Matched token is also consumed
 */ 
private void consumeUntilGreedy(TokenStream input, BitSet follow) {
  CSSToken t = null;
  do{
   Token next = input.LT(1);
   if (next instanceof CSSToken)
     t= (CSSToken) input.LT(1);
   else
     break; /* not a CSSToken, probably EOF */
   log.trace("Skipped greedy: {} follow: {}", t, follow);
   // consume token even if it will match
   input.consume();
  }while(!(t.getLexerState().isBalanced() && follow.member(t.getType())));
}

代码示例来源:origin: net.sourceforge.cssbox/jstyleparser

/**
 * Consumes token until lexer state is function-balanced and
 * token from follow is matched. Matched token is also consumed
 */ 
private void consumeUntilGreedy(TokenStream input, BitSet follow, LexerState.RecoveryMode mode, LexerState ls) {
 CSSToken t = null;
 do{
  Token next = input.LT(1);
  if (next instanceof CSSToken)
    t= (CSSToken) input.LT(1);
  else
    break; /* not a CSSToken, probably EOF */
  log.trace("Skipped greedy: {}", t);
  // consume token even if it will match
  input.consume();
 }while(!(t.getLexerState().isBalanced(mode, ls) && follow.member(t.getType())));
}

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

/**
 * Consumes token until lexer state is balanced and
 * token from follow is matched. Matched token is also consumed
 */
private void consumeUntilGreedy(TokenStream input, BitSet follow) {
  CSSToken t = null;
  do{
   Token next = input.LT(1);
   if (next instanceof CSSToken)
     t= (CSSToken) input.LT(1);
   else
     break; /* not a CSSToken, probably EOF */
   log.trace("Skipped greedy: {} follow: {}", t, follow);
   // consume token even if it will match
   input.consume();
  }while(!(t.getLexerState().isBalanced() && follow.member(t.getType())));
}

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

/**
 * Consumes token until lexer state is function-balanced and
 * token from follow is matched. Matched token is also consumed
 */
private void consumeUntilGreedy(TokenStream input, BitSet follow, CSSLexerState.RecoveryMode mode, CSSLexerState ls) {
  CSSToken t = null;
  do{
    Token next = input.LT(1);
    if (next instanceof CSSToken)
      t= (CSSToken) input.LT(1);
    else
      break; /* not a CSSToken, probably EOF */
    log.trace("Skipped greedy: {}", t);
    // consume token even if it will match
    input.consume();
  }while(!(t.getLexerState().isBalanced(mode, ls, t) && follow.member(t.getType())));
}

相关文章