use of org.eclipse.xtext.lexer.backtrackingTestLanguage.Model in project xtext-core by eclipse.
the class BacktrackingLexerTestLanguageSemanticSequencer method sequence.
@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
EPackage epackage = semanticObject.eClass().getEPackage();
ParserRule rule = context.getParserRule();
Action action = context.getAssignedAction();
Set<Parameter> parameters = context.getEnabledBooleanParameters();
if (epackage == BacktrackingTestLanguagePackage.eINSTANCE)
switch(semanticObject.eClass().getClassifierID()) {
case BacktrackingTestLanguagePackage.AB:
sequence_Ab(context, (Ab) semanticObject);
return;
case BacktrackingTestLanguagePackage.MODEL:
sequence_Model(context, (Model) semanticObject);
return;
case BacktrackingTestLanguagePackage.XB:
sequence_Xb(context, (Xb) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
use of org.eclipse.xtext.lexer.backtrackingTestLanguage.Model in project xtext-core by eclipse.
the class Bug282355Test method testBug282355_04.
@Test
public void testBug282355_04() throws Exception {
Resource resource = getResourceFromString("Abc Efg Ab Xb");
assertTrue(resource.getErrors().isEmpty());
Model model = (Model) resource.getContents().get(0);
assertEquals(2, model.getEnums().size());
assertEquals(1, model.getAbs().size());
assertEquals(1, model.getXbs().size());
assertEquals(0, model.getAs().size());
assertEquals(0, model.getYs().size());
assertEquals(0, model.getYcs().size());
}
use of org.eclipse.xtext.lexer.backtrackingTestLanguage.Model in project xtext-core by eclipse.
the class Bug282355Test method testBug282355_02.
@Test
public void testBug282355_02() throws Exception {
Resource resource = getResourceFromString("Xb");
assertTrue(resource.getErrors().isEmpty());
Model model = (Model) resource.getContents().get(0);
assertEquals(0, model.getEnums().size());
assertEquals(0, model.getAbs().size());
assertEquals(1, model.getXbs().size());
assertEquals(0, model.getAs().size());
assertEquals(0, model.getYs().size());
assertEquals(0, model.getYcs().size());
}
use of org.eclipse.xtext.lexer.backtrackingTestLanguage.Model in project xtext-core by eclipse.
the class Bug282355Test method testBug282355_01.
@Test
public void testBug282355_01() throws Exception {
Resource resource = getResourceFromString("Abc Efg Xb");
assertTrue(resource.getErrors().isEmpty());
Model model = (Model) resource.getContents().get(0);
assertEquals(2, model.getEnums().size());
assertEquals(0, model.getAbs().size());
assertEquals(1, model.getXbs().size());
assertEquals(0, model.getAs().size());
assertEquals(0, model.getYs().size());
assertEquals(0, model.getYcs().size());
}
use of org.eclipse.xtext.lexer.backtrackingTestLanguage.Model in project xtext-core by eclipse.
the class Bug282355Test method testBug282355_03.
@Test
public void testBug282355_03() throws Exception {
Resource resource = getResourceFromString("Ab");
assertTrue(resource.getErrors().isEmpty());
Model model = (Model) resource.getContents().get(0);
assertEquals(0, model.getEnums().size());
assertEquals(1, model.getAbs().size());
assertEquals(0, model.getXbs().size());
assertEquals(0, model.getAs().size());
assertEquals(0, model.getYs().size());
assertEquals(0, model.getYcs().size());
}
Aggregations