class Tokenizer

deprecated use similar Nette\Tokenizer\Tokenizer

Simple lexical analyser.

Constants

VALUE

OFFSET

TYPE

Methods

__construct(array $patterns, string $flags = '')

No description

array
tokenize(string $input)

Tokenizes string.

static array
getCoordinates(string $text, int $offset)

Returns position of token in input string.

Details

at line 35
__construct(array $patterns, string $flags = '')

No description

Parameters

array $patterns

of [(int|string) token type => (string) pattern]

string $flags

regular expression flags

at line 48
array tokenize(string $input)

Tokenizes string.

Parameters

string $input

Return Value

array

Exceptions

TokenizerException

at line 94
static array getCoordinates(string $text, int $offset)

Returns position of token in input string.

Parameters

string $text
int $offset

Return Value

array

of [line, column]