Search in sources :

Example 46 with SequenceFeeder

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

the class AbstractIndexTestLanguageSemanticSequencer method sequence_Datatype.

/**
 * Contexts:
 *     Element returns Datatype
 *     Type returns Datatype
 *     Datatype returns Datatype
 *
 * Constraint:
 *     name=ID
 */
protected void sequence_Datatype(ISerializationContext context, Datatype semanticObject) {
    if (errorAcceptor != null) {
        if (transientValues.isValueTransient(semanticObject, IndexTestLanguagePackage.Literals.TYPE__NAME) == ValueTransient.YES)
            errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, IndexTestLanguagePackage.Literals.TYPE__NAME));
    }
    SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
    feeder.accept(grammarAccess.getDatatypeAccess().getNameIDTerminalRuleCall_1_0(), semanticObject.getName());
    feeder.finish();
}
Also used : SequenceFeeder(org.eclipse.xtext.serializer.acceptor.SequenceFeeder)

Example 47 with SequenceFeeder

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

the class AbstractIndexTestLanguageSemanticSequencer method sequence_Property.

/**
 * Contexts:
 *     Property returns Property
 *
 * Constraint:
 *     (type=[Type|QualifiedName] name=ID)
 */
protected void sequence_Property(ISerializationContext context, Property semanticObject) {
    if (errorAcceptor != null) {
        if (transientValues.isValueTransient(semanticObject, IndexTestLanguagePackage.Literals.PROPERTY__TYPE) == ValueTransient.YES)
            errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, IndexTestLanguagePackage.Literals.PROPERTY__TYPE));
        if (transientValues.isValueTransient(semanticObject, IndexTestLanguagePackage.Literals.PROPERTY__NAME) == ValueTransient.YES)
            errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, IndexTestLanguagePackage.Literals.PROPERTY__NAME));
    }
    SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
    feeder.accept(grammarAccess.getPropertyAccess().getTypeTypeQualifiedNameParserRuleCall_0_0_1(), semanticObject.eGet(IndexTestLanguagePackage.Literals.PROPERTY__TYPE, false));
    feeder.accept(grammarAccess.getPropertyAccess().getNameIDTerminalRuleCall_1_0(), semanticObject.getName());
    feeder.finish();
}
Also used : SequenceFeeder(org.eclipse.xtext.serializer.acceptor.SequenceFeeder)

Example 48 with SequenceFeeder

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

the class AbstractIndexTestLanguageSemanticSequencer method sequence_Import.

/**
 * Contexts:
 *     Import returns Import
 *     Element returns Import
 *
 * Constraint:
 *     importedNamespace=QualifiedNameWithWildCard
 */
protected void sequence_Import(ISerializationContext context, Import semanticObject) {
    if (errorAcceptor != null) {
        if (transientValues.isValueTransient(semanticObject, IndexTestLanguagePackage.Literals.IMPORT__IMPORTED_NAMESPACE) == ValueTransient.YES)
            errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, IndexTestLanguagePackage.Literals.IMPORT__IMPORTED_NAMESPACE));
    }
    SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
    feeder.accept(grammarAccess.getImportAccess().getImportedNamespaceQualifiedNameWithWildCardParserRuleCall_1_0(), semanticObject.getImportedNamespace());
    feeder.finish();
}
Also used : SequenceFeeder(org.eclipse.xtext.serializer.acceptor.SequenceFeeder)

Example 49 with SequenceFeeder

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

the class BacktrackingLexerTestLanguageSemanticSequencer method sequence_Xb.

/**
 * Contexts:
 *     Xb returns Xb
 *
 * Constraint:
 *     (x=CharX y=Charb)
 */
protected void sequence_Xb(ISerializationContext context, Xb semanticObject) {
    if (errorAcceptor != null) {
        if (transientValues.isValueTransient(semanticObject, BacktrackingTestLanguagePackage.Literals.XB__X) == ValueTransient.YES)
            errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, BacktrackingTestLanguagePackage.Literals.XB__X));
        if (transientValues.isValueTransient(semanticObject, BacktrackingTestLanguagePackage.Literals.XB__Y) == ValueTransient.YES)
            errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, BacktrackingTestLanguagePackage.Literals.XB__Y));
    }
    SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
    feeder.accept(grammarAccess.getXbAccess().getXCharXTerminalRuleCall_0_0(), semanticObject.getX());
    feeder.accept(grammarAccess.getXbAccess().getYCharbTerminalRuleCall_1_0(), semanticObject.getY());
    feeder.finish();
}
Also used : SequenceFeeder(org.eclipse.xtext.serializer.acceptor.SequenceFeeder)

Example 50 with SequenceFeeder

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

the class IgnoreCaseLexerTestLanguageSemanticSequencer method sequence_Model.

/**
 * Contexts:
 *     Model returns Model
 *
 * Constraint:
 *     value='CaSe'
 */
protected void sequence_Model(ISerializationContext context, Model semanticObject) {
    if (errorAcceptor != null) {
        if (transientValues.isValueTransient(semanticObject, IgnoreCaseTestLanguagePackage.Literals.MODEL__VALUE) == ValueTransient.YES)
            errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, IgnoreCaseTestLanguagePackage.Literals.MODEL__VALUE));
    }
    SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
    feeder.accept(grammarAccess.getModelAccess().getValueCaSeKeyword_2_0(), semanticObject.getValue());
    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