Search in sources :

Example 91 with Parameter

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

the class ParametersTestLanguageSemanticSequencer 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 == ParametersTestLanguagePackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case ParametersTestLanguagePackage.PARSER_RULE_PARAMETERS:
                sequence_ParserRuleParameters(context, (ParserRuleParameters) semanticObject);
                return;
            case ParametersTestLanguagePackage.SCENARIO:
                if (rule == grammarAccess.getScenario1Rule() && (parameters.isEmpty())) {
                    sequence_Scenario1$Param$false$(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario1Rule() && (ImmutableSet.of(grammarAccess.getScenario1Rule().getParameters().get(0)).equals(parameters))) {
                    sequence_Scenario1$Param$true$(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario2Rule()) {
                    sequence_Scenario2(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario3Rule()) {
                    sequence_Scenario3(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario4Rule()) {
                    sequence_Scenario4(context, (Scenario) 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) Parameter(org.eclipse.xtext.Parameter) ParserRuleParameters(org.eclipse.xtext.parser.parameters.parametersTestLanguage.ParserRuleParameters) EPackage(org.eclipse.emf.ecore.EPackage) Scenario(org.eclipse.xtext.parser.parameters.parametersTestLanguage.Scenario)

Example 92 with Parameter

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

the class TwoParametersTestLanguageSemanticSequencer 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 == ParametersTestLanguagePackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case ParametersTestLanguagePackage.PARSER_RULE_PARAMETERS:
                sequence_ParserRuleParameters(context, (ParserRuleParameters) semanticObject);
                return;
            case ParametersTestLanguagePackage.SCENARIO:
                if (rule == grammarAccess.getScenario1Rule() && (parameters.isEmpty())) {
                    sequence_Scenario1$Param$false$(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario1Rule() && (ImmutableSet.of(grammarAccess.getScenario1Rule().getParameters().get(0)).equals(parameters))) {
                    sequence_Scenario1$Param$true$(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario2Rule()) {
                    sequence_Scenario2(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario3Rule()) {
                    sequence_Scenario3(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario4Rule()) {
                    sequence_Scenario4(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario5Rule() && (ImmutableSet.of(grammarAccess.getScenario5Rule().getParameters().get(0), grammarAccess.getScenario5Rule().getParameters().get(1)).equals(parameters))) {
                    sequence_Scenario5$A$true$B$true$(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario5Rule() && (ImmutableSet.of(grammarAccess.getScenario5Rule().getParameters().get(0)).equals(parameters) || ImmutableSet.of(grammarAccess.getScenario5Rule().getParameters().get(1)).equals(parameters) || parameters.isEmpty())) {
                    sequence_Scenario5(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario6Rule()) {
                    sequence_Scenario6(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario7Rule()) {
                    sequence_Scenario7(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario8Rule()) {
                    sequence_Scenario8(context, (Scenario) 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) Parameter(org.eclipse.xtext.Parameter) ParserRuleParameters(org.eclipse.xtext.parser.parameters.parametersTestLanguage.ParserRuleParameters) EPackage(org.eclipse.emf.ecore.EPackage) Scenario(org.eclipse.xtext.parser.parameters.parametersTestLanguage.Scenario)

Example 93 with Parameter

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

the class NoParametersTestLanguageSemanticSequencer 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 == ParametersTestLanguagePackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case ParametersTestLanguagePackage.PARSER_RULE_PARAMETERS:
                sequence_ParserRuleParameters(context, (ParserRuleParameters) semanticObject);
                return;
            case ParametersTestLanguagePackage.SCENARIO:
                if (rule == grammarAccess.getScenario1Rule() && (parameters.isEmpty())) {
                    sequence_Scenario1$Param$false$(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario1Rule() && (ImmutableSet.of(grammarAccess.getScenario1Rule().getParameters().get(0)).equals(parameters))) {
                    sequence_Scenario1$Param$true$(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario1_FalseRule()) {
                    sequence_Scenario1_False(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario1_TrueRule()) {
                    sequence_Scenario1_True(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario2_FalseRule()) {
                    sequence_Scenario2_False(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario2Rule()) {
                    sequence_Scenario2(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario2_TrueRule()) {
                    sequence_Scenario2_True(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario3_FalseRule()) {
                    sequence_Scenario3_False(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario3Rule()) {
                    sequence_Scenario3(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario3_TrueRule()) {
                    sequence_Scenario3_True(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario4_FalseRule()) {
                    sequence_Scenario4_False(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario4Rule()) {
                    sequence_Scenario4(context, (Scenario) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScenario4_TrueRule()) {
                    sequence_Scenario4_True(context, (Scenario) 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) Parameter(org.eclipse.xtext.Parameter) ParserRuleParameters(org.eclipse.xtext.parser.parameters.parametersTestLanguage.ParserRuleParameters) EPackage(org.eclipse.emf.ecore.EPackage) Scenario(org.eclipse.xtext.parser.parameters.parametersTestLanguage.Scenario)

Example 94 with Parameter

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

the class KeywordsTestLanguageSemanticSequencer 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 == KeywordsTestLanguagePackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case KeywordsTestLanguagePackage.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.keywords.keywordsTestLanguage.Model) Parameter(org.eclipse.xtext.Parameter) EPackage(org.eclipse.emf.ecore.EPackage)

Example 95 with Parameter

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

the class Bug289515TestLanguageSemanticSequencer 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 == Bug289515TestPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case Bug289515TestPackage.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.bug289515Test.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