use of org.eclipse.xtext.parser.terminalrules.bug317840TestLanguage.Element in project xtext-core by eclipse.
the class Bug317840Test method testSemanticModel_04.
@Test
public void testSemanticModel_04() throws Exception {
Element element = getFirstElement("element a b c d");
assertEquals("a", element.getFirst().getName());
assertEquals("b", element.getSecond().getName());
assertEquals(1, element.getThird().size());
assertEquals("c", element.getThird().get(0).getName());
assertEquals(1, element.getForth().size());
assertEquals("d", element.getForth().get(0).getName());
}
use of org.eclipse.xtext.parser.terminalrules.bug317840TestLanguage.Element in project xtext-core by eclipse.
the class Bug317840Test method testSemanticModel_02.
@Test
public void testSemanticModel_02() throws Exception {
Element element = getFirstElement("element a b");
assertEquals("a", element.getFirst().getName());
assertEquals("b", element.getSecond().getName());
assertTrue(element.getThird().isEmpty());
assertTrue(element.getForth().isEmpty());
}
use of org.eclipse.xtext.parser.terminalrules.bug317840TestLanguage.Element in project xtext-core by eclipse.
the class Bug317840Test method testSemanticModel_05.
@Test
public void testSemanticModel_05() throws Exception {
Element element = getFirstElement("element a b c d e");
assertEquals("a", element.getFirst().getName());
assertNull(element.getSecond());
assertEquals(2, element.getThird().size());
assertEquals("b", element.getThird().get(0).getName());
assertEquals("d", element.getThird().get(1).getName());
assertEquals(2, element.getForth().size());
assertEquals("c", element.getForth().get(0).getName());
assertEquals("e", element.getForth().get(1).getName());
}
use of org.eclipse.xtext.parser.terminalrules.bug317840TestLanguage.Element in project xtext-core by eclipse.
the class Bug317840Test method testSemanticModel_03.
@Test
public void testSemanticModel_03() throws Exception {
Element element = getFirstElement("element a b c");
assertEquals("a", element.getFirst().getName());
assertNull(element.getSecond());
assertEquals(1, element.getThird().size());
assertEquals("b", element.getThird().get(0).getName());
assertEquals(1, element.getForth().size());
assertEquals("c", element.getForth().get(0).getName());
}
use of org.eclipse.xtext.parser.terminalrules.bug317840TestLanguage.Element in project xtext-core by eclipse.
the class Bug317840Test method testNodeModel_10.
@Test
public void testNodeModel_10() throws Exception {
Element element = getFirstElement("element a.a b.b c.c d.d e.e");
INode node = NodeModelUtils.getNode(element);
assertEquals("element a.a b.b c.c d.d e.e", node.getText());
assertEquals("[(element)[[( )(a)(.)(a)]][[( )(b)(.)(b)]][[( )(c)(.)(c)]][[( )(d)(.)(d)]][[( )(e)(.)(e)]]]", toDebugString(node));
}
Aggregations