790 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\rightarrow \alpha \bullet \beta , a$] where β ≠ ∈ and [$A\rightarrow \alpha \bullet , a$]
Which of the above statements are true wrt LR(1) items?

1 Answer

0 votes
0 votes

S1 : true S2 : false

Explanation for S1: 

On applying transitions look ahead does not get changed. Look ahead gets changed only applying on closure on the production.  

Explanation for S2:
The lookahead shall have no effect in an item of the form [A → α.β, a] where β is not ∈. 

[A → α.β, a]   -> (applying transition on Beta )  -> [A → αβ., a]    (look ahead remains same because First(a) = a )

[A → α., a]   -> (applying transition)  -> No Transition Possible because already reaches to reduction (look ahead remains same because First(a) = a )

Related questions

0 votes
0 votes
2 answers
1
dhruba asked Jun 5, 2023
314 views
1 votes
1 votes
0 answers
4