Class EmptyScope

Object
gudusoft.gsqlparser.resolver2.scope.EmptyScope
All Implemented Interfaces:
IScope

public class EmptyScope extends Object implements IScope
Empty scope - terminates the scope chain. This is the parent of GlobalScope, providing base-case behavior. All resolution methods do nothing or return empty/null.
  • Field Details

  • Method Details

    • getParent

      public IScope getParent()
      Description copied from interface: IScope
      Get the parent scope. Root scope (GlobalScope) has EmptyScope as parent.
      Specified by:
      getParent in interface IScope
      Returns:
      Parent scope, never null
    • getNode

      Description copied from interface: IScope
      Get the associated AST node
      Specified by:
      getNode in interface IScope
      Returns:
      AST node for this scope
    • getScopeType

      Description copied from interface: IScope
      Get the scope type
      Specified by:
      getScopeType in interface IScope
      Returns:
      Scope type enum
    • resolve

      public void resolve(List<String> names, INameMatcher matcher, boolean deep, IResolved resolved)
      Description copied from interface: IScope
      Resolve a qualified or unqualified name. This is the core method for name resolution.
      Specified by:
      resolve in interface IScope
      Parameters:
      names - Name parts (e.g., ["schema", "table", "column"])
      matcher - Name matcher for case sensitivity rules
      deep - Whether to recursively resolve into record fields
      resolved - Callback to collect all matches
    • resolveTable

      public INamespace resolveTable(String tableName)
      Description copied from interface: IScope
      Resolve a table name or alias to its namespace.
      Specified by:
      resolveTable in interface IScope
      Parameters:
      tableName - Table name or alias
      Returns:
      Namespace if found, null otherwise
    • addChild

      public void addChild(INamespace namespace, String alias, boolean nullable)
      Description copied from interface: IScope
      Add a child namespace to this scope. Typically used in FROM clauses to add tables/subqueries.
      Specified by:
      addChild in interface IScope
      Parameters:
      namespace - The namespace to add
      alias - The alias for this namespace
      nullable - Whether this namespace is nullable (e.g., RIGHT side of LEFT JOIN)
    • getChildren

      Description copied from interface: IScope
      Get all child namespaces in this scope.
      Specified by:
      getChildren in interface IScope
      Returns:
      List of scope children
    • getVisibleNamespaces

      Description copied from interface: IScope
      Get all namespaces visible in this scope. Includes children and namespaces from parent scopes.
      Specified by:
      getVisibleNamespaces in interface IScope
      Returns:
      List of visible namespaces
    • fullyQualify

      Description copied from interface: IScope
      Fully qualify a name based on this scope. E.g., "col" -> "table.col" if only one table has that column
      Specified by:
      fullyQualify in interface IScope
      Parameters:
      name - Name to qualify
      Returns:
      Qualified name
    • isWithin

      public boolean isWithin(IScope ancestorScope)
      Description copied from interface: IScope
      Check if this scope is within (nested inside) another scope.
      Specified by:
      isWithin in interface IScope
      Parameters:
      ancestorScope - Potential ancestor scope
      Returns:
      true if this scope is nested within ancestorScope
    • toString

      public String toString()
      Overrides:
      toString in class Object