0

What are the various tools that are required to build a compiler for a particular programming language, say C?

I want to know how each part of the compiler works. So, I am trying to use all the existing tools like loader, linker, etc, and combine them together to build one compiler (or can just say "compiling a compiler"). Can any one list out all such tools that are required to build a fully functional one?

8
  • compiling C++ is a pain of the highest level, start something simpler like C or a home made simpler language – ratchet freak Oct 24 '13 at 15:42
  • 2
    One typically starts with reading Lets build a compiler, the dragon book and then becoming familiar with flex and bison or antlr. Then go on to more things... – user40980 Oct 24 '13 at 15:45
  • @MichaelT I looked at that question and it is about writing a compiler, in general. But, my question is about using the various existing components to build one functional compiler. So, I guess this question is not a duplicate of that. – kevin Oct 24 '13 at 15:50
  • @kevin, meet LLVM, your new best friend. – dan_waterworth Oct 24 '13 at 15:54
  • 2
    You likely need to think more deeply about the structure of a compiler. One doesn't just take off the shelf tools and make a compiler. You design a language, write a lexer, write a parser. Thinking about linking (if at all) is very late in the process. The tools to build a compiler are the ones to make building a lexer and parser easier (rather than doing it by hand). Yacc (the predecessor of bison) stands for "Yet Another Compiler Compiler" and antlr is "ANother Tool for Language Recognition". These are the tools you use to build the tools that you will use. – user40980 Oct 24 '13 at 15:56

Browse other questions tagged or ask your own question.