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
Called from 779
Calls 4
public function symbol(string $symbol): $this

Writes punctuation or an operator made of symbol characters only.

Parameters

$symbolstring

Returns

$this
Test cases 1
Called from 133
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
Called from 85
Calls 4
public function node(?Node $node): $this

Writes a child node, when there is one.

Parameters

$node?Node

Returns

$this
Test cases 29
Called from 195
public function list(list<Node> $nodes, string $separator = ','): $this

Writes child nodes separated by a symbol.

Parameters

$nodeslist<Node>
$separatorstring

Returns

$this
Test cases 9
Called from 13
Calls 1
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
Calls 5
public function trailing(): string

Answers the trivia a layout wrote after the last piece, when nothing followed it.

Returns

string
Called from 1
public function canonical(): list<Piece>

Answers the pieces as the structure renders them, before any layout re-spelled them, for validation.

Returns

list<Piece>
Called from 1
public function pieces(): list<Piece>

Answers the pieces written so far.

Returns

list<Piece>
Test cases 252
Called from 1

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 252§

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

Other tests reaching this symbol 252

Relations§

Instantiated in 1
Method calls 1216
Type declarations 544