ACTUAL Exam Questions and CORRECT
Answers
Name all of the phases of a compiler - CORRECT ANSWER - 1. lexical analysis
2. syntax analysis
3. semantic analysis
4. intermediate code generation
5. code optimization
6. code generation
Briefly describe lexical analysis - CORRECT ANSWER - Conversion of input from
lexemes to a stream of tokens
Briefly describe syntax analysis - CORRECT ANSWER - Makes sure the tokens occur in
a meaningful order (ensures syntactically correct program)
Briefly describe semantic analysis - CORRECT ANSWER - A check for meaning among
the "sentences" created by syntax analysis
Briefly describe intermediate code generation - CORRECT ANSWER - Creation of a
machine-independent representation of the source code
Briefly describe code optimization - CORRECT ANSWER - Removal of unnecessary
instructions in an attempt to increase speed or decrease program size
Briefly describe code generation - CORRECT ANSWER - Creation of a machine-
dependent translation from the intermediate code to the target language