use of org.eclipse.xtext.xtext.generator.model.IXtextGeneratorFileSystemAccess in project xtext-core by eclipse.
the class XtextGenerator method generateExecutableExtensionFactory.
protected void generateExecutableExtensionFactory(final IXtextGeneratorLanguage language) {
IXtextGeneratorFileSystemAccess _srcGen = this.projectConfig.getEclipsePlugin().getSrcGen();
boolean _tripleNotEquals = (_srcGen != null);
if (_tripleNotEquals) {
this.templates.createEclipsePluginExecutableExtensionFactory(language, IterableExtensions.<XtextGeneratorLanguage>head(this.languageConfigs)).writeTo(this.projectConfig.getEclipsePlugin().getSrcGen());
}
}
use of org.eclipse.xtext.xtext.generator.model.IXtextGeneratorFileSystemAccess in project xtext-core by eclipse.
the class XtextAntlrGeneratorFragment2 method generateDebugGrammar.
protected void generateDebugGrammar() {
final IXtextGeneratorFileSystemAccess fsa = this.getProjectConfig().getRuntime().getSrcGen();
this.debugGenerator.generate(this.getGrammar(), this.getOptions(), fsa);
}
use of org.eclipse.xtext.xtext.generator.model.IXtextGeneratorFileSystemAccess in project xtext-core by eclipse.
the class XtextAntlrGeneratorFragment2 method generateContentAssistGrammar.
protected void generateContentAssistGrammar() {
@Extension final ContentAssistGrammarNaming naming = this.contentAssistNaming;
final IXtextGeneratorFileSystemAccess fsa = this.getProjectConfig().getGenericIde().getSrcGen();
this.contentAssistGenerator.generate(this.getGrammar(), this.getOptions(), fsa);
this.runAntlr(naming.getParserGrammar(this.getGrammar()), naming.getLexerGrammar(this.getGrammar()), fsa);
this.simplifyUnorderedGroupPredicatesIfRequired(this.getGrammar(), fsa, naming.getInternalParserClass(this.getGrammar()));
this.splitParserAndLexerIfEnabled(fsa, naming.getInternalParserClass(this.getGrammar()), naming.getLexerClass(this.getGrammar()));
this.normalizeTokens(fsa, naming.getLexerGrammar(this.getGrammar()).getTokensFileName());
this.suppressWarnings(fsa, naming.getInternalParserClass(this.getGrammar()), naming.getLexerClass(this.getGrammar()));
this.normalizeLineDelimiters(fsa, naming.getLexerClass(this.getGrammar()), naming.getInternalParserClass(this.getGrammar()));
if (this.removeBacktrackingGuards) {
this.removeBackTrackingGuards(fsa, naming.getInternalParserClass(this.getGrammar()), this.lookaheadThreshold);
}
}
use of org.eclipse.xtext.xtext.generator.model.IXtextGeneratorFileSystemAccess in project xtext-core by eclipse.
the class XtextAntlrGeneratorFragment2 method doGenerate.
@Override
protected void doGenerate() {
Grammar _grammar = this.getGrammar();
boolean _isIgnoreCase = this.getOptions().isIgnoreCase();
new KeywordHelper(_grammar, _isIgnoreCase, this.grammarUtil);
boolean _isCombinedGrammar = this.isCombinedGrammar();
new CombinedGrammarMarker(_isCombinedGrammar).attachToEmfObject(this.getGrammar());
if (this.debugGrammar) {
this.generateDebugGrammar();
}
this.generateProductionGrammar();
IXtextGeneratorFileSystemAccess _srcGen = this.getProjectConfig().getGenericIde().getSrcGen();
boolean _tripleNotEquals = (_srcGen != null);
if (_tripleNotEquals) {
this.generateContentAssistGrammar();
this.addIdeBindingsAndImports();
}
this.generateProductionParser().writeTo(this.getProjectConfig().getRuntime().getSrcGen());
this.generateAntlrTokenFileProvider().writeTo(this.getProjectConfig().getRuntime().getSrcGen());
this.generateContentAssistParser().writeTo(this.getProjectConfig().getGenericIde().getSrcGen());
boolean _hasSyntheticTerminalRule = this.hasSyntheticTerminalRule();
if (_hasSyntheticTerminalRule) {
this.generateProductionTokenSource().writeTo(this.getProjectConfig().getRuntime().getSrc());
this.generateContentAssistTokenSource().writeTo(this.getProjectConfig().getGenericIde().getSrc());
}
this.addRuntimeBindingsAndImports();
this.addIdeBindingsAndImports();
this.addUiBindingsAndImports();
}
use of org.eclipse.xtext.xtext.generator.model.IXtextGeneratorFileSystemAccess in project xtext-core by eclipse.
the class QuickfixProviderFragment2 method generate.
@Override
public void generate() {
GuiceModuleAccess.BindingFactory _bindingFactory = new GuiceModuleAccess.BindingFactory();
TypeReference _typeReference = new TypeReference("org.eclipse.xtext.ui.editor.quickfix.IssueResolutionProvider");
_bindingFactory.addTypeToType(_typeReference, this.getQuickfixProviderClass(this.getGrammar())).contributeTo(this.getLanguage().getEclipsePluginGenModule());
boolean _isGenerateStub = this.isGenerateStub();
if (_isGenerateStub) {
IBundleProjectConfig _eclipsePlugin = this.getProjectConfig().getEclipsePlugin();
IXtextGeneratorFileSystemAccess _src = null;
if (_eclipsePlugin != null) {
_src = _eclipsePlugin.getSrc();
}
boolean _tripleNotEquals = (_src != null);
if (_tripleNotEquals) {
boolean _isGenerateXtendStub = this.isGenerateXtendStub();
if (_isGenerateXtendStub) {
this.generateXtendQuickfixProvider();
} else {
this.generateJavaQuickfixProvider();
}
}
ManifestAccess _manifest = this.getProjectConfig().getEclipsePlugin().getManifest();
boolean _tripleNotEquals_1 = (_manifest != null);
if (_tripleNotEquals_1) {
Set<String> _exportedPackages = this.getProjectConfig().getEclipsePlugin().getManifest().getExportedPackages();
String _packageName = this.getQuickfixProviderClass(this.getGrammar()).getPackageName();
_exportedPackages.add(_packageName);
}
PluginXmlAccess _pluginXml = this.getProjectConfig().getEclipsePlugin().getPluginXml();
boolean _tripleNotEquals_2 = (_pluginXml != null);
if (_tripleNotEquals_2) {
this.addRegistrationToPluginXml();
}
} else {
IBundleProjectConfig _eclipsePlugin_1 = this.getProjectConfig().getEclipsePlugin();
IXtextGeneratorFileSystemAccess _srcGen = null;
if (_eclipsePlugin_1 != null) {
_srcGen = _eclipsePlugin_1.getSrcGen();
}
boolean _tripleNotEquals_3 = (_srcGen != null);
if (_tripleNotEquals_3) {
this.generateGenQuickfixProvider();
}
ManifestAccess _manifest_1 = this.getProjectConfig().getEclipsePlugin().getManifest();
boolean _tripleNotEquals_4 = (_manifest_1 != null);
if (_tripleNotEquals_4) {
Set<String> _exportedPackages_1 = this.getProjectConfig().getEclipsePlugin().getManifest().getExportedPackages();
String _packageName_1 = this.getQuickfixProviderClass(this.getGrammar()).getPackageName();
_exportedPackages_1.add(_packageName_1);
}
}
}
Aggregations