org.gradle.api.plugins.antlr.metadata
Class GrammarDelegate

java.lang.Object
  extended by org.gradle.api.plugins.antlr.metadata.GrammarDelegate

public class GrammarDelegate
extends Object

Antlr defines its Grammar class as package-protected for some unfortunate reason. So this class acts as a delegate to the Antlr Grammar class, hiding all the ugly necessary reflection code.


Field Summary
static Class[] NO_ARG_SIGNATURE
           
static Object[] NO_ARGS
           
 
Constructor Summary
GrammarDelegate(Object antlrGrammarMetadata)
           
 
Method Summary
 void associateWith(GrammarMetadata associatedGrammarMetadata)
           
static List<GrammarDelegate> extractGrammarDelegates(antlr.preprocessor.GrammarFile antlrGrammarFile)
           
 GrammarMetadata getAssociatedGrammarMetadata()
           
 String getClassName()
          Retrieves the unqualified name of the lexer/parser class.
 String getExportVocab()
          Retrieves the name of this vocabulary exported by this grammar.
 String getImportVocab()
          Retrieves the name of this vocabulary imported by this grammar.
 GrammarDelegate getSuperGrammarDelegate()
          Retrieves the grammar delegate associated with this grammars super grammar deduced during preprocessing from its extends clause.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_ARG_SIGNATURE

public static final Class[] NO_ARG_SIGNATURE

NO_ARGS

public static final Object[] NO_ARGS
Constructor Detail

GrammarDelegate

public GrammarDelegate(Object antlrGrammarMetadata)
Method Detail

extractGrammarDelegates

public static List<GrammarDelegate> extractGrammarDelegates(antlr.preprocessor.GrammarFile antlrGrammarFile)

getClassName

public String getClassName()
Retrieves the unqualified name of the lexer/parser class.

Returns:
The unqualified lexer/parser class name.

getImportVocab

public String getImportVocab()
Retrieves the name of this vocabulary imported by this grammar.

Returns:
The gammar's imported vocabulary name.

getExportVocab

public String getExportVocab()
Retrieves the name of this vocabulary exported by this grammar.

Returns:
The gammar's exported vocabulary name.

getSuperGrammarDelegate

public GrammarDelegate getSuperGrammarDelegate()
Retrieves the grammar delegate associated with this grammars super grammar deduced during preprocessing from its extends clause.

Returns:
The super-grammar grammar delegate

associateWith

public void associateWith(GrammarMetadata associatedGrammarMetadata)

getAssociatedGrammarMetadata

public GrammarMetadata getAssociatedGrammarMetadata()