Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Proving that a grammar is LR(1)

Name: Anonymous 2011-11-20 18:34

Hey /prog/, I was wondering if somebody could help me with this. I need to prove that the following grammar is an LR(1) grammar:

S -> aSb | ^ (note ^ = empty string)

I'm having trouble figuring out how exactly I go about proving this. I think I would need to show that I only need to peak one character ahead of the handle, but I'm not aware of what that would entail.

Thanks in advance for any help

Name: Anonymous 2011-11-20 23:22

>>7

cool, you are probably more familiar with this than i am. Do you think you could produce a rightmost derivation for any string in that language using that grammar, where the only information you have available is where you are in the string, the one character that is ahead of where you are in the string, and terminals/non-terminals behind you, on the stack?

the wikipedia page is actually pretty complete:

http://en.wikipedia.org/wiki/LR(1)_grammar

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List