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

Explain the quantization error of an ADC, Explain the Quantization error...

Explain the Quantization error of an ADC. Ans. Quantization error- An analog voltage is within the range of 0 to 1V and for 3 bit output, the size of all intervals are

Why SS7 protocol is use, SS7 Protocol uses: (A) Out of band signalling...

SS7 Protocol uses: (A) Out of band signalling. (B) Associated signalling. (C) Speech control signalling. (D) No signalling. Ans: SS7 Protocol uses Out of

What do you understand by electronic funds transfer, What do you understand...

What do you understand by Electronic Funds Transfer?  Electronic Funds Transfer: It's an electronic payment method that transfers the money value from one bank account to

In what way the protection fault handler concludes, In what way the protect...

In what way the protection fault handler concludes? After finishing the implementation of the fault handler, it sets the change and protection bits and clears the copy on write

Computer architecture, what is complex instruction set computer and reduce...

what is complex instruction set computer and reduced complex instruction set computer

Does gimp have scanner support, Yes. It's available on Windows and uses TWA...

Yes. It's available on Windows and uses TWAIN, and on GNU/Linux you constant have a choice among XSane and gnome-scan - both can be used as GIMP plug-ins.

Why is packet switching important, Why is packet switching important? Give ...

Why is packet switching important? Give at least two reasons. Packet switching is significant due to the following two purposes: 1. A sender and the receiver require coordin

Explain the meaning of accept socket primitive, Explain the meaning of A...

Explain the meaning of ACCEPT socket primitive. The Accept Primitive: A server which uses connection-oriented transport should call procedure accepts to accept

Ms access database to a present conversion, I have converted my MS Access d...

I have converted my MS Access database to a present conversion. I am getting conversion errors? Ans) Design specs have changed in new releases of MS Access. Visit the on-line

Dynamic programming problem, KK manufacturing company is faced with demand ...

KK manufacturing company is faced with demand for its product in each of the next four periods as shown in Table 1.  It must decide upon a production schedule to meet these demands

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