TokenStream
final class TokenStream
internal |
Methods
__construct(array $tokens)
No description
int
getIndex()
No description
void
seek(int $index)
No description
bool
is(int|string ...$kind)
Tells whether the token at current position is of given kind.
Token|null
tryConsume(int|string ...$kind)
Consumes the current token of given kind or returns null.
string
getIndentation()
No description
void
error(string|null $message = null, int|null $pos = null)
No description
Details
at line 21
__construct(array $tokens)
No description
at line 28
int
getIndex()
No description
at line 34
void
seek(int $index)
No description
at line 43
bool
is(int|string ...$kind)
Tells whether the token at current position is of given kind.
at line 58
Token|null
tryConsume(int|string ...$kind)
Consumes the current token of given kind or returns null.
at line 66
string
getIndentation()
No description
at line 76
void
error(string|null $message = null, int|null $pos = null)
No description