What are the four phases of compilation?

What will be an ideal response?


• Phase I: Lexical analysis-The compiler examines the individual characters in the source program and groups them into syntactical units, called tokens, that will be analyzed in succeeding stages. This operation is analogous to grouping letters into words prior to analyzing text.?• Phase II: Parsing-The sequence of tokens formed by the scanner is checked to see whether it is syntactically correct according to the rules of the programming language. This phase is roughly equivalent to checking whether the words in the text form grammatically correct sentences.• Phase III: Semantic analysis and code generation-If the high-level language statement is structurally correct, then the compiler analyzes its meaning and generates the proper sequence of machine language instructions to carry out the intended actions.• Phase IV: Code optimization-The compiler takes the generated code and sees whether it can be made more efficient, either by making it run faster or having it occupy less memory, or possibly both.

Computer Science & Information Technology

You might also like to view...

In the YUV color model, the Y-component is _____ , the U-component is ______ , and the V-component is _____.

A. luminance; luminance; chrominance B. luminance; chrominance; luminance C. luminance; chrominance; chrominance D. chrominance; chrominance; luminance E. chrominance; luminance; luminance

Computer Science & Information Technology

Critical Thinking QuestionsCase 12-1Your friend Leah explains to you that you have probably used Web services on the Internet many times without even knowing what they are. You are not satisfied with this and you have some questions for Leah so you can understand how they work.Which of the following is NOT an example of a Web service that Leah might share with you as part of her explanation? a. displaying an architectural rendering of a new building to be built in the cityc. giving directions to a hotelb. displaying a live stock quoted. providing the top news stories on a local college Web site

What will be an ideal response?

Computer Science & Information Technology

What is the keyboard shortcut (button or buttons to be pressed) for creating a chart from the selected cells?

a. F3 b. F5 c. F7 d. F11

Computer Science & Information Technology

You can insert a picture file as the background image on a report.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology