W3cubDocs

/Symfony 3.0

Symfony\Component\ExpressionLanguage\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

public __construct(array $tokens)

Constructor.

Parameters

array $tokens An array of tokens

public string __toString()

Returns a string representation of the token stream.

Return Value

string

public next()

Sets the pointer to the next token and returns the old one.

public expect($type, $value = null, $message = null)

Tests a token.

Parameters

$type
$value
$message

public bool isEOF()

Checks if end of stream was reached.

Return Value

bool

© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Component/ExpressionLanguage/TokenStream.html