org.eclipse.xtext.serializer.sequencer.ISyntacticSequencer Java Examples

The following examples show how to use org.eclipse.xtext.serializer.sequencer.ISyntacticSequencer. 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: SyntacticSequencerTest.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
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 #2
Source File: SerializerFragment2.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void generate() {
  new GuiceModuleAccess.BindingFactory().addTypeToType(TypeReference.typeRef(ISemanticSequencer.class), this.getSemanticSequencerClass(this.getGrammar())).addTypeToType(TypeReference.typeRef(ISyntacticSequencer.class), this.getSyntacticSequencerClass(this.getGrammar())).addTypeToType(TypeReference.typeRef(ISerializer.class), TypeReference.typeRef(Serializer.class)).contributeTo(this.getLanguage().getRuntimeGenModule());
  ManifestAccess _manifest = this.getProjectConfig().getRuntime().getManifest();
  boolean _tripleNotEquals = (_manifest != null);
  if (_tripleNotEquals) {
    Set<String> _exportedPackages = this.getProjectConfig().getRuntime().getManifest().getExportedPackages();
    String _serializerBasePackage = this.getSerializerBasePackage(this.getGrammar());
    _exportedPackages.add(_serializerBasePackage);
    Set<String> _requiredBundles = this.getProjectConfig().getRuntime().getManifest().getRequiredBundles();
    String _xbaseLibVersionLowerBound = this.getProjectConfig().getRuntime().getXbaseLibVersionLowerBound();
    String _plus = ("org.eclipse.xtext.xbase.lib;bundle-version=\"" + _xbaseLibVersionLowerBound);
    String _plus_1 = (_plus + "\"");
    _requiredBundles.add(_plus_1);
  }
  this.generateAbstractSemanticSequencer();
  this.generateAbstractSyntacticSequencer();
  boolean _isGenerateStub = this.isGenerateStub();
  if (_isGenerateStub) {
    this.generateSemanticSequencer();
    this.generateSyntacticSequencer();
  }
  if (this.generateDebugData) {
    this.generateGrammarConstraints();
    Iterable<Pair<String, String>> _generateDebugGraphs = this.debugGraphGenerator.generateDebugGraphs();
    for (final Pair<String, String> fileToContent : _generateDebugGraphs) {
      this.getProjectConfig().getRuntime().getSrcGen().generateFile(fileToContent.getKey(), fileToContent.getValue());
    }
  }
}
 
Example #3
Source File: SerializerFragment.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Set<Binding> getGuiceBindingsRt(Grammar grammar) {
	BindFactory bf = new BindFactory();
	bf.addTypeToType(ISemanticSequencer.class.getName(), names.getSemanticSequencer().getQualifiedName());
	bf.addTypeToType(ISyntacticSequencer.class.getName(), names.getSyntacticSequencer().getQualifiedName());
	bf.addTypeToType(ISerializer.class.getName(), Serializer.class.getName());
	return bf.getBindings();
}
 
Example #4
Source File: AbstractBug348427TestLanguageRuntimeModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return Bug348427TestLanguageSyntacticSequencer.class;
}
 
Example #5
Source File: AbstractRefactoringTestLanguage1RuntimeModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return RefactoringTestLanguage1SyntacticSequencer.class;
}
 
Example #6
Source File: AbstractContentAssistTestLanguageRuntimeModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return ContentAssistTestLanguageSyntacticSequencer.class;
}
 
Example #7
Source File: AbstractRefactoringTestLanguageRuntimeModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return RefactoringTestLanguageSyntacticSequencer.class;
}
 
Example #8
Source File: AbstractBug313089TestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return Bug313089TestLanguageSyntacticSequencer.class;
}
 
Example #9
Source File: AbstractQuickfixCrossrefTestLanguageRuntimeModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return QuickfixCrossrefTestLanguageSyntacticSequencer.class;
}
 
Example #10
Source File: AbstractParametersTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return ParametersTestLanguageSyntacticSequencer.class;
}
 
Example #11
Source File: AbstractBug292245TestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return Bug292245TestLanguageSyntacticSequencer.class;
}
 
Example #12
Source File: AbstractIndentationAwareTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return IndentationAwareTestLanguageSyntacticSequencer.class;
}
 
Example #13
Source File: AbstractHelloWorldRuntimeModule.java    From dsl-devkit with Eclipse Public License 1.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return HelloWorldSyntacticSequencer.class;
}
 
Example #14
Source File: AbstractCrossReferenceProposalTestLanguageRuntimeModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return CrossReferenceProposalTestLanguageSyntacticSequencer.class;
}
 
Example #15
Source File: AbstractIgnoreCaseImportsTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return IgnoreCaseImportsTestLanguageSyntacticSequencer.class;
}
 
Example #16
Source File: AbstractSequencerTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return SequencerTestLanguageSyntacticSequencer.class;
}
 
Example #17
Source File: AbstractBug287941TestLanguageRuntimeModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return Bug287941TestLanguageSyntacticSequencer.class;
}
 
Example #18
Source File: AbstractDomainmodelRuntimeModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return DomainmodelSyntacticSequencer.class;
}
 
Example #19
Source File: AbstractUnassignedRuleCallTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return UnassignedRuleCallTestLanguageSyntacticSequencer.class;
}
 
Example #20
Source File: AbstractIndexTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return IndexTestLanguageSyntacticSequencer.class;
}
 
Example #21
Source File: AbstractParameterizedExpressionsTestLanguageRuntimeModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return ParameterizedExpressionsTestLanguageSyntacticSequencer.class;
}
 
Example #22
Source File: AbstractBug347012TestLanguageRuntimeModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return Bug347012TestLanguageSyntacticSequencer.class;
}
 
Example #23
Source File: AbstractDatatypeRuleTestLanguageRuntimeModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return DatatypeRuleTestLanguageSyntacticSequencer.class;
}
 
Example #24
Source File: AbstractBug288760TestLanguageRuntimeModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return Bug288760TestLanguageSyntacticSequencer.class;
}
 
Example #25
Source File: AbstractLiveContainerBuilderIntegerationTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return LiveContainerBuilderIntegerationTestLanguageSyntacticSequencer.class;
}
 
Example #26
Source File: AbstractBuilderTestLanguageRuntimeModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return BuilderTestLanguageSyntacticSequencer.class;
}
 
Example #27
Source File: AbstractIgnoreCaseLexerTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return IgnoreCaseLexerTestLanguageSyntacticSequencer.class;
}
 
Example #28
Source File: AbstractUnorderedGroupsTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return UnorderedGroupsTestLanguageSyntacticSequencer.class;
}
 
Example #29
Source File: AbstractBug291022TestLanguageRuntimeModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return Bug291022TestLanguageSyntacticSequencer.class;
}
 
Example #30
Source File: AbstractBug348199TestLanguageRuntimeModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return Bug348199TestLanguageSyntacticSequencer.class;
}