Search in sources :

Example 21 with ParserRule

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

Example 22 with ParserRule

use of org.eclipse.xtext.ParserRule 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 23 with ParserRule

use of org.eclipse.xtext.ParserRule 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 24 with ParserRule

use of org.eclipse.xtext.ParserRule 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 25 with ParserRule

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

Aggregations

ParserRule (org.eclipse.xtext.ParserRule)380 Test (org.junit.Test)172 Grammar (org.eclipse.xtext.Grammar)151 Action (org.eclipse.xtext.Action)144 Parameter (org.eclipse.xtext.Parameter)137 EPackage (org.eclipse.emf.ecore.EPackage)126 AbstractRule (org.eclipse.xtext.AbstractRule)94 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)74 AbstractXtextRuleInspectorTest (org.eclipse.xtext.xtext.AbstractXtextRuleInspectorTest)49 RuleCall (org.eclipse.xtext.RuleCall)41 EObject (org.eclipse.emf.ecore.EObject)27 EnumRule (org.eclipse.xtext.EnumRule)21 TerminalRule (org.eclipse.xtext.TerminalRule)21 AbstractElement (org.eclipse.xtext.AbstractElement)18 Assignment (org.eclipse.xtext.Assignment)15 UnorderedGroup (org.eclipse.xtext.UnorderedGroup)12 EClass (org.eclipse.emf.ecore.EClass)11 Group (org.eclipse.xtext.Group)11 NamedArgument (org.eclipse.xtext.NamedArgument)11 TypeRef (org.eclipse.xtext.TypeRef)11