I have a lot of people to thank for my knowledge of translator construction, which is always growing, especially lately. My chief interest in putting this tutorial together was not simply helping out other curious minds (as important as that is), but also solidifying my own understanding of the process. As Albert Einstein once said, “You do not really understand something until you can explain it to your grandmother”.
My first translators, though I may not have called them that at the time, were built maybe fifteen years ago, when I first attempted to add executable data to a personal file format with a newly constructed grammar. I made a lot of terrible mistakes, and I learned from them. (You will too.) What is the nature of human inquisition and curiosity if not adaptation? Writing translator engines is a notoriously nonlinear and irrational problem (technical term!),
For starters, there is an excellent manual on the subject, first published in the year 2000 by Pearson Education Limited. It’s called “Programming Language Processors in Java“, by David A. Watt and Deryck F. Brown. Java was very different back then, and I spot new things in the example code which I can optimize all the time; but the core material is perfectly communicated. It’s in the realm of a hundred dollars, but if you’re even knee deep in this, I recommend it. (Tragically it is not yet available via Safari Books.)
Additionally, via MIT’s OpenCourseWare, you have an entire course on the subject. It appears to be partially complete; the videos can be found under “Lecture Notes”. I’m still familiarizing myself with the professors, Prof. Martin Rinard and Prof. Saman Amarasinghe, but they have been very helpful. Like any online course, you should make it a point to find extracurricular work in the subject.
Finally, my general education on the subjects of linguistics, psycholinguistics, and neurolinguistics have provided me with a grasp of that nature of language that goes far beyond natural language. While I must put emphasis on the more directly related text above, there are many great books on these subjects, by equivalently great teachers, which are very helpful alongside them. Joseph O’Connor and John Seymour have played a large part into my comprehension of the human end of any language, and believe me, it is important to you.
I believe that my work is sufficiently original beyond the bindings of actually working; but should any of them determine that my code is too close to theirs, or that I am in violation of a license of some kind, please contact me so that I may make amends. The future of computing lies on the backs of the teachers as much as it does the engineers.