Data Model or Data Structure for Stored Procedures in Databases

I know that Relational Algebra is the goto data model for storing information related to SQL queries.

I am however yet to find a standard data model that can encapsulate constructs of stored procedures such as cursors, loops, in/out variables, statements etc.

I might be wrong, but usually people talk about an AST, but is there something more specific? I tried looking into MySQL code to get some idea but wasn’t too successful.