xtc.parser
Class ProductionVoider.Tester

java.lang.Object
  extended by xtc.tree.Visitor
      extended by xtc.parser.GrammarVisitor
          extended by xtc.parser.ProductionVoider.Tester
Enclosing class:
ProductionVoider

public static class ProductionVoider.Tester
extends GrammarVisitor

Visitor to determine which productions are voidable.


Field Summary
protected  boolean secondPhase
          The flag for whether we are currently unmarking productions.
protected  boolean voidable
          The flag for whether a production may be voided.
 
Fields inherited from class xtc.parser.GrammarVisitor
analyzer, isBound, isLastElement, isPredicate, isRepeatedOnce, isTopLevel, isVoided, needsSequence, runtime, transformInPlace
 
Constructor Summary
ProductionVoider.Tester(Runtime runtime, Analyzer analyzer)
          Create a new tester.
 
Method Summary
 Element visit(Action a)
          Visit the specified action.
 Element visit(Binding b)
          Visit the specified binding.
 java.lang.Object visit(Module m)
          Visit the specified grammar.
 Element visit(NonTerminal nt)
          Visit the specified nonterminal.
 Element visit(ParserAction pa)
          Visit the specified parser action.
 Element visit(SemanticPredicate p)
          Visit the specified semantic predicate.
 java.util.Set<NonTerminal> voidable()
          Get the set of nonterminals corresponding to voidable productions.
 
Methods inherited from class xtc.parser.GrammarVisitor
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
 
Methods inherited from class xtc.tree.Visitor
dispatch, equals, hashCode, iterate, map, mapInPlace, unableToVisit, visit
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

secondPhase

protected boolean secondPhase
The flag for whether we are currently unmarking productions.


voidable

protected boolean voidable
The flag for whether a production may be voided.

Constructor Detail

ProductionVoider.Tester

public ProductionVoider.Tester(Runtime runtime,
                               Analyzer analyzer)
Create a new tester.

Parameters:
runtime - The runtime.
analyzer - The analyzer utility.
Method Detail

voidable

public java.util.Set<NonTerminal> voidable()
Get the set of nonterminals corresponding to voidable productions. Note that this method must only be called after visiting the corresponding grammar with this visitor.

Returns:
The set of voidable nonterminals.

visit

public java.lang.Object visit(Module m)
Visit the specified grammar.

Overrides:
visit in class GrammarVisitor

visit

public Element visit(Binding b)
Visit the specified binding.

Overrides:
visit in class GrammarVisitor

visit

public Element visit(NonTerminal nt)
Visit the specified nonterminal.


visit

public Element visit(SemanticPredicate p)
Visit the specified semantic predicate.

Overrides:
visit in class GrammarVisitor

visit

public Element visit(Action a)
Visit the specified action.


visit

public Element visit(ParserAction pa)
Visit the specified parser action.

Overrides:
visit in class GrammarVisitor


Copyright © 2012. All Rights Reserved.