The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
50 views

 

asked in Compiler Design by Boss (5k points) | 50 views

.....

didn't get you what you are saying.. could you please elaborate further.
Thanks i got it now ! Actually i was interpreting the production wrongly based on string derivation !

1 Answer

+3 votes
Best answer
S` - > .S, dollar
S - > .Aa, dollar [Because of .S] ---------------------1
A  - > .Ab, a [Because of A at 1, and lookahead symbol will be first ( a, dollar) i.e a] ------ 2
A - > .c, a [Because of A at 1, and lookahead symbol will be first ( a, dollar ) i.e a]
A -> .Ab,b [Because of A at 2, and lookahead symbol will be first ( b, a ) i.e b]
A -> .c, b [Because of A at 2, and lookahead symbol will be first ( b, a ) i.e b]

So we can also write it as

S` -> .S, dollar
S -> .Aa, dollar
A - > .Ab, a/b
A - > .c, a/b

Option c is correct here
answered by Boss (6.6k points)
selected by


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

29,167 questions
36,992 answers
92,225 comments
34,837 users