Class VisitorExpressionBuilder

java.lang.Object
dev.frostlake.executor.VisitorExpressionBuilder

public class VisitorExpressionBuilder extends Object
Builds and evaluates SQL expressions on behalf of SQLCommandVisitor: the procedural expression AST (buildExpression), constant / DDL-time evaluation (evaluateExpression), and the SYSTEM$ built-in family (evaluateSystemFunc). Extracted from the visitor; identifier/text and literal helpers are reached through the visitor back-reference and engine state through queryExecutor.
  • Method Details

    • buildExpression

      public BaseExpression buildExpression(FrostlakeParser.BooleanExprContext ctx)
      Boolean tier (OR/AND/NOT) over the value/predicate `expression` below.
    • buildExpression

      public BaseExpression buildExpression(FrostlakeParser.ExpressionContext ctx)
      Build an Expression from ANTLR expression context
    • evaluateExpression

      public Object evaluateExpression(FrostlakeParser.ExpressionContext ctx)
      Simplified expression evaluation for immediate values (like DEFAULT), in a Snowflake Scripting expression context — a bare name may be a scripting variable here (a LET / := right-hand side, an IF condition, RETURN <expr>, a DECLARE … DEFAULT).
    • evaluateSqlExpression

      public Object evaluateSqlExpression(FrostlakeParser.ExpressionContext ctx)
      Evaluate an expression that sits in an embedded SQL statement rather than in a scripting expression (a CALL argument — Snowflake dispatches CALL as SQL — or a session SET value). A bare name is an identifier there, never a stored-procedure parameter / DECLAREd / LET variable: Snowflake answers invalid identifier '<NAME>' and requires the :name bind form. Session variables stay visible, as they are in Snowflake SQL.