Search in sources :

Example 1 with EPackageImport

use of org.eclipse.xtext.parser.epatch.epatchTestLanguage.EPackageImport in project xtext-core by eclipse.

the class EpatchTestLanguageSemanticSequencer 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 == EpatchTestLanguagePackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case EpatchTestLanguagePackage.ASSIGNMENT_VALUE:
                if (rule == grammarAccess.getAssignmentValueRule()) {
                    sequence_AssignmentValue(context, (AssignmentValue) semanticObject);
                    return;
                } else if (rule == grammarAccess.getListAssignmentValueRule()) {
                    sequence_ListAssignmentValue(context, (AssignmentValue) semanticObject);
                    return;
                } else if (rule == grammarAccess.getSingleAssignmentValueRule()) {
                    sequence_SingleAssignmentValue(context, (AssignmentValue) semanticObject);
                    return;
                } else
                    break;
            case EpatchTestLanguagePackage.EPACKAGE_IMPORT:
                sequence_EPackageImport(context, (EPackageImport) semanticObject);
                return;
            case EpatchTestLanguagePackage.EPATCH:
                sequence_EPatch(context, (EPatch) semanticObject);
                return;
            case EpatchTestLanguagePackage.EXPRESSION_EXECUTABLE:
                sequence_ExpressionExecutable(context, (ExpressionExecutable) semanticObject);
                return;
            case EpatchTestLanguagePackage.EXTENSION_IMPORT:
                sequence_ExtensionImport(context, (ExtensionImport) semanticObject);
                return;
            case EpatchTestLanguagePackage.JAVA_EXECUTABLE:
                sequence_JavaExecutable(context, (JavaExecutable) semanticObject);
                return;
            case EpatchTestLanguagePackage.JAVA_IMPORT:
                sequence_JavaImport(context, (JavaImport) semanticObject);
                return;
            case EpatchTestLanguagePackage.LIST_ASSIGNMENT:
                if (rule == grammarAccess.getBiListAssignmentRule()) {
                    sequence_BiListAssignment(context, (ListAssignment) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAssignmentRule()) {
                    sequence_BiListAssignment_MonoListAssignment(context, (ListAssignment) semanticObject);
                    return;
                } else if (rule == grammarAccess.getMonoListAssignmentRule()) {
                    sequence_MonoListAssignment(context, (ListAssignment) semanticObject);
                    return;
                } else
                    break;
            case EpatchTestLanguagePackage.MIGRATION:
                sequence_Migration(context, (Migration) semanticObject);
                return;
            case EpatchTestLanguagePackage.NAMED_RESOURCE:
                sequence_NamedResource(context, (NamedResource) semanticObject);
                return;
            case EpatchTestLanguagePackage.OBJECT_COPY:
                if (rule == grammarAccess.getNamedObjectRule() || rule == grammarAccess.getCreatedObjectRule()) {
                    sequence_CreatedObject_ObjectCopy(context, (ObjectCopy) semanticObject);
                    return;
                } else if (rule == grammarAccess.getObjectCopyRule()) {
                    sequence_ObjectCopy(context, (ObjectCopy) semanticObject);
                    return;
                } else
                    break;
            case EpatchTestLanguagePackage.OBJECT_NEW:
                if (rule == grammarAccess.getNamedObjectRule() || rule == grammarAccess.getCreatedObjectRule()) {
                    sequence_CreatedObject_ObjectNew(context, (ObjectNew) semanticObject);
                    return;
                } else if (rule == grammarAccess.getObjectNewRule()) {
                    sequence_ObjectNew(context, (ObjectNew) semanticObject);
                    return;
                } else
                    break;
            case EpatchTestLanguagePackage.OBJECT_REF:
                sequence_ObjectRef(context, (ObjectRef) semanticObject);
                return;
            case EpatchTestLanguagePackage.RESOURCE_IMPORT:
                sequence_ResourceImport(context, (ResourceImport) semanticObject);
                return;
            case EpatchTestLanguagePackage.SINGLE_ASSIGNMENT:
                if (rule == grammarAccess.getAssignmentRule()) {
                    sequence_BiSingleAssignment_MonoSingleAssignment(context, (SingleAssignment) semanticObject);
                    return;
                } else if (rule == grammarAccess.getBiSingleAssignmentRule()) {
                    sequence_BiSingleAssignment(context, (SingleAssignment) semanticObject);
                    return;
                } else if (rule == grammarAccess.getMonoSingleAssignmentRule()) {
                    sequence_MonoSingleAssignment(context, (SingleAssignment) 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) AssignmentValue(org.eclipse.xtext.parser.epatch.epatchTestLanguage.AssignmentValue) SingleAssignment(org.eclipse.xtext.parser.epatch.epatchTestLanguage.SingleAssignment) Migration(org.eclipse.xtext.parser.epatch.epatchTestLanguage.Migration) EPackageImport(org.eclipse.xtext.parser.epatch.epatchTestLanguage.EPackageImport) ObjectNew(org.eclipse.xtext.parser.epatch.epatchTestLanguage.ObjectNew) ListAssignment(org.eclipse.xtext.parser.epatch.epatchTestLanguage.ListAssignment) JavaExecutable(org.eclipse.xtext.parser.epatch.epatchTestLanguage.JavaExecutable) EPackage(org.eclipse.emf.ecore.EPackage) EPatch(org.eclipse.xtext.parser.epatch.epatchTestLanguage.EPatch) ExpressionExecutable(org.eclipse.xtext.parser.epatch.epatchTestLanguage.ExpressionExecutable) JavaImport(org.eclipse.xtext.parser.epatch.epatchTestLanguage.JavaImport) NamedResource(org.eclipse.xtext.parser.epatch.epatchTestLanguage.NamedResource) ObjectCopy(org.eclipse.xtext.parser.epatch.epatchTestLanguage.ObjectCopy) Parameter(org.eclipse.xtext.Parameter) ObjectRef(org.eclipse.xtext.parser.epatch.epatchTestLanguage.ObjectRef) ExtensionImport(org.eclipse.xtext.parser.epatch.epatchTestLanguage.ExtensionImport) ResourceImport(org.eclipse.xtext.parser.epatch.epatchTestLanguage.ResourceImport)

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 AssignmentValue (org.eclipse.xtext.parser.epatch.epatchTestLanguage.AssignmentValue)1 EPackageImport (org.eclipse.xtext.parser.epatch.epatchTestLanguage.EPackageImport)1 EPatch (org.eclipse.xtext.parser.epatch.epatchTestLanguage.EPatch)1 ExpressionExecutable (org.eclipse.xtext.parser.epatch.epatchTestLanguage.ExpressionExecutable)1 ExtensionImport (org.eclipse.xtext.parser.epatch.epatchTestLanguage.ExtensionImport)1 JavaExecutable (org.eclipse.xtext.parser.epatch.epatchTestLanguage.JavaExecutable)1 JavaImport (org.eclipse.xtext.parser.epatch.epatchTestLanguage.JavaImport)1 ListAssignment (org.eclipse.xtext.parser.epatch.epatchTestLanguage.ListAssignment)1 Migration (org.eclipse.xtext.parser.epatch.epatchTestLanguage.Migration)1 NamedResource (org.eclipse.xtext.parser.epatch.epatchTestLanguage.NamedResource)1 ObjectCopy (org.eclipse.xtext.parser.epatch.epatchTestLanguage.ObjectCopy)1 ObjectNew (org.eclipse.xtext.parser.epatch.epatchTestLanguage.ObjectNew)1 ObjectRef (org.eclipse.xtext.parser.epatch.epatchTestLanguage.ObjectRef)1 ResourceImport (org.eclipse.xtext.parser.epatch.epatchTestLanguage.ResourceImport)1 SingleAssignment (org.eclipse.xtext.parser.epatch.epatchTestLanguage.SingleAssignment)1