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

Various phases of consumer merchantile model, What are the various phases o...

What are the various phases of consumer merchantile model and also differentiate between prepurchase interaction & post purchase interaction.    There are three phase of consumer

4 bit comparator, how to breadboARD THE 4 BIT COMPARATOR

how to breadboARD THE 4 BIT COMPARATOR

What is independent process, What is independent process? A process is ...

What is independent process? A process is independent it cannot affect or be affected by the other processes implementing in the system. Any process does not share data with ot

What is write-through protocol, What is write-through protocol? For a w...

What is write-through protocol? For a write operation using write-through protocol during write-hit: The cache location and the major memory location are updated concurrently.

Conversion of decimal number to binary number, Conversion of Decimal Number...

Conversion of Decimal Number to Binary Number: For converting a decimal number to binary integer part and fractional part are handled separately. Let's describe it with help of

Define hypertext verses hypermedia briefly, Define Hypertext verses Hyperme...

Define Hypertext verses Hypermedia briefly. Hypertext is fundamentally the same as regular text- this can be stored, read, searched or edited along with a significant exception

What is meant by super scalar processor, What is meant by super scalar proc...

What is meant by super scalar processor?  Super scalar processors are designed to exploit more instruction level parallelism in user programs. This means that multiple function

Define optimistic synchronization, Q. Define Optimistic Synchronization? ...

Q. Define Optimistic Synchronization? Optimistic Synchronization: This method too updates atom by requester process however sole access is granted after atomic operation by abo

Specifying the problem - learning decision trees, Specifying the Problem: ...

Specifying the Problem: Now next here furtherly we now use to look at how you mentally constructed your decision tree where deciding what to do at the weekend. But if one way

Explain different system calls for performing different task, Write down di...

Write down different system calls for performing different kinds of tasks. The major types of system calls are given as: Process Control: These kinds of system calls are

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