Go To operation

Steps:

  1. Make sure that one grammar has only 1 production result by removing the OR (essentially splitting the grammar)
  2. Add augmented grammar (added grammar than can result a start symbol)
  3. Add numbers to each grammar except augmented grammar
  4. Add . at the front of each production result (used for kernel method)
  5. Use the kernel method starting from the top most grammar
    1. Group the grammars
    2. Input the thing after the . to each grammar and group them
    3. 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
    4. 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


References