class MacroTokens extends TokenIterator

Macro tag tokenizer.

Constants

T_WHITESPACE

T_COMMENT

T_SYMBOL

T_NUMBER

T_VARIABLE

T_STRING

T_CAST

T_KEYWORD

T_CHAR

Properties

int $depth

Methods

__construct(string|array $input = [])

No description

array
parse(string $s)

No description

append($val, int $position = null)

Appends simple token or string (will be parsed).

prepend(string|array{string, $val)

Prepends simple token or string (will be parsed).

string|null
fetchWord()

Reads single expression optionally delimited by comma.

array
fetchWords() deprecated

No description

string
joinUntilSameDepth(int|string ...$args)

No description

array|null
fetchWordWithModifier(string|string[] $modifiers)

No description

reset()

No description

void
next()

Moves cursor to next token.

Details

at line 39
__construct(string|array $input = [])

Parameters

string|array $input int, int}> $input

at line 49
array parse(string $s)

Parameters

string $s

Return Value

array int, int}>

at line 71
MacroTokens append($val, int $position = null)

Appends simple token or string (will be parsed).

Parameters

$val
int $position

Return Value

MacroTokens

at line 90
MacroTokens prepend(string|array{string, $val)

Prepends simple token or string (will be parsed).

Parameters

string|array{string, $val int, int} $val

Return Value

MacroTokens

at line 102
string|null fetchWord()

Reads single expression optionally delimited by comma.

Return Value

string|null

at line 125
array fetchWords() deprecated

deprecated

Return Value

array

at line 144
string joinUntilSameDepth(int|string ...$args)

Parameters

int|string ...$args token type or value to stop before (required)

Return Value

string

at line 162
array|null fetchWordWithModifier(string|string[] $modifiers)

Parameters

string|string[] $modifiers

Return Value

array|null ?string}

at line 180
TokenIterator reset()

Return Value

TokenIterator

at line 187
protected void next()

Moves cursor to next token.

Return Value

void