retagged by
859 views
0 votes
0 votes

Consider the following context-free grammar:

Find the number of unique productions in {Goto (A → D.BC, B) U Goto (A → .DBC, D)}

retagged by

2 Answers

3 votes
3 votes

Goto (A → D.BC, B) = {A → DB.C , C→ .c , C→ eps}

Goto (A → .DBC, D) = {A → D.BC , B→ .Bb, B→ eps}

Goto (A → D.BC, B) U Goto (A → .DBC, D) =  {A → DB.C , C→ .c , C→ eps} U {A → D.BC , B→ .Bb, B→ eps}

There is no duplicate production , so answer is 6.


X→ eps. = X→ .eps = X→ .   because all are having same meaning.

2 votes
2 votes
In Goto(A → D.BC,B) there well be one more production  i.e. (B→ B.b) because you are moving through B

so in this block there will be 3 and 3 in previous total 6.

Related questions

0 votes
0 votes
2 answers
1
moe12leb asked Jan 21, 2023
251 views
what is the langauge generated by this grammar ?S >aS | aSbS | ε what is the language
1 votes
1 votes
1 answer
3
Mk Utkarsh asked Mar 22, 2018
1,317 views
Please post few examples of Linear Ambiguous Context Free Grammar.It would be helpful if you post grammars for famous languages.