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

The following examples show how to use org.eclipse.xtext.serializer.sequencer.ISyntacticSequencer. These examples are extracted from open source projects. 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 Project: xtext-extras   Source File: SerializerFragment.java    License: 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 2
Source Project: xtext-core   Source File: SyntacticSequencerTest.java    License: 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 3
Source Project: xtext-core   Source File: SerializerFragment2.java    License: 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 4
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return IndentationAwareUiTestLanguageSyntacticSequencer.class;
}
 
Example 5
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return Bug289059TestLanguageSyntacticSequencer.class;
}
 
Example 6
Source Project: n4js   Source File: AbstractSemverRuntimeModule.java    License: Eclipse Public License 1.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return SemverSyntacticSequencer.class;
}
 
Example 7
Source Project: n4js   Source File: AbstractUnicodeRuntimeModule.java    License: Eclipse Public License 1.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return UnicodeSyntacticSequencer.class;
}
 
Example 8
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return RegularExpressionSyntacticSequencer.class;
}
 
Example 9
Source Project: n4js   Source File: AbstractN4JSRuntimeModule.java    License: Eclipse Public License 1.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return N4JSSyntacticSequencer.class;
}
 
Example 10
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return IndentationAwareTestLanguageSyntacticSequencer.class;
}
 
Example 11
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return Bug362902SyntacticSequencer.class;
}
 
Example 12
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return UnicodeTestLanguageSyntacticSequencer.class;
}
 
Example 13
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return EcoreFragmentTestLanguageSyntacticSequencer.class;
}
 
Example 14
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return AssignmentFinderTestLanguageSyntacticSequencer.class;
}
 
Example 15
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return MultiGenMMTestLanguageSyntacticSequencer.class;
}
 
Example 16
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return RefactoringTestLanguage1SyntacticSequencer.class;
}
 
Example 17
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return ContentAssistTestLanguageSyntacticSequencer.class;
}
 
Example 18
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return FragmentTestLanguageSyntacticSequencer.class;
}
 
Example 19
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return ExBeeLangTestLanguageSyntacticSequencer.class;
}
 
Example 20
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return Bug305397SyntacticSequencer.class;
}
 
Example 21
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return AbstractIgnoreCaseLinkingTestLanguageSyntacticSequencer.class;
}
 
Example 22
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return XImportSectionTestLangSyntacticSequencer.class;
}
 
Example 23
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return Bug299237TestLanguageSyntacticSequencer.class;
}
 
Example 24
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return GrammarAccessTestLanguageSyntacticSequencer.class;
}
 
Example 25
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return EnumRulesTestLanguageSyntacticSequencer.class;
}
 
Example 26
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return SuperTestLanguageSyntacticSequencer.class;
}
 
Example 27
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return AbstractTestLanguageSyntacticSequencer.class;
}
 
Example 28
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return StatemachineSyntacticSequencer.class;
}
 
Example 29
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return SimpleUnorderedGroupsTestLanguageSyntacticSequencer.class;
}
 
Example 30
Source Project: M2Doc   Source File: AbstractMyDslRuntimeModule.java    License: Eclipse Public License 1.0 4 votes vote down vote up
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
	return MyDslSyntacticSequencer.class;
}