Reading tokens or finding out what a script does from a plugin

Is there any way to do what the title says? I know it’s possible I just don’t know how to start and yes I am willing to put forth a lot of effort.

Use script.Source. Reading from it will return a string of the script’s code.

I know this, but how can I split the source into tokens? I was looking for Lua parsers but couldn’t find a reliable one