org.eclipse.xtext.serializer.sequencer.ISemanticSequencer Java Examples
The following examples show how to use
org.eclipse.xtext.serializer.sequencer.ISemanticSequencer.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractSemanticSequencerTest.java From xtext-core with Eclipse Public License 2.0 | 6 votes |
private EObject testSequence(String stringModel) throws Exception { DebugSequenceAcceptor genericActual = new DebugSequenceAcceptor(); DebugSequenceAcceptor generatedActual = new DebugSequenceAcceptor(); DebugSequenceAcceptor expected = new DebugSequenceAcceptor(); ISemanticSequencer generatedSequencer = generatedSequencerProvider.get(); ISemanticSequencer genericSequencer = getGenericSemanticSequencer(); assertTrue(generatedSequencer instanceof SequencerTestLanguageSemanticSequencer); generatedSequencer.init(generatedActual, ISerializationDiagnostic.STDERR_ACCEPTOR); genericSequencer.init(genericActual, ISerializationDiagnostic.STDERR_ACCEPTOR); nmSequencer.init(expected, ISerializationDiagnostic.STDERR_ACCEPTOR); EObject model = getModel(stringModel).eContents().get(0); ISerializationContext context = nmSequencer.findContexts(model, true, null).iterator().next(); generatedSequencer.createSequence(context, model); genericSequencer.createSequence(context, model); nmSequencer.createSequence(context, model); assertEquals(expected.toString(), genericActual.toString()); assertEquals(expected.toString(), generatedActual.toString()); return model; }
Example #2
Source File: HiddenTokenSequencerTest.java From xtext-core with Eclipse Public License 2.0 | 6 votes |
private void testSequence(String stringModel) throws Exception { EObject model = getModel(stringModel); ISerializationContext context = nmSequencer.findContexts(model, true, null).iterator().next(); DebugSequenceAcceptor actual = new NoEnterNodesDebugSequenceAcceptor(false); ISemanticSequencer semanticSequencer = semanticSequencerProvider.get(); ISyntacticSequencer syntacticSequencer = syntacticSequencerProvider.get(); IHiddenTokenSequencer hiddenTokenSequencer = hiddenTokenSequencerProvider.get(); semanticSequencer .init((ISemanticSequenceAcceptor) syntacticSequencer, ISerializationDiagnostic.STDERR_ACCEPTOR); syntacticSequencer.init(context, model, (ISyntacticSequenceAcceptor) hiddenTokenSequencer, ISerializationDiagnostic.STDERR_ACCEPTOR); hiddenTokenSequencer.init(context, model, actual, ISerializationDiagnostic.STDERR_ACCEPTOR); semanticSequencer.createSequence(context, model); // System.out.println(actual); // System.out.println(NodeModelUtils.compactDump(NodeModelUtils.findActualNodeFor(model), true)); assertEquals(Joiner.on("\n").join(getNodeSequence(model)), Joiner.on("\n").join(actual.getColumn(4))); }
Example #3
Source File: Serializer.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
protected void serialize(ISerializationContext context, EObject semanticObject, ISequenceAcceptor tokens, ISerializationDiagnostic.Acceptor errors) { ISemanticSequencer semantic = semanticSequencerProvider.get(); ISyntacticSequencer syntactic = syntacticSequencerProvider.get(); IHiddenTokenSequencer hidden = hiddenTokenSequencerProvider.get(); semantic.init((ISemanticSequenceAcceptor) syntactic, errors); syntactic.init(context, semanticObject, (ISyntacticSequenceAcceptor) hidden, errors); hidden.init(context, semanticObject, tokens, errors); if (tokens instanceof TokenStreamSequenceAdapter) ((TokenStreamSequenceAdapter) tokens).init(context); semantic.createSequence(context, semanticObject); }
Example #4
Source File: SequenceFeeder.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
protected SequenceFeeder(Provider provider, ISerializationContext context, EObject semanticObject, INodesForEObjectProvider nodes, ISemanticSequencer masterSequencer, ISemanticSequenceAcceptor sequenceAcceptor, Acceptor errorAcceptor) { super(); if (semanticObject == null || nodes == null || sequenceAcceptor == null) throw new NullPointerException(); this.context = context; this.provider = provider; this.semanticObject = semanticObject; this.nodes = nodes; this.masterSequencer = masterSequencer; this.sequenceAcceptor = sequenceAcceptor; this.errorAcceptor = errorAcceptor; }
Example #5
Source File: SyntacticSequencerTest.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
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())); }
Example #6
Source File: Serializer.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
/** * @deprecated use {@link #serialize(ISerializationContext, EObject, ISequenceAcceptor, ISerializationDiagnostic.Acceptor)} */ @Deprecated protected void serialize(EObject semanticObject, EObject context, ISequenceAcceptor tokens, ISerializationDiagnostic.Acceptor errors) { ISemanticSequencer semantic = semanticSequencerProvider.get(); ISyntacticSequencer syntactic = syntacticSequencerProvider.get(); IHiddenTokenSequencer hidden = hiddenTokenSequencerProvider.get(); semantic.init((ISemanticSequenceAcceptor) syntactic, errors); syntactic.init(context, semanticObject, (ISyntacticSequenceAcceptor) hidden, errors); hidden.init(context, semanticObject, tokens, errors); if (tokens instanceof TokenStreamSequenceAdapter) ((TokenStreamSequenceAdapter) tokens).init(context); semantic.createSequence(context, semanticObject); }
Example #7
Source File: AbstractRefactoringTestLanguage1RuntimeModule.java From xtext-eclipse with Eclipse Public License 2.0 | 4 votes |
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { return RefactoringTestLanguage1SemanticSequencer.class; }
Example #8
Source File: AbstractLiveContainerTestLanguageRuntimeModule.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { return LiveContainerTestLanguageSemanticSequencer.class; }
Example #9
Source File: AbstractContentAssistTestLanguageRuntimeModule.java From xtext-eclipse with Eclipse Public License 2.0 | 4 votes |
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { return ContentAssistTestLanguageSemanticSequencer.class; }
Example #10
Source File: AbstractImportUriTestLanguageRuntimeModule.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { return ImportUriTestLanguageSemanticSequencer.class; }
Example #11
Source File: AbstractGrammarAccessTestLanguageRuntimeModule.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { return GrammarAccessTestLanguageSemanticSequencer.class; }
Example #12
Source File: AbstractBug302128TestLanguageRuntimeModule.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { return Bug302128TestLanguageSemanticSequencer.class; }
Example #13
Source File: AbstractAbstractTestLanguageRuntimeModule.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { return AbstractTestLanguageSemanticSequencer.class; }
Example #14
Source File: AbstractComplexReconstrTestLanguageRuntimeModule.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { return ComplexReconstrTestLanguageSemanticSequencer.class; }
Example #15
Source File: AbstractConcreteSyntaxValidationTestLanguageRuntimeModule.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { return ConcreteSyntaxValidationTestLanguageSemanticSequencer.class; }
Example #16
Source File: AbstractBug419429RuntimeModule.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { return Bug419429SemanticSequencer.class; }
Example #17
Source File: AbstractSubTestLanguageRuntimeModule.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { return SubTestLanguageSemanticSequencer.class; }
Example #18
Source File: AbstractRefactoringTestLanguage2RuntimeModule.java From xtext-eclipse with Eclipse Public License 2.0 | 4 votes |
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { return RefactoringTestLanguage2SemanticSequencer.class; }
Example #19
Source File: AbstractEpatchTestLanguageRuntimeModule.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { return EpatchTestLanguageSemanticSequencer.class; }
Example #20
Source File: AbstractBug301935TestLanguageRuntimeModule.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { return Bug301935TestLanguageSemanticSequencer.class; }
Example #21
Source File: AbstractBug378967TestLanguageRuntimeModule.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { return Bug378967TestLanguageSemanticSequencer.class; }
Example #22
Source File: AbstractContentAssistCustomizingTestLanguageRuntimeModule.java From xtext-eclipse with Eclipse Public License 2.0 | 4 votes |
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { return ContentAssistCustomizingTestLanguageSemanticSequencer.class; }
Example #23
Source File: AbstractXtextGrammarTestLanguageRuntimeModule.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { return XtextGrammarTestLanguageSemanticSequencer.class; }
Example #24
Source File: AbstractMultiRuleEnumTestLanguageRuntimeModule.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { return MultiRuleEnumTestLanguageSemanticSequencer.class; }
Example #25
Source File: AbstractBug347012TestLanguageRuntimeModule.java From xtext-eclipse with Eclipse Public License 2.0 | 4 votes |
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { return Bug347012TestLanguageSemanticSequencer.class; }
Example #26
Source File: AbstractEObjectAtOffsetTestLanguageRuntimeModule.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { return EObjectAtOffsetTestLanguageSemanticSequencer.class; }
Example #27
Source File: AbstractUnorderedGroupsTestLanguageRuntimeModule.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { return UnorderedGroupsTestLanguageSemanticSequencer.class; }
Example #28
Source File: AbstractActionTestLanguage2RuntimeModule.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { return ActionTestLanguage2SemanticSequencer.class; }
Example #29
Source File: AbstractSerializationErrorTestLanguageRuntimeModule.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { return SerializationErrorTestLanguageSemanticSequencer.class; }
Example #30
Source File: AbstractTransientValuesTestRuntimeModule.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { return TransientValuesTestSemanticSequencer.class; }