karan / Projects

:page_with_curl: A list of practical projects that anyone can solve in any programming language.
https://twitter.com/karangoel
MIT License
44.57k stars 10.52k forks source link

Compiler #87

Open justanothercoder opened 8 years ago

justanothercoder commented 8 years ago

Implementing a compiler is a big challenge, but nowadays it can be built by parts.

For example:

  1. Lexer - can be implemented with flex.
  2. Parser - can be implemented with bison.
  3. AST processing - this part is almost always specific for each concrete project, so it should be done by hand.
  4. Code generation and optimization - LLVM provides great framework for this.

You can gradually replace parts with your own implementations.

Also, that problem involves designing architecture of compiler, so it can help you with OOP style or functional programming design, if you want.

sbelidhe commented 6 years ago

lsbasi_part1_compiler_interpreter compiler

Please refer to details on how to implement compiler using java here Modern Compiler Implementation