Class BinaryLiteralText
java.lang.Object
dev.frostlake.executor.expressions.BinaryLiteralText
A hex BINARY literal's text,
X'..', read the way live reads it: SPACES inside the quotes are
dropped wherever they fall (X'00 11' is two bytes, X'0 0' one), and what remains
must be pairs of hexadecimal digits. Anything else — an odd count, a letter past F, a tab — is
refused while the statement compiles, echoing the literal as written:
Invalid binary literal x'0'; should contain pairs of hexadecimal digits. (all live-verified).-
Method Summary
Modifier and TypeMethodDescriptionstatic intdeclaredWidth(BinaryValue value) The width a literal declares: its byte count, and one for the emptyX''(live types it BINARY(1), as it does every literal of one byte).static BinaryValueThe bytes a literal token spells.
-
Method Details
-
decode
The bytes a literal token spells.- Parameters:
token- the token as written,Xand quotes included- Returns:
- its value
-
declaredWidth
The width a literal declares: its byte count, and one for the emptyX''(live types it BINARY(1), as it does every literal of one byte).- Parameters:
value- the literal's value- Returns:
- the declared width
-