Package java.util

Examples of java.util.BitSet.nextSetBit()


    @Override
    public void reportAmbiguity(Parser recognizer, DFA dfa, int startIndex, int stopIndex, boolean exact, BitSet ambigAlts, ATNConfigSet configs) {
      if (COMPUTE_TRANSITION_STATS && DETAILED_DFA_STATE_STATS) {
        BitSet sllPredictions = getConflictingAlts(_sllConflict, _sllConfigs);
        int sllPrediction = sllPredictions.nextSetBit(0);
        BitSet llPredictions = getConflictingAlts(ambigAlts, configs);
        int llPrediction = llPredictions.cardinality() == 0 ? ATN.INVALID_ALT_NUMBER : llPredictions.nextSetBit(0);
        if (sllPrediction != llPrediction) {
          ((StatisticsParserATNSimulator)recognizer.getInterpreter()).nonSll[dfa.decision]++;
        }
View Full Code Here


    public void reportAmbiguity(Parser recognizer, DFA dfa, int startIndex, int stopIndex, boolean exact, BitSet ambigAlts, ATNConfigSet configs) {
      if (COMPUTE_TRANSITION_STATS && DETAILED_DFA_STATE_STATS) {
        BitSet sllPredictions = getConflictingAlts(_sllConflict, _sllConfigs);
        int sllPrediction = sllPredictions.nextSetBit(0);
        BitSet llPredictions = getConflictingAlts(ambigAlts, configs);
        int llPrediction = llPredictions.cardinality() == 0 ? ATN.INVALID_ALT_NUMBER : llPredictions.nextSetBit(0);
        if (sllPrediction != llPrediction) {
          ((StatisticsParserATNSimulator)recognizer.getInterpreter()).nonSll[dfa.decision]++;
        }
      }
View Full Code Here

    @Override
    public void reportContextSensitivity(Parser recognizer, DFA dfa, int startIndex, int stopIndex, int prediction, ATNConfigSet configs) {
      if (COMPUTE_TRANSITION_STATS && DETAILED_DFA_STATE_STATS) {
        BitSet sllPredictions = getConflictingAlts(_sllConflict, _sllConfigs);
        int sllPrediction = sllPredictions.nextSetBit(0);
        if (sllPrediction != prediction) {
          ((StatisticsParserATNSimulator)recognizer.getInterpreter()).nonSll[dfa.decision]++;
        }
      }
View Full Code Here

      out = dir.createOutput(fileName, context);
      SimpleTextUtil.write(out, SIZE);
      SimpleTextUtil.write(out, Integer.toString(size), scratch);
      SimpleTextUtil.writeNewline(out);
     
      for (int i = set.nextSetBit(0); i >= 0; i=set.nextSetBit(i + 1)) {
        SimpleTextUtil.write(out, DOC);
        SimpleTextUtil.write(out, Integer.toString(i), scratch);
        SimpleTextUtil.writeNewline(out);
      }
     
View Full Code Here

      out = dir.createOutput(fileName, context);
      SimpleTextUtil.write(out, SIZE);
      SimpleTextUtil.write(out, Integer.toString(size), scratch);
      SimpleTextUtil.writeNewline(out);
     
      for (int i = set.nextSetBit(0); i >= 0; i=set.nextSetBit(i + 1)) {
        SimpleTextUtil.write(out, DOC);
        SimpleTextUtil.write(out, Integer.toString(i), scratch);
        SimpleTextUtil.writeNewline(out);
      }
     
View Full Code Here

        for ( HierNode<T> parent : py ) {
            t.or( parent.getBitMask() );
        }

        BitSet d = singleBitDiff( t, y.getBitMask() );
        int inDex = d.nextSetBit( 0 );

        if ( inDex < 0 ) {
            propagate( y, i );
        } else {
View Full Code Here

        for ( HierNode<T> parent : py ) {
            t.or( parent.getBitMask() );
        }

        BitSet d = singleBitDiff( t, y.getBitMask() );
        int inDex = d.nextSetBit( 0 );

        if ( inDex < 0 ) {
            propagate( y, i );
        } else {
View Full Code Here

            if (!didSomething) {
                break;
            }

            if (!undeodexedInstructions.isEmpty()) {
                for (int i=undeodexedInstructions.nextSetBit(0); i>=0; i=undeodexedInstructions.nextSetBit(i+1)) {
                    instructionsToAnalyze.set(i);
                }
            }
        } while (true);
View Full Code Here

            if (!didSomething) {
                break;
            }

            if (!undeodexedInstructions.isEmpty()) {
                for (int i=undeodexedInstructions.nextSetBit(0); i>=0; i=undeodexedInstructions.nextSetBit(i+1)) {
                    instructionsToAnalyze.set(i);
                }
            }
        } while (true);
View Full Code Here

        //the next iteration of the while loop.
        //This could also be done recursively, but in large methods it would likely cause very deep recursion,
        //which requires the user to specify a larger stack size. This isn't really a problem, but it is slightly
        //annoying.
        while (!changedInstructions.isEmpty()) {
            for (int instructionIndex=changedInstructions.nextSetBit(0);
                     instructionIndex>=0;
                     instructionIndex=changedInstructions.nextSetBit(instructionIndex+1)) {

                changedInstructions.clear(instructionIndex);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.