search
Log In
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
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
0 votes
13 views
Given a LR grammar {S->A|B, A->Aa|epsilon, B->Bb|Sc|epsilon} can I solve it in following way?
1) S->A|Bb|Sc|epsilon (Placing B’s productions in S)
=> AS' | BbS' | epsilon & S'->cS' | epsilon
2) A->A' & A'->aA' | epsilon
3)B->ScB' | B' & B'->bB' | epsilon
in Compiler Design 5 points 13 views

1 Answer

1 vote

@arnab2022

For LL(1) You have to check by using First and Follow method.

For LR(0) and SLR(1) you have to do augmented transition method, and then by making state transition diagram, you have to look where Shift-Reduce and Reduce Reduce conflicts are present and according to that you've to eliminate the parser….

For LR(1) items such as CLR(1), LALR(1) you've to do again state transition diagram again using Look-Ahead....

 

1. https://gateoverflow.in/169567/finding-type-of-grammar-ll-1-or-lr-0-or-clr-1-or-lalr-1 

 

2. https://gatecse.in/viable-prefixes-and-handle-in-lr-parsing/  

 

3. https://www.youtube.com/watch?v=0fLyZCHkK7o  

 

4. https://cse.iitkgp.ac.in/~goutam/compiler/lect/lect7.pdf  

 

5. https://gatecse.in/category/compiler-design/ 

633 points
...