org.antlr.tool |
|
Java Source File Name | Type | Comment |
ActionAnalysisLexer.java | Class | We need to set Rule.referencedPredefinedRuleAttributes before
code generation. |
ANTLRErrorListener.java | Interface | Defines behavior of object able to handle error messages from ANTLR including
both tool errors like "can't write file" and grammar ambiguity warnings. |
ANTLRLexer.java | Class | |
ANTLRParser.java | Class | Read in an ANTLR grammar and build an AST. |
ANTLRTokenTypes.java | Interface | |
ANTLRTreePrinter.java | Class | Print out a grammar (no pretty printing). |
ANTLRTreePrinterTokenTypes.java | Interface | |
AssignTokenTypesWalker.java | Class | [Warning: TJP says that this is probably out of date as of 11/19/2005,
but since it's probably still useful, I'll leave in. |
AssignTokenTypesWalkerTokenTypes.java | Interface | |
Attribute.java | Class | Track the names of attributes define in arg lists, return values,
scope blocks etc... |
AttributeScope.java | Class | Track the attributes within a scope. |
BuildDependencyGenerator.java | Class | Given a grammar file, show the dependencies on .tokens etc...
Using ST, emit a simple "make compatible" list of dependencies.
For example, combined grammar T.g (no token import) generates:
TParser.java : T.g
T.tokens : T.g
T__g : T.g
For tree grammar TP with import of T.tokens:
TP.g : T.tokens
TP.java : TP.g
If "-lib libdir" is used on command-line with -depend, then include the
path like
TP.g : libdir/T.tokens
Pay attention to -o as well:
outputdir/TParser.java : T.g
So this output shows what the grammar depends on *and* what it generates.
Operate on one grammar file at a time. |
DefineGrammarItemsWalker.java | Class | |
DefineGrammarItemsWalkerTokenTypes.java | Interface | |
DOTGenerator.java | Class | The DOT (part of graphviz) generation aspect. |
ErrorManager.java | Class | Defines all the errors ANTLR can generator for both the tool and for
issues with a grammar.
Here is a list of language names:
http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt
Here is a list of country names:
http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html
I use constants not strings to identify messages as the compiler will
find any errors/mismatches rather than leaving a mistyped string in
the code to be found randomly in the future. |
FASerializer.java | Class | An aspect of FA (finite automata) that knows how to dump them to serialized
strings. |
Grammar.java | Class | Represents a grammar in memory. |
GrammarAnalysisAbortedMessage.java | Class | Reports the condition that ANTLR's LL(*) analysis engine terminated
early. |
GrammarAST.java | Class | Grammars are first converted to ASTs using this class and then are
converted to NFAs via a tree walker.
The reader may notice that I have made a very non-OO decision in this
class to track variables for many different kinds of nodes. |
GrammarDanglingStateMessage.java | Class | Reports a potential parsing issue with a decision; the decision is
nondeterministic in some way. |
GrammarInsufficientPredicatesMessage.java | Class | |
GrammarNonDeterminismMessage.java | Class | Reports a potential parsing issue with a decision; the decision is
nondeterministic in some way. |
GrammarReport.java | Class | |
GrammarSanity.java | Class | Factor out routines that check sanity of rules, alts, grammars, etc.. |
GrammarSemanticsMessage.java | Class | A problem with the symbols and/or meaning of a grammar such as rule
redefinition. |
GrammarSyntaxMessage.java | Class | |
GrammarUnreachableAltsMessage.java | Class | Reports a potential parsing issue with a decision; the decision is
nondeterministic in some way. |
Interp.java | Class | Interpret any ANTLR grammar:
java Interp file.g tokens-to-ignore start-rule input-file
java Interp C.g 'WS COMMENT' program t.c
where the WS and COMMENT are the names of tokens you want to have
the parser ignore. |
Interpreter.java | Class | The recognition interpreter/engine for grammars. |
LeftRecursionCyclesMessage.java | Class | Similar to LeftRecursionMessage except this is used for announcing
cycles found by walking rules without decisions; the other msg is
invoked when a decision DFA construction finds a problem in closure. |
Message.java | Class | The ANTLR code calls methods on ErrorManager to report errors etc...
Rather than simply pass these arguments to the ANTLRErrorListener directly,
create an object that encapsulates everything. |
NameSpaceChecker.java | Class | |
NFAFactory.java | Class | Routines to construct StateClusters from EBNF grammar constructs.
No optimization is done to remove unnecessary epsilon edges.
TODO: add an optimization that reduces number of states and transitions
will help with speed of conversion and make it easier to view NFA. |
NonRegularDecisionMessage.java | Class | More a single alternative recurses so this decision is not regular. |
RandomPhrase.java | Class | Generate a random phrase given a grammar. |
RecursionOverflowMessage.java | Class | Indicates recursion overflow. |
Rule.java | Class | |
RuleLabelScope.java | Class | |
ToolMessage.java | Class | A generic message from the tool such as "file not found" type errors; there
is no reason to create a special object for each error unlike the grammar
errors, which may be rather complex. |
TreeToNFAConverter.java | Class | Build an NFA from a tree representing an ANTLR grammar. |
TreeToNFAConverterTokenTypes.java | Interface | |