Class PushDownVariantsVisitor


  • public class PushDownVariantsVisitor
    extends Visitor
    A visitor which pushes the variant nodes down to the bottom of the tree.

    Expectation of a tree at input, e.g.:

       Rule
         Variant
           Mask
             Pattern
               ...
                 Mask
                   Pattern
     

    Expectation of the tree at output:

       Rule
         Mask
           Pattern
             ...
               Mask
                 Pattern
                   Variant
     
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void visit​(Mask mask)
      Saves the topmost mask of the variant and dettaches it from the variant.
      void visit​(Pattern pattern)
      Attaches the variant to the bottommost pattern.
      void visit​(Rule rule)
      Attaches the top mask of each variant to the rule.
      void visit​(Variant variant)
      Saves the current variant and detaches the variant from the rule if at least one variant's child is a mask.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PushDownVariantsVisitor

        public PushDownVariantsVisitor()