answersLogoWhite

0


Best Answer
  1. A one-pass compiler is a compiler that passes through the source code of each compilation unit only once. A multi-pass compiler is a type of compiler that processes the source code or abstract syntax tree of a program several times.
  2. A one-pass compilers is faster than multi-pass compilers
  3. A one-pass compiler has limited scope of passes but multi-pass compiler has wide scope of passes.
  4. Multi-pass compilers are sometimes called wide compilers where as one-pass compiler are sometimes called narrow compiler.
  5. Many programming languages cannot be represented with a single pass compilers, for example Pascal can be implemented with a single pass compiler where as languages like Java require a multi-pass compiler.
User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

16y ago

When a compiler, or a parser for that matter, parses a text written in a formal language called "programming language" (describing algorithms in an imperative way, see wikipedia for "imperative programming"), it constructs a so-called "parse tree".

A multi pass compiler iterates this recursive tree of tokens (terminals and non terminals) several times, thus being able to optimize the code or find common mistakes, eventually fixing them.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

Single-Pass Compiler

Multi-pass Compiler

  • A one-pass compiler is a compiler that passes through the source code of each compilation unit only once.

  • A one-pass compiler does not "look back" at code it previously processed.

  • It is also called narrow compiler.

  • While one-pass compilers may be faster than multi-pass compilers.

  • Unable to generate as efficient programs, due to the limited scope available.

  • The ability to compile in a single pass is often seen as a benefit because it simplifies the job of writing a compiler and one pass compilers are generally faster than multi-pass compilers.

  • Pascal's compiler is an example of single-pass compiler.

  • A multi-pass compiler is a type of compiler that processes the source code of a program several times.

  • Each pass takes the result of the previous pass as the input, and creates an intermediate output.

  • It is sometimes called wide compiler.

  • The wider scope thus available to these compilers allows better code generation.

  • Some languages cannot be compiled in a single pass, as a result of their design.

  • In this way, the (intermediate) code is improved pass by pass, until the final pass emits the final code.

  • C++ compiler is multi-pass compiler.

Another answer: the number of passes.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

A single pass compiler also known as a one-pass compiler is a compiler that only passes through the code once and doesn't go back.

They're faster than a multi-pass compiler but they are very limited in what they can do.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

It is not that simple.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

No.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why single pass compiler are faster than multi pass compiler?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What are the four types of grammars used in compiler?

-Single pass compiler -Multi pass compiler -Cross compiler -Optimizing compiler


What is difference between Single pass compiler and double pass compiler?

i think a pass is reading the input file, i.e. the file in which the code is written in the source language.so in a single pass compiler, the input file is read only once and in doublepass compiler this is done 2 times .


What is pass in compiler design?

There are two types of compilers one-pass and multi-pass. Pass means that some of inner operations are repeated several times. If we have one-pass compiler and this source code: i++; i++; i++; Inside compiler it would generate: i = i + 1; i = i + 1; i = i + 1; If compiler would be two-pass: i = i + 3; The more passes compiler has, the better optimized code it can generate, but it is slower because it must repeat some steps again.


How do you pass command line arguments using turbo in c compiler?

In the Options menu the Arguments command.


What are the differences between pass and phase in compiler?

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.

Related questions

What is passed on?

A single pass compiler also known as a one-pass compiler is a compiler that only passes through the code once and doesn't go back. They're faster than a multi-pass compiler but they are very limited in what they can do.


What are the four types of grammars used in compiler?

-Single pass compiler -Multi pass compiler -Cross compiler -Optimizing compiler


Advantages and disadvatages of single and multi pass compiler?

Single pass: Adv: More efficient than multi pass compilers in the compiler phase. Smaller compilers than multi pass Dis: Produces less efficient programs. Multi pass: adv: Can be useful when optimizing code. more machine independent Java like variable declaration - it doesn't need to be before the use of it, because Java require multi pass compilers. Dis: Slower at compile time


Whether MS VC is one pass compiler or multi pass compiler?

one pass compiler


What is difference between Single pass compiler and double pass compiler?

i think a pass is reading the input file, i.e. the file in which the code is written in the source language.so in a single pass compiler, the input file is read only once and in doublepass compiler this is done 2 times .


What are the various types of compilers used in computers?

Compiler can be divided into following four main types. 1. one pass compilers 2. multi pass compilers 3. load and go compiler 4. optimizing compilers


What is pass in compiler design?

There are two types of compilers one-pass and multi-pass. Pass means that some of inner operations are repeated several times. If we have one-pass compiler and this source code: i++; i++; i++; Inside compiler it would generate: i = i + 1; i = i + 1; i = i + 1; If compiler would be two-pass: i = i + 3; The more passes compiler has, the better optimized code it can generate, but it is slower because it must repeat some steps again.


What is compiler pass?

When a compiler, or a parser for that matter, parses a text written in a formal language called "programming language" (describing algorithms in an imperative way, see wikipedia for "imperative programming"), it constructs a so-called "parse tree". A multi pass compiler iterates this recursive tree of tokens (terminals and non terminals) several times, thus being able to optimize the code or find common mistakes, eventually fixing them.


Will a single row triple pass radiator cool the same as a double row double pass radiator?

A triple pass radiator is advertised as cooling much better and faster than a double row, double pass. This will also be the most expensive option.


How do you pass command line arguments using turbo in c compiler?

In the Options menu the Arguments command.


What are the differences between pass and phase in compiler?

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.


Which are the factors that decide number of passes for a compiler?

There are many. I have encountered compilers with as few as 2 passes to as many as 63 passes (this number of passes were necessitated by the very tiny magnetic core memory of the machine). I even encountered a compiler that the programmer that wrote it claimed was a 1 pass compiler, but on detailed examination all he had done was "piped" the output of pass 1 to the input of pass 2 (instead of writing it to an intermediate file between passes), so it was actually a 2 pass compiler. I have also encountered a language (the US Navy's CMS-2) that has both syntactic and semantic ambiguities that made it impossible to write a compiler (no matter how many passes) that could reliably compile all code given to it, to do what the programmer intended.