I am having difficulties understanding the principle of lookahead in LR(1) - items. How do I compute the lookahead sets?
Say for an example that I have the following grammar:
S -> AB
A -> aAb | b
B -> d
Then the first state will look like this:
S -> .AB , {look ahead}
A -> .aAb, {look ahead}
A -> .b, {look ahead}
I know what look aheads are, but I don't know how to compute them. I have googled for answers but couldn't find a webpage which explains this in a simple manner.
Thanks in advance