Evaluation Methods - Compiler Construction - Lecture Slides, Slides of Compiler Construction

Evaluation Methods, Dynamic methods, Rule based, Oblivious, Problems, Traversing parse tree, Ad Hoc Analysis are basic concepts discussed of course.

Typology: Slides

2011/2012

Uploaded on 11/03/2012

ekavia
ekavia 🇮🇳

4.3

(58)

241 documents

1 / 29

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Compiler
Construction
Lecture 32
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d

Partial preview of the text

Download Evaluation Methods - Compiler Construction - Lecture Slides and more Slides Compiler Construction in PDF only on Docsity!

Compiler

Construction

Lecture 32

2

Number

Sign List

Bit

1

List

List

Bit

Bit^1

0

Parse tree for –

4

Number

Sign

List

Bit

1

val: -

List

List

Bit

Bit 1

0

Inherited Attributes

pos: 0 val: 5

pos: 0 val: 1

pos: 1 val: 4

pos: 1 val: 0

pos: 2 val: 4

pos: 2 val: 4

neg: true

5

Number

Sign

List

Bit

1

val: -

List

List

Bit

Bit 1

0

Synthesized Attributes

pos: 0 val: 5

pos: 0 val: 1

pos: 1 val: 4

pos: 1 val: 0

pos: 2 val: 4

pos: 2 val: 4

neg: true

7

Number

Sign

List

Bit

1

val: -

List

List

Bit

Bit 1

0

peel away parse tree

pos: 0 val: 5

pos: 0 val: 1

pos: 1 val: 4

pos: 1 val: 0

pos: 2 val: 4

pos: 2 val: 4

neg: true

8

1

val: -

1

0

dependence graph

pos: 0 val: 5

pos: 0 val: 1

pos: 1 val: 4

pos: 1 val: 0

pos: 2 val: 4

pos: 2 val: 4

neg: true

10

Evaluation Methods

Dynamic methods

 Build the parse tree

 Build the dependence graph

 Topological sort the graph

 Define attributes in topological

order

11

Evaluation Methods

Dynamic methods

 Build the parse tree

 Build the dependence graph

 Topological sort the graph

 Define attributes in topological

order

13

Evaluation Methods

Dynamic methods

 Build the parse tree

 Build the dependence graph

 Topological sort the graph

 Define attributes in topological

order

14

Evaluation Methods

Dynamic methods

 Build the parse tree

 Build the dependence graph

 Topological sort the graph

 Define attributes in topological

order

16

Evaluation Methods

Oblivious (passes, dataflow)

 Ignore rules and parse tree

 Pick a convenient order (at

design time) and use it

17

Problems

Attribute grammars have

not achieved widespread

use due to a myraid of

problems

19

Problems

 non-local computation

 traversing parse tree

 storage management for

short-lived attributes

 lack of high-quality

inexpensive tools

20

Problems

 non-local computation

 traversing parse tree

 storage management for

short-lived attributes

 lack of high-quality

inexpensive tools