org.eclipse.xtext.xtext.generator.DefaultGeneratorModule Java Examples

The following examples show how to use org.eclipse.xtext.xtext.generator.DefaultGeneratorModule. 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: AntlrGeneratorFragmentTest.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
protected void asserTranslatesToDebugGrammar(final CharSequence xtextGrammar, final String expectedDebugGrammar) {
  try {
    EObject _model = super.getModel(xtextGrammar.toString());
    final Grammar grammar = ((Grammar) _model);
    DefaultGeneratorModule _defaultGeneratorModule = new DefaultGeneratorModule();
    final Injector injector = Guice.createInjector(_defaultGeneratorModule);
    final AntlrGeneratorFragmentTest.InMemFSA inMem = new AntlrGeneratorFragmentTest.InMemFSA();
    final AntlrOptions options = new AntlrOptions();
    injector.<AntlrDebugGrammarGenerator>getInstance(AntlrDebugGrammarGenerator.class).generate(grammar, options, inMem);
    Assert.assertEquals(expectedDebugGrammar, IterableExtensions.<Object>head(inMem.getAllFiles().values()).toString());
  } catch (Throwable _e) {
    throw Exceptions.sneakyThrow(_e);
  }
}
 
Example #2
Source File: XtextGenerator.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
@Pure
public DefaultGeneratorModule getConfiguration() {
  return this.configuration;
}
 
Example #3
Source File: XtextGenerator.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public void setConfiguration(final DefaultGeneratorModule configuration) {
  this.configuration = configuration;
}