Class CustomTSQLParserListener

java.lang.Object
org.pgcodekeeper.core.parsers.antlr.base.CustomParserListener<MsDatabase>
org.pgcodekeeper.core.parsers.antlr.ms.CustomTSQLParserListener
All Implemented Interfaces:
AntlrContextProcessor<TSQLParser.Tsql_fileContext>, TSqlContextProcessor

public final class CustomTSQLParserListener extends CustomParserListener<MsDatabase> implements TSqlContextProcessor
Custom ANTLR listener for parsing Microsoft SQL Server (T-SQL) statements. Processes CREATE, ALTER, DROP statements and builds database schema model.
  • Constructor Details

    • CustomTSQLParserListener

      public CustomTSQLParserListener(MsDatabase database, String filename, ParserListenerMode mode, List<Object> errors, IMonitor monitor, ISettings settings)
      Creates a new Microsoft SQL Server parser listener.
      Parameters:
      database - the target database schema to populate
      filename - name of the file being parsed
      mode - parsing mode
      errors - list to collect parsing errors
      monitor - progress monitor for cancellation support
      settings - application settings
  • Method Details

    • process

      public void process(TSQLParser.Tsql_fileContext rootCtx, org.antlr.v4.runtime.CommonTokenStream stream)
      Processes the complete T-SQL file context. Extracts and processes all batches and statements in the file.
      Specified by:
      process in interface AntlrContextProcessor<TSQLParser.Tsql_fileContext>
      Parameters:
      rootCtx - the root file context from ANTLR parser
      stream - the token stream associated with the context
    • clause

      public void clause(TSQLParser.St_clauseContext st)
      Processes a single T-SQL clause
      Parameters:
      st - the clause context to process