Package antlr.collections.impl

Examples of antlr.collections.impl.BitSet


  {
    TokenManager localTokenManager = this.grammar.tokenManager;
    println("");
    for (int i = 0; i < paramVector.size(); i++)
    {
      BitSet localBitSet = (BitSet)paramVector.elementAt(i);
      localBitSet.growToInclude(paramInt);
      println("const unsigned long " + paramString + getBitsetName(i) + "_data_" + "[] = { " + localBitSet.toStringOfHalfWords() + " };");
      String str = "// ";
      for (int j = 0; j < localTokenManager.getVocabulary().size(); j++)
      {
        if (!localBitSet.member(j))
          continue;
        if ((this.grammar instanceof LexerGrammar))
        {
          if ((32 <= j) && (j < 127) && (j != 92))
            str = str + this.charFormatter.escapeChar(j, true) + " ";
          else
            str = str + "0x" + Integer.toString(j, 16) + " ";
        }
        else
          str = str + localTokenManager.getTokenStringAt(j) + " ";
        if (str.length() <= 70)
          continue;
        println(str);
        str = "// ";
      }
      if (str != "// ")
        println(str);
      println("const " + namespaceAntlr + "BitSet " + paramString + getBitsetName(i) + "(" + getBitsetName(i) + "_data_," + localBitSet.size() / 32 + ");");
    }
  }
View Full Code Here


  protected void genBitsetsHeader(Vector paramVector, int paramInt)
  {
    println("");
    for (int i = 0; i < paramVector.size(); i++)
    {
      BitSet localBitSet = (BitSet)paramVector.elementAt(i);
      localBitSet.growToInclude(paramInt);
      println("static const unsigned long " + getBitsetName(i) + "_data_" + "[];");
      println("static const " + namespaceAntlr + "BitSet " + getBitsetName(i) + ";");
    }
  }
View Full Code Here

    StringBuffer localStringBuffer = new StringBuffer(100);
    int i = 1;
    localStringBuffer.append("(");
    for (int j = 1; j <= paramInt; j++)
    {
      BitSet localBitSet = paramArrayOfLookahead[j].fset;
      if (i == 0)
        localStringBuffer.append(") && (");
      i = 0;
      if (paramArrayOfLookahead[j].containsEpsilon())
        localStringBuffer.append("true");
View Full Code Here

    int i = paramAlternative.lookaheadDepth;
    if (i == 2147483647)
      i = this.grammar.maxk;
    for (int j = 1; (j <= i) && (j <= paramInt); j++)
    {
      BitSet localBitSet = paramAlternative.cache[j].fset;
      if (localBitSet.degree() != 0)
        return false;
    }
    return true;
  }
View Full Code Here

  protected String filterRule = null;

  LexerGrammar(String paramString1, Tool paramTool, String paramString2)
  {
    super(paramString1, paramTool, paramString2);
    BitSet localBitSet = new BitSet();
    for (int i = 0; i <= 127; i++)
      localBitSet.add(i);
    setCharVocabulary(localBitSet);
    this.defaultErrorHandler = false;
  }
View Full Code Here

  BitSet epsilonDepth;
  boolean hasEpsilon = false;

  public Lookahead()
  {
    this.fset = new BitSet();
  }
View Full Code Here

  protected void genBitsets(Vector paramVector, int paramInt)
  {
    println("", -999);
    for (int i = 0; i < paramVector.size(); i++)
    {
      BitSet localBitSet = (BitSet)paramVector.elementAt(i);
      localBitSet.growToInclude(paramInt);
      genBitSet(localBitSet, i);
    }
  }
View Full Code Here

    StringBuffer localStringBuffer = new StringBuffer(100);
    int i = 1;
    localStringBuffer.append("(");
    for (int j = 1; j <= paramInt; j++)
    {
      BitSet localBitSet = paramArrayOfLookahead[j].fset;
      if (i == 0)
        localStringBuffer.append(") && (");
      i = 0;
      if (paramArrayOfLookahead[j].containsEpsilon())
        localStringBuffer.append("true");
View Full Code Here

    int i = paramAlternative.lookaheadDepth;
    if (i == 2147483647)
      i = this.grammar.maxk;
    for (int j = 1; (j <= i) && (j <= paramInt); j++)
    {
      BitSet localBitSet = paramAlternative.cache[j].fset;
      if (localBitSet.degree() != 0)
        return false;
    }
    return true;
  }
View Full Code Here

      localLookahead1.combineWith(localLookahead2);
    }
    if ((paramInt == 1) && (paramAlternativeBlock.not) && (subruleCanBeInverted(paramAlternativeBlock, this.lexicalAnalysis)))
      if (this.lexicalAnalysis)
      {
        BitSet localBitSet = (BitSet)((LexerGrammar)this.grammar).charVocabulary.clone();
        localObject = localLookahead1.fset.toArray();
        for (int j = 0; j < localObject.length; j++)
          localBitSet.remove(localObject[j]);
        localLookahead1.fset = localBitSet;
      }
      else
      {
        localLookahead1.fset.notInPlace(4, this.grammar.tokenManager.maxTokenType());
View Full Code Here

TOP

Related Classes of antlr.collections.impl.BitSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.