use of org.eclipse.xtext.linking.bug287988Test.Model in project xtext-core by eclipse.
the class Bug287988TestLanguageSemanticSequencer 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 == Bug287988TestPackage.eINSTANCE)
switch(semanticObject.eClass().getClassifierID()) {
case Bug287988TestPackage.ATTRIBUTE:
if (rule == grammarAccess.getActionAttributeRule()) {
sequence_ActionAttribute(context, (Attribute) semanticObject);
return;
} else if (rule == grammarAccess.getAttributeRule()) {
sequence_Attribute(context, (Attribute) semanticObject);
return;
} else if (rule == grammarAccess.getBaseAttributeRule()) {
sequence_Attribute_BaseAttribute(context, (Attribute) semanticObject);
return;
} else if (rule == grammarAccess.getCallMe2Rule()) {
sequence_CallMe2(context, (Attribute) semanticObject);
return;
} else if (rule == grammarAccess.getRuleCallAttribute2Rule()) {
sequence_CallMe2_RuleCallAttribute2(context, (Attribute) semanticObject);
return;
} else if (rule == grammarAccess.getCallMe3Rule() || rule == grammarAccess.getCallMe4Rule()) {
sequence_CallMe4(context, (Attribute) semanticObject);
return;
} else if (rule == grammarAccess.getRuleCallAttribute3Rule()) {
sequence_CallMe4_RuleCallAttribute3(context, (Attribute) semanticObject);
return;
} else if (rule == grammarAccess.getCallMeRule()) {
sequence_CallMe(context, (Attribute) semanticObject);
return;
} else if (rule == grammarAccess.getRuleCallAttributeRule()) {
sequence_CallMe_RuleCallAttribute(context, (Attribute) semanticObject);
return;
} else if (rule == grammarAccess.getSimpleAttributeRule()) {
sequence_SimpleAttribute(context, (Attribute) semanticObject);
return;
} else
break;
case Bug287988TestPackage.MASTER:
if (rule == grammarAccess.getActionAttributeRule()) {
sequence_ActionAttribute(context, (Master) semanticObject);
return;
} else if (rule == grammarAccess.getBaseAttributeRule()) {
sequence_BaseAttribute_Master(context, (Master) semanticObject);
return;
} else if (rule == grammarAccess.getMasterRule()) {
sequence_Master(context, (Master) semanticObject);
return;
} else
break;
case Bug287988TestPackage.MODEL:
sequence_Model(context, (Model) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
use of org.eclipse.xtext.linking.bug287988Test.Model in project xtext-core by eclipse.
the class Bug287988WithEagerLinkingTest method testAction_03.
@Override
@Test
public void testAction_03() throws Exception {
String modelAsString = "actions master mytype attr1; attribute ref attr3 attr2;";
Model model = (Model) getModelAndExpect(modelAsString, 1);
assertEquals(2, model.getAttributes().size());
BaseAttribute baseAttribute = model.getAttributes().get(1);
assertNull(baseAttribute.getTypeRef());
}
use of org.eclipse.xtext.linking.bug287988Test.Model in project xtext-core by eclipse.
the class Bug287988Test method testAction_03.
@Test
public void testAction_03() throws Exception {
String modelAsString = "actions master mytype attr1; attribute ref attr3 attr2;";
Model model = (Model) getModelAndExpect(modelAsString, 1);
assertEquals(2, model.getAttributes().size());
BaseAttribute baseAttribute = model.getAttributes().get(1);
assertNotNull(baseAttribute.getTypeRef());
EObject eObject = baseAttribute.getTypeRef();
assertTrue(eObject.eIsProxy());
}
use of org.eclipse.xtext.linking.bug287988Test.Model in project xtext-core by eclipse.
the class Bug287988Test method checkSecondAttrRefersToFirst.
protected void checkSecondAttrRefersToFirst(String modelAsString) throws Exception {
Model model = (Model) getModel(modelAsString);
assertEquals(2, model.getAttributes().size());
BaseAttribute baseAttribute = model.getAttributes().get(1);
assertEquals(model.getAttributes().get(0), baseAttribute.getTypeRef());
}
use of org.eclipse.xtext.linking.bug287988Test.Model in project xtext-core by eclipse.
the class Bug287988Test method testAction_02.
@Test
public void testAction_02() throws Exception {
String modelAsString = "actions master mytype attr1; attribute myOtherType attr2;";
Model model = (Model) getModel(modelAsString);
assertEquals(2, model.getAttributes().size());
BaseAttribute baseAttribute = model.getAttributes().get(1);
assertNull(baseAttribute.getTypeRef());
}
Aggregations