How can I make a Compiler/Programming Language?

I would like to make a compiler for a high level language in C++. I have researched this and understand the fundamental concepts of parsing, lexing, code generation, and the possible addition of an AST tree. However, I have yet to find an in depth tutorial that I can build off of.

I would like to understand how I could use C++ to take the source, split it up, read each section, and then compile to machine code. I am not opposed to making an interpreter if it can be fast enough, but I would prefer to make an actual compiled language.

I am mostly experienced in C++ except in graphics, but I can do simple SDL.
Last edited on
Have you checked out any of the earlier threads on this topic? For example:

Simple compiler/langauge
http://www.cplusplus.com/forum/beginner/104561/

Writing my own programming language
http://www.cplusplus.com/forum/lounge/94115/

Write a compiler.
http://www.cplusplus.com/forum/general/39652/

What does it take to make a language
http://www.cplusplus.com/forum/lounge/36515/

Andy

PS Writing an interpreter to start with might make sense as it would be easier to test and debug. Then you could push on to generate object code instead (or as well as?)
Topic archived. No new replies allowed.