-
Notifications
You must be signed in to change notification settings - Fork 21
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
Implemented a basic compiler that integrates lexer and parser + assembler directives explained #4
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work here! This was certainly needed as previously you could spend anywhere from five to ten hours trying to get this framework setup yourself, just to get to a point where you could add a single feature to your compiler. Collectively this will easily save hundreds of hours across the cohort :D
I've made some suggestions which can be summed up as:
- More Makefile improvements (track dependencies more generically, use GNU bison instead of yacc & also depend on the Makefile itself)
- Pass the Context by reference instead of by copy
Additionally, I'd maybe take a look at the int f() { return; }
example as this leads to undefined behaviour; this is as the value of f()
is used by example_driver.c
when running ./test.sh
. So this needs to be reworked I think (maybe back to the original return 5
, even if it does mean having to add a Number/IntegerConstant class). I've put some more details on the line itself.
Co-authored-by: Jpnock <[email protected]>
Co-authored-by: Jpnock <[email protected]>
Thanks for the review James, I really appreciate it! Saving hundreds of hours across the cohort was indeed my biggest motivation! Re Makefile - brilliant changes, setting makefiles is not my strong point, but your version makes much more sense (and hopefully is even less error-prone for the students). I've left some minor comments in some of your suggestions above and committed the rest of them. |
As discussed over MS Teams.