Explain analysis and synthesis phase of a compiler, Computer Engineering

Assignment Help:

Explain analysis and synthesis phase of a compiler.

The synthesis and analysis phases of a compiler are:

Analysis Phase: In this breaks the source program in constituent pieces and makes intermediate representation. This analysis part can be divided along the phases as follows:

1. Lexical Analysis- The program is seems as a unique sequence of characters. Its analyzer reads the program from left-to-right and then sequence of characters is grouped in tokens-lexical units along with a collective meaning.

2. Syntax Analysis- It is also termed as Parsing. Tokens are grouped in grammatical phrases represented through a Parse Tree that provides a hierarchical structure to the source program.

3. Semantic Analysis- The phase of semantic analysis checks the program for semantic errors (i.e. Type Checking) and then gathers type information for the successive phases.

Type Checking is check types of operands; not any real number as index for array and so on.

Synthesis Phase: Produces the target program from the intermediate representation. The part of synthesis can be divided along the phases as follows:

1. Intermediate Code Generator- An intermediate code is produced as a program for an abstract machine. The code of intermediate must be easy to translate in the target program.

2. Code Optimizer- Such phase attempts to enhance the intermediate code therefore faster-running machine code can be acquired. Various compilers adopt various optimization techniques.

3. Code Generator- In this phase generates the target code containing assembly code. Now

 1. Memory locations are chosen for each variable;

2. Instructions are translated in a sequence of assembly instructions;

3. Intermediate and variables results are allocated to memory registers.


Related Discussions:- Explain analysis and synthesis phase of a compiler

Add another layout cell, Next add a layout cell for the Learn More About gr...

Next add a layout cell for the Learn More About graphic. 1.  In Objects panel, click the Draw Layout Cell icon. 2.  In Document window, draw a new cell in the space below nav

Write a short note on pointer declaration, Write a short note on pointer de...

Write a short note on pointer declaration A simple variable in a program is stored in a certain number of bytes at a particular memory location, or address, in the machine. Poi

Explain definition of fibonacci, Explain definition of fibonacci Where ...

Explain definition of fibonacci Where an input value gives a trivial result, it is returned directly, otherwise the function calls itself, passing a changed version of the inpu

Explain about the term business-to-customer, Explain about the term busines...

Explain about the term business-to-customer. B2C (business-to-customer): "Electronic commerce" is usually understood mostly as selling goods or services to people ("last

The constructed datatype of c, The constructed datatype of C is known as ...

The constructed datatype of C is known as Structure is a constructed datatype of C.

Determine the framed data including a parity bit, Determine the Framed data...

Determine the Framed data including a parity bit   For illustration when even parity is chosen, parity bit is transmitted with a value of 0 if the number of preceding

Explain characteristics of prototyping, Question: (a) List five main c...

Question: (a) List five main characteristics of ‘Prototyping'. (b) Describe briefly why ‘Prototyping' is essential to Rapid Application Development. (c) Describe the 2 t

What are the disadvantages of fcfs scheduling algorithm, What are the disad...

What are the disadvantages of FCFS scheduling algorithm as compared to shortest job first (SJF) scheduling? Disadvantages: (i) Waiting time can be huge if short requests w

Explain how the different access methods work, Question: (a) Primary an...

Question: (a) Primary and secondary memory differs in their way they access data: (i) Mention the four generic access methods usually present in a computer system. (ii) E

What is rational administrator, Use the Rational Administrator to: * M...

Use the Rational Administrator to: * Make and manage projects. * Make a project under configuration management. * Make a project outside of configuration management.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd