Class PgCustomParserListener
java.lang.Object
org.pgcodekeeper.core.database.base.parser.CustomParserListener<PgDatabase>
org.pgcodekeeper.core.database.pg.parser.PgCustomParserListener
- All Implemented Interfaces:
AntlrContextProcessor<SQLParser.SqlContext>,IPgContextProcessor
public final class PgCustomParserListener
extends CustomParserListener<PgDatabase>
implements IPgContextProcessor
Custom ANTLR listener for parsing PostgreSQL SQL statements.
Processes CREATE, ALTER, DROP statements and builds database schema model.
-
Constructor Summary
ConstructorsConstructorDescriptionPgCustomParserListener(PgDatabase database, String filename, ParserListenerMode mode, DiffSettings diffSettings, Queue<AntlrTask<?>> antlrTasks) Creates a new PostgreSQL SQL parser listener. -
Method Summary
Modifier and TypeMethodDescriptionvoidprocess(SQLParser.SqlContext rootCtx, org.antlr.v4.runtime.CommonTokenStream stream) Processes the complete SQL file context.voidstatement(SQLParser.StatementContext statement, org.antlr.v4.runtime.CommonTokenStream stream) Processes a single SQL statement.Methods inherited from class org.pgcodekeeper.core.database.base.parser.CustomParserListener
getMonitor, getSettings, handleUnresolvedReference
-
Constructor Details
-
PgCustomParserListener
public PgCustomParserListener(PgDatabase database, String filename, ParserListenerMode mode, DiffSettings diffSettings, Queue<AntlrTask<?>> antlrTasks) Creates a new PostgreSQL SQL parser listener.- Parameters:
database- the target database schema to populatefilename- name of the file being parsedmode- parsing modediffSettings- unified context object containing settings, monitor, and error accumulatorantlrTasks- queue for asynchronous parsing tasks
-
-
Method Details
-
process
Processes the complete SQL file context. Extracts and processes all statements in the file.- Specified by:
processin interfaceAntlrContextProcessor<SQLParser.SqlContext>- Parameters:
rootCtx- the root file context from ANTLR parserstream- the token stream associated with the context
-
statement
public void statement(SQLParser.StatementContext statement, org.antlr.v4.runtime.CommonTokenStream stream) Processes a single SQL statement. Routes to appropriate handler based on statement type.- Parameters:
statement- the statement context to processstream- the token stream for the statement
-