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

Writing my own programming language

Write a compiler.

What does it take to make a language


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.