Class CustomParseTreeListener

java.lang.Object
org.pgcodekeeper.core.database.base.parser.CustomParseTreeListener
All Implemented Interfaces:
org.antlr.v4.runtime.tree.ParseTreeListener

public final class CustomParseTreeListener extends Object implements org.antlr.v4.runtime.tree.ParseTreeListener
Custom ANTLR parse tree listener that monitors parsing progress and checks for cancellation. Provides basic progress tracking during parsing operations.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CustomParseTreeListener(int monitoringLevel, IMonitor monitor)
    Creates a new parse tree listener with progress monitoring.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    enterEveryRule(org.antlr.v4.runtime.ParserRuleContext ctx)
     
    void
    exitEveryRule(org.antlr.v4.runtime.ParserRuleContext ctx)
    Called when exiting any parser rule in the parse tree.
    void
    visitErrorNode(org.antlr.v4.runtime.tree.ErrorNode node)
    Called when visiting an error node in the parse tree.
    void
    visitTerminal(org.antlr.v4.runtime.tree.TerminalNode node)
    Called when entering a terminal node in the parse tree.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CustomParseTreeListener

      public CustomParseTreeListener(int monitoringLevel, IMonitor monitor)
      Creates a new parse tree listener with progress monitoring.
      Parameters:
      monitoringLevel - the depth level at which to report progress
      monitor - the progress monitor to report to (cannot be null)
  • Method Details

    • visitTerminal

      public void visitTerminal(org.antlr.v4.runtime.tree.TerminalNode node)
      Called when entering a terminal node in the parse tree. This implementation does nothing.
      Specified by:
      visitTerminal in interface org.antlr.v4.runtime.tree.ParseTreeListener
      Parameters:
      node - the terminal node being entered
    • visitErrorNode

      public void visitErrorNode(org.antlr.v4.runtime.tree.ErrorNode node)
      Called when visiting an error node in the parse tree. This implementation does nothing.
      Specified by:
      visitErrorNode in interface org.antlr.v4.runtime.tree.ParseTreeListener
      Parameters:
      node - the error node being visited
    • exitEveryRule

      public void exitEveryRule(org.antlr.v4.runtime.ParserRuleContext ctx)
      Called when exiting any parser rule in the parse tree. Checks for cancellation and reports progress when exiting rules at or above monitoring level.
      Specified by:
      exitEveryRule in interface org.antlr.v4.runtime.tree.ParseTreeListener
      Parameters:
      ctx - the parser rule context being exited
      Throws:
      MonitorCancelledRuntimeException - if parsing was cancelled
    • enterEveryRule

      public void enterEveryRule(org.antlr.v4.runtime.ParserRuleContext ctx)
      Specified by:
      enterEveryRule in interface org.antlr.v4.runtime.tree.ParseTreeListener