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

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.XtextAntlrUiGeneratorFragment
All Implemented Interfaces:
IGeneratorFragment, NamingAware

public class XtextAntlrUiGeneratorFragment
extends AbstractAntlrGeneratorFragment

A IGeneratorFragment to generate a lightweight AntLR based parser used in content assist.

Author:
Sebastian Zarnekow - Initial contribution and API

Constructor Summary
XtextAntlrUiGeneratorFragment()
           
 
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.util.Collection<Alternatives> getAllAlternatives(Grammar g)
           
static java.util.Collection<Assignment> getAllAssignments(Grammar g)
           
static java.util.Collection<Group> getAllGroups(Grammar g)
           
static java.util.Collection<AbstractElement> getAllPredicatedElements(Grammar g)
           
static java.util.Collection<UnorderedGroup> getAllUnorderedGroups(Grammar g)
           
 java.lang.String[] getExportedPackagesUi(Grammar grammar)
          return the exported packages for the ui bundle
static java.lang.String getGrammarFileName(Grammar g, Naming naming)
           
 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 getInternalLexerClassName(Grammar g, Naming naming)
           
static java.lang.String getInternalParserClassName(Grammar g, Naming naming)
           
static java.lang.String getParserClassName(Grammar g, Naming naming)
           
 java.lang.String[] getRequiredBundlesUi(Grammar grammar)
          return the bundles this fragment requires in ui
 
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, getExportedPackagesRt, getGuiceBindingsRt, getNaming, getRequiredBundlesRt, 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

XtextAntlrUiGeneratorFragment

public XtextAntlrUiGeneratorFragment()
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.

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

getRequiredBundlesUi

public java.lang.String[] getRequiredBundlesUi(Grammar grammar)
Description copied from interface: IGeneratorFragment
return the bundles this fragment requires in ui

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

getExportedPackagesUi

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

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

getParserClassName

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

getInternalLexerClassName

public static java.lang.String getInternalLexerClassName(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)

getAllAlternatives

public static java.util.Collection<Alternatives> getAllAlternatives(Grammar g)

getAllUnorderedGroups

public static java.util.Collection<UnorderedGroup> getAllUnorderedGroups(Grammar g)

getAllGroups

public static java.util.Collection<Group> getAllGroups(Grammar g)

getAllAssignments

public static java.util.Collection<Assignment> getAllAssignments(Grammar g)

getAllPredicatedElements

public static java.util.Collection<AbstractElement> getAllPredicatedElements(Grammar g)