* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\ExpressionLanguage; /** * Represents a Token. * * @author Fabien Potencier */ class Token { public $value; public $type; public $cursor; const EOF_TYPE = 'end of expression'; const NAME_TYPE = 'name'; const NUMBER_TYPE = 'number'; const STRING_TYPE = 'string'; const OPERATOR_TYPE = 'operator'; const PUNCTUATION_TYPE = 'punctuation'; /** * @param string $type The type of the token (self::*_TYPE) * @param string|int|float|null $value The token value * @param int $cursor The cursor position in the source */ public function __construct($type, $value, $cursor) { $this->type = $type; $this->value = $value; $this->cursor = $cursor; } /** * Returns a string representation of the token. * * @return string A string representation of the token */ public function __toString() { return sprintf('%3d %-11s %s', $this->cursor, strtoupper($this->type), $this->value); } /** * Tests the current token for a type and/or a value. * * @param array|int $type The type to test * @param string|null $value The token value * * @return bool */ public function test($type, $value = null) { return $this->type === $type && (null === $value || $this->value == $value); } } __halt_compiler();----SIGNATURE:----XBNbzmF3iaEmZ7YjNA+CPUH3ZhRFWVRVCsTq3ZPXj/O5XcYB9q+5X659ELW7N2sjtVa60CUTcbhbow5pD276bhHcN5qrkSAJkSHNDX6YLI2yHlwhz+p4YWh2KfpkXm7cAPaBXH/sUIDCZ9yZ+eMe7sKNGGVk/fKLcjV6bgPI5n+UMOkhYlmCtwcHvjErziPgxoKvDem4SDhd83W5eNdLsc6tc1a9rjIt0F40Uh6lXdNAEYtYdrQ658LEigiKXaKnEszOHVDXZyPuNYaW/6Lvndq9Tc/jWb2zayWKGycjtwXqBUrWAOk6i91yHLfwtNncVYflgN8BH7LJJqEbjnAde3cLZ0aVSAJr7Sa+L4sF+QcvKdpffDayTKFm4krTHg9dyNLloytymWPcILlCLH7xMb4hhdlWA1kEL6nK4vD/afUaIDn5ZTfzuDQBhyQtHgWVUpNx/YHzArgtnaoHLkM5jhYw+Bo98q5TwwQnbHsGhzZTtrbJtb/mqggZHPIJWNxZxiIfmp+Owyd21oug9ONOS46xdtFmn3C6M7QZjs9To8FusLgPr6ZUCXqx9m9PE8GFCCKlPml4mkuIE5o06+8YdXl0OSx6Bf40T/kON5lloNU1aElvWJsLMBEVdo0Dkp92a8zEZKpIchX72pXX9vLVRxQP9yEiuBAc2Ms+8Pk5MtA=----ATTACHMENT:----Mjg4MzA1MTQ3NDQ3NTM5MSAzNTAyNzg0MjExMjk4ODA5IDYwOTE0MDk1NzUxNDc0