TokenStream
class TokenStream
Represents a token stream.
Properties
$current |
Methods
__construct(array $tokens)
Constructor.
string
__toString()
Returns a string representation of the token stream.
next()
Sets the pointer to the next token and returns the old one.
expect($type, $value = null, $message = null)
Tests a token.
bool
isEOF()
Checks if end of stream was reached.
Details
at line line 31
__construct(array $tokens)
Constructor.
at line line 42
string
__toString()
Returns a string representation of the token stream.
at line line 50
next()
Sets the pointer to the next token and returns the old one.
at line line 64
expect($type, $value = null, $message = null)
Tests a token.
at line line 78
bool
isEOF()
Checks if end of stream was reached.