Search in sources :

Example 16 with Parameter

use of org.eclipse.xtext.Parameter in project xtext-core by eclipse.

the class MetamodelRefTestLanguageSemanticSequencer 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 == AnotherSimpleTestPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case AnotherSimpleTestPackage.FOO:
                sequence_Foo(context, (Foo) semanticObject);
                return;
        }
    else if (epackage == XtextPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case XtextPackage.PARSER_RULE:
                sequence_MyRule(context, (ParserRule) semanticObject);
                return;
            case XtextPackage.RULE_CALL:
                sequence_NameRef(context, (RuleCall) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) Foo(org.eclipse.xtext.metamodelreferencing.tests.anotherSimpleTest.Foo) Parameter(org.eclipse.xtext.Parameter) EPackage(org.eclipse.emf.ecore.EPackage)

Example 17 with Parameter

use of org.eclipse.xtext.Parameter 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 18 with Parameter

use of org.eclipse.xtext.Parameter 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 19 with Parameter

use of org.eclipse.xtext.Parameter 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 20 with Parameter

use of org.eclipse.xtext.Parameter 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)

Aggregations

Parameter (org.eclipse.xtext.Parameter)146 ParserRule (org.eclipse.xtext.ParserRule)137 Action (org.eclipse.xtext.Action)127 EPackage (org.eclipse.emf.ecore.EPackage)123 NamedArgument (org.eclipse.xtext.NamedArgument)7 EClass (org.eclipse.emf.ecore.EClass)6 ISerializationContext (org.eclipse.xtext.serializer.ISerializationContext)6 AbstractElement (org.eclipse.xtext.AbstractElement)5 AbstractRule (org.eclipse.xtext.AbstractRule)5 RuleCall (org.eclipse.xtext.RuleCall)5 EObject (org.eclipse.emf.ecore.EObject)4 ParserRuleParameters (org.eclipse.xtext.parser.parameters.parametersTestLanguage.ParserRuleParameters)4 Scenario (org.eclipse.xtext.parser.parameters.parametersTestLanguage.Scenario)4 ImmutableSet (com.google.common.collect.ImmutableSet)3 Group (org.eclipse.xtext.Group)3 ConditionEvaluator (org.eclipse.xtext.xtext.ConditionEvaluator)3 Set (java.util.Set)2 Assignment (org.eclipse.xtext.Assignment)2 EnumRule (org.eclipse.xtext.EnumRule)2 Grammar (org.eclipse.xtext.Grammar)2