Num

Num

class Num

From the docs.

All integers can be written in either decimal or hexadecimal notation. In both cases, digits can optionally be separated by underscores.


digit      ::= '0' => 0, '1' => 1, ... '9' => 9
hexdigit   ::= d:digit => d
'A' => 10, 'B' => 11, ... 'F' => 15
'a' => 10, 'b' => 11, ... 'f' => 15
num        ::= d:digit => d
n:num ''? d:digit => n * 10 + d
hexnum     ::= h:hexdigit => h
n:hexnum ''? h:hexdigit => n * 16 + h

Fields

Name Description
var forceHex: Boolean
val foundHexChars: Boolean
val value: ULong
val sequence: CharSequence

Constructors

<init>

constructor(sequence: CharSequence, context: ParseContext?)

From the docs.

All integers can be written in either decimal or hexadecimal notation. In both cases, digits can optionally be separated by underscores.


digit      ::= '0' => 0, '1' => 1, ... '9' => 9
hexdigit   ::= d:digit => d
'A' => 10, 'B' => 11, ... 'F' => 15
'a' => 10, 'b' => 11, ... 'f' => 15
num        ::= d:digit => d
n:num ''? d:digit => n * 10 + d
hexnum     ::= h:hexdigit => h
n:hexnum ''? h:hexdigit => n * 16 + h

Parameters

Name Description
sequence: CharSequence
context: ParseContext?

CompanionObject

Num

class Num

From the docs.

All integers can be written in either decimal or hexadecimal notation. In both cases, digits can optionally be separated by underscores.


digit      ::= '0' => 0, '1' => 1, ... '9' => 9
hexdigit   ::= d:digit => d
'A' => 10, 'B' => 11, ... 'F' => 15
'a' => 10, 'b' => 11, ... 'f' => 15
num        ::= d:digit => d
n:num ''? d:digit => n * 10 + d
hexnum     ::= h:hexdigit => h
n:hexnum ''? h:hexdigit => n * 16 + h

Fields

Name Description
const DECIMAL_PATTERN: String
const HEX_PATTERN: String