Assert.assertEquals(expected, actual);
}
public void testCheckSimple1() {
Grammar g = SyntaxUtilOld.parseSyntax("syntax1", openStream("syntax1", TESTCONTAINER), new TestNotifier(),
new HashMap<String, String>());
Assert.assertNotNull(g);
Assert.assertEquals(0, g.getEoi().getIndex());
Symbol[] syms = g.getSymbols();
Assert.assertEquals(7, syms.length);
Assert.assertEquals("eoi", syms[0].getName());
Assert.assertEquals("identifier", syms[1].getName());
Assert.assertEquals("Licon", syms[2].getName());
Assert.assertEquals("_skip", syms[3].getName()); // TODO do not
// collect skip
// symbols
Assert.assertEquals("input", syms[4].getName());
Assert.assertEquals("list", syms[5].getName());
Assert.assertEquals("list_item", syms[6].getName());
Rule[] rules = g.getRules();
Assert.assertEquals(5, rules.length);
Assert.assertEquals("input", rules[0].getLeft().getName());
Assert.assertEquals("list", rules[0].getRight()[0].getTarget().getName());
Assert.assertEquals(1, rules[0].getRight().length);
Lexem[] lexems = g.getLexems();
Assert.assertEquals(3, lexems.length);
Assert.assertEquals("@?[a-zA-Z_][A-Za-z_0-9]*", lexems[0].getRegexp());
Assert.assertEquals("([1-9][0-9]*|0[0-7]*|0[xX][0-9a-fA-F]+)([uU](l|L|ll|LL)?|(l|L|ll|LL)[uU]?)?", lexems[1]
.getRegexp());
Assert.assertEquals("[\\t\\r\\n ]+", lexems[2].getRegexp());