Interface PartialParseTreeListener

All Superinterfaces:
ParseTreeListener
All Known Implementing Classes:
ProxyParseTreeListener, RunPhase, TransformationPhase, WalkPhase

public interface PartialParseTreeListener extends ParseTreeListener
Adds a method to the parse tree listener with which the parse tree walker can detect if it should stop walking the tree.
  • Method Details

    • isFinished

      default boolean isFinished()
      Returns if this parse tree listener is no longer interested in walking the tree.
      Returns:
      true if the parse tree walker should stop walking the tree entirely.
      API Usage Note:
      This method will be called at every level of the tree as the parse tree walker decides whether or not to continue iterating the children of each node.
    • isDeepEnough

      default boolean isDeepEnough(ExtendedContext node)
      Returns if this parse tree listener wants to continue to walk the tree but not go any deeper into the current (given) rule.
      Parameters:
      node - The current node in which to maybe not visit the children
      Returns:
      true if the parse tree walker
    • canStop

      default boolean canStop()
      Returns if the parse tree listener is ever interested in maybe returning true from isFinished() or isDeepEnough(ExtendedContext). If this method return false, the other two methods will never be called for better performance.
      Returns:
      true if the parse tree listener is ever interested in prematurely stopping the walk