final class Output
Restricted visibility: declared "@visibility SqlSemantics". Code outside that scope must not name this declaration.

The typed, temporary output a statement structure is written to.

Nodes add keywords, punctuation, names and literal spellings; there is no operation that adds a free SQL fragment. The pieces are joined into text by the lexical writer and the result is parsed again and compared with the structure before an operation is published.

Methods§

public function __construct(private Codec $codec)

Parameters

$codecCodecThe name codec of the language profile
public function keyword(string ...$words): $this

Writes fixed keywords.

Parameters

$wordsstring

Returns

$this
Test cases 4
Called from 190
Calls 4
public function symbol(string $symbol): $this

Writes punctuation or an operator made of symbol characters only.

Parameters

$symbolstring

Returns

$this
Test cases 3
Called from 39
Calls 4
public function name(Name $name, NameUse $use = NameUse::Column): $this

Writes a decoded name, spelled by the profile codec for its position.

Parameters

$nameName
$useNameUse

Returns

$this
Test cases 2
Called from 38
Calls 4
public function spelled(string $text): $this

Writes the spelling a literal or parameter value produces from its exact value.

Parameters

$textstring

Returns

$this
Test cases 2
Called from 9
Calls 3
public function node(?Node $node): $this

Writes a child node, when there is one.

Parameters

$node?Node

Returns

$this
Test cases 2
Called from 49
public function layout(?Layout $layout, Node $node): $this

Writes a node in the spelling of a layout, or regularly when there is none.

The node renders its pieces as always; each piece then takes the spelling and the preceding trivia of the layout token at its position, and the next piece written takes the trailing trivia of the layout. Inside a spelled region a nested layout has no effect, since the outer layout spells every token of the region.

Parameters

$layout?Layout
$nodeNode

Returns

$this

Throws

InvariantViolation When the layout does not have one token per rendered piece
Test cases 4
Called from 1
Calls 5
public function trailing(): string
public function canonical(): list<Piece>
public function pieces(): list<Piece>

Answers the pieces written so far.

Returns

list<Piece>
Test cases 26
Called from 2

Private surface 6§

Implementation details, listed for orientation only.

private list<Piece> $pieces = []
private bool $glue = false
private bool $spelling = false
private ?string $trail = null
private list<Piece> $canonical = []
private Codec $codec

Test cases 32§

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

Dedicated tests 18
Other tests reaching this symbol 14

Relations§

Instantiated in 2
Method calls 335
Type declarations 125