Passes 06/24/2022 1 ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN
05/01/2023 1
Passes
ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN
05/01/2023 ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN
2
Single Pass
05/01/2023 ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN
3
Contd.
05/01/2023 ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN
4
Two Pass
05/01/2023 ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN
5
Comparison
05/01/2023 ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN
6
Multi pass
• Passes 1. Several phases of compilers are grouped into passes. 2 . Other passes generates an explicit output file. 3. In each pass the whole input file/source is processed.
Syntax Analyser
Lexical analyser Intermediate code generator--Semantic analyser
05/01/2023 ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN
7
Contd…..
05/01/2023 ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN
8
Load and Go
05/01/2023 ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN
9
Contd….
05/01/2023 ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN
10
Debugging
05/01/2023 ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN
11
Bootstraping
• Bootstrapping is the process of writing a compiler (or assembler) in the source programming language that it intends to compile.
• Many compilers for many programming languages are bootstrapped, including compilers for-
• BASIC, Algol, C, D, Pascal, PL/I, Factor, Haskell, Modula-2, Oberon, OCaml, Common Lisp, Scheme, Go, Java, Rust, Python, Scala, Nim, Eiffel, and more.
05/01/2023 ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN
12
List Of Compilers• Compiler is program that translate (either from source code,
byte code to another source code, byte code, or binary), for example:
• gcc• clang• javac• go (compiler)
05/01/2023 ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN
13
• Interpreter is program that executes source code or byte code, for example:
• ruby (interpreter)• python (interpreter)• php (interpreter)
05/01/2023 ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN
14
CONTD…
• 1 Ada compilers• 2 ALGOL compilers• 3 Assemblers (Intel *86)• 4 Assemblers (Motorola 68*) • 5 Assemblers (Zilog Z80) • 6 Assemblers (other) • 7 BASIC Compilers