CS606 - Complier Construction Solution Assignment No 3 Spring 2021

 

Dear Students, Here you can read or download CS606 - Assignment No 3 Solution Spring 2021. Previously we shared MGT101 Assignment No 1 Solution Spring 2021. You can also see the File of CS606 Assignment No 3 Solution 2021 provided by Raise For Success. Click on button to Download File and Must Follow our Website and subscribe our YouTube Channel for latest updates.
Requirements:
Consider the following CGF?
We also recommend to read:

Answer:

Add augment production, insert.(Dot)symbol at the position for every production (Raise For Success) of “G”. Also add the look ahead.
 
S` à .S , $
 
I0 State :
 
 Add augment production to the I0 state and compute the closure
I0 = closure (S` à .S)
 
 Add all the production starting with “S” in I0 state because “.” Is followed by non-terminal, so the I0 state becames
 
S à .S , $
 
S à .tTd , $
 
S à .fFd , $
 
S à .tFe , $
 
S à .fTe , $
 
I1 = Go to ( I0 , S ) = S` à S. , $ (Accepting State)
I2 = Go to ( I0 , t ) = S à t.Td , $
Add all production starting (Raise For Success) with small “t” in I2 state because “.” Is followed by non-terminal
so, the I2 state becomes
 
I2     =  S à .tTd , $
 
 S à .tTd , $
 S à  t.Fe , $
 T à .a , d
  F à .b , e
 
 
I3 = Go to ( I0 , f ) = S à f .Fd , $
 
Add all peoduction starting with small “f” in I3 state because “.” Is followed by non-terminal
So,the I3 state becomes
 
I3 = S à  f .Fd , $
 
            S à f .Te , $
 
T à .a , e
 
 F à .b , d
 
 
 
I4 = Go to ( I2 , T ) = Closure ( S à tT . d ,$ ) = S à tT . d ,$
 
I5 = Go to ( I2 , F ) = Closure ( S à tF . e ,$ ) = S à tF . e ,$
 
I6 = Go to ( I2 , a ) = Closure ( T à a ., d )  = T à a ., d
 
I7 = Go to ( I3 , F ) = Closure ( F à b ., e  ) = F à b ., e
 
I8 = Go to ( I2 , b ) = Closure ( S à fF .d , $  ) = S à fF .d , $ 
 
I9 = Go to ( I3 , T ) = Closure ( S à fT . e ,$  ) = S à fT . e ,$ 
 
I10 = Go to ( I3 , a ) = Closure ( T à a ., e  ) = T à a ., e  (*)
 
I11 = Go to ( I3 , b ) = Closure ( F à b ., d  ) = F à b ., d (*)
 
I12 = Go to ( I4 , d ) = Closure ( S à tTd ., $  ) = S à tTd ., $  (*)
 
I13 = Go to ( I5 , e ) = Closure ( S à tFe ., $  ) = S à tFe ., $  (*)
 
I14 = Go to ( I8 , F ) = Closure ( S à tFd ., $  ) = S à tFd ., $  (*)
I15 = Go to ( I9 , e ) = Closure ( S à fTe ., $  ) = S à fTe ., $  (*)


pointing hand for click

Download CS606signment No 3 Solution Spring 2021


Click Here


Previous Post Next Post