Download presentation
Presentation is loading. Please wait.
Published byEarl Hamilton Modified over 8 years ago
1
Type Inference Example -- 1 source text: x:=1; z := y < x Abstract Syntax Tree: ; := < x 1 z y x assignment = vars ‘:=‘ exprs; stmts = stmts ‘;’ stmt; relation = sum ‘<‘ sum; b logical i integer r real
2
Type Inference Example -- 2 source text: x:=1; z := y < x initial state: ; := < x 1 z y x symbol table
3
Type Inference Example -- 3 source text: x:=1; z := y < x visit 1: ; := < x 1 z y x symbol table
4
Type Inference Example -- 4 source text: x:=1; z := y < x visit 1: ; := < x 1 z y x x/left/bir symbol table
5
Type Inference Example -- 5 source text: x:=1; z := y < x return: ; := < x 1 z y x x/left/bir symbol table bir
6
Type Inference Example -- 6 source text: x:=1; z := y < x visit 2: ; := < x 1 z y x x/left/bir symbol table i
7
Type Inference Example -- 7 source text: x:=1; z := y < x return: ; := < x 1 z y x x/left/i symbol table i
8
Type Inference Example -- 8 source text: x:=1; z := y < x return: ; := < x 1 z y x x/left/i symbol table
9
Type Inference Example -- 9 source text: x:=1; z := y < x visit 2: ; := < x 1 z y x x/left/i symbol table
10
Type Inference Example -- 10 source text: x:=1; z := y < x visit 1: ; := < x 1 z y x z/left/bir x/left/i symbol table
11
Type Inference Example -- 11 source text: x:=1; z := y < x return: ; := < x 1 z y x z/left/bir x/left/i symbol table bir
12
Type Inference Example -- 12 source text: x:=1; z := y < x visit 2: ; := < x 1 z y x z/left/bir x/left/i symbol table
13
Type Inference Example -- 13 source text: x:=1; z := y < x visit 1: ; := < x 1 z y x y/right/ir z/left/bir x/left/i symbol table
14
Type Inference Example -- 14 source text: x:=1; z := y < x return: ; := < x 1 z y x y/right/ir z/left/bir x/left/i symbol table ir
15
Type Inference Example -- 15 source text: x:=1; z := y < x visit 2: ; := < x 1 z y x y/right/ir z/left/bir x/leftright/i symbol table i
16
Type Inference Example -- 16 source text: x:=1; z := y < x return: ; := < x 1 z y x y/right/ir z/left/bir x/leftright/i symbol table i~=ir
17
Type Inference Example -- 17 source text: x:=1; z := y < x visit 1 (again): ; := < x 1 z y x y/right/i z/left/bir x/leftright/i symbol table
18
Type Inference Example -- 18 source text: x:=1; z := y < x return: ; := < x 1 z y x y/right/i z/left/bir x/leftright/i symbol table b
19
Type Inference Example -- 19 source text: x:=1; z := y < x return: ; := < x 1 z y x y/right/i z/left/b x/leftright/i symbol table b
20
Type Inference Example -- 20 source text: x:=1; z := y < x return: ; := < x 1 z y x y/right/i z/left/b x/leftright/i symbol table
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.