ua.gradsoft.termware.strategies
Class AbstractTermRewritingStrategy

java.lang.Object
  extended by ua.gradsoft.termware.AbstractBuildinTransformer
      extended by ua.gradsoft.termware.strategies.AbstractTermRewritingStrategy
All Implemented Interfaces:
ITermRewritingStrategy, ITermTransformer
Direct Known Subclasses:
BTStrategy, FirstTopStrategy, NFirstTopsStrategy, TopDownStrategy

public abstract class AbstractTermRewritingStrategy
extends AbstractBuildinTransformer
implements ITermRewritingStrategy

Base class for rewriting strategies. Strategy maintain set of transformers and in own transform method do applying of this transformers via subclass-specifics mechanism.


Constructor Summary
AbstractTermRewritingStrategy()
          constructor
 
Method Summary
 TransformersStar getStar()
          return set of transformers inside strategy.
 boolean hasOtherwise()
          true, if underlaying transformers include transformer for OTHERWISE keyword.
 boolean internalsAtFirst()
           
abstract  Term transform(Term t, TermSystem system, TransformationContext ctx)
          main work of strategy is here: transform term t in system by applying transformers in 'Star' via subclass-specific algorithm.
 
Methods inherited from class ua.gradsoft.termware.AbstractBuildinTransformer
getDescription, getName, getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ua.gradsoft.termware.ITermTransformer
getDescription, getName, getSource
 

Constructor Detail

AbstractTermRewritingStrategy

public AbstractTermRewritingStrategy()
constructor

Method Detail

internalsAtFirst

public boolean internalsAtFirst()

transform

public abstract Term transform(Term t,
                               TermSystem system,
                               TransformationContext ctx)
                        throws TermWareException
main work of strategy is here: transform term t in system by applying transformers in 'Star' via subclass-specific algorithm.

Specified by:
transform in interface ITermRewritingStrategy
Specified by:
transform in interface ITermTransformer
Parameters:
t - - term to transform
system - - system which we use
ctx - - context of transformation
Returns:
- transformed term.
Throws:
TermWareException

getStar

public TransformersStar getStar()
return set of transformers inside strategy.

Specified by:
getStar in interface ITermRewritingStrategy
Returns:
star of transformers

hasOtherwise

public boolean hasOtherwise()
true, if underlaying transformers include transformer for OTHERWISE keyword.

Specified by:
hasOtherwise in interface ITermRewritingStrategy