Theoretical question #4472
Replies: 2 comments 11 replies
-
Here's an overview of the back end https://rustpython.github.io/blog/2020/04/02/thing-explainer-parser.html, some paths might be different but the filenames are generally the same. You should probably be able to get an idea of how things generally work. |
Beta Was this translation helpful? Give feedback.
-
@DimitrisJim Hey! :) So, I tried reading some of the source in the blog post that was linked here and stumbled across the enum that tries to determine what type of statement was written. My latest commit to Mandy here kind of implements that but I don't know how to proceed now. Could you maybe post a small example of how I would construct an AST from a stream of tokens that are just a struct with the token name and value? I know it might be asking a bit much but I'm really quite lost. |
Beta Was this translation helpful? Give feedback.
-
I've been trying to implement an interpreter for a language of my own. I struggle with defining a module that parses and analyzes a stream of tokens. Where can I find the module for the grammar definiton? And the module that generates an AST?
Beta Was this translation helpful? Give feedback.
All reactions