Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
(CS-460)
1
Outline
1. SLR(1) Parsing
2. SLR(1) Parsing Table
3. Problems in SLR(1) Parsing
4. LR(1) Items
5. DFA of LR(1) Items
6. LR(1) Parsing
7. Summary
2
Bottom-Up Parsing
Lecture: 17-18
3
SLR(1) Parsing
4
SLR(1) Parsing (Continue…)
5
SLR(1) Parsing (Continue…)
Grammar: E’ E
EE+n|n
Input: n+n
SLR(1) Process
List down LR(0) items for the grammar
Construct NFA and DFA of LR(0) items
Determine Follow(E’) and Follow(E) set
Construct SLR(1) parsing table for grammar
Perform parsing using LR(1) algorithm
6
SLR(1) Parsing Table
7
Problems in SLR(1)
8
LR(1) Items
9
DFA of LR(1) Items
10
DFA of LR(1) Items (Continue…)
A(A)|a
11
LR(1) Parsing
12
LR(1) Parsing (Continue…)
Any Questions?
14