classTokenCorrespondence
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
$tree | Node | |
$productions | Productions | |
$rules | LeafKeys |
Returns
list<string>Called from 2
Calls 4
- method-call Productions::signature() line 33
- function-call
countline 35 - function-call
array_popline 38 - method-call LeafKeys::key() line 44
public function difference(list<string> $source, list<string> $rendered): ?stringAnswers a description of the first difference between two key sequences, or null when they are equal.
Parameters
$source | list<string> | |
$rendered | list<string> |
Returns
?stringCalled from 2
Relations§
Instantiated in 2
Method calls 4
- method-call SqlSemantics\Platform\MySql\Model\Validation\Spellings::check() packages/sql-semantics-mysql/src/Model/Validation/Spellings.php:55
- method-call SqlSemantics\Platform\MySql\Model\Validation\Spellings::check() packages/sql-semantics-mysql/src/Model/Validation/Spellings.php:55
- method-call SqlSemantics\Platform\MySql\Semantics::inspect() packages/sql-semantics-mysql/src/Semantics.php:173
- method-call SqlSemantics\Platform\MySql\Semantics::inspect() packages/sql-semantics-mysql/src/Semantics.php:173