use of org.eclipse.xtext.parser.datatyperules.datatypeRulesTestLanguage.CompositeModel in project xtext-core by eclipse.
the class DatatypeRulesTestLanguageSemanticSequencer 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 == DatatypeRulesTestLanguagePackage.eINSTANCE)
switch(semanticObject.eClass().getClassifierID()) {
case DatatypeRulesTestLanguagePackage.COMPOSITE_MODEL:
sequence_CompositeModel(context, (CompositeModel) semanticObject);
return;
case DatatypeRulesTestLanguagePackage.MODEL:
sequence_Model(context, (Model) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
use of org.eclipse.xtext.parser.datatyperules.datatypeRulesTestLanguage.CompositeModel in project xtext-core by eclipse.
the class EFactoryValueConverterTest method testImplicitEFactoryValueConverter.
@Test
public void testImplicitEFactoryValueConverter() throws Exception {
with(DatatypeRulesTestLanguageStandaloneSetup.class);
EObject model = getModel("a.b.c.d * -2.5E-23 ;");
assertTrue(model instanceof CompositeModel);
assertFalse(((CompositeModel) model).getModel().isEmpty());
model = ((CompositeModel) model).getModel().get(0);
double myDouble = ((Model) model).getDouble();
assertEquals(-2.5E-23, myDouble, 0.0001);
}
Aggregations