TokenIterator
class TokenIterator extends Object
internal |
Traversing helper.
Properties
array | $tokens | ||
int | $position | ||
array | $ignored |
Methods
No description
Returns current token.
Returns current token value.
Returns next token.
Returns next token value.
Returns all next tokens.
Returns all next tokens until it sees a given token type or value.
Returns concatenation of all next token values.
Returns concatenation of all next tokens until it sees a given token type or value.
Checks the current token.
Checks the next token existence.
Checks the previous token existence.
No description
Moves cursor to next token.
Looks for (first) (not) wanted tokens.
Details
at line 32
__construct(array $tokens)
No description
at line 42
array|null
currentToken()
Returns current token.
at line 54
string|null
currentValue()
Returns current token value.
at line 67
array|null
nextToken()
Returns next token.
at line 78
string|null
nextValue()
Returns next token value.
at line 89
array[]
nextAll()
Returns all next tokens.
at line 100
array[]
nextUntil($arg)
Returns all next tokens until it sees a given token type or value.
at line 111
string
joinAll()
Returns concatenation of all next token values.
at line 122
string
joinUntil($arg)
Returns concatenation of all next tokens until it sees a given token type or value.
at line 133
bool
isCurrent($arg)
Checks the current token.
at line 150
bool
isNext()
Checks the next token existence.
at line 161
bool
isPrev()
Checks the previous token existence.
at line 170
TokenIterator
reset()
No description
at line 180
protected
next()
Moves cursor to next token.
at line 196
protected mixed
scan($wanted, $onlyFirst, $advance, $strings = FALSE, $until = FALSE, $prev = FALSE)
Looks for (first) (not) wanted tokens.