org.eclipse.xtext.generator.parser.antlr
Class XtextAntlrGeneratorFragment

java.lang.Object
  extended by org.eclipse.xtext.generator.DefaultGeneratorFragment
      extended by org.eclipse.xtext.generator.AbstractGeneratorFragment
          extended by org.eclipse.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment
              extended by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment
All Implemented Interfaces:
IGeneratorFragment, NamingAware

public class XtextAntlrGeneratorFragment
extends AbstractAntlrGeneratorFragment

Converts the Xtext grammar to an AntLR grammar runs the AntLR generator. Additionally generates some parser/lexer related services

Author:
Sebastian Zarnekow - Initial contribution and API, Sven Efftinge

Constructor Summary
XtextAntlrGeneratorFragment()
           
 
Method Summary
 void checkConfiguration(org.eclipse.emf.mwe.core.issues.Issues issues)
          Called by the container after configuration so the component can validate the configuration before invocation.
 void generate(Grammar grammar, org.eclipse.xpand2.XpandExecutionContext ctx)
          can be used to generate whatever necessary
static java.lang.String getAntlrTokenFileProviderClassName(Grammar grammar, Naming naming)
           
 java.lang.String[] getExportedPackagesRt(Grammar grammar)
          return the exported packages for the runtime bundle
static java.lang.String getGrammarFileName(Grammar g, Naming naming)
           
 java.util.Set<Binding> getGuiceBindingsRt(Grammar grammar)
          return a map containing the contributed guice bindings created in this generator fragment
 java.util.Set<Binding> getGuiceBindingsUi(Grammar grammar)
          return a map containing the contributed guice bindings for the ui part created in this generator fragment
static java.lang.String getInternalParserClassName(Grammar g, Naming naming)
           
static java.lang.String getLexerClassName(Grammar g, Naming naming)
           
static java.lang.String getParserClassName(Grammar g, Naming naming)
           
 java.lang.String[] getRequiredBundlesRt(Grammar grammar)
          return the bundles this fragment requires at runtime
 
Methods inherited from class org.eclipse.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment
addAntlrParam, containsUnorderedGroup, getAntlrParams, getAntlrTool, getLexerFileNameSuffix, getOptions, getParameters, getParserFileNameSuffix, setAntlrTool, setOptions, simplifyUnorderedGroupPredicates, simplifyUnorderedGroupPredicatesIfRequired, splitLexerClassFile, splitParserAndLexerIfEnabled, splitParserAndLexerIfEnabled, splitParserClassFile, suppressWarnings, suppressWarnings
 
Methods inherited from class org.eclipse.xtext.generator.AbstractGeneratorFragment
addToPluginXmlRt, addToPluginXmlTests, addToPluginXmlUi, addToStandaloneSetup, getExportedPackagesUi, getNaming, getRequiredBundlesUi, getTemplate, registerNaming
 
Methods inherited from class org.eclipse.xtext.generator.DefaultGeneratorFragment
getImportedPackagesRt, getImportedPackagesUi
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XtextAntlrGeneratorFragment

public XtextAntlrGeneratorFragment()
Method Detail

generate

public void generate(Grammar grammar,
                     org.eclipse.xpand2.XpandExecutionContext ctx)
Description copied from interface: IGeneratorFragment
can be used to generate whatever necessary

Specified by:
generate in interface IGeneratorFragment
Overrides:
generate in class AbstractAntlrGeneratorFragment
ctx - - the execution context to use

checkConfiguration

public void checkConfiguration(org.eclipse.emf.mwe.core.issues.Issues issues)
Description copied from interface: IGeneratorFragment
Called by the container after configuration so the component can validate the configuration before invocation.

Specified by:
checkConfiguration in interface IGeneratorFragment
Overrides:
checkConfiguration in class AbstractAntlrGeneratorFragment
Parameters:
issues - implementors should report configuration issues to this.

getExportedPackagesRt

public java.lang.String[] getExportedPackagesRt(Grammar grammar)
Description copied from interface: IGeneratorFragment
return the exported packages for the runtime bundle

Specified by:
getExportedPackagesRt in interface IGeneratorFragment
Overrides:
getExportedPackagesRt in class AbstractGeneratorFragment

getRequiredBundlesRt

public java.lang.String[] getRequiredBundlesRt(Grammar grammar)
Description copied from interface: IGeneratorFragment
return the bundles this fragment requires at runtime

Specified by:
getRequiredBundlesRt in interface IGeneratorFragment
Overrides:
getRequiredBundlesRt in class AbstractGeneratorFragment

getGuiceBindingsRt

public java.util.Set<Binding> getGuiceBindingsRt(Grammar grammar)
Description copied from interface: IGeneratorFragment
return a map containing the contributed guice bindings created in this generator fragment

Specified by:
getGuiceBindingsRt in interface IGeneratorFragment
Overrides:
getGuiceBindingsRt in class AbstractGeneratorFragment

getGuiceBindingsUi

public java.util.Set<Binding> getGuiceBindingsUi(Grammar grammar)
Description copied from interface: IGeneratorFragment
return a map containing the contributed guice bindings for the ui part created in this generator fragment

Specified by:
getGuiceBindingsUi in interface IGeneratorFragment
Overrides:
getGuiceBindingsUi in class AbstractGeneratorFragment

getAntlrTokenFileProviderClassName

public static java.lang.String getAntlrTokenFileProviderClassName(Grammar grammar,
                                                                  Naming naming)

getLexerClassName

public static java.lang.String getLexerClassName(Grammar g,
                                                 Naming naming)

getParserClassName

public static java.lang.String getParserClassName(Grammar g,
                                                  Naming naming)

getInternalParserClassName

public static java.lang.String getInternalParserClassName(Grammar g,
                                                          Naming naming)

getGrammarFileName

public static java.lang.String getGrammarFileName(Grammar g,
                                                  Naming naming)