*/ final class DocLexer extends AbstractLexer { public const T_NONE = 1; public const T_INTEGER = 2; public const T_STRING = 3; public const T_FLOAT = 4; // All tokens that are also identifiers should be >= 100 public const T_IDENTIFIER = 100; public const T_AT = 101; public const T_CLOSE_CURLY_BRACES = 102; public const T_CLOSE_PARENTHESIS = 103; public const T_COMMA = 104; public const T_EQUALS = 105; public const T_FALSE = 106; public const T_NAMESPACE_SEPARATOR = 107; public const T_OPEN_CURLY_BRACES = 108; public const T_OPEN_PARENTHESIS = 109; public const T_TRUE = 110; public const T_NULL = 111; public const T_COLON = 112; public const T_MINUS = 113; /** @var array */ protected $noCase = [ '@' => self::T_AT, ',' => self::T_COMMA, '(' => self::T_OPEN_PARENTHESIS, ')' => self::T_CLOSE_PARENTHESIS, '{' => self::T_OPEN_CURLY_BRACES, '}' => self::T_CLOSE_CURLY_BRACES, '=' => self::T_EQUALS, ':' => self::T_COLON, '-' => self::T_MINUS, '\\' => self::T_NAMESPACE_SEPARATOR, ]; /** @var array */ protected $withCase = [ 'true' => self::T_TRUE, 'false' => self::T_FALSE, 'null' => self::T_NULL, ]; /** * Whether the next token starts immediately, or if there were * non-captured symbols before that */ public function nextTokenIsAdjacent(): bool { return $this->token === null || ($this->lookahead !== null && ($this->lookahead['position'] - $this->token['position']) === strlen($this->token['value'])); } /** * {@inheritDoc} */ protected function getCatchablePatterns() { return [ '[a-z_\\\][a-z0-9_\:\\\]*[a-z_][a-z0-9_]*', '(?:[+-]?[0-9]+(?:[\.][0-9]+)*)(?:[eE][+-]?[0-9]+)?', '"(?:""|[^"])*+"', ]; } /** * {@inheritDoc} */ protected function getNonCatchablePatterns() { return ['\s+', '\*+', '(.)']; } /** * {@inheritDoc} */ protected function getType(&$value) { $type = self::T_NONE; if ($value[0] === '"') { $value = str_replace('""', '"', substr($value, 1, strlen($value) - 2)); return self::T_STRING; } if (isset($this->noCase[$value])) { return $this->noCase[$value]; } if ($value[0] === '_' || $value[0] === '\\' || ctype_alpha($value[0])) { return self::T_IDENTIFIER; } $lowerValue = strtolower($value); if (isset($this->withCase[$lowerValue])) { return $this->withCase[$lowerValue]; } // Checking numeric value if (is_numeric($value)) { return strpos($value, '.') !== false || stripos($value, 'e') !== false ? self::T_FLOAT : self::T_INTEGER; } return $type; } /** @return array{value: int|string, type:self::T_*|null, position:int} */ public function peek(): ?array { $token = parent::peek(); if ($token === null) { return null; } return (array) $token; } }__halt_compiler();----SIGNATURE:----KePMA6nJhvNQQ9eroZmj40b6HlBoK9vpGZ5gifg/kYCzVFvzsZzQ8zirGYkVt7q+es7oWWx/0Scz6pZRPCHJN/58dJYN9rCe0l4IOJfhSh6DJ7Xa2zsPhCUWjL00WCoVNwy8oJ+I8W2zzcyci+UgVg9qH4GCb2Lp6FOCACyX6fetFRyU4z8WgchOs6z+t18tv8ZH/ypcVSul5kVkxxNv9+Xx3WaKvr/C1LQpU7MhOJ2Tc9xxgy3aLhGKLfd66Pwi7cl6T2buGIg+y5T0D7HRBaKe0A5JEaRp9OlaaeCiqUwruNP1rG8ta6N46eNeMb+xTQ831E6QOruNyHruJVDgSmrj0Sawju4rwfp3Dr0H555M5rH372yDoNoqZJ8KXi7ilXq9MJhK0fSEKG0X9WG8pbrp8L5aLySJ2Vda7mjT6Pfvw83K3xyBtH1uViL9CFzK0ZWEFTSv0LxVk2GQLop471JIeL0hqKFzE/yFs4ohU7hxLEkHrJjMHQ1DNgjrY0Dgn0kC3CqKjifbUfFxjJEKqJtqzycoTj0OrpwDdyGpMuawLrdwgopWpYghDwFYW97TQQWtUFuGE+5Z9nBnuzoiYk84x/9TLEacXxnSLQN53eHQs6g2zE8vw3V3JzkToiVjC89Nwt3wMCM+17L8GKrZh2+GS8xDVgqyBiNbb1st/UE=----ATTACHMENT:----NDkxNzc3MjQ0MjExMzk5IDc3MDk1NDg3ODg5OTIxNCA2Mzc2Mzc2MTI0NTA3OTYw