is there a simple compiler for a small language

前端 未结 18 2093
有刺的猬
有刺的猬 2021-01-29 22:55

I am looking for a simple compiler that compiles a simple language, I need it to write a paper about it and to learn how compilers work, I am not looking for a sophisticated thi

18条回答
  •  伪装坚强ぢ
    2021-01-29 23:18

    You could also try this book : The Elements of Computing Systems.

    Though a book that intends to cover right from designing a microprocessor to a language with its compiler, you could just focus on the relevant chapters.

    Chapter 10: Syntax analysis is what you can work through, if you intend to focus only on the compiler front end part. However, chapter 9 should be a pre-requisite as it describes the design of a high level language for which a compiler is implemented. This high level language is actually a simple OO java like language, hence the compiler actually compiles to a VM.

    The best part of it all is that you could actually follow the instructions and implement the front end part in any language of your choice, if you think that will further your understanding. It gels pretty well if you combine it with compiler theory.

    And, you can find my review of the book here.

提交回复
热议问题