[Nonterminal → .blabla, Follow terminal of Nonterminal or $]
첫번째 논터미널 아닌 애들 말고 시작하는 논터미널들 initial state
맨 앞 터미널 논터미널 별로 state 이동가능
그 뒤에 논터미널이면 그놈으로 시작하는 걸로 변경해
How to execute an LR(1) parser?
Parsing Table
nonterminal - target state or r(nonterminal → blabla)
$ - single accept of main(A’ → A) end or r(nonterminal → blabla)
terminal - target state number
Conflict
in State ~, the shift items [A → a. B b, $] and [B → . a, b] and the reduce item [C → a ., d] do not form any conflicts as their second components are different.
Execution
stack - $blabla
input - blabla$
action - shift or reduce or accept - reduce 하면 table nonterminal state로 이동
Common types of IR: three-address code and stack machine code
Code Generation
Understand the idea of treating code as a synthesized attribute
Be able to write semantic rules to generate code for expressions and assignments, array references, control structures (if-else and loops), and functions