Dresden OCL Toolkit

tudresden.ocl.normalize
Interface NodeNormalizer

All Known Implementing Classes:
CollectShorthandExpansion, ConstraintNaming, DefaultContextInsertion, IteratorInsertion, TypeInformationInsertion

public interface NodeNormalizer

By implementing this interface, normalizations on tree nodes are possible. More complex normalization steps might need to be implemented as TreeNormalizers. The class NormalizerPass, objects of which usually invoke NodeNormalizer objects, traverses an AST left-recursive, and calls the method normalize with each tree node before descending further "down" the tree (the trees root is on top, of course...). Modifications to the node will take effect immediatle, i.e. they will effect the further recursion. For token nodes, which are leaf nodes, the method normalize is not called.

Author:
Frank Finger
See Also:
TreeNormalizer

Method Summary
 void close(OclTree tree, NormalizerPass pass)
          This method notifies the NodeNormalizer of the end of a tree normalization.
 void normalize(Node n, OclTree tree)
          normalize a single node
 void open(OclTree tree, NormalizerPass pass)
          allows the NodeNormalizers to initialize itself.
 

Method Detail

normalize

public void normalize(Node n,
                      OclTree tree)
normalize a single node


open

public void open(OclTree tree,
                 NormalizerPass pass)
allows the NodeNormalizers to initialize itself. In this method, a NodeNormalizer typically makes sure that the AST fulfills the preconditions it requires and then registers its own postconditions.


close

public void close(OclTree tree,
                  NormalizerPass pass)
This method notifies the NodeNormalizer of the end of a tree normalization. Here new invariants on the tree can be registered that were not registered in open() already


Dresden OCL Toolkit

Submit a bug
Developed at the Dresden University of Technology.
This software is published under the GNU Lesser General Public License.