-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overhaul the lexer parse and interpreter architecture to a better scheme #6
Comments
I would love to work on this issue, can you send me some resources so I can learn the relevant parts of compiler design for this project. |
Hey, Thanks a lot for your interest. https://craftinginterpreters.com/ is my go to suggestion for learning about compilers. Do you have any preference for approach 1 or 2? I have a basic lexer written for another project, which I can share in a gist, and you can adapt it for this. A good idea might be to start with printer interpreter, and convert it from lalrpop to hand-written stuff. Its pretty small and pretty eacy. They we can think about converting the rest. What do you think? |
I think we can implement strat 1 first and then we can think of removing lalrpop completely. Starting with the print parser sounds good to me, will help me understand this project piece by piece better. |
Great! So how do you want to proceed? Do you need any help? |
FYI, ADIthaker will not be proceeding with this due to some personal issues. Any reader who is interested can comment and take up parts 👍 |
Currently the overall architecture of this is acceptable, but pretty hideous. The choices were made for various different (not necessarily correct) reasons at the time when this was written, but needs a fixing to some better choices now.
This is horrible for many reasons :
Currently the two strategies are :
Even though second option is desirable, it is equally tricky, so first shifting to custom lexer, than a custom parser separately might be a better way.
Either way, we should make the initial parser generate enum instead of text again and remove "interpreter parser", and remove print parser as well.
Tracking:
Just noticed that the 8086 manual also include hex codes for instructions, if we can use them, we can actually store instructions in the memory and remove that barrier.
The text was updated successfully, but these errors were encountered: