public function readToken(): Token
    {
        if ($this->isEnd()) {
            throw new LogicException("The end of buffer is reached");
        }
        $token = $this->getTokenAtIndex($this->cursor);
        $this->cursor++;
        return $token;
    }
public function readToken(): Token
    {
        if ($this->isEnd()) {
            throw new LogicException("The end of buffer is reached");
        }
        $token = $this->getTokenAtIndex($this->cursor);
        $this->cursor++;
        return $token;
    }
public function readToken ( ) : Token { if ( $ this -> isEnd ( ) ) { throw new LogicException ( "The end of buffer is reached" ) ; } $ token = $ this -> getTokenAtIndex ( $ this -> cursor ) ; $ this -> cursor ++ ; return $ token ; }
Reads token from current cursor position and advances cursor.

@return Token
Reads token from current cursor position and advances cursor .