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 30
__construct(array $tokens)
No description
at line 40
array|null
currentToken()
Returns current token.
at line 52
string|null
currentValue()
Returns current token value.
at line 65
array|null
nextToken()
Returns next token.
at line 76
string|null
nextValue()
Returns next token value.
at line 87
array[]
nextAll()
Returns all next tokens.
at line 98
array[]
nextUntil($arg)
Returns all next tokens until it sees a given token type or value.
at line 109
string
joinAll()
Returns concatenation of all next token values.
at line 120
string
joinUntil($arg)
Returns concatenation of all next tokens until it sees a given token type or value.
at line 131
bool
isCurrent($arg)
Checks the current token.
at line 148
bool
isNext()
Checks the next token existence.
at line 159
bool
isPrev()
Checks the previous token existence.
at line 168
TokenIterator
reset()
No description
at line 178
protected
next()
Moves cursor to next token.
at line 194
protected mixed
scan($wanted, $onlyFirst, $advance, $strings = FALSE, $until = FALSE, $prev = FALSE)
Looks for (first) (not) wanted tokens.