xtc.parser
Class RootFinder
java.lang.Object
xtc.tree.Visitor
xtc.parser.GrammarVisitor
xtc.parser.RootFinder
public class RootFinder
- extends GrammarVisitor
Visitor to identify a grammar's real root. A real root is a
top-level nonterminal, whose production directly or indirectly
depends on all other top-level nonterminals. If a grammar has such
a root, this visitor annotates the grammar with the root property.
Note that this visitor assumes that the entire grammar is
contained in a single module.
- Version:
- $Revision: 1.12 $
- Author:
- Robert Grimm
|
Field Summary |
protected java.util.Set<NonTerminal> |
topLevel
The set of qualified top-level nonterminals. |
| Methods inherited from class xtc.parser.GrammarVisitor |
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
topLevel
protected java.util.Set<NonTerminal> topLevel
- The set of qualified top-level nonterminals.
RootFinder
public RootFinder(Runtime runtime,
Analyzer analyzer)
- Create a new root finder.
- Parameters:
runtime - The runtime.analyzer - The analyzer utility.
visit
public java.lang.Object visit(Module m)
- Visit the specified grammar.
- Overrides:
visit in class GrammarVisitor
visit
public Element visit(NonTerminal nt)
- Visit the specified nonterminal.
Copyright © 2012. All Rights Reserved.