All Known Subinterfaces:
FunctionSymbol, RelationSymbol
All Known Implementing Classes:
DatabaseRelationSymbol, InlineRelationSymbol, QueryRelationSymbol, RelationFunctionSymbol, ScalarFunctionSymbol, SourceRelationSymbol, SystemRelationSymbol

public sealed interface Symbol permits RelationSymbol, FunctionSymbol
Root sealed interface for every named entity registered in a SymbolTable.

The two immediate branches of the hierarchy are:

  • RelationSymbol — database tables, inline (markdown) tables, and named query expressions.
  • FunctionSymbol — scalar functions, both built-in and user-defined.

Naming

Each symbol stores its name in two forms:

  • declaredName() — case-preserved, exactly as the user typed it.
  • canonicalName() — lower-cased; used as the lookup key so that all name resolution is case-insensitive.

Namespaces

Every symbol belongs to a namespace(). Symbols declared in a .relix file without an explicit namespace declaration are placed in the "default" namespace. Built-in symbols use the "builtin" namespace.

Shadow policy

When a new symbol is registered under a name that already exists in the same namespace, the shadowPolicy() of the existing symbol governs whether the replacement is allowed.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    The lower-cased form of declaredName(), used as the lookup key in the symbol table to ensure case-insensitive resolution.
    The name exactly as declared by the user or the runtime, with original casing.
    The namespace this symbol belongs to.
    Whether this symbol was supplied by the runtime or declared by a user.
    The policy that governs whether this symbol may be replaced by a later registration under the same name.
  • Method Details

    • namespace

      String namespace()
      The namespace this symbol belongs to.
      Returns:
      a non-blank namespace string; "default" for user symbols, "builtin" for runtime-provided symbols
    • declaredName

      String declaredName()
      The name exactly as declared by the user or the runtime, with original casing.
      Returns:
      the declared name; never blank
    • canonicalName

      default String canonicalName()
      The lower-cased form of declaredName(), used as the lookup key in the symbol table to ensure case-insensitive resolution.
      Returns:
      declaredName().toLowerCase(Locale.ROOT)
    • provenance

      Provenance provenance()
      Whether this symbol was supplied by the runtime or declared by a user.
      Returns:
      the provenance; never null
    • shadowPolicy

      ShadowPolicy shadowPolicy()
      The policy that governs whether this symbol may be replaced by a later registration under the same name.
      Returns:
      the shadow policy; never null