Good morning !

Please suggest how to write a translator of your own language in Java (SE).

Operators are simple if, for, variable types.

Ready source is not needed, as it should look in the theories or something else that's what you need?

    2 answers 2

    In theory, it looks like this:

    1. We set ourselves a parser / compiler generator - for Java, these are CUP , ANTLR , JavaCC, and so on. - Google to help.
    2. We set ourselves the grammar of our own “language” - each compiler has a more or less syntax - based on the so-called Banach forms. For example on ANTLR it looks like this
    3. We generate on a target language (in this case, Java) a set of classes that implement the analysis of your grammar
    4. Profit

      recently asked about this - Parsing a formal language