retagged by
329 views
1 votes
1 votes
Consider the following statements:
S1: Whenever we apply transition on any symbol the lookahead does not change
S2: The lookahead has effect on items of the form
[A → α. β, a] where β ≠ ∈ and [A → α., a]
Which of the above statements are true wrt LR(1) items?

I am not able to understand S2..
retagged by

1 Answer

1 votes
1 votes

S1 is true.

In S2 lookahead help us to determine where to place reduce moves in parsing table for final item like  [A-->alpha. , a]

In this A-->alpha.beta,a ====> if beta starts with non-terminal then we go onto define closure of beta. Now inorder to define the lookaheads of productions arising due to closure, lookahead of first production becomes useful.

Eg: A---->aplha.BCD , a

      B----->............... , first(CDa) 

So in this way looakead plays a role, so S2 is true

Related questions

1 votes
1 votes
1 answer
1
learner_geek asked Aug 2, 2017
340 views
is this given diagram correct or incorrect if incorrect then please correct it .
0 votes
0 votes
1 answer
2
Shyam Singh 1 asked Dec 10, 2016
1,470 views
Every SLR grammar is unambiguous. True or False? Why?
4 votes
4 votes
2 answers
3
vaishali jhalani asked Nov 19, 2016
2,688 views
Does every DCFL has corresponding LR parser?
1 votes
1 votes
4 answers
4
Rahul_Rathod_ asked Jan 21, 2019
3,511 views
grammar is CLR(1) or not?if yes then how?