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

Customer service and support in post purchase interaction, Describe the cus...

Describe the customer service and support in post purchase Interaction. Post purchase Interaction: The considerations at this step can be explained by the given example:

Describe generic framework for electronic commerce, Describe generic framew...

Describe generic framework for electronic commerce Generic Framework for electronic commerce contains the Applications of EC   (like as banking, shopping in online stores and m

What is the demand of mobile application developers, Desktop based IT appli...

Desktop based IT application is present but the mobile is future. All the applications that were made to work only on counter top are being ported to mobile. In the coming 10 years

What do you mean by software poll, Q. What do you mean by Software Poll? ...

Q. What do you mean by Software Poll? In this scheme on occurrence of an interrupt, processor jumps to an interrupt service program or routine whose job is to poll (roll call

Make your simulation run faster, Ameliorating the mechanical delays of seek...

Ameliorating the mechanical delays of seeks and rottion are usually regardeed as major aspects of device drivers for disks. The simplest way for a disk device driver to service dis

Introduction to the sorted arraylist, Consider  a  collection  class  that ...

Consider  a  collection  class  that  is  similar  to  the ArrayList  class,  except  that  elements  are sorted in a certain order. We will call this class SortedArrayList. This c

Explain data warehousing, data warehousing Data warehouse means  ...

data warehousing Data warehouse means  Subject oriented Integrated Time variant Non-volatile collection of data for management's decisions. It is h

EME, How can i made Carnot engine

How can i made Carnot engine

What are the differences between one hot and binary encoding, What are the ...

What are the differences between one hot and binary encoding? Common classifications used to explain the state encoding of an FSM is Binary or highly encoded and one hot. A bin

What are qualified associations, What are qualified associations? A qua...

What are qualified associations? A qualified association is an association in which an attribute known as the qualifier disambiguates the object many associated end.

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