Phases Flashcards
How many phases does a compiler typically go through?
7
What are the two ends of the compile process?
Front End
Back End
What is the first phase of the front end called and what object completes it?
Lexical Analyzer - Scanner
What is the second phase of the front end called and what object completes it?
Syntax Analyzer - Parser
What is the third phase of the front end called?
Semantic Analysis
What is the fourth phase of the front end called and what object completes it?
Intermediate Code Generation - Generator
What is the fifth phase of the front end called and what object completes it?
Optimization - Optimizer
What is the first phase of the back end called?
Code Generator
What is the second phase of the back end called?
Machine-Dependent Code Optimizer
What details are sent by the scanner to the parser?
Lexemes/Tokens
How does the parser organize data to check for syntax errors?
Using an Abstract-Syntax Tree
What is a typical example of intermediate code generation?
3-Address code
What is ‘|’ is regular expression?
Or
What is ‘.’ is regular expression?
Followed by
What is ‘*’ is regular expression?
Zero of more instances of
What is the output of the Scanner?
Token Stream
What is the output of the Parser?
Abstract-Syntax Tree
What is the output of phase three?
Annotated-Syntax Tree
What is the output of the Generator?
Intermediate Code
What is the output of the Optimizer?
Optimized Intermediate Code
What is the output of the back end code generator?
Target-Machine Code
What is the output of the back end optimizer?
Object Program