



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




The final phase of our compiler model is code generator. It takes input from the intermediate representation with supplementary information in symbol table of the source program and produces as output an equivalent target program.
The Code generation module has to tackle a number of issues.
Program submitted to a compiler often have errors of various kinds. So, good compiler should be able to detect as many errors as possible in various ways and also recover from them. Even in the presence of errors, the compiler should scan the program and try to compile all of it (error recovery). Errors may be encountered at various stages of the compilation process. A program may have the following kinds of errors at various stages:
delimiter, such as semi-colon. This is the easiest way of error-recovery and also, it prevents the parser from developing infinite loops.