Class Rewriter

java.lang.Object
eu.bandm.tools.format.Rewriter
Direct Known Subclasses:
ReferenceRewriter

public class Rewriter extends Object
General purpose Rewriter. Any instance must override the methods where the rewritten structure shall be changed. The exchanged subformat must be assigned to result and must not be null.
  • Field Details

    • result

      protected Format result
      Intermediate register for the rewriting result.
  • Constructor Details

    • Rewriter

      public Rewriter()
      Sole constructor.
  • Method Details

    • rewrite

      public Format rewrite(Format f)
      Service point: start the rewriting process with the given format and return the result.
      Parameters:
      f - the starting point of the rewriting process.
      Returns:
      the result of rewriting
    • action

      public void action(Object o)
    • action

      public void action(Format f)
    • action

      public void action(Compound f)
    • action

      public void action(Append f)
    • action

      public void action(Beneath f)
    • action

      public void action(Beside f)
    • action

      public void action(Block f)
    • action

      public void action(Line f)
    • action

      public void action(Tabular f)
    • action

      public void action(Comment f)
    • action

      public void action(Empty f)
    • action

      public void action(Literal f)
    • action

      public void action(Markup f)
    • action

      public void action(Prior f)
    • action

      public void action(Space f)
    • action

      public void action(Annotated<?> f)
    • action

      public void action(Subst f)
    • action

      public void action(Variable f)
    • action

      public void action(BoundVariable f)
    • action

      public void action(FreeVariable f)
    • match

      default void match(Object o)
      Switch controlled by type, which calls a particular method action(f) with the most-specific class of the format.
      Parameters:
      o - the object to visit.
    • match

      default void match(Format f)
      Central switch controlled by type, which calls a particular method action(f) with the most-specific class of the format.
      Parameters:
      f - the format to visit.
    • match

      default void match(Compound f)
      Switch controlled by type, which calls a particular method action(f) with the most-specific class of the format.
      Parameters:
      f - the format to visit.
    • match

      default void match(Variable f)
      Switch conrolled by type, which calls a particular method action(f) with the most-specific class of the format.
      Parameters:
      f - the format to visit.