single pass compiler and its architecture

398 views 13 slides Feb 11, 2020
Slide 1
Slide 1 of 13
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13

About This Presentation

definition of compiler
single pass compiler
architecture
advantage
disadvantage
working.


Slide Content

Single pass compiler Topic

Group Member Ramsha N az 24 Aqsa H abib 42 Noor ul Ain 22

compiler A compiler is a computer program which helps you transform source code written in a high-level language into low-level machine language. It translates the code written in one programming language to some other language without changing the meaning of the code.

Types of compiler Native code compiler. Cross compiler. Source to source compiler. Single pass compiler. Multi pass compiler. Thread code compiler. Incremental compiler. Source compiler.

Single pass compiler

Definition In  computer programming , a  one-pass compiler  is a  compiler  that passes through the parts of each  compilation unit  only once, immediately translating each part into its final machine code.

Architecture o f single pass compiler.

Main stages of single pass compiler are lexical analysis, syntactical analysis and code generator. First, the lexical analysis scans the source code and divides it into tokens. Every programming language has a grammar. It represents the syntax and legal statements of the language. Then, the syntactical analysis determines the language constructs described by the grammar. Finally, the code generator generates the target code. Overall, single pass compiler does not optimize the code. Moreover, there is no intermediate code generation. 

Advantage It is more efficient then multi-pass compiler in the compiler phases. It takes a minimum time to compile Memory consumption in single pass compiler is low. It is smaller and faster than multi-pass compiler

Disadvantage There is no code optimization. It compile less efficient program It has a limited scope. There is no intermediate code generation in single pass compiler. Programming languages such as Pascal can be implemented using a single pass compiler. we can’t backup and process, it again so grammar should be limited or simplified.