final class ExpressionRule
Restricted visibility: declared "@visibility SqlSemantics\Platform\Sqlite". Code outside that scope must not name this declaration.

Lowers expression productions into scalar structure.

Rule: SQLITE-EXPR-001. Scope: expr (the forms that are no operator and no function call), exprlist, nexprlist, paren_exprlist, where_opt, case_operand, case_exprlist, case_else. Operands keep their written order and every parenthesis pair is kept as a grouping, so the structure states the evaluation order the parser chose. An unqualified word is a column use, a double-quoted word or a truth word by how it is written (SQLITE-DOUBLE-QUOTED-WORD-001, SQLITE-TRUTH-WORD-001). Terminates: every operand is a strict subtree and lists are flattened iteratively. Source: https://sqlite.org/lang_expr.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
Calls 1
public function expression(Node $expression): Scalar

Lowers one expression.

Parameters

$expressionNode

Returns

Called from 10
Calls 17
public function word(Token $token): Scalar

Lowers an unqualified word by how it is written: in double quotes, as bare TRUE or FALSE, or as any other name.

Parameters

$tokenToken

Returns

Called from 1
Calls 5
public function parameter(Token $token): BindParameter

Lowers a bind parameter token and records it as an operand leaf.

Parameters

$tokenToken
Called from 1
Calls 3
public function conditional(Node $operand, Node $branches, Node $otherwise): CaseExpression

Lowers a CASE expression from its operand, branches and ELSE part.

Parameters

$operandNode
$branchesNode
$otherwiseNode

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 8
public function list(Node $exprlist): list<Scalar>

Lowers an exprlist into its expressions in written order.

Parameters

$exprlistNode

Returns

list<Scalar>

Throws

ImplementationGap When the production has no rule
Called from 1
Calls 2
public function optionalList(Node $list): list<Scalar>|null

Lowers a paren_exprlist: the expressions, or null when no parentheses are written.

Parameters

$listNode

Returns

list<Scalar>|null

Throws

ImplementationGap When the production has no rule
Calls 2
public function where(Node $where): ?Scalar

Lowers a where_opt: the predicate, or null when the clause is absent.

Parameters

$whereNode

Returns

Throws

ImplementationGap When the production has no rule
Calls 2

Private surface 2§

Implementation details, listed for orientation only.

private OperatorRule $operators
private Lowering $lowering

Test cases 1§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1

Relations§

Instantiated in 1
Type declarations 1