in Compiler Design
840 views
1 vote
1 vote
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?
in Compiler Design
by
840 views

4 Comments

yea...:)
1
1
effect means role of lookahead here ..
0
0
so, s1-true

s2-false
0
0

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 in Compiler Design Jun 5, 2023
331 views
dhruba asked in Compiler Design Jun 5, 2023
by dhruba
331 views