| Methods |
public
|
__construct(array $tokens, Source $source = null)
|
#
|
public
|
__toString()
|
#
|
public
|
injectTokens(array $tokens)
|
#
|
public
|
next(): Token
Sets the pointer to the next token and returns the old one.
Sets the pointer to the next token and returns the old one.
|
#
|
public
|
nextIf($primary, $secondary = null): Token|null
Tests a token, sets the pointer to the next one and returns it or throws a syntax error.
Tests a token, sets the pointer to the next one and returns it or throws a syntax error.
Returns
The next token if the condition is true, null otherwise
|
#
|
public
|
expect($type, $value = null, string $message = null): Token
Tests a token and returns it or throws a syntax error.
Tests a token and returns it or throws a syntax error.
|
#
|
public
|
look(int $number = 1): Token
Looks at the next token.
|
#
|
public
|
test($primary, $secondary = null): bool
Tests the current token.
|
#
|
public
|
isEOF(): bool
Checks if end of stream was reached.
Checks if end of stream was reached.
|
#
|
public
|
getCurrent(): Token
|
#
|