Stream
class Stream
Stream of tokens.
Properties
Token[] | $tokens | ||
int | $position | ||
array | $ignored |
Methods
No description
Returns current token.
Returns current token value.
Returns next token 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.
Moves cursor to next token.
Looks for (first) (not) wanted tokens.
Details
at line 29
__construct(array $tokens)
No description
at line 39
Token|null
currentToken()
Returns current token.
at line 51
string|null
currentValue()
Returns current token value.
at line 64
Token|null
nextToken()
Returns next token.
at line 75
string|null
nextValue()
Returns next token value.
at line 86
Token[]
nextAll()
Returns all next tokens.
at line 97
Token[]
nextUntil($arg)
Returns all next tokens until it sees a given token type or value.
at line 108
string
joinAll()
Returns concatenation of all next token values.
at line 119
string
joinUntil($arg)
Returns concatenation of all next tokens until it sees a given token type or value.
at line 130
bool
isCurrent($arg)
Checks the current token.
at line 147
bool
isNext()
Checks the next token existence.
at line 158
bool
isPrev()
Checks the previous token existence.
at line 167
Stream
reset()
No description
at line 177
protected
next()
Moves cursor to next token.
at line 193
protected mixed
scan($wanted, $onlyFirst, $advance, $strings = false, $until = false, $prev = false)
Looks for (first) (not) wanted tokens.