RE: Complicated AST manipulation looks ugly in C++. How to refactor it?
January 29, 2022 at 8:52 am
(January 29, 2022 at 1:26 am)FlatAssembler Wrote:(January 27, 2022 at 2:16 pm)Jehanne Wrote: Isn't that the whole point of a compiler, to translate computer code into machine code?
No, that is what the assembler is doing. An assembler is translating computer code (assembly code) into machine code. A compiler is translating computer code into assembly code. A compiler does not have to deal with machine code at all, that is the assembler's job.
My understanding is that some compilers, after the syntax analysis and parsing trees, proceed directly to the binary code while others generate assembly code that the assembler then uses to generate the machine code.