Package net.sf.jcontracts.antlr.collections.impl

Examples of net.sf.jcontracts.antlr.collections.impl.BitSet


    protected int markBitsetForGen(BitSet p)
    {
        for (int i = 0; i < bitsetsUsed.size(); i++)
        {
            BitSet set = (BitSet) bitsetsUsed.elementAt(i);
            if (p.equals(set))
            {
                return i;
            }
        }
View Full Code Here


    protected void genBitsets(Vector bitsetList, int maxVocabulary)
    {
        println("");
        for (int i = 0; i < bitsetList.size(); i++)
        {
            BitSet p = (BitSet) bitsetList.elementAt(i);
            p.growToInclude(maxVocabulary);
            println("private static final long " + getBitsetName(i) + "_data_" + "[] = { " + p.toStringOfWords()
                    + " };");
            println("public static final BitSet " + getBitsetName(i) + " = new BitSet(" + getBitsetName(i) + "_data_"
                    + ");");
        }
View Full Code Here

            depth = grammar.maxk;
        }
        boolean first = true;
        for (int i = 1; i <= depth && i <= maxDepth; i++)
        {
            BitSet p = alt.cache[i].fset;
            if ((grammar instanceof LexerGrammar) && p.member(1))
            {
                if (i == 1)
                {
                    e.append("true");
                }
View Full Code Here

        {
            depth = grammar.maxk;
        }
        for (int i = 1; i <= depth && i <= maxDepth; i++)
        {
            BitSet p = alt.cache[i].fset;
            if ((grammar instanceof LexerGrammar) && p.member(1))
            {
                return false;
            }
            if (p.degree() != 0)
            {
                return false;
            }
        }
View Full Code Here

        }
    }

    public final BitSet charSet() throws ParserException
    {
        BitSet b = null;
        BitSet tmpSet = null;
        b = setBlockElement();
        do
        {
            if (la_1 != 21)
            {
View Full Code Here

        {
            if (la_1 == 17)
            {
                match(17);
                match(14);
                BitSet b = charSet();
                match(15);
                if (guessing == 0)
                {
                    behavior.setCharVocabulary(b);
                }
View Full Code Here

    public final BitSet setBlockElement() throws ParserException
    {
        Token c1 = null;
        Token c2 = null;
        BitSet b = null;
        int rangeMin = 0;
        c1 = LT(1);
        match(19);
        if (guessing == 0)
        {
            rangeMin = ANTLRLexer.escapeCharValue(c1.getText());
            b = BitSet.of(rangeMin);
        }
        if (la_1 == 22)
        {
            match(22);
            c2 = LT(1);
            match(19);
            if (guessing == 0)
            {
                int rangeMax = ANTLRLexer.escapeCharValue(c2.getText());
                if (rangeMax < rangeMin)
                {
                    tool.error("Malformed range", c1.getLine());
                }
                for (int i = rangeMin + 1; i <= rangeMax; i++)
                {
                    b.add(i);
                }

            }
        }
        return b;
View Full Code Here

public class BitSetTest
{

    public static void main(String args[])
    {
        BitSet a = BitSet.of(1);
        System.out.println("BitSet.of(1) == " + a);
        a.add(2);
        a.add(3);
        a.add(4);
        System.out.println("a == " + a);
        System.out.println("a.clone() == " + a.clone());
        BitSet b = BitSet.of(2);
        System.out.println("b == " + b);
        System.out.println("b.not() == " + b.not());
        System.out.println("a.not() == " + a.not());
        System.out.println("a.equals(b) == " + a.equals(b));
        System.out.println("b.equals(a) == " + b.equals(a));
        System.out.println("b.equals(b) == " + b.equals(b));
        System.out.println("a.equals(a) == " + a.equals(a));
        System.out.println("a.size() == " + a.size());
        System.out.println("new BitSet().equals(new BitSet()) == " + (new BitSet()).equals(new BitSet()));
        System.out.println("a&b == " + a.and(b));
        System.out.println("b.or(BitSet.of(5)) == " + b.or(BitSet.of(5)));
        System.out.println("a.nil() == " + a.nil());
        System.out.println("new BitSet().nil() == " + (new BitSet()).nil());
        System.out.println("new BitSet().degree() == " + (new BitSet()).degree());
        System.out.println("BitSet.of(1).degree() == " + BitSet.of(1).degree());
        System.out.println("a.degree() == " + a.degree());
        System.out.println("b.subset(a) == " + b.subset(a));
        System.out.println("a.subset(b) == " + a.subset(b));
        System.out.println("new BitSet().subset(a) == " + (new BitSet()).subset(a));
        System.out.println("b.or(BitSet.of(4)).subset(a) == " + b.or(BitSet.of(4)).subset(a));
        System.out.println("b.or(BitSet.of(5)).subset(a) == " + b.or(BitSet.of(5)).subset(a));
        System.out.println("BitSet.of(85) == " + BitSet.of(85));
        System.out.println("a|BitSet.of(85) == " + a.or(BitSet.of(85)));
        System.out.println("BitSet.of(85).size() == " + BitSet.of(85).size());
        System.out.println("BitSet.of(85).degree() == " + BitSet.of(85).degree());
        BitSet z = a.or(BitSet.of(85));
        z.clear();
        System.out.println("a|BitSet.of(85).clear() == " + z);
    }
View Full Code Here

    {
        super(className_, tool_, superClass);
        testLiterals = true;
        caseSensitiveLiterals = true;
        caseSensitive = true;
        charVocabulary = new BitSet();
        longestPossible = true;
        defaultErrorHandler = false;
    }
View Full Code Here

public class Lookahead implements Cloneable
{

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

TOP

Related Classes of net.sf.jcontracts.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.