Question

In: Computer Science

---------This question is related to Compiler Design---------- What are the different phases of a compiler. How...

---------This question is related to Compiler Design----------

What are the different phases of a compiler. How can we group these phases into two

major groups. What are some of the advantages of this grouping.

Solutions

Expert Solution

Compiler is a special program that converts high level language to machine level or low level.

There are 6 phases in a compiler. They are

1) Lexical Analysis

2) Syntax Analysis

3) Semantic Analysis

4) Intermediate Code Generation

5) Code Optimization

6) Code Generation.

The above 6 phases are divided into 2 groups Analysis Phase and Synthesis Phase.

The first 3 components constitute Analysis Phase(Lexical Analysis, Syntax Analysis, Semantic Analysis)

The last 3 components constitute Synthesis Phase(Intermediate Code Generation, Code Optimization, Code Generation)

Advantages of this Grouping

1) Reduced time as when the code is perfectly parsed then only it will be processed by the next group.

2) Redundancy is minimized. Each group works on its own and no task is carried out redundantly.

3) Improves efficiency. The output of one group will be sent to the other meanwhile if any left over instructions will be carried out by the first group.

4) Accountability will be more and ease of debugging errors by the programmer if any is easy.


Related Solutions

What is the purpose of a compiler? What are the phases of the compilation process? What...
What is the purpose of a compiler? What are the phases of the compilation process? What does each phase do? What are the inputs and outputs of each phase? How does a compiler differ from an interpreter?
What is the cell cycle and how does the cell move through the different phases of...
What is the cell cycle and how does the cell move through the different phases of the cell cycle? A complete answer will describe the phases and the molecular mechanisms that allows cells to progress from one phase to another.
What is thermochemistry and how is it related to thermodynamics. What are the different forms of...
What is thermochemistry and how is it related to thermodynamics. What are the different forms of energy.
A design related question. 1)design a walk in refrigerator and freezer with 10 ton and 30...
A design related question. 1)design a walk in refrigerator and freezer with 10 ton and 30 ton cooling capacity respectively. 2) freezer must be maintained between (24 to 15 deg celcius) and refrigerator between (3-7 deg celcius) 3)ambient condition ( 38 deg celcius) and refrigeration compressor efficiency assumed at 75%. 4)heat exchanger maintained at 11 deg celcius. 5) emphasis on reducing operating cost, so one compressor can be used and also flash chamber 6) reducing compressor work input and increasing...
What are the differences between classical theory and what Keynes believed? What are the different phases...
What are the differences between classical theory and what Keynes believed? What are the different phases of the business cycle, and how are production and employment affected in each phase?
What is Experimen design statistic how to solve a question about it, and how to find...
What is Experimen design statistic how to solve a question about it, and how to find treatment & factor Explain using an advanced problem and clarify every step. Please write in normal and clear English Thanks in advance
How is sprue bushing design related to cycle time?
How is sprue bushing design related to cycle time?
In Cloud architecture, what are the different phases involved? Explain each a. In cloud architecture, what...
In Cloud architecture, what are the different phases involved? Explain each a. In cloud architecture, what are the building blocks? Explain each
How are the different dimensions of development related to learning.
How are the different dimensions of development related to learning? Explain it.
know the different phases and what happens in each phase of the nurse client relationship?
know the different phases and what happens in each phase of the nurse client relationship?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT