Class ModificationVisitor

java.lang.Object
edu.iu.jrsalata.ModificationVisitor
All Implemented Interfaces:
VisitorInterface

public class ModificationVisitor extends Object implements VisitorInterface
The ModificationVisitor class implements the VisitorInterface and is used to collect modification records from ExtendedStatement objects. It maintains a queue to store the modification information. This visitor does not perform any actions on other types of statements as no other type of statements generate modification records
  • Field Details

    • modifications

      protected Queue<String> modifications
      queue to store modification information
  • Constructor Details

    • ModificationVisitor

      public ModificationVisitor()
      Constructs a new ModificationVisitor instance. Initializes the modifications list as a LinkedList.
  • Method Details

    • visit

      public void visit(Statement statement)
      Description copied from interface: VisitorInterface
      Visits the given statement.
      Specified by:
      visit in interface VisitorInterface
      Parameters:
      statement - a given statement to visit
    • visit

      public void visit(BaseStatement statement)
      Description copied from interface: VisitorInterface
      Visits the given statement.
      Specified by:
      visit in interface VisitorInterface
      Parameters:
      statement - a given statement to visit
    • visit

      public void visit(SicStatement statement)
      Description copied from interface: VisitorInterface
      Visits the given statement.
      Specified by:
      visit in interface VisitorInterface
      Parameters:
      statement - a given statement to visit
    • visit

      public void visit(SingleStatement statement)
      Description copied from interface: VisitorInterface
      Visits the given statement.
      Specified by:
      visit in interface VisitorInterface
      Parameters:
      statement - a given statement to visit
    • visit

      public void visit(ExtendedStatement statement)
      Visits an ExtendedStatement and adds its modification to the list of modifications if the modification is not an empty string.
      Specified by:
      visit in interface VisitorInterface
      Parameters:
      statement - the ExtendedStatement to visit
    • visit

      public void visit(DirectiveStatement statement)
      Description copied from interface: VisitorInterface
      Visits the given statement.
      Specified by:
      visit in interface VisitorInterface
      Parameters:
      statement - a given statement to visit
    • visit

      public void visit(RegisterStatement statement)
      Description copied from interface: VisitorInterface
      Visits the given statement.
      Specified by:
      visit in interface VisitorInterface
      Parameters:
      statement - a given statement to visit
    • getStrings

      public Queue<String> getStrings()
      Retrieves the queue of modification strings.
      Specified by:
      getStrings in interface VisitorInterface
      Returns:
      a Queue containing the modification strings.