Class VisitorWithResult

  • All Implemented Interfaces:
    Visitor
    Direct Known Subclasses:
    ReflectiveVisitor

    public abstract class VisitorWithResult
    extends Object
    implements Visitor
    Sometimes it will be necessary - for example in dialects - to change the flow of elements visted. Some vistables will react on Visitor.enterWithResult(Visitable) and change course (not all and we don't give any guarantees on any behaviour). This class has been introduced for visitors providing such a behaviour so that an implementation doesn't need to deal with an empty Visitor.enter(Visitable) method.
    Since:
    2022.3.0
    Author:
    Michael J. Simons
    • Constructor Detail

      • VisitorWithResult

        public VisitorWithResult()
    • Method Detail

      • enter

        public final void enter​(Visitable segment)
        Description copied from interface: Visitor
        Enter a Visitable. Not all visitables will obey to the result
        Specified by:
        enter in interface Visitor
        Parameters:
        segment - the segment to visit.