org.eclipse.xtext.xtext.generator.CodeConfig Java Examples

The following examples show how to use org.eclipse.xtext.xtext.generator.CodeConfig. 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: XtextGenerator.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
public void initialize() {
  if ((this.injector == null)) {
    XtextGenerator.LOG.info("Initializing Xtext generator");
    new StandaloneSetup().addRegisterGeneratedEPackage("org.eclipse.xtext.common.types.TypesPackage");
    this.initializeEncoding();
    this.injector = this.createInjector();
    this.injector.injectMembers(this);
    CodeConfig _instance = this.injector.<CodeConfig>getInstance(CodeConfig.class);
    final Procedure1<CodeConfig> _function = (CodeConfig it) -> {
      it.initialize(this.injector);
    };
    ObjectExtensions.<CodeConfig>operator_doubleArrow(_instance, _function);
    this.projectConfig.initialize(this.injector);
    this.cleaner.initialize(this.injector);
    this.standaloneSetup.initialize(this.injector);
    for (final XtextGeneratorLanguage language : this.languageConfigs) {
      {
        final Injector languageInjector = this.createLanguageInjector(this.injector, language);
        language.initialize(languageInjector);
      }
    }
  }
}
 
Example #2
Source File: SerializerFragment.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void generate(Xtend2ExecutionContext ctx) {
	SerializerFragment2 delegate = new SerializerFragment2();
	delegate.setGenerateStub(isGenerateStub());
	delegate.setDetectSyntheticTerminals(detectSyntheticTerminals);
	delegate.setGenerateDebugData(generateDebugData);
	delegate.setGenerateSupportForDeprecatedContextEObject(generateSupportForDeprecatedContextEObject);
	adapterSetup.getInjector().getInstance(CodeConfig.class).setPreferXtendStubs(isGenerateXtendStub());
	delegate.initialize(adapterSetup.getInjector());
	delegate.generate();
}
 
Example #3
Source File: JavaFileAccess.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
protected JavaFileAccess(final TypeReference typeRef, final CodeConfig codeConfig) {
  int _length = ((Object[])Conversions.unwrapArray(typeRef.getSimpleNames(), Object.class)).length;
  boolean _greaterThan = (_length > 1);
  if (_greaterThan) {
    throw new IllegalArgumentException(("Nested type cannot be serialized: " + typeRef));
  }
  this.javaType = typeRef;
  this.codeConfig = codeConfig;
  String _path = typeRef.getPath();
  String _plus = (_path + ".");
  String _fileExtension = this.getFileExtension();
  String _plus_1 = (_plus + _fileExtension);
  this.setPath(_plus_1);
}
 
Example #4
Source File: AbstractExternalHighlightingFragment2.java    From sarl with Apache License 2.0 4 votes vote down vote up
/** Replies the code configuration.
 *
 * @return the code configuration.
 */
@Pure
protected CodeConfig getCodeConfig() {
	return this.codeConfig;
}
 
Example #5
Source File: Generator2AdapterSetup.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
private CodeConfig createCodeConfig() {
	CodeConfig codeConfig = new CodeConfig();
	codeConfig.setLineDelimiter(naming.getLineDelimiter());
	codeConfig.setFileHeader(naming.fileHeader());
	return codeConfig;
}
 
Example #6
Source File: PluginXmlAccess.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public void setCodeConfig(final CodeConfig codeConfig) {
  this.codeConfig = codeConfig;
}
 
Example #7
Source File: PluginXmlAccess.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
@Pure
public CodeConfig getCodeConfig() {
  return this.codeConfig;
}
 
Example #8
Source File: GeneratedJavaFileAccess.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
protected GeneratedJavaFileAccess(final TypeReference typeRef, final CodeConfig codeConfig) {
  super(typeRef, codeConfig);
}
 
Example #9
Source File: AbstractAntlrGeneratorFragment2.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
@Pure
protected CodeConfig getCodeConfig() {
  return this.codeConfig;
}
 
Example #10
Source File: XtendFileAccess.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
protected XtendFileAccess(TypeReference typeRef, CodeConfig codeConfig) {
	super(typeRef, codeConfig);
}
 
Example #11
Source File: XtextProjectConfig.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public void setCodeConfig(CodeConfig codeConfig) {
	this.codeConfig = codeConfig;
}
 
Example #12
Source File: XtextProjectConfig.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public CodeConfig getCodeConfig() {
	return codeConfig;
}
 
Example #13
Source File: AbstractExternalHighlightingFragment2.java    From sarl with Apache License 2.0 3 votes vote down vote up
/** Constructor.
 *
 * @param indentation the string for a single indentation level.
 * @param codeConfig the code configuration.
 * @param languageName the language name.
 * @param languageVersion the language version.
 */
