dk.brics.grammar.ambiguity
Class RegularApproximation2

java.lang.Object
  extended by dk.brics.grammar.ambiguity.ApproximationStrategy
      extended by dk.brics.grammar.ambiguity.RegularApproximation
          extended by dk.brics.grammar.ambiguity.RegularApproximation2

public class RegularApproximation2
extends RegularApproximation

Variation of RegularApproximation that adds extra approximation on unfolded grammars.


Field Summary
 
Fields inherited from class dk.brics.grammar.ambiguity.ApproximationStrategy
debug, g, HORIZONTAL_NOT_APPLICABLE, out, VERTICAL_NOT_APPLICABLE
 
Constructor Summary
RegularApproximation2()
          Constructs a new approximator.
 
Method Summary
 HorizontalOverlapString checkHorizontalOverlap(Production p, int index)
          Conservatively checks horizontal overlap in a production.
 VerticalOverlapString checkVerticalOverlap(Production p1, Production p2)
          Conservatively checks vertical overlap of two productions of the same nonterminal.
 String getName()
          Returns the name "regular2".
 void init()
          Initializes for the current grammar.
 
Methods inherited from class dk.brics.grammar.ambiguity.RegularApproximation
verticalDone
 
Methods inherited from class dk.brics.grammar.ambiguity.ApproximationStrategy
horizontalCheck, horizontalDone, init, printStatistics, verticalCheck
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegularApproximation2

public RegularApproximation2()
Constructs a new approximator.

Method Detail

checkHorizontalOverlap

public HorizontalOverlapString checkHorizontalOverlap(Production p,
                                                      int index)
Description copied from class: ApproximationStrategy
Conservatively checks horizontal overlap in a production. This method is typically implemented in a subclass. The default implementation returns ApproximationStrategy.HORIZONTAL_NOT_APPLICABLE.

Overrides:
checkHorizontalOverlap in class RegularApproximation
Parameters:
p - a production
index - division point
Returns:
potential example string in overlap, null if definitely no overlap, ApproximationStrategy.HORIZONTAL_NOT_APPLICABLE can be used as a "don't know" value

checkVerticalOverlap

public VerticalOverlapString checkVerticalOverlap(Production p1,
                                                  Production p2)
Description copied from class: ApproximationStrategy
Conservatively checks vertical overlap of two productions of the same nonterminal. This method is typically implemented in a subclass. The default implementation returns ApproximationStrategy.VERTICAL_NOT_APPLICABLE.

Overrides:
checkVerticalOverlap in class RegularApproximation
Parameters:
p1 - one production
p2 - another production
Returns:
potential example string in overlap, null if definitely no overlap, ApproximationStrategy.VERTICAL_NOT_APPLICABLE can be used as a "don't know" value

getName

public String getName()
Returns the name "regular2".

Overrides:
getName in class RegularApproximation
Returns:
approximation strategy name

init

public void init()
Description copied from class: ApproximationStrategy
Initializes for the current grammar. This method is typically implemented in a subclass. The default implementation does nothing. The grammar is available as ApproximationStrategy.g.

Overrides:
init in class RegularApproximation


Copyright © 2005-2008 Anders Møller.