SqlParser\Lexer::parseSymbol PHP Метод

parseSymbol() публичный Метод

Parses a symbol.
public parseSymbol ( ) : Token
Результат Token
    public function parseSymbol()
    {
        $token = $this->str[$this->last];
        if (!($flags = Context::isSymbol($token))) {
            return null;
        }
        if ($flags & Token::FLAG_SYMBOL_VARIABLE) {
            if ($this->str[++$this->last] === '@') {
                // This is a system variable (e.g. `@@hostname`).
                $token .= $this->str[$this->last++];
                $flags |= Token::FLAG_SYMBOL_SYSTEM;
            }
        } else {
            $token = '';
        }
        $str = null;
        if ($this->last < $this->len) {
            if (($str = $this->parseString('`')) === null) {
                if (($str = static::parseUnknown()) === null) {
                    $this->error(__('Variable name was expected.'), $this->str[$this->last], $this->last);
                }
            }
        }
        if ($str !== null) {
            $token .= $str->token;
        }
        return new Token($token, Token::TYPE_SYMBOL, $flags);
    }