public void testNonCNF17() throws Exception{
checkNonCNF("expr.txt", "expr");
}
public void testNonCNF18() throws Exception{
Grammar g = new Parser(DIR + "test_cnf1.txt").parse();
assertTrue(!g.isCNF());
List<Grammar> steps = new ArrayList<Grammar>();
Grammar gCNF = new CNFConverter().convertToCNF(g, "S", steps);
System.out.println("orig :\n" + g);
System.out.println("step0:\n" + steps.get(0));
System.out.println("step1:\n" + steps.get(1));
compareIgnoreNewlines(steps.get(1).toString(), DIR + "test_cnf1_step1_expected.txt");
System.out.println("step2:\n" + steps.get(2));
compareIgnoreNewlines(steps.get(2).toString(), DIR + "test_cnf1_step2_expected.txt");
System.out.println("step3:\n" + steps.get(3));
compareIgnoreNewlines(steps.get(3).toString(), DIR + "test_cnf1_step3_expected.txt");
System.out.println("step4:\n" + steps.get(4));
compareIgnoreNewlines(steps.get(4).toString(), DIR + "test_cnf1_step4_expected.txt");
System.out.println("step5:\n" + gCNF);
assertEquals(5, steps.size());
compareIgnoreNewlines(gCNF.toString(), DIR + "test_cnf1_expected.txt");
assertTrue("Not in CNF\n" + gCNF.toString(), gCNF.isCNF());
}