In general, I want to write a brainfuck compiler or my own language (simple). How to do it?
PS
The interpreter (for brainfuck) I mastered myself, how to make a compiler, I do not even guess.
It is advisable to find literature.

    3 answers 3

    for brainfuck I once wrote the compiler myself. It is better to start writing a switch that will translate the code into s / s ++ / java / any other favorite language. It is very simple. Here is an example of a Java translator. After it turns out to write this, no one bothers to write something similar for an assembler (for fasm or masm). The last step will be the generation of an immediately executable file. The fact that you need to know the assembler, I think there are no questions.

    And some more interesting material - http://habrahabr.ru/blogs/development/113339/

      There is such a book, Marc-André Cournoyer, “ How to Create Your Own Freaking Awesome Programming Language ” (for sale it’s for sale, but it’s always looking for the name and the word “pdf”, where to get it in a less civilized way, EUWRD). Show the basics on the fingers, a sort of "Dragon Book for the smallest." Begin with lexer and parser, then interpreter, and then - compiler under LLVM and, just in case, own toy virtual machine. Everything is true in Ruby, but the general ideas do not depend on the language. So if there is interest - you can search and see, I recommend.

        It was already.

        Let's create a compiler

        • Pascal is used here, I do not understand it well (however, it’s not on Linux) - sudo97
        • Linux has pascal (free pascal compiler), but better not needed. - Jakeroid
        • that's it - sudo97