Documentation

TokenStream
in package

Represents a token stream.

Tags
author

Fabien Potencier fabien@symfony.com

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

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
Return values
mixed

Search results