TokenStream
final class TokenStream
| internal |
Methods
No description
No description
No description
Tells whether the token at current position is of given kind.
Consumes the current token of given kind or returns null.
Returns the whitespace indentation of the token at the current position, i.e. the whitespace token immediately following a newline (or at the start).
Throws a parsing exception with position information from the current or given token.
Details
at line 19
__construct(array $tokens)
No description
at line 26
int
getIndex()
No description
at line 32
void
seek(int $index)
No description
at line 41
bool
is(int|string ...$kind)
Tells whether the token at current position is of given kind.
at line 56
Token|null
tryConsume(int|string ...$kind)
Consumes the current token of given kind or returns null.
at line 68
string
getIndentation()
Returns the whitespace indentation of the token at the current position, i.e. the whitespace token immediately following a newline (or at the start).
at line 78
never
error(string|null $message = null, int|null $pos = null)
Throws a parsing exception with position information from the current or given token.