Class PgAbstractExprWithNmspc<T extends org.antlr.v4.runtime.ParserRuleContext>

Direct Known Subclasses:
PgAbstractStatements, PgDelete, PgFunctionExp, PgInsert, PgMerge, PgSelect, PgUpdate, PgValueExprWithNmspc

public abstract class PgAbstractExprWithNmspc<T extends org.antlr.v4.runtime.ParserRuleContext> extends PgAbstractExpr
Abstract expression parser with namespace support for tracking variables, references, and CTEs.
  • Method Details

    • findReference

      public Map.Entry<String,ObjectReference> findReference(String schema, String name, String column)
      Overrides:
      findReference in class AbstractExpr
      Parameters:
      schema - optional schema qualification of name, may be null
      name - alias of the referenced object
      column - optional referenced column alias, may be null
      Returns:
      a pair of (Alias, Dealiased name) where Alias is the given name. Dealiased name can be null if the name is internal to the query and is not a reference to external table.
      null if the name is not found
    • declareNamespaceVar

      public void declareNamespaceVar(String alias, String name, ObjectReference argType)
      Declares a variable in the current namespace. Variables of relation types are declared as references, rest are treated as primitives.
      Parameters:
      alias - var alias (required)
      name - var name (optional, may be null)
      argType - var type
    • addNamespaceVariable

      public void addNamespaceVariable(Pair<String,String> variable)
      Adds a "freestanding" variable (e.g. a non-table function parameter) into a special complexNamespace container.
    • addReference

      public boolean addReference(String alias, ObjectReference object)
      Clients may use this to set up pseudo-variable names before expression analysis.
    • addRawTableReference

      public void addRawTableReference(ObjectReference qualifiedTable)
    • analyze

      public abstract List<ModPair<String,String>> analyze(T ruleCtx)
      Analyzes the given rule context.
      Parameters:
      ruleCtx - the parser rule context to analyze
      Returns:
      list of modifiable pairs containing analyzed results