> For the complete documentation index, see [llms.txt](https://docs.r.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.r.xyz/glider-ide/api/instruction/instruction.next_instructions_recursive.md).

# Instruction.next\_instructions\_recursive()

`next_instructions_recursive() →` [`APISet`](/glider-ide/api/iterables/apiset.md)`[`[`Instruction`](/glider-ide/api/instruction.md)`]`

The difference between the next\_instructions\_recursive() function and [next\_instructions()](/glider-ide/api/instruction/instruction.next_instructions.md) is that this function works in an recursive (**inter**-procedural) manner and returns all instructions following the current instruction in the CFG (control-flow-graph).

*The function is recursive (intra-procedural), and follows function calls; for the non-recursive (**intra**-procedural) variant of this function, use* [*`next_instructions()`*](/glider-ide/api/instruction/instruction.next_instructions.md)*.*

For example, in the function:

```solidity
function approve(address spender, uint256 amount) public override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }
```

for the instruction:

```solidity
_approve(_msgSender(), spender, amount);
```

the function will return instructions from `_approve()`.

### Query Example

```python
from glider import *
def query():

  instructions = Functions().with_name("approve").exec(1, 9).instructions().exec(1,1)
  
  return instructions + list(instructions.next_instructions_recursive())
```

### Output Example

<figure><img src="/files/95dwmAOCuPQu7wDSF3VW" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/lnfyh1A3HE2YEcO4GpGf" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/tmUvNXio9BhJJOj7YFsL" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/csF4gsEOKpsLGphdpZ53" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/ahpga5nFcZtnSJRMAHpd" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/38QVZW30xHlIcqgSGlbV" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/Ss7xN3yXOqTWDgi0tgD1" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The function returns APISet, instead of APIList, in case the result of the function is used as the return value of the query it must be casted to `list()`
{% endhint %}
