Search in sources :

Example 6 with Model

use of org.eclipse.xtext.lexer.backtrackingTestLanguage.Model in project xtext-core by eclipse.

the class Bug282355Test method testParse_Yc_01.

@Test
public void testParse_Yc_01() throws Exception {
    Resource resource = getResourceFromString("Abc Efg Yc");
    assertTrue(resource.getErrors().isEmpty());
    Model model = (Model) resource.getContents().get(0);
    assertEquals(2, model.getEnums().size());
    assertEquals(0, model.getAbs().size());
    assertEquals(0, model.getXbs().size());
    assertEquals(0, model.getAs().size());
    assertEquals(0, model.getYs().size());
    assertEquals(1, model.getYcs().size());
}
Also used : Resource(org.eclipse.emf.ecore.resource.Resource) Model(org.eclipse.xtext.lexer.backtrackingTestLanguage.Model) Test(org.junit.Test)

Example 7 with Model

use of org.eclipse.xtext.lexer.backtrackingTestLanguage.Model in project xtext-core by eclipse.

the class Bug282355Test method testParse_A.

@Test
public void testParse_A() throws Exception {
    Resource resource = getResourceFromString("A");
    assertTrue(resource.getErrors().isEmpty());
    Model model = (Model) resource.getContents().get(0);
    assertEquals(0, model.getEnums().size());
    assertEquals(0, model.getAbs().size());
    assertEquals(0, model.getXbs().size());
    assertEquals(1, model.getAs().size());
    assertEquals(0, model.getYs().size());
    assertEquals(0, model.getYcs().size());
}
Also used : Resource(org.eclipse.emf.ecore.resource.Resource) Model(org.eclipse.xtext.lexer.backtrackingTestLanguage.Model) Test(org.junit.Test)

Example 8 with Model

use of org.eclipse.xtext.lexer.backtrackingTestLanguage.Model in project xtext-core by eclipse.

the class Bug282355Test method testParse_Yc_02.

@Test
public void testParse_Yc_02() throws Exception {
    Resource resource = getResourceFromString("YcYc");
    assertTrue(resource.getErrors().isEmpty());
    Model model = (Model) resource.getContents().get(0);
    assertEquals(0, model.getEnums().size());
    assertEquals(0, model.getAbs().size());
    assertEquals(0, model.getXbs().size());
    assertEquals(0, model.getAs().size());
    assertEquals(0, model.getYs().size());
    assertEquals(2, model.getYcs().size());
}
Also used : Resource(org.eclipse.emf.ecore.resource.Resource) Model(org.eclipse.xtext.lexer.backtrackingTestLanguage.Model) Test(org.junit.Test)

Example 9 with Model

use of org.eclipse.xtext.lexer.backtrackingTestLanguage.Model in project xtext-core by eclipse.

the class Bug282355Test method testParse_YcAA.

@Test
public void testParse_YcAA() throws Exception {
    Resource resource = getResourceFromString("YcAA");
    assertTrue(resource.getErrors().isEmpty());
    Model model = (Model) resource.getContents().get(0);
    assertEquals(0, model.getEnums().size());
    assertEquals(0, model.getAbs().size());
    assertEquals(0, model.getXbs().size());
    assertEquals(2, model.getAs().size());
    assertEquals(0, model.getYs().size());
    assertEquals(1, model.getYcs().size());
}
Also used : Resource(org.eclipse.emf.ecore.resource.Resource) Model(org.eclipse.xtext.lexer.backtrackingTestLanguage.Model) Test(org.junit.Test)

Example 10 with Model

use of org.eclipse.xtext.lexer.backtrackingTestLanguage.Model in project xtext-core by eclipse.

the class Bug282355Test method testParse_YA.

@Test
public void testParse_YA() throws Exception {
    Resource resource = getResourceFromString("YA");
    assertTrue(resource.getErrors().isEmpty());
    Model model = (Model) resource.getContents().get(0);
    assertEquals(0, model.getEnums().size());
    assertEquals(0, model.getAbs().size());
    assertEquals(0, model.getXbs().size());
    assertEquals(1, model.getAs().size());
    assertEquals(1, model.getYs().size());
    assertEquals(0, model.getYcs().size());
}
Also used : Resource(org.eclipse.emf.ecore.resource.Resource) Model(org.eclipse.xtext.lexer.backtrackingTestLanguage.Model) Test(org.junit.Test)

Aggregations

Model (org.eclipse.xtext.lexer.backtrackingTestLanguage.Model)11 Resource (org.eclipse.emf.ecore.resource.Resource)10 Test (org.junit.Test)10 EPackage (org.eclipse.emf.ecore.EPackage)1 Action (org.eclipse.xtext.Action)1 Parameter (org.eclipse.xtext.Parameter)1 ParserRule (org.eclipse.xtext.ParserRule)1 Ab (org.eclipse.xtext.lexer.backtrackingTestLanguage.Ab)1 Xb (org.eclipse.xtext.lexer.backtrackingTestLanguage.Xb)1