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
120
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
CSC307 Lecture 16
javiergs
PRO
0
49
CSC570 Lecture 13
javiergs
PRO
0
27
CSC307 Lecture 17
javiergs
PRO
0
3
UP Lecture 30
javiergs
PRO
0
81
UP Lecture 25
javiergs
PRO
0
71
CSC486 Lecture 14
javiergs
PRO
0
150
CSC486 Lecture 13
javiergs
PRO
0
110
CSC486 Lecture 12
javiergs
PRO
0
110
CSC486 Lecture 11
javiergs
PRO
0
60
Other Decks in Programming
See All in Programming
【TSkaigi 2025】これは型破り?型安全? 真実はいつもひとつ!(じゃないかもしれない)TypeScript クイズ〜〜〜〜!!!!!
kimitashoichi
1
300
DevDay2025-OracleDatabase-kernel-addressing-history
oracle4engineer
PRO
7
1.6k
複雑なフォームを継続的に開発していくための技術選定・設計・実装 #tskaigi / #tskaigi2025
izumin5210
12
6.4k
インターフェース設計のコツとツボ
togishima
2
490
メモリリークが発生した時にpprofを使用して原因特定した話
zono33lhd
0
100
TypeScript エンジニアが Android 開発の世界に飛び込んだ話
yuisakamoto
6
950
Feature Flag 自動お掃除のための TypeScript プログラム変換
azrsh
PRO
4
630
Cloudflare Realtime と Workers でつくるサーバーレス WebRTC
nekoya3
0
230
TypeScript製IaCツールのAWS CDKが様々な言語で実装できる理由 ~他言語変換の仕組み~ / cdk-language-transformation
gotok365
7
380
RubyKaigi Hack Space in Tokyo & 函館最速 "予習" 会 / RubyKaigi Hack Space in Tokyo & The Fastest Briefing of RubyKaigi 2026 in Hakodate
moznion
1
120
AIエージェントによるテストフレームワーク Arbigent
takahirom
0
270
JSAI2025 RecSysChallenge2024 優勝報告
unonao
1
380
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
5
620
Testing 201, or: Great Expectations
jmmastey
42
7.5k
Fontdeck: Realign not Redesign
paulrobertlloyd
84
5.5k
Writing Fast Ruby
sferik
628
61k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
12k
BBQ
matthewcrist
88
9.7k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Intergalactic Javascript Robots from Outer Space
tanoku
271
27k
Practical Orchestrator
shlominoach
188
11k
It's Worth the Effort
3n
184
28k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
840
Transcript
jgs Compilers Lecture 13: Deriving trees Dr. Javier Gonzalez-Sanchez
[email protected]
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.
[email protected]
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.