Package com.darkcollective.relix.lang.ast


package com.darkcollective.relix.lang.ast
Root scripting-language AST — the Script node and the Statement hierarchy.

A parsed .relix file is represented as a Script record containing an optional namespace string and an ordered list of Statements. The six statement kinds are:

  • EnvStatement — env from '...' using '...'; declares the environment file and active profile.
  • ImportStatement — import source X from '...'; pulls symbols from another file.
  • SourceDeclaration — source X from http { ... }; declares a virtual relation backed by an external data source.
  • AssignmentStatement — X := { RA-expr }; or X := [...]; gives a name to a query expression or an inline table.
  • DefStatement — def f(x: NUMBER): NUMBER := { expr }; defines a scalar UDF.
  • QueryStatement — query X; or query { expr }; produces output.

Embedded RA expressions (RelNode) and operand expressions (Operand) are stored as fully parsed objects produced by the relix-parser module; they are not raw strings. This keeps the AST type-safe and lets RA parse errors surface at script-parse time rather than later.

  • Class
    Description
    Sealed interface for the right-hand side of an assignment statement.
    An assignment statement — gives a name to a relational algebra expression or an inline table.
    A top-level connection NAME from <type> { … } declaration.
    A def … : relation statement — defines a table-valued (relation-returning) user-defined function.
    A def statement — defines a scalar user-defined function.
    One endpoint of a RelateStatement — a relation reference plus the ordered columns joined at this side, with optional multiplicity bounds.
    An env statement — declares the environment file and active profile used for credential and configuration variable resolution.
    A query target that holds an inline relational algebra expression.
    Classifies the kind of symbol being imported in an ImportStatement.
    An import statement — brings symbols from another .relix file into the current namespace.
    An assignment body that holds an inline data table (Markdown or CSV format).
    A query target that references a previously declared symbol by name.
    A slip the parser accepted in a script, and says what to write instead.
    An assignment body that holds a parsed relational algebra expression.
    A query statement — produces output from a named symbol or an inline relational algebra expression.
    Sealed interface for the argument of a query statement.
    A standalone schema relationship declaration:
    The root AST node for a parsed .relix script file.
    The Script authoring surface — the statement-level half of the AST contract, for tests and embedders that assemble a whole script without the .relix grammar.
    The comments a parsed script carried, each placed by the code it was written next to, so that ScriptPrinter can put it back there.
    The comments placed by one statement, and whether a blank line came before it.
    Thrown when a frontend cannot turn its input into a Script.
    Renders a Script — or one Statement — back as .relix text.
    A source declaration — names a virtual relation backed by an external data source.
    Sealed root interface for every top-level declaration in a .relix script.