final class RadixSpelling
Restricted visibility: declared "@visibility SqlSemantics\Platform\MySql". Code outside that scope must not name this declaration.

Reads and spells the digits of a hexadecimal or bit literal token.

Rule: MYSQL-RADIX-DECODE-001. Scope: the terminals HEX_NUM and BIN_NUM. Both spellings of each literal, X'1F' and 0x1F, b'101' and 0b101, denote the same value: the digits between the quotes or after the prefix. The digits are kept exactly, leading zeros and letter case included. Terminates: constant work per token. Source: https://dev.mysql.com/doc/refman/8.4/en/hexadecimal-literals.html, https://dev.mysql.com/doc/refman/8.4/en/bit-value-literals.html. Status: Implemented.

Methods§

public function digits(string $text): string

Answers the digits of a hexadecimal or bit literal token text.

Parameters

$textstring

Returns

string
Test cases 4
Called from 8
Calls 1
public function hexadecimal(string $digits): string

Spells hexadecimal digits: quoted when their count is even, with the 0x prefix otherwise.

The quoted spelling requires an even count and is the only spelling of no digits at all; the prefixed spelling reads an odd count as having a leading zero. Either spelling answers the same digits to digits().

Parameters

$digitsstring

Returns

string
Test cases 2
Called from 3
Calls 1
public function bits(string $digits): string

Test cases 5§

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

Dedicated tests 5

Relations§

Instantiated in 9
Method calls 13