in Compiler Design
1,894 views
2 votes
2 votes

$S\rightarrow aA|bAc|dc$

$A\rightarrow d$

Number of states in $CLR\left ( 1 \right )$ parser construction _______________


Is

$S\rightarrow d.c|$$

$A\rightarrow d.,a$

will be in $1$ state or in $2$ different states??

in Compiler Design
by
1.9k views

4 Comments

your basics are not clear

lookaheads don't merge

You should read from page 260
0
0

 that line is correct coz that production is not added in that state

 @Mk Utkarsh

yes, because it shouldnot add that state

Check the rule

lookahead1 is lookahead to that $A$ in red color ${\color{Red} A}\rightarrow a.A,a|b$

And that $A$ comes from prev. state

And in prev state 

we got $A\rightarrow .aA$ which again has no follow set

So, go to prev production again, i.e. $S\rightarrow .AA$

And from here we got value of $Follow\left ( A \right )=\left \{ a,b \right \}$

Ok??

0
0

your basics are not clear
 

I just looking for a shortcut : |

check the 3rd for loop

for(each terminal $b$ in $first\left ( \beta a \right )$) 

What is $a$ here??

0
0

Please log in or register to answer this question.