Here you ask a lot of unrelated questions. Depending on the language you define, there may be a node method in your language or not, say, if your language is compiled using the main(String[]) method unconditionally.
There are several approaches to transforming AST into a target language. Basically, you will not generate the code directly, but generate the AST for your target platform and have a beautiful printer that generates code from it using a treewalker.
Semantic analysis is compiler programming. Reading and understanding input at the syntax level is parsing. You will need to write a semantic analyzer yourself, otherwise you would not write a compiler at all .; -)
I assume that you are using Jasmin to compile assembly code? A very good start would be to write grammars for your input language and target language (Jasmin) and think about which input structures would display which result. How to write a for i := 1 to 10 loop in Jasmin? Solve small problems and expand your compiler as needed, but slowly, testing recently implemented transformations early and thoroughly.
A very good reading: Let the compiler build, Jack Crenshaw .
kay
source share