protected function getTokenAtIndex(int $index): Token
    {
        if (!$this->hasTokenAtIndex($index)) {
            throw new OutOfRangeException("No token in buffer at given index");
        }
        return $this->tokenList[$index];
    }
protected function getTokenAtIndex(int $index): Token
    {
        if (!$this->hasTokenAtIndex($index)) {
            throw new OutOfRangeException("No token in buffer at given index");
        }
        return $this->tokenList[$index];
    }
protected function getTokenAtIndex ( int $ index ) : Token { if ( ! $ this -> hasTokenAtIndex ( $ index ) ) { throw new OutOfRangeException ( "No token in buffer at given index" ) ; } return $ this -> tokenList [ $ index ] ; }
Returns token at given index.

@param int $index
@return Token
Returns token at given index .