Package beaver.comp.util

Examples of beaver.comp.util.BitSet


      }
    }

    static private void writeStaticReturns(Grammar grammar, Writer out) throws IOException
    {
      BitSet ret_elems = new BitSet();
      for (int i = 0; i < grammar.rules.length; i++)
      {
        Production rule = grammar.rules[i];
        if (rule.code == null && rule.rhs.size() > 1)
        {
          int n = indexOfLastReferencedSymbol(rule.rhs);
                    if (n == 0)
                        continue;
                    if (n < 0)
                        n = rule.rhs.size() - 1;
          if (ret_elems.add(n))
          {
            out.write("\n\tstatic final Action RETURN");
            out.write(String.valueOf(n + 1));
            out.write(" = new Action() {\n");
            out.write("\t\tpublic Symbol reduce(Symbol[] _symbols, int offset) {\n");
View Full Code Here


  Configuration(Configuration factory_probe, Grammar grammar)
  {
    this.rule = factory_probe.rule;
    this.dot = factory_probe.dot;
    this.lookaheads = new BitSet(grammar.terminals.length);
  }
View Full Code Here

   */
  public void buildFirstSets()
  {
    for (int i = 0; i < nonterminals.length; i++)
    {
      nonterminals[i].first_set = new BitSet(terminals.length);
    }
    for (int i = 0; i < rules.length; i++)
    {
      rules[i].startFirstSet();
    }
View Full Code Here

TOP

Related Classes of beaver.comp.util.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.