classPublication
final class Publication
Establishes everything an operation publishes: audited structure, complete facts, and corresponding SQL.
Rule: CORE-PUBLICATION-001. (1) The structure is audited against the closed immutable value domain. (2) The statement derives its facts against the context; every scalar, relation and query node must have received a fact. (3) The structure is rendered to typed pieces and joined to text. (4) The text is parsed under the same profile and lowered by the same rules, and the result must correspond operand by operand to the structure. Spelled regions must only re-spell the rendered tokens (CORE-SPELLING-001). Any failure discards the candidate. Trusted: the parser, the lowering and derivation rules, and these checks. Status: Implemented.
Methods§
public function establish(AnalysisContext $context, Statement $statement): array{Facts, string}Derives the facts and the checked SQL of a statement.
Parameters
$context | AnalysisContext | |
$statement | Statement |
Returns
array{Facts, string}Throws
InvariantViolation When the rendered SQL does not correspond to the structureCalled from 1
Calls 21
- static-call Platform::shared() line 48
- new ValueGraph line 49
- method-call ValueGraph::objects() line 50
- new Derivation line 52
- method-call Derivation::statement() line 53
- method-call Derivation::facts() line 54
- static-call Check::invariant() line 57
- new Output line 62
- method-call Statement::render() line 63
- method-call Lexical::join() line 64
- new Lexical line 64
- method-call Output::pieces() line 64
- method-call Output::trailing() line 64
- method-call Spellings::check() line 65
- new Spellings line 65
- method-call Output::canonical() line 65
- new InvariantViolation line 69
- method-call Equivalence::difference() line 71
- new Equivalence line 71
- method-call Publication::root() line 71
- new Leaves line 71
Answers the root of a lowered input: its only statement, or a script of none or several.
Parameters
$statements | list<Statement> |