xtc.parser
Class ReferenceCounter
java.lang.Object
xtc.tree.Visitor
xtc.parser.GrammarVisitor
xtc.parser.ReferenceCounter
public class ReferenceCounter
- extends GrammarVisitor
Visitor to fill in meta-data reference counts. This visitor
determines the usage and self counts for a grammar's productions.
Note that this visitor does not create the meta-data records; they
must be created with the meta-data creator
before applying this visitor. Further note that the grammar must
have been simplified and inlined
before applying this visitor. Finally, note that this visitor
assumes that the entire grammar is contained in a single module.
- Version:
- $Revision: 1.22 $
- Author:
- Robert Grimm
|
Field Summary |
protected boolean |
isTransformable
The flag for whether the current production is a transformable
direct left-recursive production. |
| Methods inherited from class xtc.parser.GrammarVisitor |
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 |
isTransformable
protected boolean isTransformable
- The flag for whether the current production is a transformable
direct left-recursive production.
ReferenceCounter
public ReferenceCounter(Runtime runtime,
Analyzer analyzer)
- Create a new reference counter.
- 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(OrderedChoice c)
- Visit the specified ordered choice.
- Overrides:
visit in class GrammarVisitor
visit
public Element visit(NonTerminal nt)
- Visit the specified nonterminal.
Copyright © 2012. All Rights Reserved.