Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface BuiltinProvider
Hook for registering built-in symbols into the symbol table before any user-defined symbols are processed.

Implement this interface to provide functions and/or relations that are available in every .relix script without an explicit import. Common examples include mathematical functions (abs, ceil, floor), string utilities (length, upper), and aggregate helpers (coalesce, now).

The interface is FunctionalInterface so it can be expressed as a lambda or method reference:

   BuiltinProvider myBuiltins = table -> {
       table.register(ScalarFunctionSymbol.builder("length")
           .namespace("builtin")
           .provenance(Provenance.BUILTIN)
           .shadowPolicy(ShadowPolicy.FORBIDDEN)
           .parameter("s", ScalarType.STRING)
           .returnType(ScalarType.NUMBER)
           .build());
   };

   SemanticAnalyzer analyzer = new SemanticAnalyzer(loader, myBuiltins);
 

Use none() to explicitly pass a no-op provider.

  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a BuiltinProvider that registers nothing.
    void
    register(SymbolTable symbolTable)
    Registers built-in symbols into symbolTable.
  • Method Details

    • register

      void register(SymbolTable symbolTable)
      Registers built-in symbols into symbolTable.

      Called once, before user-defined symbols are collected. Any symbol registered here is visible to every script processed by the analyser.

      Parameters:
      symbolTable - the symbol table to populate; never null
    • none

      static BuiltinProvider none()
      Returns a BuiltinProvider that registers nothing.
      Returns:
      a no-op provider