Package org.allspice.parser.generation

Examples of org.allspice.parser.generation.FirstImpl


   * @param g
   * @return A Parse table for the specified grammar
   * @throws StateConflict
   */
  public static ParseTable createParseTable(Grammar g) throws StateConflict {
    ParseTableGeneratorStategy strat = new LALR1ParseTableGeneratorImpl(g,new FirstImpl(g)) ;
    return strat.createParseTable();
  }
View Full Code Here


    Grammar g = new Grammar("T'",Arrays.asList(
        new Rule("T'","T")),
        new Tree23Map<String,AssocType>(),
        new Tree23Map<String,Integer>(),
        new Tree23Map<Rule,Integer>()) ;
    FirstStrategy ff = new FirstImpl(g) ;
    Set<String> f = ff.first("T'");
    assertEquals(f,new HashSet<String>(Arrays.asList("T"))) ;
  }
View Full Code Here

    Grammar g = new Grammar("T'",Arrays.asList(
      new Rule("T'","T1","T2")),
      new Tree23Map<String,AssocType>(),
      new Tree23Map<String,Integer>(),
      new Tree23Map<Rule,Integer>()) ;
    FirstStrategy ff = new FirstImpl(g) ;
    Set<String> f = ff.first("T'");
    assertEquals(f,new HashSet<String>(Arrays.asList("T1"))) ;
  }
View Full Code Here

      new Rule("B"),
      new Rule("B","T2")),
      new Tree23Map<String,AssocType>(),
      new Tree23Map<String,Integer>(),
      new Tree23Map<Rule,Integer>()) ;
    FirstStrategy ff = new FirstImpl(g) ;
    Set<String> f = ff.first("T'");
    assertEquals(f,new HashSet<String>(Arrays.asList("T1","T2"))) ;
  }
View Full Code Here

      new Rule("A","T1"),
      new Rule("B","T2")),
      new Tree23Map<String,AssocType>(),
      new Tree23Map<String,Integer>(),
      new Tree23Map<Rule,Integer>()) ;
    FirstStrategy ff = new FirstImpl(g) ;
    Set<String> f = ff.first("T'");
    assertEquals(f,new HashSet<String>(Arrays.asList("T1","T2"))) ;
  }
View Full Code Here

      new Rule("A"),
      new Rule("A","A","A","T1")),
      new Tree23Map<String,AssocType>(),
      new Tree23Map<String,Integer>(),
      new Tree23Map<Rule,Integer>()) ;
    FirstStrategy ff = new FirstImpl(g) ;
    Set<String> f = ff.first("T'");
    assertEquals(f,new HashSet<String>(Arrays.asList("T1","T2"))) ;
  }
View Full Code Here

      new Rule("A"),
      new Rule("A","A","A","T1")),
      new Tree23Map<String,AssocType>(),
      new Tree23Map<String,Integer>(),
      new Tree23Map<Rule,Integer>()) ;
    FirstStrategy ff = new FirstImpl(g) ;
    Set<String> f = ff.first("T'");
    assertEquals(f,new HashSet<String>(Arrays.asList("T1"))) ;
  }
View Full Code Here

    Grammar g = new Grammar("T'",Arrays.asList(
      new Rule("T'","T")),
      new Tree23Map<String,AssocType>(),
      new Tree23Map<String,Integer>(),
      new Tree23Map<Rule,Integer>()) ;
    FirstStrategy ff = new FirstImpl(g) ;
    Set<String> f = ff.first();
    assertEquals(f,new HashSet<String>()) ;
  }
View Full Code Here

TOP

Related Classes of org.allspice.parser.generation.FirstImpl

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.