Where's some good documentation for creating a GCC front end?
-
04-12-2019 - |
Вопрос
I've been tasked to come up with some half-year and full-year university projects for IT students and, due to the fact that it's hopefully never been done before (and also that I harbor certain sadistic tendencies), one of them is adding a BCPL front-end compiler to the GCC suite.
Where can I locate one or more of:
- some good reference-type documentation describing how to add such a beast to GCC?
- an example of doing so, for a simple language.
- any guides to the process.
Решение
Go-lang's gccgo is a Go front end for gcc. Here is the announcement. I have not studied enough of Go to comment about its complexity or simplicity. I hope for someone prepared to write a front end for gcc, gccgo should be a decent reference and/or example.
Другие советы
https://www.tldp.org/HOWTO/GCC-Frontend-HOWTO.html is very old.
https://www.linuxjournal.com/article/7884 is also very old.
https://thinkingeek.com/2016/01/05/tiny-gcc-front-part-1/ and https://thinkingeek.com/2016/01/06/tiny-gcc-front-part-2/ are much more recent.
I haven't read any of them.