in Theory of Computation edited by
339 views
0 votes
0 votes

S-> Aa

A-> Ab

A-> c

Which of the following item is present in LR(1) item with S'->S, $

a) A->. Ab,$

b) A->Ab,a

c) A->Ab,a/b

d) None

in Theory of Computation edited by
339 views

1 Answer

4 votes
4 votes
Best answer
C seems more appropriate Looking ahead $"a"$ so $S  \rightarrow Aa$ will take care and looking ahead "$b$"$A  \rightarrow Ab$ will take care.
Drawing DFA productions will be like :
$S' \rightarrow.S ,\$\\ S\rightarrow.Aa,\$\\A\rightarrow .Ab,a/b\\A\rightarrow .c,a/b$
selected by

3 Comments

I am confused with DFA

S'->.S, $

S->.Aa,$

A->.Ab,a

A->.c ,a

A->.Ab,b

A->.c ,b

and

S′→.S,$

S→.Aa,$

A→.Ab,a/b

A→.c,a/b

are these both same??
0
0
YES both are same
0
0
ok and thanks
0
0