Search in sources :

Example 1 with TypeReference

use of org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeReference in project xtext-core by eclipse.

the class TestLanguageSemanticSequencer 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 == TestLanguagePackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case TestLanguagePackage.MODEL:
                sequence_Model(context, (Model) semanticObject);
                return;
            case TestLanguagePackage.OPERATION:
                sequence_Operation(context, (Operation) semanticObject);
                return;
            case TestLanguagePackage.OPERATION_CALL:
                sequence_OperationCall(context, (OperationCall) semanticObject);
                return;
            case TestLanguagePackage.PACKAGE_DECLARATION:
                sequence_PackageDeclaration(context, (PackageDeclaration) semanticObject);
                return;
            case TestLanguagePackage.PARAMETER:
                sequence_Parameter(context, (org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Parameter) semanticObject);
                return;
            case TestLanguagePackage.PRIMITIVE_TYPE:
                if (rule == grammarAccess.getPrimitiveTypeRule()) {
                    sequence_PrimitiveType(context, (PrimitiveType) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeRule()) {
                    sequence_PrimitiveType_Type(context, (PrimitiveType) semanticObject);
                    return;
                } else
                    break;
            case TestLanguagePackage.PROPERTY:
                sequence_Property(context, (Property) semanticObject);
                return;
            case TestLanguagePackage.TYPE_DECLARATION:
                sequence_TypeDeclaration(context, (TypeDeclaration) semanticObject);
                return;
            case TestLanguagePackage.TYPE_REFERENCE:
                if (rule == grammarAccess.getTypeReferenceRule()) {
                    sequence_TypeReference(context, (TypeReference) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeRule()) {
                    sequence_Type_TypeReference(context, (TypeReference) semanticObject);
                    return;
                } else
                    break;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) Operation(org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Operation) EPackage(org.eclipse.emf.ecore.EPackage) OperationCall(org.eclipse.xtext.ide.tests.testlanguage.testLanguage.OperationCall) Model(org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Model) Parameter(org.eclipse.xtext.Parameter) PrimitiveType(org.eclipse.xtext.ide.tests.testlanguage.testLanguage.PrimitiveType) TypeReference(org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeReference) Property(org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Property) TypeDeclaration(org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeDeclaration) PackageDeclaration(org.eclipse.xtext.ide.tests.testlanguage.testLanguage.PackageDeclaration)

Aggregations

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 Model (org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Model)1 Operation (org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Operation)1 OperationCall (org.eclipse.xtext.ide.tests.testlanguage.testLanguage.OperationCall)1 PackageDeclaration (org.eclipse.xtext.ide.tests.testlanguage.testLanguage.PackageDeclaration)1 PrimitiveType (org.eclipse.xtext.ide.tests.testlanguage.testLanguage.PrimitiveType)1 Property (org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Property)1 TypeDeclaration (org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeDeclaration)1 TypeReference (org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeReference)1