Class TokenStream
This class provides stream functions to navigate an array of tokens
Methods summary
public
|
|
public
WPGMZA\Selector\Token |null
|
#
peek( string|null $expectedType = null, integer $calledByRead = 0 )
Peeks at the next token in the stream, without advancing the cursor
Peeks at the next token in the stream, without advancing the cursor
Parameters
- $expectedType
- The token type to expect.
- $calledByRead
- Used for internal debug logging.
Returns
Throws
|
public
WPGMZA\Selector\Token |null
|
#
read( string|null $expectedType = null )
Reads the next token in the stream. This performs the same actions as peek, but will advance the cursor before returning the token. The cursor may not advance past the token count.
Reads the next token in the stream. This performs the same actions as peek, but will advance the cursor before returning the token. The cursor may not advance past the token count.
Parameters
- $expectedType
- The token type to expect.
Returns
Throws
|
public
boolean
|
#
eof( )
Returns true if the cursor has reached the end of the token stream
Returns true if the cursor has reached the end of the token stream
Returns
boolean
|