Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9544904

Have any Question?


Related Questions in Computer Engineering

The toronto blue jays raises ticket prices from 100 to 120

The Toronto Blue Jays raises ticket prices from $100 to $120 per seat and experience a decline in ticket sales from 12000 to 10000 per game. i) What is the elasticity of demand for tickets? ii) Assuming the marginal cost ...

Question part 1 analyze the case study titled vodafone a

Question: Part 1: Analyze the case study titled "Vodafone: A Giant Global ERP Implementation" (below) For this assignment, you will need to: 1. analyze and discuss the central issue(s) faced by Vodafone, including the co ...

Question discuss in your own words using 250 words or more

Question: Discuss, in your own words using 250 words or more, the relationship between users and roles in databases. Explain why we use roles rather than simply assigning rights and privileges to each individual user. Th ...

Question 1 identify all the dfd data flow diagram elements

Question: 1. Identify all the DFD (data flow diagram) elements (Shostack, 2014, p.531.). 2. Identify all threat types to each element(Shostack, 2014, p.531.). 3. Identify threats (three or more), one each for data flow, ...

Question in ruby as in java 8 or scala an interface mix-in

Question : In Ruby, as in Java 8 or Scala, an interface (mix-in) can provide method code as well as signatures. (It can't provide data members; that would be multiple inheritance.) Explain why dynamic typing makes this f ...

A monochromatic source emitting photons at 250 nm shines

A monochromatic source emitting photons at 250 nm shines with equal intensity on a zinc electrode (threshold n =1.04 x1015 Hz) and a sodium electrode (threshold n = 5.51 x1014 Hz). Which of the following statements is tr ...

Suppose you want to back up a huge file to a cd-r you can

Suppose you want to back up a huge file to a CD-R. You can do this by splitting the file into smaller pieces and backup up those pieces separately. Write a utility program named FileSplitter that splits a large file into ...

Sometimes when we visit super markets we may share our

Sometimes when we visit super markets, we may share our personal details to get (for example) "Loyalty cards" and other benefits. Do you think sharing such details is a good approach? Give arguments for both cases: "shar ...

Consider a tcp connection between two hosts that are 400

Consider a TCP connection between two hosts that are 400 miles away from each other (propagation delay is 100 miles per msec.). Assume that there is no error or loss in this communication and the receive window size is s ...

Question future policy and legislative issuesthe

Question: Future Policy and Legislative Issues The cyberspace domain continues to grow significantly in terms of its size, influence, and complexity. This complexity requires some form of meaningful policy formulation. D ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As