definition of compiler
single pass compiler
architecture
advantage
disadvantage
working.
Size: 455.41 KB
Language: en
Added: Feb 11, 2020
Slides: 13 pages
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.