Class MsAbstractExprWithNmspc<T>

java.lang.Object
org.pgcodekeeper.core.parsers.antlr.ms.expr.MsAbstractExpr
org.pgcodekeeper.core.parsers.antlr.ms.expr.MsAbstractExprWithNmspc<T>
Type Parameters:
T - analyzed expression, should be extension of ParserRuleContext or a rulectx wrapper class
Direct Known Subclasses:
MsDelete, MsExprWithNmspc, MsInsert, MsMerge, MsSelect, MsUpdate

public abstract class MsAbstractExprWithNmspc<T> extends MsAbstractExpr
Abstract base class for analyzing Microsoft SQL expressions with namespace support. Provides functionality for managing table aliases, common table expressions (CTEs), and resolving object references within a specific namespace context.
Author:
levsha_aa
  • Method Details

    • addReference

      public boolean addReference(String alias, GenericColumn object)
      Adds a reference to the namespace with the specified alias. Clients may use this to setup pseudo-variable names before expression analysis.
      Parameters:
      alias - the alias name for the reference
      object - the database object being referenced, may be null for internal query names
      Returns:
      true if the reference was added successfully, false if alias already exists
    • addRawTableReference

      public void addRawTableReference(GenericColumn qualifiedTable)
      Adds an unaliased table reference to the namespace. Used for tables that don't have explicit aliases in the FROM clause.
      Parameters:
      qualifiedTable - the fully qualified table reference to add
    • analyze

      public abstract List<String> analyze(T ruleCtx)
      Analyzes the given rule context and returns a list of column names. Implementations should process the specific Microsoft SQL expression type and extract relevant database dependencies and column information.
      Parameters:
      ruleCtx - the parser rule context to analyze
      Returns:
      list of column names found during analysis