Package antlr.collections.impl

Examples of antlr.collections.impl.BitSet


      return paramCharLiteralElement.next.look(paramInt - 1);
    if (this.lexicalAnalysis)
    {
      if (paramCharLiteralElement.not)
      {
        BitSet localBitSet = (BitSet)((LexerGrammar)this.grammar).charVocabulary.clone();
        if (this.DEBUG_ANALYZER)
          System.out.println("charVocab is " + localBitSet.toString());
        removeCompetingPredictionSets(localBitSet, paramCharLiteralElement);
        if (this.DEBUG_ANALYZER)
          System.out.println("charVocab after removal of prior alt lookahead " + localBitSet.toString());
        localBitSet.clear(paramCharLiteralElement.getType());
        return new Lookahead(localBitSet);
      }
      return Lookahead.of(paramCharLiteralElement.getType());
    }
    this.tool.panic("Character literal reference found in parser");
View Full Code Here


  {
    if (this.DEBUG_ANALYZER)
      System.out.println("lookCharRange(" + paramInt + "," + paramCharRangeElement + ")");
    if (paramInt > 1)
      return paramCharRangeElement.next.look(paramInt - 1);
    BitSet localBitSet = BitSet.of(paramCharRangeElement.begin);
    for (int i = paramCharRangeElement.begin + '\001'; i <= paramCharRangeElement.end; i++)
      localBitSet.add(i);
    return new Lookahead(localBitSet);
  }
View Full Code Here

  {
    if (this.DEBUG_ANALYZER)
      System.out.println("lookTokenRange(" + paramInt + "," + paramTokenRangeElement + ")");
    if (paramInt > 1)
      return paramTokenRangeElement.next.look(paramInt - 1);
    BitSet localBitSet = BitSet.of(paramTokenRangeElement.begin);
    for (int i = paramTokenRangeElement.begin + 1; i <= paramTokenRangeElement.end; i++)
      localBitSet.add(i);
    return new Lookahead(localBitSet);
  }
View Full Code Here

  {
    if (this.DEBUG_ANALYZER)
      System.out.println("look(" + paramInt + "," + paramWildcardElement + ")");
    if (paramInt > 1)
      return paramWildcardElement.next.look(paramInt - 1);
    BitSet localBitSet;
    if (this.lexicalAnalysis)
    {
      localBitSet = (BitSet)((LexerGrammar)this.grammar).charVocabulary.clone();
    }
    else
    {
      localBitSet = new BitSet(1);
      int i = this.grammar.tokenManager.maxTokenType();
      localBitSet.notInPlace(4, i);
      if (this.DEBUG_ANALYZER)
        System.out.println("look(" + paramInt + "," + paramWildcardElement + ") after not: " + localBitSet);
    }
    return new Lookahead(localBitSet);
  }
View Full Code Here

  public static boolean lookaheadEquivForApproxAndFullAnalysis(Lookahead[] paramArrayOfLookahead, int paramInt)
  {
    for (int i = 1; i <= paramInt - 1; i++)
    {
      BitSet localBitSet = paramArrayOfLookahead[i].fset;
      if (localBitSet.degree() > 1)
        return false;
    }
    return true;
  }
View Full Code Here

      switch (LA(1))
      {
      case 18:
        match(18);
        match(15);
        BitSet localBitSet = charSet();
        match(16);
        if (this.inputState.guessing != 0)
          continue;
        this.behavior.setCharVocabulary(localBitSet);
        break;
View Full Code Here

  }

  public final BitSet charSet()
    throws RecognitionException, TokenStreamException
  {
    BitSet localBitSet1 = null;
    BitSet localBitSet2 = null;
    localBitSet1 = setBlockElement();
    while (LA(1) == 21)
    {
      match(21);
      localBitSet2 = setBlockElement();
View Full Code Here

  public final BitSet setBlockElement()
    throws RecognitionException, TokenStreamException
  {
    Token localToken1 = null;
    Token localToken2 = null;
    BitSet localBitSet = null;
    int i = 0;
    localToken1 = LT(1);
    match(19);
    if (this.inputState.guessing == 0)
    {
      i = ANTLRLexer.tokenTypeForCharLiteral(localToken1.getText());
      localBitSet = BitSet.of(i);
    }
    int j;
    int k;
    switch (LA(1))
    {
    case 22:
      match(22);
      localToken2 = LT(1);
      match(19);
      if (this.inputState.guessing != 0)
        break;
      j = ANTLRLexer.tokenTypeForCharLiteral(localToken2.getText());
      if (j < i)
        this.antlrTool.error("Malformed range line ", getFilename(), localToken1.getLine(), localToken1.getColumn());
      k = i + 1;
    case 16:
    case 21:
    default:
      while (k <= j)
      {
        localBitSet.add(k);
        k++;
        continue;
        break;
        throw new NoViableAltException(LT(1), getFilename());
      }
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 void genBitsets(antlr.collections.impl.Vector paramVector, int paramInt)
  {
    println("");
    for (int i = 0; i < paramVector.size(); i++)
    {
      BitSet localBitSet = (BitSet)paramVector.elementAt(i);
      localBitSet.growToInclude(paramInt);
      genBitSet(localBitSet, i);
    }
  }
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.