Download presentation
Presentation is loading. Please wait.
1
Syntax Trees MathWorks Compiler Course – Day 5
2
Syntax Trees MathWorks Compiler Course – Day 5 Parser lexemes shift/reduce seq. Cfg tables Tree Symbols syntax tree. symbol table.
3
Syntax Trees –Construction MathWorks Compiler Course – Day 5
4
Syntax Trees –Construction Stack shifted tokens Pop stack to build reduce nodes MathWorks Compiler Course – Day 5
5
Syntax Trees –Construction –Walking MathWorks Compiler Course – Day 5
6
Syntax Trees –Construction –Walking Inherited attributes –Passed by parameter to getNode MathWorks Compiler Course – Day 5
7
Syntax Trees –Construction –Walking Inherited attributes –Passed by parameter to walker methods Synthesized attributes –Returned values from walker methods MathWorks Compiler Course – Day 5
8
Syntax Trees –Construction –Walking –Tree Transformations MathWorks Compiler Course – Day 5
9
Syntax Trees –Construction –Walking –Tree Transformations Abstract Syntax Trees MathWorks Compiler Course – Day 5
10
Syntax Trees –Construction –Walking –Tree Transformations Abstract Syntax Trees –Chain shortening –Leaf node elimination –Parenthesis elimination MathWorks Compiler Course – Day 5
11
Syntax Trees –Construction –Walking –Tree Transformations Abstract Syntax Trees Decorations MathWorks Compiler Course – Day 5
12
Syntax Trees –Construction –Walking –Tree Transformations Abstract Syntax Trees Decorations –Attributes –Symbol Table Index MathWorks Compiler Course – Day 5
13
Syntax Trees –Construction –Walking –Tree Transformations Abstract Syntax Trees Decorations Optimization MathWorks Compiler Course – Day 5
14
Syntax Trees –Construction –Walking –Tree Transformations Abstract Syntax Trees Decorations Optimizations –Constant evaluation –Code motion MathWorks Compiler Course – Day 5
15
Syntax Trees Symbol Tables MathWorks Compiler Course – Day 5
16
Symbol Table MathWorks Compiler Course – Day 5 lexemes shift/reduce seq. Cfg tables Tree Symbols syntax tree. symbol table. Generator semantic actions.
17
Symbol Table –Frames Symbol frame Runtime frame MathWorks Compiler Course – Day 5
18
Symbol Table –Frames Symbol frame Runtime frame –temporary variables MathWorks Compiler Course – Day 5
19
Symbol Table –Frames –Scope not in xcom MathWorks Compiler Course – Day 5
20
Symbol Table –Frames –Scope –Variable Attributes Use –Left/Right MathWorks Compiler Course – Day 5
21
Symbol Table –Frames –Scope –Variable Attributes Use Type constraints –All -- logical | integer | real (nothing excluded) –Arithmetic -- integer | real –None -- 0 (nothing allowed) MathWorks Compiler Course – Day 5
22
Symbol Table –Frames –Scope –Variable Attributes –Look-up Linear Hash MathWorks Compiler Course – Day 5
23
Symbol Table –Frames –Scope –Variable Attributes –Look-up –Inference passes MathWorks Compiler Course – Day 5
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.