| |
|
| java.lang.Object antlr.Grammar
All known Subclasses: antlr.LexerGrammar, antlr.TreeWalkerGrammar, antlr.ParserGrammar,
Grammar | abstract public class Grammar (Code) | | A Grammar holds a set of rules (which are stored
in a symbol table). Most of the time a grammar
needs a code generator and an LLkAnalyzer too.
|
analyzerDebug | protected boolean analyzerDebug(Code) | | |
buildAST | protected boolean buildAST(Code) | | |
classMemberAction | protected Token classMemberAction(Code) | | |
debuggingOutput | protected boolean debuggingOutput(Code) | | |
defaultErrorHandler | protected boolean defaultErrorHandler(Code) | | |
exportVocab | protected String exportVocab(Code) | | The name of the export vocabulary...used to generate the output
token types interchange file.
|
hasSyntacticPredicate | protected boolean hasSyntacticPredicate(Code) | | |
hasUserErrorHandling | protected boolean hasUserErrorHandling(Code) | | |
importVocab | protected String importVocab(Code) | | The name of the import vocabulary. "Initial conditions"
|
interactive | protected boolean interactive(Code) | | |
tokenManager | protected TokenManager tokenManager(Code) | | The token manager associated with the grammar, if any.
// The token manager is responsible for maintaining the set of valid tokens, and
// is conceptually shared between the lexer and parser. This may be either a
// LexerGrammar or a ImportVocabTokenManager.
|
traceRules | protected boolean traceRules(Code) | | |
traceSyntacticPredicates | protected boolean traceSyntacticPredicates(Code) | | |
generate | abstract public void generate() throws IOException(Code) | | Top-level call to generate the code for this grammar
|
getDefaultErrorHandler | public boolean getDefaultErrorHandler()(Code) | | |
getIntegerOption | public int getIntegerOption(String key) throws NumberFormatException(Code) | | Get an integer option. Given the name of the option find its
associated integer value. If the associated value is not an integer or
is not in the table, then throw an exception of type NumberFormatException.
Parameters: key - The name of the option The value associated with the key. |
getOption | public Token getOption(String key)(Code) | | Get an option. Given the name of the option find its associated value.
Parameters: key - The name of the option The value associated with the key, or null if the key has not been set. |
getSuperClass | abstract protected String getSuperClass()(Code) | | |
hasOption | public boolean hasOption(String key)(Code) | | Check the existence of an option in the table
Parameters: key - The name of the option true if the option is in the table |
isDefined | public boolean isDefined(String s)(Code) | | Is a rule symbol defined? (not used for tokens)
|
processArguments | abstract public void processArguments(String[] args)(Code) | | Process command line arguments. Implemented in subclasses
|
setOption | public boolean setOption(String key, Token value)(Code) | | Set a generic option.
This associates a generic option key with a Token value.
No validation is performed by this method, although users of the value
(code generation and/or analysis) may require certain formats.
The value is stored as a token so that the location of an error
can be reported.
Parameters: key - The name of the option. Parameters: value - The value to associate with the key. true if the option was a valid generic grammar option, false o/w |
toString | public String toString()(Code) | | Print out the grammar without actions
|
|
|
|