What are the different passes of a compiler?

Difference between phases and passes of compiler?

  • Answer:

    When we talk about the phases we talk about the steps compiler should do in order to finish it job. For example phases could be creating local variables symbol table, generating parsing tree, lexical checking, optimization, etc. When we talk about passes we talk about times some operation was repeated. For example there are 2-passes Assembler compilers. It means that before giving the results it repeats some steps twice, most of time times optimization step. The more passes you put the better quality result you get. The same applies to music and video encoding. For example: Source code: i++; i++; i++; 1st step (pass): i = i + 1; i = i + 1; i = i + 1; 2nd step (pass): i = i + 3; Most of compiler before generating results converts source code some kind inner language that is easier to parse, check in later steps. As you can see two-pass compiler would generate better quality code, than one-pass compiler, but the first one would be faster to compile.

wiki.answers.com Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.