is there a simple compiler for a small language

前端 未结 18 2097
有刺的猬
有刺的猬 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 22:58

    I've started a video tutorial on writing an ANTLR 3.x compiler - check out

    http://javadude.com/articles/antlr3xtut

    I'll be adding more to it soon! -- Scott

    0 讨论(0)
  • 2021-01-29 23:00

    In my former IT school, we had to develop a compiler in C++, but not from scratch : there were steps, learning curve etc..

    The concept of the TIGER Compiler and projet assignments

    All documents are available, but the code itself isn't, so you'd have to do it all by yourself.

    There's a lot of understandable and usable informations, it could be a good start for learning to code a compiler.

    0 讨论(0)
  • 2021-01-29 23:00

    Google UCSD Pascal. It was a ground-breaker in the 70s. Maybe it's more than you want, but it was easily ported to lot of "micro" chips back then.

    0 讨论(0)
  • 2021-01-29 23:04

    LISPes (Scheme, etc) are the simplest actual languages. You can look how to build a primitive Scheme interpreter in perl with this book (paper version here on Lulu). Parsing, type checking are similar in interpreters and compilers. Then, here is a more hardcore book on the compiler design subject (also available as dead tree on Lulu).

    0 讨论(0)
  • 2021-01-29 23:05

    Jack Crenshaw, a Ph.D. who has written extensively about practical numerical methods, was scared of compilers for a long time. He finally got tired of being scared, and wrote a multi-part tutorial on compiler construction, based on what he learned as he was teaching himself about the subject.

    See "Let's Build a Compiler" for more information. Note that it isn't complete; he ran out of steam before he finished it, but there is a lot of easily-digestible information in there.

    0 讨论(0)
  • 2021-01-29 23:07

    The standard Stack Overflow resource for resources on compiler writing is Learning to write a compiler

    0 讨论(0)
提交回复
热议问题