* * 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:----pks2P26fqBacnBqqY1GP7YPxLFdxq2wKaSUOoc0Xi99x0UwZsapk00KjkqckhUl5kRyTMySzHg7mgZ9vwIuJUPiol6IuMiZUkQ41uGPCHG6gqzboW/hmMvsvEUHKUypYKZ0kyiRBumtzdVE0JdBQbaY+9oPLxOKnXLm1ohOM1/NQol0MpUvsOP78AwL+MRrMe3sMGTou9JRUixItPfKsD7UlNpVRQq7RrPjxGXeqEyEnav8St9VTOi6xIoRHvlJ212boETHL4k36jb4VLPLqIxQ+CBbaprYMwvYE9SErQq0FMbgq8lUVo+rHvlrRGoJz4EWtl7jjMav9lgzyQR2Fre3bP3nWUYm3hFE8RVsn2Tc617Fdu6V3Z4CkuPm/eazKerswPbfAESjGErMZ3d/j5Jq9pJZcvaMOYGTcEExyl3U/4R24jGdT4/fYvYSUU4NMabtydea18TeS5CmkUqULDuZR95/N4TMWm+CpkNgZTR7mgLJipcdLp0HGDVMcNrNu8o4Oxz2sNyeUaqONmsi7b+dknWUJoYgxuO561dr52afo5PXSuvLi5QWM7agHVh1U/Eut3FVIupuvI+YPGatUlXu46OtzrJDKCop8Ir2zM+A9XnA4KTwpn95DmgVOACtrbqw1W9VhvCPY5RQ/9xu7X+EleyfqdMw38InkYwBRpN8=----ATTACHMENT:----MTIxMzUzMDgzOTU2MTU3NyAxNjU2MzA3Njk0NzEwODYzIDE0NDQzMzQwMDI2MzE5NzQ=