TokenStream
in package
Represents a token stream.
Tags
Table of Contents
- $current : mixed
- $expression : mixed
- $position : mixed
- $tokens : mixed
- __construct() : mixed
- __toString() : string
- Returns a string representation of the token stream.
- expect() : mixed
- isEOF() : bool
- Checks if end of stream was reached.
- next() : mixed
- Sets the pointer to the next token and returns the old one.
Properties
$current
public
mixed
$current
$expression
private
mixed
$expression
$position
private
mixed
$position
= 0
$tokens
private
mixed
$tokens
Methods
__construct()
public
__construct(array<string|int, mixed> $tokens[, string $expression = '' ]) : mixed
Parameters
- $tokens : array<string|int, mixed>
- $expression : string = ''
Return values
mixed —__toString()
Returns a string representation of the token stream.
public
__toString() : string
Return values
string —expect()
public
expect(string $type[, string|null $value = null ][, string|null $message = null ]) : mixed
Parameters
- $type : string
- $value : string|null = null
- $message : string|null = null
-
The syntax error message
Return values
mixed —isEOF()
Checks if end of stream was reached.
public
isEOF() : bool
Return values
bool —next()
Sets the pointer to the next token and returns the old one.
public
next() : mixed