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 thing just a simple language (by simple I mean a small code because for example gcc is toooooo big). any help is appreciated.
相关问题
- Correctly parse PDF paragraphs with Python
- R: eval(parse()) error message: cannot ope
- How do shader compilers work?
- C++ Builder - Difference between Lib and Res
- How do I parse a .pls file using PHP? Having troub
相关文章
- How do I get from a type to the TryParse method?
- Slow ANTLR4 generated Parser in Python, but fast i
- How to force Delphi compiler to display all hints
- Xcode - How to change application/project name : w
- What other neat tricks does the SpecialNameAttribu
- Parsing JSON in QML [duplicate]
- What is the purpose of “-Wa,option” in GCC? [close
- Generate Fortran subroutine with SymPy codegen for
You should read a book on compiler design; it should have the theory you want to know, as well as some appropriately simple examples.
I recommend "the dragon book": Principles of Compiler Design, by Aho and Ullman. It has been many years since I read it, so I don't recall exactly what examples are available, but it is a very good text.
This one is only 300 lines of normal code and implements a simple universal language link text , is something like that what you were looking for?
If you want to look at code, I'm very impressed with Eijiro Sumii's MinCaml compiler.
It's only 2000 lines long.
It compiles a pretty interesting source language.
It generates real machine code, none of this namby-pamby C or LLVM stuff :-)
Speed of compiled code is competetive with gcc and the native OCaml compilers.
The compiler is designed for teaching.
Did I mention I've been very impressed?
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
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.
The standard Stack Overflow resource for resources on compiler writing is Learning to write a compiler