dk.brics.servletvalidator
Class UnitProductionRemovalVisitor

java.lang.Object
  extended by dk.brics.servletvalidator.grammar.AbstractGrammarEntityVisitor
      extended by dk.brics.servletvalidator.UnitProductionRemovalVisitor
All Implemented Interfaces:
GrammarEntityVisitor

public class UnitProductionRemovalVisitor
extends AbstractGrammarEntityVisitor

Removes all unit productions n1 the Grammar. Assumes that EpsilonRemovalVisitor has already been run on the Grammar so that no ε productions exist. Uses the algorithm described in [Martin]


Field Summary
 
Fields inherited from class dk.brics.servletvalidator.grammar.AbstractGrammarEntityVisitor
marked
 
Constructor Summary
UnitProductionRemovalVisitor()
           
 
Method Summary
 void apply(Grammar g)
           
 void out(Production production)
           
 boolean shouldPrettyPrint()
          If this method returns true the grammar will be printed to debug after the visitor has run
 
Methods inherited from class dk.brics.servletvalidator.grammar.AbstractGrammarEntityVisitor
apply, apply, apply, getPath, in, in, in, isMarked, mark, out, out, print
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnitProductionRemovalVisitor

public UnitProductionRemovalVisitor()
Method Detail

apply

public void apply(Grammar g)
Specified by:
apply in interface GrammarEntityVisitor
Overrides:
apply in class AbstractGrammarEntityVisitor

out

public void out(Production production)
Specified by:
out in interface GrammarEntityVisitor
Overrides:
out in class AbstractGrammarEntityVisitor

shouldPrettyPrint

public boolean shouldPrettyPrint()
Description copied from class: AbstractGrammarEntityVisitor
If this method returns true the grammar will be printed to debug after the visitor has run

Specified by:
shouldPrettyPrint in interface GrammarEntityVisitor
Overrides:
shouldPrettyPrint in class AbstractGrammarEntityVisitor


Copyright © 2008 Mathias Schwarz.