Search in sources :

Example 71 with EPackage

use of org.eclipse.emf.ecore.EPackage in project xtext-core by eclipse.

the class Bug296889ExTestLanguageSemanticSequencer 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 == Bug296889ExTestPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case Bug296889ExTestPackage.MODEL:
                sequence_Model(context, (Model) semanticObject);
                return;
            case Bug296889ExTestPackage.POSTOP:
                sequence_Postop(context, (Postop) semanticObject);
                return;
            case Bug296889ExTestPackage.PREOP:
                sequence_Preop(context, (Preop) semanticObject);
                return;
            case Bug296889ExTestPackage.VARIABLE:
                sequence_Variable(context, (Variable) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) Variable(org.eclipse.xtext.parser.antlr.bug296889ExTest.Variable) Postop(org.eclipse.xtext.parser.antlr.bug296889ExTest.Postop) Model(org.eclipse.xtext.parser.antlr.bug296889ExTest.Model) Preop(org.eclipse.xtext.parser.antlr.bug296889ExTest.Preop) Parameter(org.eclipse.xtext.Parameter) EPackage(org.eclipse.emf.ecore.EPackage)

Example 72 with EPackage

use of org.eclipse.emf.ecore.EPackage in project xtext-core by eclipse.

the class Bug296889TestLanguageSemanticSequencer 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 == Bug296889TestPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case Bug296889TestPackage.MODEL:
                sequence_Model(context, (Model) semanticObject);
                return;
            case Bug296889TestPackage.POSTOP:
                sequence_Postop(context, (Postop) semanticObject);
                return;
            case Bug296889TestPackage.PREOP:
                sequence_Preop(context, (Preop) semanticObject);
                return;
            case Bug296889TestPackage.VARIABLE:
                sequence_Variable(context, (Variable) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) Variable(org.eclipse.xtext.parser.antlr.bug296889Test.Variable) Postop(org.eclipse.xtext.parser.antlr.bug296889Test.Postop) Model(org.eclipse.xtext.parser.antlr.bug296889Test.Model) Preop(org.eclipse.xtext.parser.antlr.bug296889Test.Preop) Parameter(org.eclipse.xtext.Parameter) EPackage(org.eclipse.emf.ecore.EPackage)

Example 73 with EPackage

use of org.eclipse.emf.ecore.EPackage in project xtext-core by eclipse.

the class Bug301935ExTestLanguageSemanticSequencer 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 == Bug301935TestPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case Bug301935TestPackage.MODEL:
                sequence_Model(context, (Model) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) Model(org.eclipse.xtext.parser.antlr.bug301935Test.Model) Parameter(org.eclipse.xtext.Parameter) EPackage(org.eclipse.emf.ecore.EPackage)

Example 74 with EPackage

use of org.eclipse.emf.ecore.EPackage in project xtext-core by eclipse.

the class Bug378967TestLanguageSemanticSequencer 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 == Bug378967TestPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case Bug378967TestPackage.AFTER_OBJ:
                sequence_AfterObj(context, (AfterObj) semanticObject);
                return;
            case Bug378967TestPackage.ROOT:
                sequence_Root(context, (Root) semanticObject);
                return;
            case Bug378967TestPackage.RULE1:
                sequence_Rule1(context, (Rule1) semanticObject);
                return;
            case Bug378967TestPackage.RULE2:
                sequence_Rule2(context, (Rule2) semanticObject);
                return;
            case Bug378967TestPackage.RULE3:
                sequence_Rule3(context, (Rule3) semanticObject);
                return;
            case Bug378967TestPackage.RULE4:
                sequence_Rule4(context, (Rule4) semanticObject);
                return;
            case Bug378967TestPackage.SOBJ:
                sequence_SObj(context, (SObj) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) Rule4(org.eclipse.xtext.parser.antlr.bug378967Test.Rule4) SObj(org.eclipse.xtext.parser.antlr.bug378967Test.SObj) Root(org.eclipse.xtext.parser.antlr.bug378967Test.Root) AfterObj(org.eclipse.xtext.parser.antlr.bug378967Test.AfterObj) Parameter(org.eclipse.xtext.Parameter) Rule2(org.eclipse.xtext.parser.antlr.bug378967Test.Rule2) Rule3(org.eclipse.xtext.parser.antlr.bug378967Test.Rule3) EPackage(org.eclipse.emf.ecore.EPackage) Rule1(org.eclipse.xtext.parser.antlr.bug378967Test.Rule1)

Example 75 with EPackage

use of org.eclipse.emf.ecore.EPackage 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)416 ParserRule (org.eclipse.xtext.ParserRule)194 Action (org.eclipse.xtext.Action)189 Parameter (org.eclipse.xtext.Parameter)189 Test (org.junit.Test)101 EClass (org.eclipse.emf.ecore.EClass)83 EClassifier (org.eclipse.emf.ecore.EClassifier)75 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)60 Resource (org.eclipse.emf.ecore.resource.Resource)50 EObject (org.eclipse.emf.ecore.EObject)45 URI (org.eclipse.emf.common.util.URI)30 ResourceSet (org.eclipse.emf.ecore.resource.ResourceSet)23 Grammar (org.eclipse.xtext.Grammar)22 ResourceSetImpl (org.eclipse.emf.ecore.resource.impl.ResourceSetImpl)16 EStructuralFeature (org.eclipse.emf.ecore.EStructuralFeature)15 GenPackage (org.eclipse.emf.codegen.ecore.genmodel.GenPackage)14 AbstractMetamodelDeclaration (org.eclipse.xtext.AbstractMetamodelDeclaration)14 XtextResource (org.eclipse.xtext.resource.XtextResource)14 EEnum (org.eclipse.emf.ecore.EEnum)13 EReference (org.eclipse.emf.ecore.EReference)12