parsingcompiler-constructionlr-grammar

Discussion of LR(1) items: meaning?


What is the canonical LR(1) items ! I have read the Dragon Book, It confuses Me , (delta,gamma,toh,...)

Can Someone help me with this issue ?

What is this meaning in English? [A - > alpha.Bbeta , a]

Thanks a lot..


Solution

  • [A -> alpha . B beta , a] basically means "assuming rule A was being expanded, so far we have seen alpha. We then expect to see B beta. We also know that after A, we are going to see an a"

    So, in CLR(1), you have states consisting of some of these items. You then have many options:

    That was the simplest way I could explain this.