Search in sources :

Example 66 with EPackage

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

the class Bug287184TestLanguageSemanticSequencer 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 == Bug287184TestPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case Bug287184TestPackage.ASSOCIATED_DETAIL:
                sequence_AssociatedDetail(context, (AssociatedDetail) semanticObject);
                return;
            case Bug287184TestPackage.DETAIL:
                sequence_Detail(context, (Detail) semanticObject);
                return;
            case Bug287184TestPackage.MODEL:
                sequence_Model(context, (Model) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) AssociatedDetail(org.eclipse.xtext.parser.assignments.bug287184Test.AssociatedDetail) Action(org.eclipse.xtext.Action) Model(org.eclipse.xtext.parser.assignments.bug287184Test.Model) Parameter(org.eclipse.xtext.Parameter) AssociatedDetail(org.eclipse.xtext.parser.assignments.bug287184Test.AssociatedDetail) Detail(org.eclipse.xtext.parser.assignments.bug287184Test.Detail) EPackage(org.eclipse.emf.ecore.EPackage)

Example 67 with EPackage

use of org.eclipse.emf.ecore.EPackage 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));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) CompositeModel(org.eclipse.xtext.parser.datatyperules.datatypeRulesTestLanguage.CompositeModel) Model(org.eclipse.xtext.parser.datatyperules.datatypeRulesTestLanguage.Model) Parameter(org.eclipse.xtext.Parameter) CompositeModel(org.eclipse.xtext.parser.datatyperules.datatypeRulesTestLanguage.CompositeModel) EPackage(org.eclipse.emf.ecore.EPackage)

Example 68 with EPackage

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

the class AbstractBug301935TestLanguageSemanticSequencer 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 69 with EPackage

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

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

Example 70 with EPackage

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

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

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