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

Compares the significant tokens of the analyzed SQL with those of the rendered SQL.

Both parse trees are reduced to the ordered comparison keys of their tokens. Equal sequences establish that rendering the model reproduces every significant token of the input in order; whitespace, comments, letter case of keywords, equivalent spellings of one name or literal, and the positions a database package declares as noise are not significant.

Methods§

public function keys(Node $tree, Productions $productions, LeafKeys $rules): list<string>

Answers the ordered comparison keys of the tokens of a parse tree.

Parameters

$treeNode
$productionsProductions
$rulesLeafKeys

Returns

list<string>
Called from 2
Calls 4
public function difference(list<string> $source, list<string> $rendered): ?string

Answers a description of the first difference between two key sequences, or null when they are equal.

Parameters

$sourcelist<string>
$renderedlist<string>

Returns

?string
Called from 2
Calls 2

Relations§

Instantiated in 2
Method calls 4