Search in sources :

Example 1 with ISemanticSequenceAcceptor

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

the class SyntacticSequencerTest method testSequence.

private void testSequence(EObject inObj, String outModel) throws Exception {
    EObject outObj = getModel(outModel);
    ISerializationContext context = nmSequencer.findContexts(inObj, true, null).iterator().next();
    Acceptor actual = new Acceptor();
    ISemanticSequencer semanticSeq = semanticSequencerProvider.get();
    ISyntacticSequencer syntacticSeq = syntacticSequencerProvider.get();
    semanticSeq.init((ISemanticSequenceAcceptor) syntacticSeq, ISerializationDiagnostic.STDERR_ACCEPTOR);
    syntacticSeq.init(context, inObj, actual, ISerializationDiagnostic.STDERR_ACCEPTOR);
    semanticSeq.createSequence(context, inObj);
    assertEquals(Joiner.on("\n").join(getNodeSequence(outObj)), Joiner.on("\n").join(actual.getResult()));
}
Also used : ISequenceAcceptor(org.eclipse.xtext.serializer.acceptor.ISequenceAcceptor) ISemanticSequenceAcceptor(org.eclipse.xtext.serializer.acceptor.ISemanticSequenceAcceptor) ISyntacticSequencer(org.eclipse.xtext.serializer.sequencer.ISyntacticSequencer) EObject(org.eclipse.emf.ecore.EObject) ISemanticSequencer(org.eclipse.xtext.serializer.sequencer.ISemanticSequencer)

Aggregations

EObject (org.eclipse.emf.ecore.EObject)1 ISemanticSequenceAcceptor (org.eclipse.xtext.serializer.acceptor.ISemanticSequenceAcceptor)1 ISequenceAcceptor (org.eclipse.xtext.serializer.acceptor.ISequenceAcceptor)1 ISemanticSequencer (org.eclipse.xtext.serializer.sequencer.ISemanticSequencer)1 ISyntacticSequencer (org.eclipse.xtext.serializer.sequencer.ISyntacticSequencer)1