Package hampi.constraints

Examples of hampi.constraints.Regexp.matches()


  public void testMultiCharTerminals() throws Exception{
    Grammar g = new Parser(GrammarTests.DIR + "test_multiCharTerminal.txt").parse();
    GrammarStringBounder gsb = new GrammarStringBounder();
    Regexp boundedRegexp = gsb.getBoundedRegexp(g, "program", 3, false);
    System.out.println(boundedRegexp);
    assertTrue(!boundedRegexp.matches("AB__"));
    assertTrue(boundedRegexp.matches("AB_"));
  }

  public void test1() throws Exception{
    Grammar g = new Parser(GrammarTests.DIR + "test_generate_parent.txt").parse();
View Full Code Here


    Grammar g = new Parser(GrammarTests.DIR + "test_multiCharTerminal.txt").parse();
    GrammarStringBounder gsb = new GrammarStringBounder();
    Regexp boundedRegexp = gsb.getBoundedRegexp(g, "program", 3, false);
    System.out.println(boundedRegexp);
    assertTrue(!boundedRegexp.matches("AB__"));
    assertTrue(boundedRegexp.matches("AB_"));
  }

  public void test1() throws Exception{
    Grammar g = new Parser(GrammarTests.DIR + "test_generate_parent.txt").parse();
    GrammarStringBounder gsb = new GrammarStringBounder();
View Full Code Here

  public void test1() throws Exception{
    Grammar g = new Parser(GrammarTests.DIR + "test_generate_parent.txt").parse();
    GrammarStringBounder gsb = new GrammarStringBounder();
    Regexp boundedRegexp = gsb.getBoundedRegexp(g, "expr", 2, false);
    assertTrue(boundedRegexp.matches("()"));
    assertTrue(!boundedRegexp.matches("(())"));
  }

  public void test2() throws Exception{
    Grammar g = new Parser(GrammarTests.DIR + "test_generate_parent.txt").parse();
View Full Code Here

  public void test1() throws Exception{
    Grammar g = new Parser(GrammarTests.DIR + "test_generate_parent.txt").parse();
    GrammarStringBounder gsb = new GrammarStringBounder();
    Regexp boundedRegexp = gsb.getBoundedRegexp(g, "expr", 2, false);
    assertTrue(boundedRegexp.matches("()"));
    assertTrue(!boundedRegexp.matches("(())"));
  }

  public void test2() throws Exception{
    Grammar g = new Parser(GrammarTests.DIR + "test_generate_parent.txt").parse();
    GrammarStringBounder gsb = new GrammarStringBounder();
View Full Code Here

  public void test3() throws Exception{
    Grammar g = new Parser(GrammarTests.DIR + "test_generate_parent.txt").parse();
    GrammarStringBounder gsb = new GrammarStringBounder();
    Regexp boundedRegexp = gsb.getBoundedRegexp(g, "expr", 4, false);
    System.out.println(boundedRegexp);
    assertTrue(!boundedRegexp.matches("()"));
    assertTrue(boundedRegexp.matches("(())"));
    assertTrue(boundedRegexp.matches("()()"));
    assertTrue(!boundedRegexp.matches("(((("));

  }
View Full Code Here

    Grammar g = new Parser(GrammarTests.DIR + "test_generate_parent.txt").parse();
    GrammarStringBounder gsb = new GrammarStringBounder();
    Regexp boundedRegexp = gsb.getBoundedRegexp(g, "expr", 4, false);
    System.out.println(boundedRegexp);
    assertTrue(!boundedRegexp.matches("()"));
    assertTrue(boundedRegexp.matches("(())"));
    assertTrue(boundedRegexp.matches("()()"));
    assertTrue(!boundedRegexp.matches("(((("));

  }
View Full Code Here

    GrammarStringBounder gsb = new GrammarStringBounder();
    Regexp boundedRegexp = gsb.getBoundedRegexp(g, "expr", 4, false);
    System.out.println(boundedRegexp);
    assertTrue(!boundedRegexp.matches("()"));
    assertTrue(boundedRegexp.matches("(())"));
    assertTrue(boundedRegexp.matches("()()"));
    assertTrue(!boundedRegexp.matches("(((("));

  }

  public void test4() throws Exception{
View Full Code Here

    Regexp boundedRegexp = gsb.getBoundedRegexp(g, "expr", 4, false);
    System.out.println(boundedRegexp);
    assertTrue(!boundedRegexp.matches("()"));
    assertTrue(boundedRegexp.matches("(())"));
    assertTrue(boundedRegexp.matches("()()"));
    assertTrue(!boundedRegexp.matches("(((("));

  }

  public void test4() throws Exception{
    Grammar g = new Parser(GrammarTests.DIR + "test_generate_parent.txt").parse();
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.