public class XtextGeneratorLanguage extends CompositeGeneratorFragment2 implements IXtextGeneratorLanguage
StandardLanguage
to work with the standard
fragments.
The most important property is name
, which should be set to the language name exactly
as specified in the grammar file. If the default grammar resolution based on the name does not
work in your particular scenario, set the grammarUri
property instead. Furthermore,
use fileExtensions
to specify the file extensions for your language.
Generator fragments can be added with the fragment
property. See StandardLanguage
for a list of useful fragments.
Constructor and Description |
---|
XtextGeneratorLanguage() |
Modifier and Type | Method and Description |
---|---|
void |
addReferencedResource(java.lang.String referencedResource)
Add a resource to be included in the resource set that will be used to load the grammar file.
|
GuiceModuleAccess |
getEclipsePluginGenModule() |
java.util.List<java.lang.String> |
getFileExtensions() |
org.eclipse.xtext.Grammar |
getGrammar() |
java.lang.String |
getGrammarUri() |
com.google.inject.Module |
getGuiceModule() |
GuiceModuleAccess |
getIdeGenModule() |
protected java.util.List<? extends IXtextGeneratorFragment> |
getImplicitFragments() |
java.util.List<java.lang.String> |
getReferencedResources() |
org.eclipse.emf.ecore.resource.ResourceSet |
getResourceSet() |
org.eclipse.xtext.xtext.RuleNames |
getRuleNames() |
GuiceModuleAccess |
getRuntimeGenModule() |
StandaloneSetupAccess |
getRuntimeGenSetup() |
GuiceModuleAccess |
getWebGenModule() |
void |
initialize(org.eclipse.xtext.Grammar grammar) |
void |
initialize(com.google.inject.Injector injector) |
boolean |
isGenerateXtendStubs()
Deprecated.
Use
CodeConfig.isPreferXtendStubs() instead |
void |
setFileExtensions(java.lang.String fileExtensions)
Either a single file extension or a comma-separated list of extensions for which the language
shall be registered.
|
void |
setGenerateXtendStubs(java.lang.Boolean generateXtendStubs)
Deprecated.
Use
CodeConfig.setPreferXtendStubs(boolean) instead |
void |
setGrammarUri(java.lang.String uri)
The URI of the grammar file.
|
void |
setGuiceModule(com.google.inject.Module guiceModule) |
void |
setName(java.lang.String name)
The language name exactly as specified in the grammar.
|
void |
setResourceSet(org.eclipse.emf.ecore.resource.ResourceSet resourceSet) |
protected void |
validateAllImports(org.eclipse.xtext.Grammar grammar) |
protected void |
validateGrammar(org.eclipse.xtext.Grammar grammar) |
protected void |
validateReferencedMetamodel(org.eclipse.xtext.ReferencedMetamodel ref) |
addFragment, checkConfiguration, generate, getFragments
public void setGrammarUri(java.lang.String uri)
setName(String)
does not work in your particular scenario.public java.lang.String getGrammarUri()
public void setName(java.lang.String name)
public void setFileExtensions(java.lang.String fileExtensions)
public void addReferencedResource(java.lang.String referencedResource)
public java.util.List<java.lang.String> getFileExtensions()
getFileExtensions
in interface IXtextGeneratorLanguage
@Deprecated public void setGenerateXtendStubs(java.lang.Boolean generateXtendStubs)
CodeConfig.setPreferXtendStubs(boolean)
instead@Deprecated public boolean isGenerateXtendStubs()
CodeConfig.isPreferXtendStubs()
insteadisGenerateXtendStubs
in interface IXtextGeneratorLanguage
public void initialize(com.google.inject.Injector injector)
initialize
in interface IGuiceAwareGeneratorComponent
initialize
in class CompositeGeneratorFragment2
protected java.util.List<? extends IXtextGeneratorFragment> getImplicitFragments()
public void initialize(org.eclipse.xtext.Grammar grammar)
protected void validateGrammar(org.eclipse.xtext.Grammar grammar)
protected void validateAllImports(org.eclipse.xtext.Grammar grammar)
protected void validateReferencedMetamodel(org.eclipse.xtext.ReferencedMetamodel ref)
@Pure public org.eclipse.xtext.Grammar getGrammar()
getGrammar
in interface IXtextGeneratorLanguage
@Pure public org.eclipse.xtext.xtext.RuleNames getRuleNames()
@Pure public java.util.List<java.lang.String> getReferencedResources()
@Pure public org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
getResourceSet
in interface IXtextGeneratorLanguage
public void setResourceSet(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
@Pure public com.google.inject.Module getGuiceModule()
public void setGuiceModule(com.google.inject.Module guiceModule)
@Pure public StandaloneSetupAccess getRuntimeGenSetup()
getRuntimeGenSetup
in interface IXtextGeneratorLanguage
@Pure public GuiceModuleAccess getRuntimeGenModule()
getRuntimeGenModule
in interface IXtextGeneratorLanguage
@Pure public GuiceModuleAccess getIdeGenModule()
getIdeGenModule
in interface IXtextGeneratorLanguage
@Pure public GuiceModuleAccess getEclipsePluginGenModule()
getEclipsePluginGenModule
in interface IXtextGeneratorLanguage
@Pure public GuiceModuleAccess getWebGenModule()
getWebGenModule
in interface IXtextGeneratorLanguage