use of org.eclipse.xtext.parser.terminalrules.bug317840TestLanguage.Element in project xtext-core by eclipse.
the class Bug317840Test method getFirstElement.
public Element getFirstElement(String model) throws Exception {
Model m = getModel(model);
Element element = m.getElements().get(0);
return element;
}
use of org.eclipse.xtext.parser.terminalrules.bug317840TestLanguage.Element in project xtext-core by eclipse.
the class Bug317840Test method testSemanticModel_09.
@Test
public void testSemanticModel_09() throws Exception {
Element element = getFirstElement("element a.a b.b c.c d.d");
assertEquals("a.a", element.getFirst().getName());
assertEquals("b.b", element.getSecond().getName());
assertEquals(1, element.getThird().size());
assertEquals("c.c", element.getThird().get(0).getName());
assertEquals(1, element.getForth().size());
assertEquals("d.d", element.getForth().get(0).getName());
}
use of org.eclipse.xtext.parser.terminalrules.bug317840TestLanguage.Element in project xtext-core by eclipse.
the class Bug317840TestLanguageSemanticSequencer 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 == Bug317840TestLanguagePackage.eINSTANCE)
switch(semanticObject.eClass().getClassifierID()) {
case Bug317840TestLanguagePackage.ELEMENT:
sequence_Element(context, (Element) semanticObject);
return;
case Bug317840TestLanguagePackage.MODEL:
sequence_Model(context, (Model) semanticObject);
return;
case Bug317840TestLanguagePackage.NAMED:
sequence_Named(context, (Named) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
use of org.eclipse.xtext.parser.terminalrules.bug317840TestLanguage.Element in project xtext-core by eclipse.
the class Bug317840Test method testSemanticModel_01.
@Test
public void testSemanticModel_01() throws Exception {
Element element = getFirstElement("element a");
assertEquals("a", element.getFirst().getName());
assertNull(element.getSecond());
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_07.
@Test
public void testSemanticModel_07() throws Exception {
Element element = getFirstElement("element a.a b.b");
assertEquals("a.a", element.getFirst().getName());
assertEquals("b.b", element.getSecond().getName());
assertTrue(element.getThird().isEmpty());
assertTrue(element.getForth().isEmpty());
}
Aggregations