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
ConstructorsConstructorDescriptionCustomParseTreeListener(int monitoringLevel, IMonitor monitor) Creates a new parse tree listener with progress monitoring. -
Method Summary
Modifier and TypeMethodDescriptionvoidenterEveryRule(org.antlr.v4.runtime.ParserRuleContext ctx) voidexitEveryRule(org.antlr.v4.runtime.ParserRuleContext ctx) Called when exiting any parser rule in the parse tree.voidvisitErrorNode(org.antlr.v4.runtime.tree.ErrorNode node) Called when visiting an error node in the parse tree.voidvisitTerminal(org.antlr.v4.runtime.tree.TerminalNode node) Called when entering a terminal node in the parse tree.
-
Constructor Details
-
CustomParseTreeListener
Creates a new parse tree listener with progress monitoring.- Parameters:
monitoringLevel- the depth level at which to report progressmonitor- 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:
visitTerminalin interfaceorg.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:
visitErrorNodein interfaceorg.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:
exitEveryRulein interfaceorg.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:
enterEveryRulein interfaceorg.antlr.v4.runtime.tree.ParseTreeListener
-