org.eclipse.xtext.generator.parser.antlr.ex.rt
Class AntlrGeneratorFragment

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.ex.common.AbstractAntlrGeneratorFragmentEx
                  extended by org.eclipse.xtext.generator.parser.antlr.ex.rt.AntlrGeneratorFragment
All Implemented Interfaces:
IGeneratorFragment, NamingAware

public class AntlrGeneratorFragment
extends AbstractAntlrGeneratorFragmentEx

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

Constructor Summary
AntlrGeneratorFragment()
           
 
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.
protected  void cleanupLexerTokensFile(java.lang.String lexerBaseFileName)
           
protected  MutableTokenDefProvider createLexerTokensProvider(java.lang.String lexerBaseFileName)
           
 void generate(Grammar grammar, org.eclipse.xpand2.XpandExecutionContext ctx)
          can be used to generate whatever necessary
 java.lang.String[] getExportedPackagesRt(Grammar grammar)
          return the exported packages for the runtime bundle
 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
 java.lang.String[] getRequiredBundlesRt(Grammar grammar)
          return the bundles this fragment requires at runtime
 
Methods inherited from class org.eclipse.xtext.generator.parser.antlr.ex.common.AbstractAntlrGeneratorFragmentEx
getFragmentHelper, getLexerFileNameSuffix, getParameters, getParserFileNameSuffix, setFragmentHelper
 
Methods inherited from class org.eclipse.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment
addAntlrParam, containsUnorderedGroup, getAntlrParams, getAntlrTool, getOptions, 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

AntlrGeneratorFragment

public AntlrGeneratorFragment()
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

createLexerTokensProvider

protected MutableTokenDefProvider createLexerTokensProvider(java.lang.String lexerBaseFileName)

cleanupLexerTokensFile

protected void cleanupLexerTokensFile(java.lang.String lexerBaseFileName)

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

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.