edited by
1,072 views
1 votes
1 votes

1)shift e

2)reduce the configuration

3)sr conflict

4)rr conflict


Ques 2 In LL(1) parsing algorithm let X is the topmost symbol of the stack  and "a" is a lookahaed symbol then which condition will require to operate only  pop on stack

1)X=a=$

2)X=a <>$

3)X<>a<>$

4)none 

edited by

1 Answer

Best answer
4 votes
4 votes

Solution 1: you didn't mention about the type of the parser, so I am assuming you're talking about LR(0) parser.

It should S/R conflict. because parser can't decide whether to shift 'e' or reduce 'iEtS' to S.

Solution 2:
X = TOS Symbol
a = Look Ahead Symbol

1) X=a=$   is acceptence condition.
2) X is a terminal and it will be removed from the stack, and 'a' will point to the next input symbol
3) This is when TOS is a variable, Variable will be replaced with its RHS part.

Hence, 2) seems correct answer!
 

selected by

Related questions

3 votes
3 votes
2 answers
1
Manu Thakur asked Jan 27, 2018
1,058 views
Given answer is (D), how?
1 votes
1 votes
4 answers
3
Rahul_Rathod_ asked Jan 21, 2019
3,615 views
grammar is CLR(1) or not?if yes then how?
2 votes
2 votes
0 answers
4
Na462 asked Jan 19, 2019
908 views
Which one of the following is true about LALR(1) Parser ?It can resolve SR Conflict in favor of reducedIt can resolve SR Conflict in favor of ShiftIt can resolve RR Confl...