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

Switch statement with the use of nested if-else statement, Compare the use ...

Compare the use of switch statement with the use of nested if-else statement. If-else statement:  When there are many conditional statements that may all evaluate to true, bu

Classify data networks, Classify data networks. Data Network Classifica...

Classify data networks. Data Network Classifications: Data Networks are classified as per to their geographical coverage: - Wide area networks (WANs) - Metropolitan ar

Show types under which networks will be divided, What are the two broad typ...

What are the two broad types under which Networks will be divided? Ans: All computer networks fit in one of the two dimensions specifically: a)  Transmission Technology, thi

Features of hyper-threading, The salient features of hyper threading are: ...

The salient features of hyper threading are: i)  Improved support for multi-threaded code, permitting multiple threads to run concurrently. ii) Response time and improved rea

What is .net and .net framework, What is .NET / .NET Framework?  It i...

What is .NET / .NET Framework?  It is a Framework in which Windows applications might be developed and run. The Microsoft .NET Framework is a platform for building, deploying,

Porcess of identifying input and output values, Porcess of Identifying Inpu...

Porcess of Identifying Input and Output Values First, recognize what data is going to be used as input to system, and what will be output from system. Input and output values

What is bea weblogic?, Ans) BEA Web Logic is a J2EE application server and ...

Ans) BEA Web Logic is a J2EE application server and also an HTTP web server by BEA Systems of San Jose, California, for UNIX, Linux, Microsoft Windows, and other platforms. Web Log

System analysis and design, write an algorithm on railway reservation ticke...

write an algorithm on railway reservation ticket window

What is disadvantage of distributed systems, What is disadvantage of Dis...

What is disadvantage of Distributed systems? Ans. Reliability is disadvantage of Distributed system.

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