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(array|int $type, string|null $value = null, string|null $message = null)

Tests a token.

bool isEOF()

Checks if end of stream was reached.

Details

__construct(array $tokens)

Constructor.

Parameters

array $tokens An array of tokens

string __toString()

Returns a string representation of the token stream.

Return Value

string

next()

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

expect(array|int $type, string|null $value = null, string|null $message = null)

Tests a token.

Parameters

array|int $type The type to test
string|null $value The token value
string|null $message The syntax error message

bool isEOF()

Checks if end of stream was reached.

Return Value

bool
doc_Symfony
2016-10-28 06:34:50
Comments
Leave a Comment

Please login to continue.