Go To operation
Steps:
- Make sure that one grammar has only 1 production result by removing the
OR
(essentially splitting the grammar) - Add augmented grammar (added grammar than can result a start symbol)
- Add numbers to each grammar except augmented grammar
- Add
.
at the front of each production result (used for kernel method) - Use the kernel method starting from the top most grammar
- Group the grammars
- Input the thing after the
.
to each grammar and group them - If the result has a
.
before a variable, copy paste the variable producers from i0 and continue to check the grammars of the new group if there is a.
before a variable - If the group contains same exact grammars as previous groups label as the same group
the goal is to make the
.
at the front move to the back
Status: #idea
Tags: compilation-techniques > Final ExamCompilation Techniques NotesMid Exam
RE to DFA
RE to E-NFA to DFA
Context Free Grammar
Top down parsing
Final Exam
Bottom Up Parsing
Directed Acyclic Graph
TAC, Triples, Quadriples
Intermediate Code Generator
Annotated Parse Tree
Three Address Statement
https://www.youtube.com/watch?v=\_Jng5xgLxkI&list=PLB2GiO0mMjw9J_OwnDMAqtsANzWsIylQz&index=9&ab_channel=HIMTIBINUS
Status: #MOC
Tags:, Bottom Up ParsingBottom Up Parsingsteps
1. Perform Go To operation
1. Find Follow value
1. Create SLR Table
1. Search through parsing
no need to remove Left Recursive
Example Alvina Aulia Bottom Up Parsing
1. E -> E + T | T
1. T -> T * F | F
1. F -> (E) | id
Perform Go To operation:
i0:
E' -> .E
1. E -> .E + T
1. E -> .T
1. T -> .T * F
1. T -> .F
1. F -> .(E)
1. F -> .id
(Input E to i0)
i1:
E' -> E.
1. E -> E. + T
(Input T to i0)
i2:
2. E -> T.
3. T -> T. * F
(Input F to i0)
i3:
4. T -> F.
Screenshot 2024-11-17