Top Banner
Passes 06/24/2022 1 ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN
14

Passescd

Mar 03, 2017

Download

Education

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Passescd

05/01/2023 1

Passes

ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN

Page 2: Passescd

05/01/2023 ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN

2

Single Pass

Page 3: Passescd

05/01/2023 ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN

3

Contd.

Page 4: Passescd

05/01/2023 ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN

4

Two Pass

Page 5: Passescd

05/01/2023 ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN

5

Comparison

Page 6: Passescd

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

Page 7: Passescd

05/01/2023 ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN

7

Contd…..

Page 8: Passescd

05/01/2023 ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN

8

Load and Go

Page 9: Passescd

05/01/2023 ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN

9

Contd….

Page 10: Passescd

05/01/2023 ANKUR SRIVASTAVA JETGI ASSISTANT PROFESSOR COMPILER DESIGN

10

Debugging

Page 11: Passescd

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.

Page 12: Passescd

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)

Page 13: Passescd

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)