Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
UP Lecture 13
Search
Javier Gonzalez-Sanchez
PRO
December 16, 2023
Programming
0
110
UP Lecture 13
Compilers
Deriving Trees
(202503)
Javier Gonzalez-Sanchez
PRO
December 16, 2023
Tweet
Share
More Decks by Javier Gonzalez-Sanchez
See All by Javier Gonzalez-Sanchez
CSC486 Lecture 14
javiergs
PRO
0
150
CSC486 Lecture 13
javiergs
PRO
0
98
CSC486 Lecture 12
javiergs
PRO
0
100
CSC486 Lecture 11
javiergs
PRO
0
58
CSC486 Lecture 10
javiergs
PRO
1
95
CSC486 Lecture 08
javiergs
PRO
0
84
CSC486 Lecture 07
javiergs
PRO
0
140
CSC486 Lecture 06
javiergs
PRO
0
120
CSC486 Lecture 05
javiergs
PRO
0
120
Other Decks in Programming
See All in Programming
スモールスタートで始めるためのLambda×モノリス(Lambdalith)
akihisaikeda
2
300
Golangci-lint v2爆誕: 君たちはどうすべきか
logica0419
1
190
SwiftUI API Design Lessons
niw
1
310
Cursorを活用したAIプログラミングについて 入門
rect
0
110
個人開発の学生アプリが企業譲渡されるまで
akidon0000
0
1.1k
七輪ライブラリー: Claude AI で作る Next.js アプリ
suneo3476
1
140
監視 やばい
syossan27
11
10k
Orleans + Sekiban + SignalR でリアルタイムWeb作ってみた
tomohisa
0
140
新しいPHP拡張モジュールインストール方法「PHP Installer for Extensions (PIE)」を使ってみよう!
cocoeyes02
0
440
MCP調べてみました! / Exploring MCP
uhzz
2
2.3k
Bedrock × Confluenceで簡単(?)社内RAG
iharuoru
1
100
一緒に働きたくなるプログラマの思想 #QiitaConference
mu_zaru
77
19k
Featured
See All Featured
Side Projects
sachag
453
42k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Stop Working from a Prison Cell
hatefulcrawdad
268
20k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.3k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.6k
It's Worth the Effort
3n
184
28k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Typedesign – Prime Four
hannesfritz
41
2.6k
Writing Fast Ruby
sferik
628
61k
GraphQLの誤解/rethinking-graphql
sonatard
71
10k
Transcript
jgs Compilers Lecture 13: Deriving trees Dr. Javier Gonzalez-Sanchez jgonzalezs@up.edu.mx
jgs Previously …
Dr. Javier Gonzalez-Sanchez | Compilers | 3 jgs Layering Rule
1 Rule 2 Rule 3 Rule 4 Rule 5 . . . . . Leaf (Terminals, i.e., Tokens) Root Start symbol Layers
Dr. Javier Gonzalez-Sanchez | Compilers | 4 jgs Precedence Precedence
of operators + - * / -
Dr. Javier Gonzalez-Sanchez | Compilers | 5 jgs Syntax Diagrams
E A B C
Dr. Javier Gonzalez-Sanchez | Compilers | 6 jgs Precedence Precedence
of operators + - * / - ( )
Dr. Javier Gonzalez-Sanchez | Compilers | 7 jgs Syntax Diagrams
E A B C
jgs Operators
Dr. Javier Gonzalez-Sanchez | Compilers | 9 jgs Exercise 4
Provide a Grammar with Precedence of operators and Associativity for this: 10 + 20 > 15 & -10 != 1 | 20 / ( 10 + 1) < 5
Dr. Javier Gonzalez-Sanchez | Compilers | 10 jgs Precedence Precedence
of operators | & ! < > == != <= >= + - * / - ( )
Dr. Javier Gonzalez-Sanchez | Compilers | 11 jgs Exercise 3
| Handwritten notes ...
Dr. Javier Gonzalez-Sanchez | Compilers | 12 jgs Exercise 4
R EXPRESSION X Y
Dr. Javier Gonzalez-Sanchez | Compilers | 13 jgs Exercise 4
E A B C
Dr. Javier Gonzalez-Sanchez | Compilers | 14 jgs Homework |
Derivation Tree x = ((3 + 5) * 2 > 10) && (8 / (4 + 1) == 1 || 7 - 3 < 2)
jgs Language
Dr. Javier Gonzalez-Sanchez | Compilers | 16 jgs Parser PROGRAM
Dr. Javier Gonzalez-Sanchez | Compilers | 17 jgs Parser PROGRAM
We have BODY. What about method definition? What about global variables? What about classes?
Dr. Javier Gonzalez-Sanchez | Compilers | 18 jgs Assignment 2
| Code BODY
Dr. Javier Gonzalez-Sanchez | Compilers | 19 jgs Assignment 2
| Code ASSIGNMENT
Dr. Javier Gonzalez-Sanchez | Compilers | 20 jgs Assignment 2
| Code VARIABLE
Dr. Javier Gonzalez-Sanchez | Compilers | 21 jgs Assignment 2
| Code VARIABLE What about int x = 2 + 2; ?
Dr. Javier Gonzalez-Sanchez | Compilers | 22 jgs Assignment 2
| Code WHILE
Dr. Javier Gonzalez-Sanchez | Compilers | 23 jgs Assignment 2
| Code WHILE What do/while ?
Dr. Javier Gonzalez-Sanchez | Compilers | 24 jgs Assignment 2
| Code IF
Dr. Javier Gonzalez-Sanchez | Compilers | 25 jgs Assignment 2
| Code IF What switch/case?
Dr. Javier Gonzalez-Sanchez | Compilers | 26 jgs Assignment 2
| Code RETURN What about return 2 + 2?
Dr. Javier Gonzalez-Sanchez | Compilers | 27 jgs Assignment 2
| Code PRINT
Dr. Javier Gonzalez-Sanchez | Compilers | 28 jgs Assignment 2
| Code PRINT What about calling a method (any method)?
Dr. Javier Gonzalez-Sanchez | Compilers | 29 jgs Parser EXPRESSION
Dr. Javier Gonzalez-Sanchez | Compilers | 30 jgs Parser X
Dr. Javier Gonzalez-Sanchez | Compilers | 31 jgs Parser Y
Dr. Javier Gonzalez-Sanchez | Compilers | 32 jgs Parser R
Dr. Javier Gonzalez-Sanchez | Compilers | 33 jgs Parser R
What about >= or <= ?
Dr. Javier Gonzalez-Sanchez | Compilers | 34 jgs Parser E
Dr. Javier Gonzalez-Sanchez | Compilers | 35 jgs Parser A
Dr. Javier Gonzalez-Sanchez | Compilers | 36 jgs Parser B
Dr. Javier Gonzalez-Sanchez | Compilers | 37 jgs Assignment 2
| Code C
Dr. Javier Gonzalez-Sanchez | Compilers | 38 jgs Assignment 2
| Code C What about 5 + calculate_xyz() ?
Dr. Javier Gonzalez-Sanchez | Compilers | 45 jgs Questions
jgs Compilers Javier Gonzalez-Sanchez, Ph.D. jgonzalezs@up.edu.mx Spring 2025 Copyright. These
slides can only be used as study material for the Compilers course at Universidad Panamericana. They cannot be distributed or used for another purpose.