Property | Type | Description | |
---|---|---|---|
$count | integer | The count of tokens. | |
$idx | integer | The index of the next token to be returned. | |
$tokens | array | The array of tokens. |
Method | Description | |
---|---|---|
__construct ( array $tokens = [], integer $count ) | Constructor. | |
add ( |
Adds a new token. | |
build ( string | |
Builds an array of tokens by merging their raw value. | |
getNext ( ) : |
Gets the next token. Skips any irrelevant token (whitespaces and comments). | |
getNextOfType ( integer $type ) : |
Gets the next token. | |
getNextOfTypeAndValue ( integer $type, string $value ) : |
Gets the next token. | |
offsetExists ( integer $offset ) : boolean | Checks if an offset was previously set. | |
offsetGet ( integer $offset ) : |
Gets a value from the container. | |
offsetSet ( integer $offset, |
Sets an value inside the container. | |
offsetUnset ( integer $offset ) : void | Unsets the value of an offset. |
public __construct ( array $tokens = [], integer $count ) | ||
$tokens | array | The initial array of tokens. |
$count | integer | The count of tokens in the initial array. |
public getNext ( ) : |
||
return |
public getNextOfType ( integer $type ) : |
||
$type | integer | The type. |
return |
public getNextOfTypeAndValue ( integer $type, string $value ) : |
||
$type | integer | The type of the token. |
$value | string | The value of the token. |
return |
public offsetExists ( integer $offset ) : boolean | ||
$offset | integer | The offset to be checked. |
return | boolean |
public offsetUnset ( integer $offset ) : void | ||
$offset | integer | The offset to be unset. |
return | void |