Search in sources :

Example 56 with SequenceFeeder

use of org.eclipse.xtext.serializer.acceptor.SequenceFeeder in project xtext-core by eclipse.

the class BaseInheritanceTestLanguageSemanticSequencer method sequence_Model.

/**
 * Contexts:
 *     Model returns Model
 *
 * Constraint:
 *     name=ID
 */
protected void sequence_Model(ISerializationContext context, Model semanticObject) {
    if (errorAcceptor != null) {
        if (transientValues.isValueTransient(semanticObject, BaseInheritanceTestPackage.Literals.MODEL__NAME) == ValueTransient.YES)
            errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, BaseInheritanceTestPackage.Literals.MODEL__NAME));
    }
    SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
    feeder.accept(grammarAccess.getModelAccess().getNameIDTerminalRuleCall_1_0(), semanticObject.getName());
    feeder.finish();
}
Also used : SequenceFeeder(org.eclipse.xtext.serializer.acceptor.SequenceFeeder)

Example 57 with SequenceFeeder

use of org.eclipse.xtext.serializer.acceptor.SequenceFeeder in project xtext-core by eclipse.

the class ConcreteTestLanguageSemanticSequencer method sequence_OverridableParserRule2.

/**
 * Contexts:
 *     RootRule returns AType2
 *     OverridableParserRule2 returns AType2
 *
 * Constraint:
 *     (name=ID age=INT)
 */
protected void sequence_OverridableParserRule2(ISerializationContext context, AType2 semanticObject) {
    if (errorAcceptor != null) {
        if (transientValues.isValueTransient(semanticObject, AmetamodelPackage.Literals.ATYPE__NAME) == ValueTransient.YES)
            errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, AmetamodelPackage.Literals.ATYPE__NAME));
        if (transientValues.isValueTransient(semanticObject, FooPackage.Literals.ATYPE2__AGE) == ValueTransient.YES)
            errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, FooPackage.Literals.ATYPE2__AGE));
    }
    SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
    feeder.accept(grammarAccess.getOverridableParserRule2Access().getNameIDTerminalRuleCall_1_0(), semanticObject.getName());
    feeder.accept(grammarAccess.getOverridableParserRule2Access().getAgeINTTerminalRuleCall_3_0(), semanticObject.getAge());
    feeder.finish();
}
Also used : SequenceFeeder(org.eclipse.xtext.serializer.acceptor.SequenceFeeder)

Example 58 with SequenceFeeder

use of org.eclipse.xtext.serializer.acceptor.SequenceFeeder in project xtext-core by eclipse.

the class ConcreteTestLanguageSemanticSequencer method sequence_OverridableParserRule.

/**
 * Contexts:
 *     OverridableParserRule returns AType
 *
 * Constraint:
 *     name=ID
 */
protected void sequence_OverridableParserRule(ISerializationContext context, AType semanticObject) {
    if (errorAcceptor != null) {
        if (transientValues.isValueTransient(semanticObject, AmetamodelPackage.Literals.ATYPE__NAME) == ValueTransient.YES)
            errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, AmetamodelPackage.Literals.ATYPE__NAME));
    }
    SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
    feeder.accept(grammarAccess.getOverridableParserRuleAccess().getNameIDTerminalRuleCall_1_0(), semanticObject.getName());
    feeder.finish();
}
Also used : SequenceFeeder(org.eclipse.xtext.serializer.acceptor.SequenceFeeder)

Example 59 with SequenceFeeder

use of org.eclipse.xtext.serializer.acceptor.SequenceFeeder in project xtext-core by eclipse.

the class ConcreteTestLanguageSemanticSequencer method sequence_Subrule2.

/**
 * Contexts:
 *     ExtendableParserRule returns Subrule2
 *     Subrule2 returns Subrule2
 *
 * Constraint:
 *     (name=ID sub2=STRING)
 */
protected void sequence_Subrule2(ISerializationContext context, Subrule2 semanticObject) {
    if (errorAcceptor != null) {
        if (transientValues.isValueTransient(semanticObject, AmetamodelPackage.Literals.ATYPE__NAME) == ValueTransient.YES)
            errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, AmetamodelPackage.Literals.ATYPE__NAME));
        if (transientValues.isValueTransient(semanticObject, FooPackage.Literals.SUBRULE2__SUB2) == ValueTransient.YES)
            errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, FooPackage.Literals.SUBRULE2__SUB2));
    }
    SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
    feeder.accept(grammarAccess.getSubrule2Access().getNameIDTerminalRuleCall_1_0(), semanticObject.getName());
    feeder.accept(grammarAccess.getSubrule2Access().getSub2STRINGTerminalRuleCall_2_0(), semanticObject.getSub2());
    feeder.finish();
}
Also used : SequenceFeeder(org.eclipse.xtext.serializer.acceptor.SequenceFeeder)

Example 60 with SequenceFeeder

use of org.eclipse.xtext.serializer.acceptor.SequenceFeeder in project xtext-core by eclipse.

the class ConcreteTestLanguageSemanticSequencer method sequence_Subrule1.

/**
 * Contexts:
 *     ExtendableParserRule returns Subrule1
 *     Subrule1 returns Subrule1
 *
 * Constraint:
 *     (name=ID sub1=ID)
 */
protected void sequence_Subrule1(ISerializationContext context, Subrule1 semanticObject) {
    if (errorAcceptor != null) {
        if (transientValues.isValueTransient(semanticObject, AmetamodelPackage.Literals.ATYPE__NAME) == ValueTransient.YES)
            errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, AmetamodelPackage.Literals.ATYPE__NAME));
        if (transientValues.isValueTransient(semanticObject, FooPackage.Literals.SUBRULE1__SUB1) == ValueTransient.YES)
            errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, FooPackage.Literals.SUBRULE1__SUB1));
    }
    SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
    feeder.accept(grammarAccess.getSubrule1Access().getNameIDTerminalRuleCall_1_0(), semanticObject.getName());
    feeder.accept(grammarAccess.getSubrule1Access().getSub1IDTerminalRuleCall_2_0(), semanticObject.getSub1());
    feeder.finish();
}
Also used : SequenceFeeder(org.eclipse.xtext.serializer.acceptor.SequenceFeeder)

Aggregations

SequenceFeeder (org.eclipse.xtext.serializer.acceptor.SequenceFeeder)350 INodesForEObjectProvider (org.eclipse.xtext.serializer.sequencer.ISemanticNodeProvider.INodesForEObjectProvider)64 List (java.util.List)1 InternalEList (org.eclipse.emf.ecore.util.InternalEList)1 AbstractElement (org.eclipse.xtext.AbstractElement)1 IConstraint (org.eclipse.xtext.serializer.analysis.IGrammarConstraintProvider.IConstraint)1 ISemState (org.eclipse.xtext.serializer.analysis.ISemanticSequencerNfaProvider.ISemState)1 NfaUtil (org.eclipse.xtext.util.formallang.NfaUtil)1