protected AbstractAppendable(String indentation, CodeConfig codeConfig, String languageName, String languageVersion) {
	super(indentation, codeConfig.getLineDelimiter(), false);
	this.codeConfig = codeConfig;
	this.languageName = languageName;
	this.languageVersion = languageVersion;
}
 
Example #14
Source File: AbstractXmlHighlightingFragment2.java    From sarl with Apache License 2.0 2 votes vote down vote up
/** Constructor.
 *
 * @param codeConfig the code configuration.
 * @param languageName the language name.
 * @param languageVersion the language version.
 */
protected XmlAppendable(CodeConfig codeConfig, String languageName, String languageVersion) {
	super(" ", codeConfig, languageName, languageVersion); //$NON-NLS-1$
}
 
Example #15
Source File: AbstractExternalHighlightingFragment2.java    From sarl with Apache License 2.0 2 votes vote down vote up
/** Replies the code configuration.
 *
 * @return the code configuration.;
 */
protected CodeConfig getCodeConfig() {
	return this.codeConfig;
}
 
Example #16
Source File: AbstractExternalHighlightingFragment2.java    From sarl with Apache License 2.0 2 votes vote down vote up
/** Constructor.
 *
 * @param codeConfig the code configuration.
 * @param languageName the language name.
 * @param languageVersion the language version.
 */
protected AbstractAppendable(CodeConfig codeConfig, String languageName, String languageVersion) {
	this("  ", codeConfig, languageName, languageVersion); //$NON-NLS-1$
}
 
Example #17
Source File: AbstractCsyntaxHighlightingFragment2.java    From sarl with Apache License 2.0 2 votes vote down vote up
/** Constructor.
 *
 * @param codeConfig the code configuration.
 * @param languageName the language name.
 * @param languageVersion the language version.
 */
protected CsyntaxAppendable(CodeConfig codeConfig, String languageName, String languageVersion) {
	super(codeConfig, languageName, languageVersion);
}
 
Example #18
Source File: TextMateGenerator2.java    From sarl with Apache License 2.0 2 votes vote down vote up
/** Constructor.
 *
 * @param codeConfig the code configuration.
 * @param languageName the language name.
 * @param languageVersion the language version.
 */
protected CombinedTmAppendable(CodeConfig codeConfig, String languageName, String languageVersion) {
	this.oldAppendable = new OldStyleTmAppendable(codeConfig, languageName, languageVersion);
	this.newAppendable = new XmlBasedTmAppendable(codeConfig, languageName, languageVersion);
}
 
Example #19
Source File: TextMateGenerator2.java    From sarl with Apache License 2.0 2 votes vote down vote up
/** Constructor.
 *
 * @param codeConfig the code configuration.
 * @param languageName the language name.
 * @param languageVersion the language version.
 */
protected XmlBasedTmAppendable(CodeConfig codeConfig, String languageName, String languageVersion) {
	super("\t", codeConfig, languageName, languageVersion); //$NON-NLS-1$
}
 
Example #20
Source File: TextMateGenerator2.java    From sarl with Apache License 2.0 2 votes vote down vote up
/** Constructor.
 *
 * @param codeConfig the code configuration.
 * @param languageName the language name.
 * @param languageVersion the language version.
 */
protected OldStyleTmAppendable(CodeConfig codeConfig, String languageName, String languageVersion) {
	super("  ", codeConfig, languageName, languageVersion); //$NON-NLS-1$
}
 
Example #21
Source File: LaTeXListingsGenerator2.java    From sarl with Apache License 2.0 2 votes vote down vote up
/** Constructor.
 *
 * @param codeConfig the code configuration.
 * @param languageName the language name.
 * @param languageVersion the language version.
 */
protected TeXAppendable(CodeConfig codeConfig, String languageName, String languageVersion) {
	super(codeConfig, languageName, languageVersion);
}
 
Example #22
Source File: VimGenerator2.java    From sarl with Apache License 2.0 2 votes vote down vote up
/** Constructor.
 *
 * @param codeConfig the code configuration.
 * @param languageName the language name.
 * @param languageVersion the language version.
 */
protected VimAppendable(CodeConfig codeConfig, String languageName, String languageVersion) {
	super("  ", codeConfig, languageName, languageVersion); //$NON-NLS-1$
}
 
Example #23
Source File: AbstractScriptHighlightingFragment2.java    From sarl with Apache License 2.0 2 votes vote down vote up
/** Constructor.
 *
 * @param codeConfig the code configuration.
 * @param languageName the language name.
 * @param languageVersion the language version.
 */
protected ScriptAppendable(CodeConfig codeConfig, String languageName, String languageVersion) {
	super(codeConfig, languageName, languageVersion);
}